Question: Lab3: Network Scanning Purpose: this lab gives students a hands-on experience to write a Python program to do a network scan on selected targets. The

Lab3: Network Scanning

Purpose: this lab gives students a hands-on experience to write a Python program to do a network scan on selected targets. The Python program to be developed should able do the basic task of network scan on a given host (or IP address) with a list of ports. With this lab students will gain better understanding and appreciation for use of popular network scan tools, such as Nmap.

Lab requirement: Student should write a single thread Python program that read in selected targets (hosts) and a list of ports for each target from a text file with 10 to 15 host names or host IP address. Then the Python program will scan each target and report on the status of each port. The outcome should be saved in a text file for later usage (see the sample lab3-input.txt and lab3-output.txt files as references). Your Python program must be well documented with:

A head section of program author name, date

Lines of comments for each function that you defined as what it is the major task of this function.

Use proper inline comments to make your program for readable.

Rewrite the sample code provided to use Nmap library in your Python program.

There is an optional requirement after you have successfully completed all above, you can challenge yourself by writing a multi-thread version of program doing the same things (read in host names and ports from a input file and write results to a output file). You will earn 1 additional point.

Lab deliverables: Submit a lab report no more than one page about what are the major difficulties you have encountered and how you overcome them (2 to 3 major problems) with these files as attachments:

1. You Python program source code.

2. You input data file and output data file

3. A Screen shot of your program in execution

Tips:

1. Study and test the two sample Python programs provided to you and use them as the base for your program.

2. Make sure you always close the input and output files before exit your program.

3. To test the Nmap after download, you can use the sample problem in lecture 6 folder, NmapScan.py, feel free to this sample code as a starting point to integrate Nmap with your Python program.

4. When write a multi-thread program, consider the use of Semaphore to prevent multiple threads write data to the file at the same time.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!