Monday, January 6, 2020

NEW TOOL RELEASE: nmap2csv

Port scanning to spreadsheets...


What is nmap2csv? 
A wrapper for Nmap (Python3) that outputs port scan results to a CSV file. Also created is a 'targets.txt' file where discovered services are logged one host:service pair per line.


Where can you find nmap2csv?

How does it work? 
Modify the 'nmap2csv.py' file as needed to change 'nmap_args' (default below):

nmap_args = "-sV -T4 "

Provide a network or host (in CIDR notation) to 'nmap2csv.py' and it will perform the following...
  1. Perform Nmap scan
  2. Output CSV file of Nmap results
  3. Output 'targets.txt' file of all discovered services


Example commands and usage...

./nmap2csv.py 10.0.0.0/24


nmap2csv Walkthrough

1. Clone the 'nmap2csv' package from Github...


# git clone https://github.com/lostrabbitlabs/nmap2csv
# cd nmap2csv
# chmod 655 nmap2csv.py

2. Install the following library...


pip3 install python-nmap


3. Modify 'nmap_args' variable as needed...




4. Run 'nmap2csv.py' on desired host/network (be sure to use CIDR notation)...


#./nmap2csv.py 1.3.3.0/24




5. When complete two (2) output files will be created...

  •  NMAP-output-network.csv (all Nmap results)
  •  targets.txt (hostname:port)



6. Using 'cat' to view the CSV file...



7. Opening with Libre Office will allow sorting and filtering...
Select 'Semicolon' as your 'Separator Character':


Sort by port, protocol, service name, version, and more:



8. Also created is 'targets.txt' with all discovered 'host:service' pairs (to be used with 'grabbit.py')...





No comments:

Post a Comment