1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-08 05:31:31 +00:00

Add TCP window/MSS ratio feature for IPv6 OS detection. http://seclists.org/nmap-dev/2015/q2/103 #224

This commit is contained in:
dmiller
2015-10-09 23:25:45 +00:00
parent 7fc4687e28
commit f257fa592e
3 changed files with 906 additions and 863 deletions

View File

@@ -912,8 +912,8 @@ static struct feature_node *vectorize(const FingerPrintResultsIPv6 *FPR) {
tcp = find_tcp(resps[probe_name].getPacket()); tcp = find_tcp(resps[probe_name].getPacket());
if (tcp == NULL) { if (tcp == NULL) {
/* 48 TCP features. */ /* 49 TCP features. */
idx += 48; idx += 49;
continue; continue;
} }
features[idx++].value = tcp->getWindow(); features[idx++].value = tcp->getWindow();
@@ -951,6 +951,10 @@ static struct feature_node *vectorize(const FingerPrintResultsIPv6 *FPR) {
features[idx++].value = mss; features[idx++].value = mss;
features[idx++].value = sackok; features[idx++].value = sackok;
features[idx++].value = wscale; features[idx++].value = wscale;
if (mss != 0 && mss != -1)
features[idx++].value = (float)tcp->getWindow() / mss;
else
features[idx++].value = -1;
} }
assert(idx == nr_feature); assert(idx == nr_feature);

1757
FPModel.cc

File diff suppressed because one or more lines are too long

View File

@@ -3,8 +3,8 @@
extern struct model FPModel; extern struct model FPModel;
extern double FPscale[][2]; extern double FPscale[][2];
extern double FPmean[][676]; extern double FPmean[][689];
extern double FPvariance[][676]; extern double FPvariance[][689];
extern FingerMatch FPmatches[]; extern FingerMatch FPmatches[];
#endif #endif