HomeinetPython Port Scanner

Python Port Scanner

Python Port Scanner: Below I am listing a simple python script whose job is to find which ports are open from 1-1024 on the IP that you will give it.

It can be used for any IP, as you understood I tried it on my router and not only that 🙂
Python Port Scanner

You can of course modify it or even enhance it. It was created for educational purposes as well as for pentesting tests.

Use the Python Port Scanner correctly!

If I can help you with anything, I would do it with great pleasure!

Save the following script, e.g., portscanner.py, and run it.

If you run it on linux don't forget to give it the necessary permissions chmod a+x portscanner.py

#!/usr/bin/python import socket def PortScanner(): gateway=raw_input("Please type router's gateway : ") print "Your gateway is "+str(gateway) for port in range(1,1024): try: socket.setdefaulttimeout(2) s=socket.socket() s.connect((gateway,port)) #banner=s.recv(1024) print '%d:OPEN' %port s.close except: continue PortScanner()

You can download the ready-made script from here.

📧
Subscribe to the SecNews Newsletter

The most important Security & Technology news in your Inbox.

SecNews
SecNewshttps://www.secnews.gr
In a world without fences and walls, who needs Gates and Windows

SEARCH

FOLLOW US

📧
Newsletter SecNews
The most important Security & Technology news in your inbox.

LIVE NEWS