mirror of
https://github.com/jessfraz/dockerfiles.git
synced 2025-04-25 21:25:40 +02:00
cleanup
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
This commit is contained in:
parent
ae31e7f249
commit
d57f4f0145
@ -60,6 +60,17 @@ func main() {
|
|||||||
go func(ip string) {
|
go func(ip string) {
|
||||||
defer wg.Done()
|
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++ {
|
for port := beginPort; port <= endPort; port++ {
|
||||||
// Check if the port is open.
|
// Check if the port is open.
|
||||||
ok := portOpen(ip, port)
|
ok := portOpen(ip, port)
|
||||||
@ -84,13 +95,6 @@ func main() {
|
|||||||
ip, port,
|
ip, port,
|
||||||
info.Net.Organization.Handle, info.Net.Organization.Name, info.Net.Organization.Reference)
|
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 {
|
func portOpen(ip string, port int) bool {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user