A simple Python-based ping sweep tool that scans a network and identifies live hosts using ICMP echo requests.
Built using Scapy and netaddr, following the tutorial series:
📺 YouTube Tutorial:
https://www.youtube.com/watch?v=wzltvLSsDkE&list=PLB7R26sRn2aLhKbDDRtd7wluaX91pqAQD&index=4
- Scan all hosts in a subnet (e.g.,
/24) - Detect online hosts using ICMP packets
- Progress counter during scanning
- Clean output (no Scapy warnings)
- Works on Windows when Npcap is installed
Use Python 3.11 (best compatibility with Scapy).
Install Scapy + netaddr into Python 3.11:
py -3.11 -m pip install scapy netaddrRequired for raw packet sending.
Download here: https://nmap.org/npcap/
During installation, enable:
✔ Install Npcap in WinPcap API-compatible Mode
Run the script:
py -3.11 pingsweeper.py <network> <netmask>Scanning host: 8/254
Host 192.168.1.1 is online.
Host 192.168.1.8 is online.
Completed scan.
Live hosts: ['192.168.1.1', '192.168.1.8']-
netaddr.IPNetwork() generates each host IP
-
Scapy sends ICMP Echo Requests (ping)
-
Hosts that respond are added to a live_hosts list
-
Output is displayed as scan progresses
network-scanner/ │ ├── pingsweeper.py └── README.md
You installed packages in the wrong Python version.
Use:
py -3.11 -m pip install scapy netaddrYou need Npcap installed.
This is a Pylint false warning.
This project is for ethical and educational use only. Only scan networks you own or have permission to test.