Skip to main content

AirShark

Python 3.10+ macOS License

Terminal Wi-Fi monitor for macOS. Puts the interface into monitor mode, hops channels, with support for WPA/WPA2 decryption.

  • Capture: dumpcap while the interface is in monitor mode and captures raw frames, which are piped into tshark (-T ek) to generate JSON, which is fed into a background thread for the TUI to read off of.
  • Channel hopping: Implemented using CoreWLAN via PyObjC. The interface is disassociated once at startup to allow raw packet capture.
  • UI: Textual.

Requirements

  • macOS
  • Python 3.10+
  • Wireshark / tshark
    During install, make sure to enable the ChmodBPF capture permissions. This allows AirShark to capture packets entirely without sudo.

Installation

pip install airshark

Or clone from source and install in editable mode:

git clone <repo-url>
cd airshark
pip install -e .

Configuration

Credentials for decryption can come from the CLI or a .env file:

SSID="YourNetworkName"
PASSWORD="YourPassphrase"

CLI flags (-s/-k) can override .env.

Usage

# Monitor channel 6
airshark -i en0 -c 6

# Hop 2.4 GHz, 0.5 s per channel
airshark -i en0 --band 2.4 --dwell 0.5

# 5 GHz hop + live decryption
airshark -i en0 --band 5 -s HomeNet -k s3cr3t

Keybindings while running:

Key Action
h Toggle channel hopping on / off
, / . Previous / Next channel (when hopping)
= / - Increase / decrease channel dwell time
q Quit

Known Limitations

EAPOL (4-Way Handshake) Capture

For reliable EAPOL capture (and subsequent WPA decryption), it is recommended to lock AirShark to the target AP's specific channel (e.g., airshark -c 60) rather than sweeping an entire band, or use the h keybind and select the channel using , and . keys.

Multi-Band Hopping (2.4 + 5 GHz + 6 GHz)

The macOS CoreWLAN framework imposes hardware limitations that prevent the Wi-Fi radio from transparently hopping across different frequency bands. If attempted, the initial cross-band hop may succeed, but subsequent hops are silently ignored by the macOS Wi-Fi driver. Therefore, AirShark restricts channel hopping to a single band at a time (e.g., 2.4 GHz, 5 GHz, or 6 GHz). Refer to this post on the Apple developer forums for additional technical context.

Named pipe support

You can stream packets from AirShark to other tools like Wireshark using Unix named pipes.

  1. Create the named pipe:

    mkfifo /tmp/airshark.pipe
    
  2. Start Wireshark reading from the pipe first:

    wireshark -k -i /tmp/airshark.pipe &
    
  3. Run AirShark and output to the pipe:

    airshark --band 5 -o /tmp/airshark.pipe
    

CLI Reference

capture:
  -i IFACE, --interface   Wireless interface (default: en0)
  -I, --monitor           Enable monitor mode (default: on)
  -o FILE, --output       Output PCAP file or named pipe (default: airshark_capture.pcap)
  -c N, --channel         Channel for single mode (default: 6)
  --band BAND             Band to sweep: single | 2.4 | 5 | 6
  --dwell SECS            Seconds per channel when hopping (default: 0.75)

decryption:
  -s, -S, --ssid SSID     Network SSID for WPA decryption
  -k PASSPHRASE, --key    WPA/WPA2 passphrase

Release files for airshark 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for airshark 0.1.0
File Size Uploaded
airshark-0.1.0.tar.gz 19.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for airshark 0.1.0
File Interpreter ABI Platform
airshark-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 39.1 kB

Release files / airshark-0.1.0.tar.gz

Download URL airshark-0.1.0.tar.gz
Size 19.4 kB
Tags Source
SHA-256 checksum
How to use checksums
53f2e72cb4fae7ba7ff354928f88f6f03af41319fa6c3688b04cddc80b54cdd2
BLAKE2b-256 checksum
How to use checksums
acb5752fdfde2cd2e5a7923dab724d7ba674c162d36594ca89c305a6996f67da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.7

Release files / airshark-0.1.0-py3-none-any.whl

Download URL airshark-0.1.0-py3-none-any.whl
Size 19.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
297e3c47746da25103cd5c69ef22bc8a870b107d278c8dbf543b47d9756e8981
BLAKE2b-256 checksum
How to use checksums
4dedc2b839549a5eb7098eac9d5f43a7d0a6e2783408115675a4ea35c5e4b9ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.7

Release history Release notifications | RSS feed

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page