Skip to content

Wing9897/ipscan

Repository files navigation

ipscan banner

ipscan

Fast IP scanner — multithreaded Ping and ARP scanning (Windows, Linux, macOS)

PyPI version Python OS License

Language: English · 繁體中文 · 简体中文 · 日本語 · 한국어 · Deutsch · Français · Italiano · Español · Português BR · Русский


Table of contents

  • Quick start
  • Features
  • CLI tools
  • Python API
  • Performance notes
  • Requirements
  • Contributing

Quick start

Install from PyPI:

pip install ipscan

Windows users: Install optional Windows-optimized ping support:

pip install "ipscan[windows]"

Note: Linux users — see Linux Setup below for best performance.

CLI

fping           # High-speed continuous ping (interactive)
sping           # Simple range ping scan
sarp            # ARP range scan

Python API

Ping scan:

from ipscan import ping_range, PingScanner

online_hosts = ping_range("192.168.1.1", "192.168.1.254")

scanner = PingScanner(timeout=1.0)
results = scanner.scan_range("10.0.0.1", "10.0.0.100")

ARP scan:

from ipscan import arp_range, ArpScanner

host_info = arp_range("192.168.1.1", "192.168.1.254")
for ip, mac in host_info.items():
        print(f"{ip} -> {mac}")

scanner = ArpScanner()
results = scanner.scan_range("10.0.0.1", "10.0.0.100")

Features

  • Cross-platform: Windows, Linux, macOS support with automatic OS detection
  • Multithreaded scanning: High-speed concurrent operations
  • Smart implementations: Platform-optimized for best performance
    • Windows: Native SendARP API + ping3 library
    • Linux: Direct scapy ARP packets + system ping
    • macOS: System arp + ping commands
  • Simple API: Unified interface across all platforms
  • Progress tracking: Real-time progress bars and clean output

Linux Setup (Recommended)

For best performance on Linux, grant Python raw socket capabilities:

# Enable fast Ping scanning (raw ICMP socket, ~100x faster)
sudo setcap cap_net_raw+ep $(readlink -f $(which python3))

# Enable fast Ping + ARP scanning
sudo setcap cap_net_raw,cap_net_admin+ep $(readlink -f $(which python3))

Without this step:

  • Ping scanning still works but falls back to subprocess (slower)
  • ARP scanning requires sudo to run

To remove the capability (restore default):

sudo setcap -r $(readlink -f $(which python3))

Note: This only needs to be done once per Python installation. If using a virtualenv, run the command against the venv's Python binary.

Platform Details

Feature Windows Linux macOS
Ping scanning ping3 library raw ICMP socket (with setcap) / system ping (fallback) system ping
ARP scanning SendARP API scapy packets arp command
Permissions No special permissions setcap recommended (see above) No special permissions
Performance Optimized Optimized (with setcap) Good

Usage Examples

Linux ARP scanning (requires sudo)

sudo sarp
# Enter IP range when prompted

High-speed continuous ping

fping
# Enter target IP and interval

Range ping scanning

sping
# Enter start and end IP addresses

Requirements

  • Python 3.7+
  • Cross-platform support: Windows, Linux, macOS
  • Dependencies:
    • tqdm (progress bars)
    • scapy (ARP packet generation)
    • ping3 (Windows optimization, optional)

Contributing

Issues and PRs are welcome. If you like this project, consider starring it.


Made with ❤️ for network tinkerers.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors