Nmap snmp-netstat NSE Script


This page contains detailed information about how to use the snmp-netstat NSE script. For list of all NSE scripts, visit the Nmap NSE Library.

Script Overview


Script source code: https://github.com/nmap/nmap/tree/master/scripts/snmp-netstat.nse
Script categories: default, discovery, safe
Target service / protocol: snmp, udp
Target network port(s): 161
List of CVEs: -

Script Description


The snmp-netstat.nse script attempts to query SNMP for a netstat like output. The script can be used to identify and automatically add new targets to the scan by supplying the newtargets script argument.

Snmp-netstat NSE Script Arguments


This is a full list of arguments supported by the snmp-netstat.nse script:

creds.global

Credentials to be returned by Credentials.getCredentials regardless of the service.

creds.[service]

Credentials to be returned by Credentials.getCredentials for [service]. E.g. creds.http=admin:password

snmp.version

The SNMP protocol version. Use "v1" or 0 for SNMPv1 (default) and "v2c" or 1 for SNMPv2c.

max-newtargets

Sets the number of the maximum allowed new targets. If set to 0 or less then there is no limit. The default value is 0.

newtargets

If specified, lets NSE scripts add new targets.

- - -
To use these script arguments, add them to the Nmap command line using the --script-args arg1=value,[arg2=value,..] syntax. For example:

nmap --script=snmp-netstat --script-args creds.global=value,creds.\[service]=value <target>

Snmp-netstat NSE Script Example Usage


Here's an example of how to use the snmp-netstat.nse script:

nmap -sU -p 161 --script=snmp-netstat <target>

Snmp-netstat NSE Script Example Output


Here's a sample output from the snmp-netstat.nse script:

| snmp-netstat:
|   TCP  0.0.0.0:21           0.0.0.0:2256
|   TCP  0.0.0.0:80           0.0.0.0:8218
|   TCP  0.0.0.0:135          0.0.0.0:53285
|   TCP  0.0.0.0:389          0.0.0.0:38990
|   TCP  0.0.0.0:445          0.0.0.0:49158
|   TCP  127.0.0.1:389        127.0.0.1:1045
|   TCP  127.0.0.1:389        127.0.0.1:1048
|   UDP  192.168.56.3:137     *:*
|   UDP  192.168.56.3:138     *:*
|   UDP  192.168.56.3:389     *:*
|_  UDP  192.168.56.3:464     *:*

Snmp-netstat NSE Script Example XML Output


There is no sample XML output for this module. However, by providing the -oX <file> option, Nmap will produce a XML output and save it in the file.xml file.

Author


  • Patrik Karlsson

References


See Also


Related NSE scripts to the snmp-netstat.nse script:

Visit Nmap NSE Library for more scripts.

Version


This page has been created based on Nmap version 7.92.