D1se0/portScan ? reverse-engineered prompt

Reverse engineered prompt

Build me a simple command line port scanner in Python for network auditing and ethical hacking.

I want to give it either one IP address or a CIDR range, then have it scan ports and tell me which ones are open, closed, or filtered. It should have an option to show only open ports with short service details, and another option to show a full detailed scan using nmap for the open ports. Please make the terminal output clean and easy to read, with a nice banner and colored results if that fits.

I also want to be able to export the scan results to a text file, and if I stop it with Ctrl+C it should exit cleanly and print a helpful message instead of crashing. Make it work from a single Python script with a simple set of command line flags, and include clear usage examples in the README so I can run it right away. If you need current docs for anything, 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