laconicwolf / Nmap-Scan-to-CSV

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

Add handling of missing "service" object for port. #12

Open stefan-wuensch opened 3 years ago

stefan-wuensch commented 3 years ago

If there is no "service" object, this fixes the skipping-over which is completely dropping that open port from the output.

Example:

<ports><extraports state="closed" count="33">
<extrareasons reason="conn-refused" count="33"/>
</extraports>
<port protocol="tcp" portid="80"><state state="open" reason="syn-ack" reason_ttl="0"/><service name="http" method="table" conf="3"/></port>
<port protocol="tcp" portid="4780"><state state="open" reason="syn-ack" reason_ttl="0"/></port>
</ports>

Without my fix, the port 4780 is completely skipped.