Giter Site home page Giter Site logo

port_scanner's Introduction

PORT_SCANNER

This is a basic python code essentially performs port scanning on the specified IP address using threading for concurrency. It attempts to connect to each port, and if successful, it prints the port number, associated service, and marks it as OPEN. The output is color-coded for better visibility.

DISCLAIMER

we are not responsible for any illegal action performed by any reader. If you planned to use the content for illegal purpose, please leave this NOW...!!!!

AN OUTPUT EXAMPLE IS SHOWN AS FOLLWING :

Untitled

INSTALLATION (IN LINUX)

$ sudo apt update

$ sudo apt upgrade

$ sudo apt install python3

$ sudo apt install git

$ git clone https://github.com/shankar219/PORT_SCANNER.git

$ cd PORT_SCANNER

$ python3 port_scanner.py

Untitled1

EXPLANATION OF THE CODE :

IMPORTS:

socket: This module provides a low-level interface to networking operations.

termcolor: This module is used for colored output in the console.

threading: This module provides a way to create and manage threads.

ASCII Art:

An ASCII art is displayed at the beginning, which is a visual representation of a network-related theme.

FUNCTION DEFINITIONS:

scan(target, ports): This function is responsible for creating and starting threads for scanning ports on the target. scan_port(ipaddress, ports): This function is used by the threads to attempt a connection to a specific port on the target IP address and print the result.

USER INPUT:

The user is prompted to enter the target IP address and the total number of ports to be scanned (limited to a maximum of 65535 ports).

IP ADDRESS VALIDATION:

The entered IP address is validated using the ipaddress module.

PORT SCANNING:

If the IP address is valid, the program proceeds to scan for open ports on the target. The scan function is called, which creates a thread for each port and starts the scanning process concurrently.

OUTPUT DISPLAY:

The program prints a table with information about each scanned port, including the port number, service name, and its status (OPEN or not).

EXCEPTION HANDLING:

If there is any ValueError (e.g., invalid IP address) or KeyboardInterrupt (user interrupts the program), appropriate messages are displayed.

Closing Message:

The program prints a closing message if it is interrupted by the user.

port_scanner's People

Contributors

shankar219 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.