feat: wi-fi - join WPA2/WPA3-PSK networks and carry traffic like ethernet
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import re, sys, subprocess
|
||||
out = subprocess.run(['trace-cmd','report','-R','-i','/tmp/iwl.dat'],
|
||||
capture_output=True, text=True).stdout
|
||||
NAMES = {(3,0x08):'MAC_CONFIG', (3,0x09):'LINK_CONFIG', (3,0x0a):'STA_CONFIG',
|
||||
(3,0x0c):'STA_REMOVE', (1,0x08):'PHY_CONTEXT', (3,0x05):'SESSION_PROT'}
|
||||
seen = {}
|
||||
for line in out.splitlines():
|
||||
m = re.search(r'hcmd=ARRAY\[(.*?)\]', line)
|
||||
if not m: continue
|
||||
b = [int(x,16) for x in m.group(1).split(', ')]
|
||||
if len(b) < 8: continue
|
||||
op, grp = b[0], b[1]
|
||||
ln = b[4] | (b[5] << 8)
|
||||
key = (grp, op)
|
||||
if key not in NAMES: continue
|
||||
payload = b[8:8+ln]
|
||||
action = payload[0] | (payload[1]<<8) | (payload[2]<<16) | (payload[3]<<24) if len(payload)>=4 else -1
|
||||
seen.setdefault(key, []).append((ln, payload))
|
||||
for key, lst in seen.items():
|
||||
print(f"\n===== {NAMES[key]} (group 0x{key[0]:02x} cmd 0x{key[1]:02x}) x{len(lst)} =====")
|
||||
lens = {l for l,_ in lst}
|
||||
print(f"payload length(s): {sorted(lens)}")
|
||||
# show the most 'interesting' one (most non-zero bytes)
|
||||
ln, p = max(lst, key=lambda t: sum(1 for x in t[1] if x))
|
||||
for off in range(0, len(p), 16):
|
||||
chunk = p[off:off+16]
|
||||
print(f" +{off:3d}: " + " ".join(f"{x:02x}" for x in chunk))
|
||||
Reference in New Issue
Block a user