Build me a network port scanning tool using python

Job ID: 32369502

Budget: $10 – $30 USD

The full project specification is attached below (please read first).


Notes:

IP address entry for the tool should be in this format:
For single IP-> 192.168.0.1
For a range of IPs-> 192.168.0.1-255
For example: mytool.py 10.1.3.10-100



The tool should only consider what Nmap determined as "Top Ports". There is a parameter in Nmap called --top-ports that will only consider the topmost prevalent ports for a given protocol.
Here is the command that will dump the content of that list:

sudo nmap -sT --top-ports 1000 -v -oG - > top_ports.txt

By making use of the --top-ports parameter for TCP, the tool will be scanning 93% of the widely-used TCP ports (according to Fyodor; who is Fyodor?).
The tool will not ask for what port to scan, it will automatically scan the "top ports for TCP".



To determine which ports are open, you can make use of TCP Connect Scan (-sT) or TCP Syn Scan (-sS) - find out which one is faster.
In your development platform (programming language), you have to find out what is the equivalent command or how to perform TCP Connect Scan and TCP Syn Scan. The parameters that I mentioned above (-sT/-sS) are for your testing purposes using Nmap.
You will not ask the user to select which TCP scan to perform - your tool will only implement one (the faster of the two).



Your tool should be able to perform a complete scan on a class C subnet within 9 seconds (with 75 live machines).
For example, your tool was given a command to scan a range of IP: 10.3.1.1-255, it should complete the scan within 9 seconds.
This 9-second target is under the assumption that there are 75 hosts running on that subnet.
If there are fewer than 75 hosts running, the target is still within 9 seconds.
If there are more than 75 hosts running, it is expected that your tool should exceed the 9 seconds target.
For your testing - just make sure that your tool will complete the scan for a class C subnet with <=75 hosts running within 9 seconds.

-The tool should be able to scan single or range IP addresses e.g 192.168.2.1 or 192.168.2.1-254
- Time spent must be 9 seconds or less when scanning 75 hosts
-Format should be aligned and properly placed
- ctrl + c should exit the program, checking if the inputs are incorrect/missing should expect an error message
- [-v] should display the version/about of the tool such as name, the purpose of the tool, how it performs ICMP echo reply, performance port checking, and any special techniques used in the tool.
Related categories: Python Linux Ubuntu Virtual Machines