Skip to content

hr21don/PortScannerTutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

PortScannerTutorial

How to build a simple Port Scanner? Lets get started!

What is a Port Scanner?

A port scanner is the process of running through a list of ports to see if they are open or not.

How can we do this?

Using, sockets to provide the basic functionality of a port scanner. This is a form of "reconnaissance" for hackers and penetration testers.

How to find Ports in use?

Method 1: Use Command Prompt

  1. Run CMD as administrator.

Capture

  1. Once in the command prompt window, execute the command below.
netstat -ab

  1. After, you run the command you will see the port number right next to the ip address for e.g. 192.168.1.198:50412.

check-ports-in-use-windows-10-01 (1)

Method 2: Currports Utility

Nirsoft Utilities has a pretty neat and lightweight tool called CurrPorts which lists all the ports that are in use by Windows and other programs. In case you don’t, Nirsoft has a lot of small and portable apps that are quite useful in day to day life. If you’ve never used Nirsoft Utilities, go browse the developer site and you will find interesting little tools.

  1. First, download CurrPorts from the official website. Being a portable application, you don’t have to install it. After downloading, extract the exe file from the zip file and double-click on it to open.

  2. As soon as you open the window, the application will list all the connections and their ports. You can find the port number under the Local Port section.

check-ports-in-use-windows-10-04

Resources To Try for youself

TCPview(2021). https://docs.microsoft.com/en-us/sysinternals/downloads/tcpview . Date Accessed: 11/12/21 Currports(2021). https://www.nirsoft.net/utils/cports.html#DownloadLinks . Date Accessed: 11/12/21

Getting Started || Follow the Installation Instructions

Installation

Git clone repo from my github page.

How to Run? || Download the zip file to your downloads directory and extract it.

python Simpleportscanner.py

Add your remote host here and press enter || x.x.x.x = Your_Remote_Host


Enter a remote host to scan: x.x.x.x
Please wait, scanning remote host x.x.x.x:

Testing the Reconnaissance Tool

In this example output, the ports that are open are '135' and '149' for the given REMOTE host x.x.x.x.

Capture

Releases

No releases published

Packages

No packages published

Languages