https://github.com/root4loot/nmap_to_host_port
Parse .nmap and output list of hostnames and open ports
https://github.com/root4loot/nmap_to_host_port
Last synced: about 1 month ago
JSON representation
Parse .nmap and output list of hostnames and open ports
- Host: GitHub
- URL: https://github.com/root4loot/nmap_to_host_port
- Owner: root4loot
- License: mit
- Created: 2024-04-10T12:35:39.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-30T12:44:12.000Z (about 1 year ago)
- Last Synced: 2025-02-17T12:45:39.435Z (4 months ago)
- Language: Python
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Simple script to parse .nmap and output list of hostnames and open ports.
```sh
usage: nmap_to_host_port.py [-h] [--unique-hosts] filenameExtract open port information from Nmap scan reports.
positional arguments:
filename The Nmap scan file to process.options:
-h, --help show this help message and exit
--unique-hosts Output only the first hostname for each unique IP address.
```## Example
```sh
➜ nmap scanme.sh -o results.nmap
Starting Nmap 7.94 ( https://nmap.org ) at 2024-04-10 15:21 CEST
Nmap scan report for scanme.sh (128.199.158.128)
Host is up (0.27s latency).
Other addresses for scanme.sh (not scanned): 2400:6180:0:d0::91:1001
Not shown: 993 closed tcp ports (conn-refused)
PORT STATE SERVICE
22/tcp open ssh
53/tcp open domain
80/tcp open http
443/tcp open https
444/tcp open snpp
445/tcp open microsoft-ds
15000/tcp open hydapNmap done: 1 IP address (1 host up) scanned in 64.32 seconds
``````sh
➜ nmap ./nmap_to_host_port.py results.nmap
scanme.sh:15000
scanme.sh:22
scanme.sh:443
scanme.sh:444
scanme.sh:445
scanme.sh:53
scanme.sh:80
```