uconthefacto/PySecure-Scanner-Native-Port-Scanner-
GitHub: uconthefacto/PySecure-Scanner-Native-Port-Scanner-
Stars: 0 | Forks: 0
# PySecure Scanner 🚀
A lightweight, dependency-free command-line interface (CLI) port scanner built entirely with native Python. This tool allows network administrators and security enthusiasts to audit network exposure and identify open TCP ports efficiently without relying on external tools like Nmap.
## 🛠️ Features
- **100% Native Python:** Built using Python's standard `socket` library. No `pip install` or Nmap installation required.
- **Flexible Scanning:** Supports scanning a single port, a custom range (e.g., 1-1024), or specific common ports.
- **Efficient Error Handling:** Gracefully handles network timeouts, keyboard interrupts (`Ctrl+C`), and unresolved hostnames.
- **Fast Execution:** Uses optimized connection timeouts to prevent hanging on filtered ports.
## 🏗️ Architecture & How It Works
This tool leverages **Socket Programming** concepts to establish network connections. Instead of using the standard blocking `connect()` method which can cause the script to hang, it utilizes `connect_ex()`.
The function returns an error indicator directly:
- Returns `0` if the operation succeeded (Port is **OPEN**).
- Returns an error code if the connection failed (Port is **CLOSED** or **FILTERED**).
## 🚀 Getting Started
### Prerequisites
- Python 3.x installed on your machine.
### Installation & Running
1. Clone this repository to your local machine:
git clone [https://github.com/uconthefacto/PySecure-Scanner-Native-Port-Scanner.git](https://github.com/uconthefacto/PySecure-Scanner-Native-Port-Scanner.git)
Navigate into the project directory and Run the script:
cd (the source code directory)
python PySecure-Scanner-Native-Port-Scanner.py