Nmap Development mailing list archives

Re: How do I test differing ports within my NSE script?


From: Patrick Donnelly <batrick () batbytes com>
Date: Tue, 14 Sep 2010 15:56:01 -0400

On Tue, Sep 14, 2010 at 3:43 PM, Bob Radvanovsky <rsradvan () unixworks net> wrote:
One thing that I've noticed is that the NSE scripts appear to target either ONE port, or a grouped number of ports 
for a specific service (such as "SMB", for example).

If I am performing either enumeration and/or validation testing against an appliance that has differing services 
available (such as the most common of ports 80/443 [web/secured web] on TCP and 161 [snmp] on UDP, how can I 
incorporate that into a given NSE script?

I looked around the same scripts provided within the 5.35 development release, and have found nothing to indicate 
this.

How can I do this?  Any ideas?

If you want to "enumerate" the ports for a given host then you can
build a hostrule function that tests whether each port [1] is
open/closed and decide whether to run the action for further testing.

[1] http://nmap.org/nsedoc/lib/nmap.html#get_port_state


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

Current thread: