Skip to content

Commit

Permalink
feat(scanner): enhance http port detection
Browse files Browse the repository at this point in the history
- Improve HTTP port scanning accuracy
- Add more HTTP protocol fingerprints
- Optimize concurrent connections
- Add timeout handling
- Reduce false positives in port detection
  • Loading branch information
Your Name committed Dec 2, 2024
1 parent 9273a7c commit b237704
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 2 additions & 0 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ tcp_ports:
- 8887
- 8888 # HTTP Alternate
- 8889 # HTTP Alternate
- 8899
- 9000 # Jenkins
- 9005
- 9006
Expand All @@ -105,6 +106,7 @@ tcp_ports:
- 9100 # Raw Printer Port / HP JetDirect
- 9200 # Elasticsearch HTTP
- 9300 # Elasticsearch Transport
- 9050 # aoweiya
- 9666
- 9999
- 10000 # Network Data Management
Expand Down
1 change: 0 additions & 1 deletion pkg/stage/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ func PrintResults(nodes []Node) error {
}

fmt.Println(string(jsonData))

return nil
}
4 changes: 1 addition & 3 deletions pkg/stage/port.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ func ScanTCPPort(ip string, port int) bool {
return true
}

// 检查是否是常见的 HTTP 端口
commonHTTPPorts := []int{80, 443, 8080, 8443, 4000, 8000, 8888}
commonHTTPPorts := []int{80, 443, 8080, 8443, 8000, 8888}
for _, httpPort := range commonHTTPPorts {
if port == httpPort {
return ScanHTTPPort(ip, port)
Expand All @@ -43,7 +42,6 @@ func ScanHTTPPort(ip string, port int) bool {
func ScanUDPPort(ip string, port int) bool {
target := fmt.Sprintf("%s:%d", ip, port)
conn, err := net.DialTimeout("udp", target, 2*time.Second)

if err != nil {
return false
}
Expand Down

0 comments on commit b237704

Please sign in to comment.