Skip to content

nafees094/Automation-of-Port-Scanning-Pentesting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Automation of Port Scanning Pentesting Project

diagram

Description

In this project, I create an automation of a Python Script that performs port scanning to automate pentesting for any IP address and desired port to check if its open or closed. We code using Virtual Studio Code (any python environment can be used) and the socket library. Lets get right into this step by step guide!

Languages and Utilities Used

  • Python
  • JSON

Environments Used

  • Virtual Studio Code

Program walk-through:

Here is the completed code, we import the socket library which is used to specify we are using IPv4 via the "AF_INET" method and "SOCK_STREAM" which specifies it being TCP and that there will be a TCP Handshake:
set up
We create a function which scans the port using the socket variable we created and it checks to see if the socket does not connect using "connect_ex" print that its closed. Else print that its open if it connects:
set up

We will be scanning the ports of this site "www.hackthissite.org" as an example, to get the ip we ping the site in our command prompt:
set up

Now we run the code and follow the input instructions we made, we add the IP which we got from the cmd:
set up

And then we input the port we want to scan to see if its open or closed, in this case we will check port 21 and it appears to be open:
set up set up

This Concludes This Automation Python Script Project! NOTE: You can add onto this and make it more complex, or use these methonds to automate other tasks!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published