Skip to content

jzmack/pingsweeper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pingsweeper PingSweeper Icon

A flexible CLI tool built with Python designed to quickly ping many devices to see what's online on your network. Targeted for network engineers, cyber security analysts, server admins, or anyone interested in what IPs respond to a ping on their network. Can be used as a standalone script or in conjuction with other automation tools as output can be in plain text, CSV, or JSON.

Demo of the tool being installed and run

Features 🚀

Performance

  • Fast Scans - Sweeps a /24 subnet (254 hosts) and returns results in just seconds
  • Configurable Concurrency - Adjust concurrent connections (default: 100) to optimize for pinging larger networks
  • Customizable Timeouts - Fine-tune ping timeouts for speed vs accuracy balance

Output

  • Stats - Success rates, response times, and summaries
  • Progress Tracking - Unicode progress bars with real-time completion status
  • Hostname Resolution - Automatic reverse DNS lookups for discovered hosts
  • Supported Output Formats:
  • Text files (--txt) - for reports, something human readable
  • CSV files (--csv) - just because, maybe for spreadsheet analysis idk
  • JSON files (--json) - Structured data for automation and APIs

Multiple Input Options

  • Supported IP Formats:
  • Single IP: 192.168.1.1
  • CIDR Notation: 192.168.1.0/24
  • IP Ranges: 192.168.1.1-192.168.1.50
  • Input Validation - Error checking with "helpful" guidance
  • Large Network Protection - Warns before scanning massive networks

Advanced Configuration

  • Customizable Ping Count - Send multiple packets per host for accuracy
  • Timeout Control - Per-ping timeout configuration
  • Progress Control - Option to hide the progress bar that I worked so hard on

Cross-Platform Compatibility

  • Windows - Native support with Windows Terminal optimization
  • Linux/Unix - Full compatibility including WSL
  • macOS - I didn't test it but I'm sure it works right?
  • Automatic OS Detection - Uses appropriate ping commands for each platform

Organized Results Management

  • Automatic Directory Creation - Results saved to sweep_results/ folder
  • Timestamped Files - Each scan gets a unique timestamp
  • Optional File Saving - Save results only if you want to

Installation

The only requirement is to have Python installed.

Use pip to install:

pip install pingsweeper

On Linux

I recommend installing in a virtual environment:

sudo apt update
sudo apt install python3-venv python3-pip
python3 -m venv .psvenv
source .psvenv/bin/activate
pip install pingsweeper

Usage

Running the script:

pingsweeper

To show available arguments:

pingsweeper -h

Example with all available arguments:

pingsweeper -s 192.168.1.0/24 -t 0.5 -c 3 --csv --max-concurrent 50

Command Line Arguments

  • -s, --subnet → IP address, range, or subnet in CIDR notation
  • -t, --timeout → Timeout per ping in seconds (default: 0.2)
  • -c, --count → Number of ping packets per host (default: 1)
  • --max-concurrent → Maximum concurrent pings (default: 100)
  • --txt → Save results as text file
  • --csv → Save results as CSV file
  • --json → Save results as JSON file
  • --no-progress → Disable progress bar
  • --quiet → Coming soon... Show only summary results
  • --verbose → Coming soon... Enable detailed debugging output

Usage Examples

# Basic subnet scan
pingsweeper -s 192.168.1.0/24

# Scan with CSV export and custom settings
pingsweeper -s 10.0.0.1-10.0.0.100 --csv -t 1.0 -c 2

# High-speed scan with limited concurrency
pingsweeper -s 192.168.0.0/16 --max-concurrent 200 --quiet

# Detailed scan with all output formats
pingsweeper -s 172.16.1.0/24 --txt --csv --json --verbose

Once the script completes, the console will print a comprehensive summary including the number of hosts pinged, hosts that responded, success rate, and detailed results for all live hosts. Optional output files are saved to the sweep_results/ directory.

Upgrading

To upgrade to the latest version:

python -m pip install --upgrade pingsweeper

To install a specific version:

python pip install pingsweeper==0.1.1

Possible issues

There have been cases where the following warning may be shown after installing the package which will not allow you to run pingsweeper as intended. If you see this warning during install, you may have to add Python scripts directory (highlighted below) to your PATH variable.

Image

TO DO

  • Add option to direct where to save results
  • Add functionality to sweep many subnets
  • Add options for quiet and verbose output

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A CLI based tool used to ping many devices on a network.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages