This repository contains an authorized-only ping sweep utility designed for security, operations, and inventory tasks on networks you own or have written permission to assess. Scanning systems without permission is illegal and unethical.
- CIDR parsing – supply IPv4 or IPv6 ranges (e.g.,
10.0.0.0/24). - Concurrency – configurable worker pool for faster sweeps.
- Timeout controls – tune per-host ping timeouts.
- Interactive safeguards – confirmations for large networks or when permission is uncertain.
- Structured logging – console plus optional file logging.
- JSON reporting – export results for dashboards or evidence.
python authorized_ping_sweeper.py \
--network 192.168.1.0/24 \
--timeout 1.5 \
--workers 128 \
--log-file sweep.log \
--json-out sweep.json \
--label "HQ inventory"| Flag | Description |
|---|---|
--network / -n |
Required. Network in CIDR notation. |
--timeout / -t |
Timeout per host in seconds (default: 1). |
--workers / -w |
Number of concurrent ping workers (default: 64). |
--retries / -r |
Ping attempts per host (default: 1). |
--rate-limit |
Cap submissions to N pings per second (default: unlimited). |
--log-file |
Optional log file path; console logging always enabled. |
--json-out |
Write detailed JSON results for automation/reporting. |
--csv-out |
Dump CSV table (ip, reachable, latency, error). |
--label |
Friendly label embedded in JSON output. |
--targets-file / -f |
Scan explicit IP list (one per line) in addition to or instead of --network. |
--show-unreachable |
Print unreachable hosts with failure reasons. |
--assume-yes |
Skip interactive confirmations (only when you already have authorization). |
--dry-run |
Enumerate targets and exit without sending any packets. |
- Confirm you have explicit authorization (written approval).
- Use
--dry-runfirst on large scopes to verify targeting. - Start with smaller subnets before scanning large address spaces.
- Respect maintenance windows or use
--rate-limitto avoid saturating links. - Store logs and exported JSON/CSV securely; they may contain sensitive topology data.
The script relies on the system ping binary, so automated tests are environment-specific. To perform a dry run:
- Use a loopback or small lab subnet (
127.0.0.1/32,192.168.56.0/30, etc.). - Invoke the script with
--networkset to that subnet. - Inspect console output and any generated log/JSON files to verify formatting.
This tool is provided for educational and defensive purposes. Do not scan networks you do not own or manage without written permission from the owner. The authors are not responsible for misuse. "# ping-sweeper"