
Lua-आधारित Wireshark postdissector जो Ubiquiti AirMAX/RouterBoard 802.11 विक्रेता IEs को डिक्रिप्ट और पार्स करके फ़िल्टर करने योग्य फ़ील्ड्स में बदलता है।
Ubiquiti AirMAX (AC + M) और साथी Mikrotik / RouterBoard विक्रेता Information Elements के लिए एक Wireshark/tshark dissector, जो Lua में लिखा गया है।
यह pyrmax का over-the-wire समकक्ष है: decode तर्क उस Python पैकेज को field-for-field प्रतिबिम्बित करता है। AC पैकेट प्रारूप AirMAX AC फर्मवेयर बाइनरी से reverse-engineer किया गया था; M और RouterBoard लेआउट पुराने AirMAX-M विक्रेता IE पर पहले प्रकाशित नोटों से आते हैं।
AirMAX 802.11 vendor-specific IEs (tag 221) के अंदर सवार होता है। Wireshark पहले से ही 802.11 फ्रेम को parse करता है और vendor IE को एक अपारदर्शी blob के रूप में दिखाता है; wiremax उस blob को लेता है, उसे decrypt करता है (AES-128-ECB, key फ्रेम MACs से व्युत्पन्न) और एक parsed, filterable सबट्री प्रस्तुत करता है।
Tag: Vendor Specific: Ubiquiti Inc (built-in 802.11 dissector)
AirMAX AC (Vendor Specific IE) ← added by wiremax
Flags: 0x02 ( .... ..1. = Encrypted: True )
Message Type: Beacon (1)
Encrypted Length: 48
[Decrypted payload (AES-128-ECB)]
[AES Key …: 1f162a13… (dst=broadcast)]
Version: 9
Source MAC: 24:5a:4c:44:57:fd
Radio MAC (mac_0c): 24:5a:4c:44:57:fd
Capability Flags: 0x0000003e
Mixed Mode: 0
Radioname: LB1
SSID: labalUBI2
TLV: Radioname (1), len 3
TLV: SSID (2), len 9
TLV: Padding (0)
decrypted लेआउट Message Type पर निर्भर करता है: beacons में mac_0c / cap_flags / mixed_mode + name TLVs होते हैं (ऊपर); assoc req/resp में chainmasks, cap_flags और version-gated tail fields (field_9c, rssi, fwname, txpower) होते हैं; probe req केवल header वाला होता है; deauth में एक jiffies nonce और एक opaque auth token होता है (और इसका source MAC XOR-masked होता है, जिसे wiremax un-mask करता है)।
| Variant | कवरेज |
|---|---|
| AirMAX AC | बाहरी header + decrypted साझा head (version + src_mac) + प्रति-message-type, version-gated body (beacon, assoc req/resp, probe req, deauth) + name TLVs |
| AirMAX M | बाहरी shell + decrypted 9 प्रलेखित bytes (version, msg_type, src_mac, enable) + raw शेष |
| RouterBoard (Mikrotik) | OUI/type + sub-IEs + device name (cleartext) |
अप्रलेखित byte क्षेत्र raw दिखाए जाते हैं (Unknown [n:len]), कभी आविष्कार नहीं किए जाते — pyrmax और ac/ knowledge base के समान अनुशासन।
एक postdissector (यह built-in 802.11 dissector को प्रतिस्थापित नहीं करता, यह उसके बाद चलता है)। प्रत्येक frame के लिए यह:
Field extractors के माध्यम से हर wlan.tag.oui के साथ wlan.sa / wlan.da पढ़ता है;00:27:22), M (00:15:6d) या RouterBoard (00:0c:42) OUI से मेल खाता है — AC/M के लिए इसे OUI-type FF FF FF की भी आवश्यकता होती है, क्योंकि 00:15:6d Mikrotik और एक अन्य Ubiquiti IE के साथ साझा किया जाता है जो same frame में दिखाई देता है;AES-128-ECB से decrypt करता है, key = HMAC-SHA1(dst_mac, src_mac)[:16], पहले कैप्चर किए गए 802.11 destination को आज़माता है और broadcast पर वापस आता है (identity frames unicast होने पर भी broadcast key का उपयोग करते हैं) — विजेता वह है जिसके decrypted payload का अंतर्निहित source MAC 802.11 source से मेल खाता है;क्रिप्टो (SHA-1, HMAC-SHA1, AES-128 decrypt) self-contained pure Lua है — Wireshark Lua को कोई crypto API उजागर नहीं करता। Payloads कुछ 16-byte ब्लॉक होते हैं, इसलिए performance अप्रासंगिक है। Key सार्वजनिक MACs से व्युत्पन्न होती है, इसलिए यह obfuscation है, सुरक्षा नहीं।
एक बार (बिना इंस्टॉल):
tshark -X lua_script:airmax.lua -r capture.pcap -V
wireshark -X lua_script:airmax.lua capture.pcap
स्थायी (Wireshark GUI + tshark): पूरा wiremax/ फ़ोल्डर Personal Lua Plugins निर्देशिका में रखें। सटीक पथ Wireshark में Help ▸ About Wireshark ▸ Folders ▸ Personal Lua Plugins के अंतर्गत दिखाया गया है; डिफ़ॉल्ट हैं:
| OS | डिफ़ॉल्ट Personal Lua Plugins पथ |
|---|---|
| Linux | ~/.local/lib/wireshark/plugins/ |
| macOS | ~/.local/lib/wireshark/plugins/ (या ~/.config/wireshark/plugins/) |
| Windows | %APPDATA%\Wireshark\plugins\ |
पुनरावृत्ति के दौरान एक symlink आदर्श है — पुनः लोड करने पर (Ctrl+Shift+L) संपादन बिना किसी copy चरण के उठाए जाते हैं:
ln -s "$PWD" ~/.local/lib/wireshark/plugins/wiremax
Wireshark plugin फ़ोल्डर के अंतर्गत प्रत्येक .lua को recursively लोड करता है; wsairmax/ के अंतर्गत submodules सादे modules हैं (स्टैंडअलोन लोड होने पर हानिरहित) और test/selftest.lua Wireshark के अंदर no-op करता है।
| फ़िल्टर | अर्थ |
|---|---|
airmax.ac.msg_type | message type: 1 Beacon, 2 Assoc Req, 3 Assoc Resp, 4 Probe Req, 0xC Deauth |
airmax.ac.flags.encrypted | encrypted बिट (0x02) |
airmax.ac.version | decrypted प्रारूप संस्करण (gate; TX 9 उत्सर्जित करता है) |
airmax.ac.src_mac | decrypted head से source MAC (deauth इसे un-mask करता है) |
airmax.ac.mac_0c | beacon radio MAC (BSSID) |
airmax.ac.cap_flags + airmax.ac.cap_flags.chanbw/.high_density/.auth_deauth/.compat_11ax | capability bitfield (§11) |
airmax.ac.radioname, airmax.ac.ssid, airmax.ac.fwname | AC name / firmware स्ट्रिंग्स |
airmax.ac.jiffies_nonce, airmax.ac.enc_token | deauth nonce + opaque auth token |
airmax.ac.tlv.tag / .len / .data | raw TLV walk |
airmax.m.version, airmax.m.msg_type, airmax.m.src_mac, airmax.m.enable | M प्रलेखित फ़ील्ड्स |
airmax.m.unknown_rest | अप्रलेखित M tail |
airmax.rb.device_name | RouterBoard device नाम |
airmax.ac.key / airmax.m.key | व्युत्पन्न AES key (जनरेटेड, सत्यापन के लिए) |
उदाहरण:
tshark -r cap.pcap -Y 'airmax.ac.ssid' -T fields -e wlan.sa -e airmax.ac.ssid
tshark -r cap.pcap -Y 'airmax.m.msg_type == 1' -T fields -e airmax.m.src_mac
tshark -r cap.pcap -Y 'airmax.rb.device_name' -T fields -e airmax.rb.device_name
Captures 802.11 monitor mode (radiotap) में होने चाहिए; IEs (beacon / probe response / assoc) ले जाने वाले management frames 802.11 परत पर unencrypted होते हैं — केवल IE के अंदर AirMAX payload AES-wrapped होता है, और wiremax इसे unwrap करता है।
test/selftest.lua standalone Lua 5.4 इंटरप्रेटर (बिना Wireshark) के अंतर्गत crypto और decoders चलाता है, ground-truth vectors के साथ-साथ मानक SHA-1 / RFC-2202 HMAC vectors के विरुद्ध जाँच करता है:
lua test/selftest.lua # from this directory
वास्तविक capture के विरुद्ध end-to-end (pyrmax tests/samples/ के अंतर्गत नमूना pcaps भेजता है):
tshark -X lua_script:airmax.lua -r airmax_ac_beacon.pcap -V
tshark -X lua_script:airmax.lua -r airmax_m_probe_response.pcap -V
wiremax/
├── airmax.lua # Wireshark entry: ProtoFields + postdissector + tree
├── wsairmax/ # pure-Lua modules (no Wireshark dependency)
│ ├── util.lua # hex / MAC helpers
│ ├── sha1.lua # SHA-1 + HMAC-SHA1
│ ├── aes.lua # AES-128 ECB decrypt
│ ├── crypto.lua # key derivation + decrypt (mirrors pyrmax/_crypto.py)
│ ├── ac.lua # AirMAX AC decoder (outer ksy: airmax_ac; payload hand-written per 09b)
│ ├── m.lua # AirMAX M decoder (ksy: airmax_m[_payload])
│ └── routerboard.lua # RouterBoard decoder (ksy: routerboard)
├── test/selftest.lua # standalone-Lua test harness
└── README.md
msg_type पुराने AirMAX-M नोटों के अनुसार 1 = Beacon लेबल करता है, लेकिन मान 1 probe responses पर भी देखा जाता है — M message-type स्थान पूरी तरह से मैप नहीं है, इसलिए raw संख्या पर भरोसा करें।enc_len है, एक u16 big-endian (09b §3); पुराना 1-byte read केवल payloads < 256 के लिए संयोगवश सही था।version < 9 decoders भी सत्यापित नहीं हैं (TX केवल 9 उत्सर्जित करता है)। test/selftest.lua में सिंथेटिक vectors देखें।जब pyrmax में कोई field जोड़ा/नाम बदला जाता है (src/pyrmax/ac.py या उसके ksy/*.ksy स्कीमा), तो उसे मेल खाते wsairmax/*.lua decoder में प्रतिबिम्बित करें और, यदि user-visible है, तो airmax.lua में एक ProtoField जोड़ें। test/selftest.lua में ground-truth vectors pyrmax नमूना pcaps से आते हैं, इसलिए विचलन वहाँ सतह पर आएगा।