Skip to content

Understanding sockets, port scanning, and TCP connection with Python

Notifications You must be signed in to change notification settings

chizuru-nina-yamauchi/Scan_IP_Address

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Port Scanner with IP address(Simple ethical hacking experiment with Python)

Overview

This Python script serves as a simple ethical hacking experiment, allowing users to scan ports on a specified IP address to identify open ports. It utilizes the socket module to create TCP sockets and establish connections to each port within a specified range.

Requirements

  • Python 3.x

Usage

  1. Clone the repository or download the Python script.
  2. Open a terminal or command prompt.
  3. Navigate to the directory containing the Python script.
  4. Run the script by executing the command:
python port_scanner.py
  1. Follow the prompts to enter the target IP address.
  2. The script will scan ports 1 to 1024 on the specified IP address and display the results.

Understanding the code

  • The socket module is used for creating network sockets, allowing the script to establish TCP connections to each port.
  • TCP (Transmission Control Protocol) connections are established to determine whether each port on the target IP address is open or closed.
  • The script utilizes error handling to gracefully handle exceptions such as KeyboardInterrupt and socket errors.

IDE I used

  • pycharm

Disclaimer

This script is intended for educational purposes only. Do not use it for any malicious activities. Always seek permission before scanning ports on a network or IP address.

About

Understanding sockets, port scanning, and TCP connection with Python

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages