From 5e67f7db4c5f0a8c7fde9b063e74f1234e55f7f6 Mon Sep 17 00:00:00 2001 From: fyodor Date: Thu, 15 Nov 2007 23:41:12 +0000 Subject: [PATCH] When version detection changes the state of a port, the reason field is now updated as well (to udp-response or tcp-response as applicable). Thanks to Thomas Buchanan for the patch. --- CHANGELOG | 4 ++++ service_scan.cc | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index d16a961e9..d45a79257 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,10 @@ o When an NSE script changes the state of a port (e.g. from scripts through a "reason" element in the port-table. Thanks to Matthew Boyle for the patch. +o When version detection changes the state of a port, the reason field + is now updated as well (to udp-response or tcp-response as + applicable). Thanks to Thomas Buchanan for the patch. + o Reworded an error message after a woman reported that it was "highly offensive and sexist". She also noted that "times have changed and many women now use your software" and "a sexist remark like the one diff --git a/service_scan.cc b/service_scan.cc index 809a6dc48..a3e1c1b32 100644 --- a/service_scan.cc +++ b/service_scan.cc @@ -1694,6 +1694,10 @@ static void adjustPortStateIfNeccessary(ServiceNFO *svc) { if (svc->port->state == PORT_OPENFILTERED) { svc->target->ports.addPort(svc->portno, svc->proto, NULL, PORT_OPEN); + if (svc->proto == IPPROTO_TCP) + svc->target->ports.setStateReason(svc->portno, svc->proto, ER_TCPRESPONSE, 0, 0); + if (svc->proto == IPPROTO_UDP) + svc->target->ports.setStateReason(svc->portno, svc->proto, ER_UDPRESPONSE, 0, 0); if (o.verbose || o.debugging > 1) { svc->target->NameIP(host, sizeof(host));