Nmap Security Scanner
*Intro
*Ref Guide
*Install Guide
*Download
*Changelog
*Book
*Docs
Security Lists
*Nmap Hackers
*Nmap Dev
*Bugtraq
*Full Disclosure
*Pen Test
*Basics
*More
Security Tools
*Pass crackers
*Sniffers
*Vuln Scanners
*Web scanners
*Wireless
*Exploitation
*Packet crafters
*More
Site News
Site Search:
Exploit World
Advertising
About/Contact
Credits
Sponsors:
edgeos

Nmap Development: [NSE patch] port or service not matching ports

[NSE patch] port or service not matching ports

From: Sven Klemm <sven_at_c3d2.de>
Date: Sun, 23 Dec 2007 16:09:02 +0100

Hi everyone,

the port_or_service function in the shortport library does not match
ports because the port variable passed to portnumber is shadowed by
the variable passed during portrule check. The attached patch fixes
this behaviour.

Cheers,
Sven

Index: shortport.lua
===================================================================
--- shortport.lua (revision 6611)
+++ shortport.lua (working copy)
@@ -65,7 +65,7 @@
         end
 end
 
-port_or_service = function(port, _service, proto, _state)
+port_or_service = function(_port, _service, proto, _state)
         local state = _state or {"open", "open|filtered"}
         local state_table
 
@@ -77,7 +77,7 @@
 
         return function(host, port)
                 for _, state in pairs(state_table) do
- local port_checker = portnumber(port, proto, state)
+ local port_checker = portnumber(_port, proto, state)
                         local service_checker = service(_service, proto, state)
                         if (port_checker(host, port) or service_checker(host, port)) then
                                 return true

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org

Received on Dec 23 2007
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]