whitepaper: 366/178 — wave5 defect tables + PDF rebuild

This commit is contained in:
russell@unturf.com 2026-03-27 15:37:42 -04:00
parent 835ae73b0f
commit a4b0cf4edd
79 changed files with 3829 additions and 17 deletions

View file

@ -0,0 +1,53 @@
--- a/service_scan.h
+++ b/service_scan.h
@@ -280,8 +280,8 @@ class ServiceProbe {
std::vector<ServiceProbeMatch *> matches; // first-ever use of STL in Nmap!
char *fallbackStr;
ServiceProbe *fallbacks[MAXFALLBACKS+1];
- std::vector<u16> probableports;
- std::vector<u16> probablesslports;
- std::vector<const char *> detectedServices;
+ std::unordered_set<u16> probableports;
+ std::unordered_set<u16> probablesslports;
+ std::unordered_set<std::string> detectedServices;
--- a/service_scan.cc
+++ b/service_scan.cc
@@ -1,6 +1,7 @@
#include "service_scan.h"
+#include <unordered_set>
@@ -1215,7 +1215,7 @@ void ServiceProbe::setPortVector(std::vector<u16> *portv, const char *portstr,
/* Now I have a rangestart and a rangeend, so I can add these ports */
while(rangestart <= rangeend) {
- portv->push_back(rangestart);
+ portv->insert(rangestart);
rangestart++;
}
@@ -1254,10 +1254,9 @@ bool ServiceProbe::portIsProbable(enum service_tunnel_type tunnel, u16 portno) c
const std::vector<u16> *portv;
-
portv = (tunnel == SERVICE_TUNNEL_SSL)? &probablesslports : &probableports;
-
- if (find(portv->begin(), portv->end(), portno) == portv->end())
+ if (portv->find(portno) == portv->end())
return false;
return true;
}
@@ -1266,10 +1266,8 @@ bool ServiceProbe::serviceIsPossible(const char *sname) const {
- std::vector<const char *>::const_iterator vi;
-
- for(vi = detectedServices.begin(); vi != detectedServices.end(); vi++) {
- if (strcmp(*vi, sname) == 0)
- return true;
- }
- return false;
+ return detectedServices.count(sname) > 0;
}
@@ -1301,7 +1301,7 @@ void ServiceProbe::addService(const char *sname) {
- detectedServices.push_back(sname);
+ detectedServices.insert(sname);
}