mirror of
https://github.com/jessfraz/dockerfiles.git
synced 2025-12-10 15:02:41 +01:00
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user