Nmap snmp-interfaces NSE Script


This page contains detailed information about how to use the snmp-interfaces 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-interfaces.nse
Script categories: default, discovery, safe
Target service / protocol: snmp, udp
Target network port(s): 161
List of CVEs: -

Script Description


The snmp-interfaces.nse script attempts to enumerate network interfaces through SNMP.

This script can also be run during Nmap's pre-scanning phase and can attempt to add the SNMP server's interface addresses to the target list. The script argument snmp-interfaces.host is required to know what host to probe. To specify a port for the SNMP server other than 161, use snmp-interfaces.port. When run in this way, the script's output tells how many new targets were successfully added.

Snmp-interfaces NSE Script Arguments


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

snmp-interfaces.host

Specifies the SNMP server to probe when running in the "pre-scanning phase".

snmp-interfaces.port

The optional port number corresponding to the host script argument. Defaults to 161.

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-interfaces --script-args snmp-interfaces.host=value,snmp-interfaces.port=value <target>

Snmp-interfaces NSE Script Example Usage


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

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

Snmp-interfaces NSE Script Example Output


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

| snmp-interfaces:
|   eth0
|     IP address: 192.168.221.128
|     MAC address: 00:0c:29:01:e2:74 (VMware)
|     Type: ethernetCsmacd  Speed: 1 Gbps
|_    Traffic stats: 6.45 Mb sent, 15.01 Mb received

Snmp-interfaces 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.

Authors


  • Thomas Buchanan
  • Kris Katterjohn

References


See Also


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

Visit Nmap NSE Library for more scripts.

Version


This page has been created based on Nmap version 7.92.