Skip to content

Commit

Permalink
[*]优化端口开放识别方式,现在扫描的更准了~~
Browse files Browse the repository at this point in the history
  • Loading branch information
lcvvvv committed Apr 17, 2021
1 parent f4677a4 commit 78485d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions gonmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,14 @@ func (n *Nmap) getPortInfo(p *probe, target *target, tls bool) *PortInfomation {
portinfo := newPortInfo()
//fmt.Println("开始发送数据:",p.request.name,"超时时间为:",p.totalwaitms,p.tcpwrappedms)
data, err := p.scan(target, tls)
//fmt.Println(err)
if err != nil {
//fmt.Println(err)
if strings.Contains(err.Error(), "STEP1") {
return portinfo.CLOSED()
}

if p.request.protocol == "UDP" {
return portinfo.CLOSED()
}
//if strings.Contains(err.Error(), "refused") {
// return portinfo.CLOSED()
//}
Expand Down
6 changes: 4 additions & 2 deletions gonmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ func TestGonmap(t *testing.T) {
fmt.Printf("[INFO] 成功加载探针:[%d]个,指纹[%d]条\n", status["PROBE"], status["MATCH"])
fmt.Printf("[INFO] 本次扫描将使用探针:[%d]个,指纹[%d]条\n", status["USED_PROBE"], status["USED_MATCH"])
n := New()
r := n.SafeScan("127.0.0.1", 7890, 30*time.Second)
fmt.Printf("%s\t%s\t%s\t%s\n", n.target.uri, r.status, r.Service(), r.finger.Information())
//r1 := n.SafeScan("111.8.60.219", 443, 30*time.Second)
//fmt.Printf("%s\t%s\t%s\t%s\n", n.target.uri, r1.status, r1.Service(), r1.finger.Information())
r2 := n.SafeScan("111.8.60.219", 7001, 30*time.Second)
fmt.Printf("%s\t%s\t%s\t%s\n", n.target.uri, r2.status, r2.Service(), r2.finger.Information())

//for i := 1; i <= 10000; i++ {
// fmt.Println("开始探测端口:",i)
Expand Down

0 comments on commit 78485d3

Please sign in to comment.