Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove skipped check #1045

Merged
merged 2 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions v2/pkg/result/confidence/confidence.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package confidence

type ConfidenceLevel uint8

const (
Normal ConfidenceLevel = iota
Low
)
13 changes: 8 additions & 5 deletions v2/pkg/result/results.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ import (
"sync"

"github.com/projectdiscovery/naabu/v2/pkg/port"
"github.com/projectdiscovery/naabu/v2/pkg/result/confidence"
"golang.org/x/exp/maps"
)

type ResultFn func(*HostResult)

type HostResult struct {
Host string
IP string
Ports []*port.Port
Host string
IP string
Ports []*port.Port
Confidence confidence.ConfidenceLevel
}

// Result of the scan
Expand Down Expand Up @@ -67,10 +69,11 @@ func (r *Result) GetIPsPorts() chan *HostResult {
defer r.RUnlock()

for ip, ports := range r.ipPorts {
confidenceLevel := confidence.Normal
if r.HasSkipped(ip) {
Mzack9999 marked this conversation as resolved.
Show resolved Hide resolved
continue
confidenceLevel = confidence.Low
}
out <- &HostResult{IP: ip, Ports: maps.Values(ports)}
out <- &HostResult{IP: ip, Ports: maps.Values(ports), Confidence: confidenceLevel}
}
}()

Expand Down
Loading