1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-02 12:59:02 +00:00

Staying on the safe side when matching TCP flags on one part in scan_engine.cc. Instead of testing th_flags == TH_SYN|TH_ACK, it tests if (th_flags & TH_SYN|TH_ACK) == TH_SYN|TH_ACK. It's looks like it's done 'correctly' everywhere else. I can't really think of a real situation where we'd recieve any extra flags when doing a SYN scan, but we could (and it's better than having a false negative anyway).

This commit is contained in:
kris
2007-02-03 04:15:18 +00:00
parent 7d778b51c9
commit 395b4d2150

View File

@@ -2953,7 +2953,7 @@ static bool get_pcap_result(UltraScanInfo *USI, struct timeval *stime) {
goodone = true;
} else {
/* Now that response has been matched to a probe, I interpret it */
if (USI->scantype == SYN_SCAN && tcp->th_flags == (TH_SYN|TH_ACK)) {
if (USI->scantype == SYN_SCAN && (tcp->th_flags & (TH_SYN|TH_ACK)) == (TH_SYN|TH_ACK)) {
/* Yeah! An open port */
newstate = PORT_OPEN;
} else if (tcp->th_flags & TH_RST) {