Skip to content

NullSpecter404/arp-scanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ARP Network Scanner

This Python script uses Scapy to perform a simple ARP scan across a given subnet, allowing you to discover active devices (IP ↔ MAC addresses) on the local network. It supports both Windows and Linux environments, with small differences between versions.


⚙️ Features

  • Scans a specified subnet using ARP requests.
  • Shows IP and MAC addresses of discovered devices.
  • Optional verbose output.
  • Allows saving results to a text file.
  • Compatible with both Windows and Linux.

🧩 Requirements

Common

  • Python 3.8+
  • Scapy library

To install Scapy:

pip install scapy

🪟 For Windows Users

Windows does not require root privileges but may need Administrator access to send raw packets.

Run Example:

python script_windows.py -i Ethernet -s 192.168.1.0/24 -t 3 -v -o results.txt

Available Options:

Option Description
-i [iface] Specify the network interface (e.g., Ethernet, Wi-Fi)
-s [subnet] Target subnet (e.g., 192.168.1.0/24)
-t [timeout] Timeout in seconds (default: 2)
-v Enable verbose output
-o [file] Save results to a file
-h, --help Show help message

Example Output:

192.168.1.1 -> 74:D4:35:AB:12:EF
192.168.1.4 -> 58:D0:6E:22:AA:34

If -o is used, results are saved to the specified file.


🐧 For Linux Users

Linux requires root privileges to send layer 2 packets.

Run Example:

sudo python3 script_linux.py -i eth0 -s 192.168.1.0/24 -t 3 -v -o scan.txt

Important:

If you do not run it as root, the script will exit with:

please run as root

Options:

Same as Windows version:

  • -i [iface] → Interface name (e.g., eth0, wlan0)
  • -s [subnet] → Subnet to scan
  • -t [timeout] → Timeout value
  • -v → Verbose mode
  • -o [file] → Output file
  • -h, --help → Help

🧠 Notes

  • The script uses srp() (send and receive packets at layer 2) — ideal for local network discovery.
  • Works only on LAN networks (not over the internet).
  • The Linux version performs a root check using os.geteuid() and enforces interface selection with -i.
  • The Windows version doesn’t enforce root but allows scanning with srp() directly.

🧾 Example Scan Result

When scanning 192.168.1.0/24, typical output:

192.168.1.1 -> 3C:7C:3F:90:12:89
192.168.1.5 -> 20:47:47:19:02:AA
192.168.1.10 -> 5C:D0:6E:55:AF:33

📄 Output File Example (results.txt)

192.168.1.1 -> 3C:7C:3F:90:12:89
192.168.1.5 -> 20:47:47:19:02:AA
192.168.1.10 -> 5C:D0:6E:55:AF:33

⚠️ Troubleshooting

  • “Scapy not found” → Run pip install scapy
  • “please run as root” (Linux) → Use sudo
  • No output → Check your interface (-i) and subnet correctness.
  • PermissionError (Windows) → Run terminal as Administrator.

🧑‍💻 NullSpecter404

Created for educational and ethical network testing using Scapy. Do not use this tool on networks you don’t own or have permission to scan.

Releases

No releases published

Packages

 
 
 

Contributors

Languages