VolkanSah/NMAP-Black-Python ? reverse-engineered prompt

Reverse engineered prompt

Build me a simple Python tool that runs Nmap scans for me from a text file of targets.

I want to put hostnames, IPs, or small network ranges into a targets.txt file, one per line, then run the script and have it scan each target safely, without any shell injection risk. It should save the full Nmap XML output for each target and also create a clean CSV report that shows the open ports and detected services so I can review the results quickly.

Please make it handle errors nicely, skip blank lines and comments in the target file, and avoid getting stuck forever on slow scans by using a timeout. If a target fails or times out, keep going with the rest. Make the scan settings easy to tweak near the top of the script, like which ports to check and whether service detection is on. If you need to check current Nmap options or Python docs, look them up online.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab