Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
This commit is contained in:
Jess Frazelle 2018-07-06 09:48:28 -04:00
parent ae31e7f249
commit d57f4f0145
No known key found for this signature in database
GPG Key ID: C0B444E6A3EFD4C1

View File

@ -60,6 +60,17 @@ func main() {
go func(ip string) {
defer wg.Done()
scanIP(ip)
}(ip.String())
}
wg.Wait()
since := time.Since(startTime)
logrus.Infof("Scan took: %s", since.String())
}
func scanIP(ip string) {
for port := beginPort; port <= endPort; port++ {
// Check if the port is open.
ok := portOpen(ip, port)
@ -84,13 +95,6 @@ func main() {
ip, port,
info.Net.Organization.Handle, info.Net.Organization.Name, info.Net.Organization.Reference)
}
}(ip.String())
}
wg.Wait()
since := time.Since(startTime)
logrus.Infof("Scan took: %s", since.String())
}
func portOpen(ip string, port int) bool {