From 1df23cd8595192a60400112608d3fe8e94ba2506 Mon Sep 17 00:00:00 2001 From: david Date: Sat, 8 Aug 2009 20:01:18 +0000 Subject: [PATCH] In x11-access.nse, make the portrule run the script if the port number is 6000-6009 *or* the service starts with "X11". In this case it didn't matter because those ports do start with "X11" in nmap-services, but this better matches the shortport.port_or_service model. --- scripts/x11-access.nse | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/scripts/x11-access.nse b/scripts/x11-access.nse index 63c59842f..50ad0fdf5 100644 --- a/scripts/x11-access.nse +++ b/scripts/x11-access.nse @@ -21,15 +21,11 @@ license = "Same as Nmap--See http://nmap.org/book/man-legal.html" categories = {"default", "safe"} portrule = function( host, port ) - if - port.number >= 6000 and port.number <= 6009 - and string.match(port.service, "^X11") + return ((port.number >= 6000 and port.number <= 6009) + or string.match(port.service, "^X11")) -- If port.version.product is not equal to nil, version -- detection "-sV" has already done this X server test. and port.version.product == nil - then - return true - end end action = function(host, port)