Nmap reverse-index NSE Script


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

Script Description


The reverse-index.nse script creates a reverse index at the end of scan output showing which hosts run a particular service. This is in addition to Nmap's normal output listing the services on each host.

Reverse-index NSE Script Arguments


This is a full list of arguments supported by the reverse-index.nse script:

reverse-index.mode

The output display mode, can be either horizontal or vertical (default: horizontal)

reverse-index.names

If set, index results by service name instead of port number. Unknown services will be listed by port number.

- - -
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=reverse-index --script-args reverse-index.mode=value,reverse-index.names=value <target>

Reverse-index NSE Script Example Usage


Here's an example of how to use the reverse-index.nse script:

nmap --script reverse-index <hosts/networks>

Reverse-index NSE Script Example Output


Here's a sample output from the reverse-index.nse script:

Post-scan script results:
| reverse-index:
|   22/tcp: 192.168.0.60
|   23/tcp: 192.168.0.100
|   80/tcp: 192.168.0.70
|   445/tcp: 192.168.0.1
|   53/udp: 192.168.0.1, 192.168.0.60, 192.168.0.70, 192.168.0.105
|_  5353/udp: 192.168.0.1, 192.168.0.60, 192.168.0.70, 192.168.0.105

Reverse-index NSE Script Example XML Output


Here's a sample XML output from the reverse-index.nse script produced by providing the -oX <file> Nmap option:

 <table key="ftp/tcp">
   <elem>127.0.0.1</elem>
 </table>
 <table key="http/tcp">
   <elem>45.33.32.156</elem>
   <elem>127.0.0.1</elem>
   <elem>172.217.9.174</elem>
 </table>
 <table key="https/tcp">
   <elem>172.217.9.174</elem>
 </table>
 <table key="smtp/tcp">
   <elem>127.0.0.1</elem>
 </table>
 <table key="ssh/tcp">
   <elem>45.33.32.156</elem>
   <elem>127.0.0.1</elem>
 </table>

Author


  • Patrik Karlsson

References


See Also


Visit Nmap NSE Library for more scripts.

Version


This page has been created based on Nmap version 7.92.