A Python script that processes nmap XML output and generates an XLSX spreadsheet for pentest kickoff activities.
- Processes nmap XML output files
- Creates a comprehensive XLSX spreadsheet with:
- Summary sheet with all scanned IPs, scan status, and open port counts
- List of unique ports and their associated services
- Individual sheets per IP address with detailed scan results
- Outputs unique ports and services table to CLI/terminal
- Future-ready for commands.json generation (not implemented yet)
- Python 3.6+
- pandas
- openpyxl
# Run the setup script (recommended)
./setup.sh- Clone or download this repository
- Create a virtual environment:
python3 -m venv venv source venv/bin/activate - Install required dependencies:
pip install -r requirements.txt
python pentest_visualizer.py <nmap_xml_file>python pentest_visualizer.py <nmap_xml_file> -o custom_output.xlsx# Activate virtual environment first
source venv/bin/activate
# Run with sample data
python pentest_visualizer.py sample_nmap.xml -o pentest_results.xlsx
# Or run the example script
./example_usage.shThe script generates:
-
XLSX Spreadsheet with multiple sheets:
- Summary: Overview of all hosts, their status, open port counts, and unique ports/services
- Individual IP sheets: Detailed scan results for each IP (e.g., "192_168_1_1", "192_168_1_10")
-
CLI Output: Table showing unique ports and services identified during the scan
A sample nmap XML file (sample_nmap.xml) is included for testing purposes.
- Commands.json generation for enumeration commands per service (planned but not implemented)
| IP Address | Scan Status | Open Ports Count |
|---|---|---|
| 192.168.1.1 | up | 3 |
| 192.168.1.10 | up | 4 |
| 192.168.1.20 | up | 3 |
| IP | Port | Status | Service | Version/Notes |
|---|---|---|---|---|
| 192.168.1.1 | 22 | open | ssh | OpenSSH 8.2p1 Ubuntu-4ubuntu0.2 |
| 192.168.1.1 | 80 | open | http | Apache httpd 2.4.41 (Ubuntu) |
| 192.168.1.1 | 443 | open | https | Apache httpd 2.4.41 (Ubuntu) |
- Ensure the nmap XML file is valid and properly formatted
- Check that all required dependencies are installed
- Verify file permissions for both input and output files