This repository contains two Python tools designed for network analysis: a Global Port Scanner and a Traffic Monitor. These tools are built to be efficient, easy to use, and provide clear, visually appealing output.
Before using these tools, ensure you have Python installed. You will also need to install the required dependencies.
-
Install Python Libraries: Run the following command to install the necessary packages:
pip install rich scapy
-
Windows Users: For the Traffic Monitor to work correctly on Windows, you must have Npcap installed. This is typically included when you install Wireshark. Ensure you check the option "Install Npcap in WinPcap API-compatible Mode" during installation.
This tool allows you to scan a target IP address or hostname for open ports. It supports both TCP and UDP protocols, multi-threading for speed, and flexible port range selection.
To run the scanner, use the following command structure:
python port_scanner.py <TARGET> [OPTIONS]target: The IP address or hostname you want to scan.-p,--ports: Specify the ports to scan. You can use a single port (e.g.,80), a range (e.g.,1-1024), a list (e.g.,22,80,443), orALLto scan all 65535 ports. Default is1-1024.-a,--all: A shortcut flag to scan all ports (1-65535).-u,--udp: Switch to UDP scanning mode (default is TCP).-t,--threads: Set the number of concurrent threads. Default is 100.--timeout: Set the socket timeout in seconds. Default is 1.0.
Scan default ports (1-1024) on a local IP:
python port_scanner.py 192.168.1.1Scan all ports on a target:
python port_scanner.py 192.168.1.1 --allScan specific ports:
python port_scanner.py google.com -p 80,443,8080Scan UDP ports:
python port_scanner.py 192.168.1.1 -p 53,123 --udpThis tool acts as a lightweight network sniffer, similar to Wireshark, but focused on a specific target IP. It captures and displays traffic in a clean, readable table format directly in your terminal.
To start monitoring traffic for a specific IP:
python traffic_monitor.py <TARGET_IP>target_ip: The IP address you want to monitor.-i,--interface: (Optional) Specify the network interface to use.--count: (Optional) Stop after capturing a specific number of packets.
On modern switched networks (like most home Wi-Fi or office networks), your computer can typically only see traffic that is sent to or from your own device, or broadcast traffic. You will not see traffic between two other devices (e.g., between a phone and the router) unless you use specific network techniques like port mirroring.
This tool is best used for:
- Monitoring traffic entering or leaving your own machine.
- Troubleshooting network applications on your local device.
- Educational purposes to understand packet flow.
Monitor traffic for your local machine:
python traffic_monitor.py 127.0.0.1To stop the capture, simply press Ctrl+C.
These tools are intended for educational purposes and for managing networks you own or have permission to audit. Please use them responsibly.
- Telegram: @SyberSc71, @WAT4F
- GitHub: waheeb71, cyberlangdev
- YouTube: Cyber Code
- X / Twitter: @wa__cys
- Location: Taiz, Yemen
English: Waheeb Mahyoob Al-Humaeri العربية: وهيب مهيوب الحميري

