A simple and efficient Bash script to convert Nmap scan results (nmap -sV) into a clean Excel (.xlsx) report for further analysis, filtering, or documentation.
β
Supports parsing Nmap scans from Linux (Ubuntu/Kali)
β
Extracts and structures the following fields:
- Hostname
- IP Address
- Port
- Protocol (TCP/UDP)
- State
- Service
- Version (if available)
β Automatically generates:
- CSV file:
nmap_results.csv - Excel file:
nmap_results.xlsx
β
Works great with spreadsheet tools like LibreOffice Calc or Microsoft Excel
β
Handles Nmap output with or without hostnames
β
Clean separation of port numbers and protocols
| Hostname | IP | Port | Protocol | State | Service | Version |
|---|---|---|---|---|---|---|
| webserver.local | 192.168.1.10 | 80 | tcp | open | http | Apache httpd 2.4.29 |
| 192.168.1.10 | 443 | tcp | open | https | nginx 1.18.0 |
Make sure the following are installed:
sudo apt install nmap
pip3 install pandas openpyxlnmap -sV 192.168.1.0/24 > nmap_scan.txtbash nmap_to_excel.sh- β
nmap_results.csvβ Raw data in CSV format - β
nmap_results.xlsxβ Excel-friendly version
π your-project/
βββ nmap_scan.txt # Your Nmap output (input)
βββ nmap_to_excel.sh # The Bash script
βββ nmap_results.csv # Generated CSV
βββ nmap_results.xlsx # Final Excel report
- Auto-detect UDP or TCP scans
- Add OS detection and MAC address fields
- Export to PDF summary
- Combine multiple scans into one Excel
- Color-coded Excel rows for open/filtered/closed ports
Made with β€οΈ for pentesters, sysadmins, and network engineers who love clean reporting.
Feel free to fork, enhance, or suggest improvements!