A TCP SYN port scanner built with Python and Scapy. The tool scans common TCP ports on a target host and checks whether the target responds to DNS queries.
- Performs TCP SYN scans on common ports
- Detects common network services (HTTP, HTTPS, DNS, SMTP, SMB)
- Detects whether the target is running a DNS service
- Displays open ports in a clean, readable format
- Accepts a user-provided target IP address
- Python 3
- Scapy
- Npcap (Windows)
This project was developed to strengthen practical cybersecurity and networking skills, including:
- Packet crafting with Scapy
- TCP SYN scanning
- DNS queries over UDP
- Understanding common network services and ports
- Writing modular Python applications
- Clone this repository:
git clone https://github.com/AfifaNaser/python-port-scanner.git- Navigate to the project folder:
cd python-port-scanner- Install the required dependency:
pip install -r requirements.txtNote: On Windows, Scapy requires Npcap to be installed.
Run the scanner:
python port_scanner.pyWhen prompted, enter the target IP address.
Example:
Enter target IP address: 127.0.0.1
========================================
Scanning Target: 127.0.0.1
========================================
Detected Open Ports:
80 HTTP
443 HTTPS
No DNS response received.
Scan completed successfully.
python-port-scanner/
│
├── port_scanner.py # Main application
├── requirements.txt # Project dependencies
├── README.md # Project documentation
├── .gitignore # Git ignored files
└── LICENSE # MIT License
This project was created for educational and learning purposes only.
Only use this tool on systems and networks that you own or have explicit permission to test.
The author is not responsible for any misuse of this software.
Afifa Nasser
- GitHub: https://github.com/AfifaNaser
