Skip to content

Commit

Permalink
fixing hosts with same ip and verify
Browse files Browse the repository at this point in the history
  • Loading branch information
Mzack9999 committed Jan 16, 2025
1 parent 7da347c commit cb5eabd
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions pkg/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,10 +435,15 @@ func (r *Runner) RunEnumeration(pctx context.Context) error {
return
}
for _, p := range filteredPorts {
r.scanner.ScanResults.AddPort(ip, p)
// ignore OnReceive when verification is enabled
if r.options.Verify {
continue
}
if r.scanner.OnReceive != nil {
r.scanner.OnReceive(&result.HostResult{IP: ip, Ports: []*port.Port{p}})
}
r.scanner.ScanResults.AddPort(ip, p)

}
}(ip)
}
Expand Down Expand Up @@ -742,9 +747,9 @@ func (r *Runner) ConnectVerification() {
}(hostResult)
}

r.scanner.ScanResults = verifiedResult

swg.Wait()

r.scanner.ScanResults = verifiedResult
}

func (r *Runner) BackgroundWorkers(ctx context.Context) {
Expand Down Expand Up @@ -911,6 +916,12 @@ func (r *Runner) handleOutput(scanResults *result.Result) {
output string
)

if r.options.Verify {
for hostResult := range scanResults.GetIPsPorts() {
r.scanner.OnReceive(hostResult)
}
}

// In case the user has given an output file, write all the found
// ports to the output file.
if r.options.Output != "" {
Expand Down

0 comments on commit cb5eabd

Please sign in to comment.