laconicwolf / Nmap-Scan-to-CSV

Converts Nmap XML output to csv file, and other useful functions
216 stars 98 forks source link

Display "Open|Filtered" Identified Ports #1

Closed efstratios closed 5 years ago

efstratios commented 5 years ago

Hello,

It would be nice to have another argument to display the "open|filtered" ports that were identified as "closed". For instance, the 520 UDP port in the following example(nmap .xml file).. :

<ports><extraports state="open|filtered" count="998">
<extrareasons reason="no-responses" count="998"/>
</extraports>
<port protocol="udp" portid="443"><state state="open" reason="udp-response" reason_ttl="52"/><service name="dtls" method="probed" conf="10"/></port>
<port protocol="udp" portid="520"><state state="closed" reason="port-unreach" reason_ttl="243"/><service name="route" method="table" conf="3"/></port>
</ports>
laconicwolf commented 5 years ago

Good point. I'll start working on it when I get a chance.

laconicwolf commented 5 years ago

Done. include the -u option if you want to see open|filtered UDP ports. It will not work if all of the UDP ports are open|filtered. For example, this scan output will add these ports/services to the csv:

sudo nmap -sU -p 53,67,111 192.168.1.1 -oX scan.xml

Host is up (0.0033s latency). PORT STATE SERVICE 53/udp open|filtered domain 67/udp open|filtered dhcps 111/udp open|filtered rpcbind

However, this next scan result will not add any entries to the csv:

sudo nmap -sU 192.168.1.1 -oX scan.xml

Host is up (0.071s latency). All 1000 scanned ports on 192.168.1.1 are open|filtered