|
@@ -44,12 +44,10 @@ func PortWalk(addr string, portmap map[int]string) *Host {
|
|
|
ports := RetrieveScanDirectives()
|
|
|
for p, s := range ports.Pairs {
|
|
|
wg.Add(1)
|
|
|
- port := p
|
|
|
- svcs := s
|
|
|
- go func() {
|
|
|
+ go func(target string, p int, s string) {
|
|
|
defer wg.Done()
|
|
|
- out = append(out, singlePortScan(addr, port, svcs))
|
|
|
- }()
|
|
|
+ out = append(out, singlePortScan(target, p, s))
|
|
|
+ }(addr, p, s)
|
|
|
}
|
|
|
wg.Wait()
|
|
|
host := &Host{IpAddress: addr, ListeningPorts: []map[int]string{}}
|