CIS115 Lab 7 New – Networking with Python- python code, word document, screenshots – Perfect Solution – Instant Delivery

Lab Price = $7
Please feel free to send us your queries at:
Payment methods

Add to Cart

Buy Now

View Cart

Problem Statement

Networking with Python
A source code Python file.
A Word document containing both source code and the screen print of the program outputs.
Lab Steps
Part 1 – Finding your IP address
We will create a python program to do a port scan. To do this you need to find the ip address of your computer. Open a Command Prompt (Start button -> Windows System-> Command Prompt). At the command prompt type ipconfig –all
In the above example the IP address is IPv4
Part 2 – Running Your Code
After you have set up your router we will create a python program to do a port scan. Open Idle create a new file. Enter the following python code to create a port scanner. NOTE – do not run the port scanner on any site except your router and your own machine.
#!/usr/bin/env python
import socket
import subprocess
import sys
from datetime import datetime

# Clear the screen‘clear’, shell=True)

# Ask for input
remoteServer = input(“Enter a remote host to scan: “)
remoteServerIP = socket.gethostbyname(remoteServer)

# Print a nice banner with information on which host we are about to scan
print (“-” * 60)
print (“Please wait, scanning remote host”, remoteServerIP)
print (“-” * 60)

# Check what time the scan started
t1 =

# Using the range function to specify ports (here it will scans all ports between 1 and 1024)

# We also put in some error handling for catching errors

for port in range(1,1025):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex((remoteServerIP, port))
if result == 0:
print (“Port {}: Open”.format(port))

except KeyboardInterrupt:
print (“You pressed Ctrl+C”)

except socket.gaierror:
print (“Hostname could not be resolved. Exiting”)

except socket.error:
print (“Couldn’t connect to server”)

# Checking the time again
t2 =

# Calculates the difference of time, to see how long it took to run the script
total = t2 – t1

# Printing the information to screen
print (“Scanning Completed in: “, total)
Run the above code and enter the IP address of the machine (note the machine above is This will take several minutes – even up to 10 minutes so please be patient! You may also try entering in the ip address of your router (shown below)

Relevant Material
Lab 7: IP Config
Lab 7: IP Config
Lab 7: Scan Result
Lab 7: Scan Result
* If you want to purchase multiple products then click on “Buy Now” button which will give you ADD TO CART option.Please note that the payment is done through PayPal.
* You can also use 2CO option if you want to purchase through Credit Cards/Paypal but make sure you put the correct billing information otherwise you wont be able to receive any download link.
* Your paypal has to be pre-loaded in order to complete the purchase or otherwise please discuss it with us at
* As soon as the payment is received, download link of the solution will automatically be sent to the address used in selected payment method.
* Please check your junk mails as the download link email might go there and please be patient for the download link email. Sometimes, due to server congestion, you may receive download link with a delay.
* All the contents are compressed in one zip folder.
* In case if you get stuck at any point during the payment process, please immediately contact us at and we will fix it with you.
* We try our best to reach back to you on immediate basis. However, please wait for atleast 8 hours for a response from our side. Afterall, we are humans.
* Comments/Feedbacks are truely welcomed and there might be some incentives for you for the next lab/quiz/assignment.
* In case of any query, please donot hesitate to contact us at
* MOST IMPORTANT Please use the tutorials as a guide and they need NOT to be used for any submission. Just take help from the material.
******************************************** Good Luck ***************************************************
Privacy Policy
We take your privacy seriously and will take all measures to protect your personal information.
Any personal information received will only be used to fill your order. We will not sell or redistribute your information to anyone.
Refund Policy
Incase you face any issues with the tutorial, please free to contact us on
We will try our best to resolve the issue and if still persists we can discuss for a refund in case its required.
Payment Details
Lab Price = $7
Please feel free to send us your queries at:

Payment methods

Add to Cart

Buy Now

View Cart

Leave a Reply