Skip to content

Commit

Permalink
optimize: 优化pacp BPFFilter过滤器规则,提高抓包效率,减少无用数据包的抓取分析
Browse files Browse the repository at this point in the history
  • Loading branch information
XinRoom committed Mar 22, 2023
1 parent 23d2a4d commit 1124d59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/port/syn/syn.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func NewSynScanner(firstIp net.IP, retChan chan port.OpenIpPort, option port.Opt
return
}
// Set filter, Reduce the number of monitoring packets
handle.SetBPFFilter(fmt.Sprintf("ether dst %s && (arp || tcp)", srcMac.String()))
handle.SetBPFFilter(fmt.Sprintf("ether dst %s && (arp || tcp[tcpflags] == tcp-syn|tcp-ack)", srcMac.String()))
ss.handle = handle

// start listen recv
Expand Down

0 comments on commit 1124d59

Please sign in to comment.