Merge pull request #472 from neutralinsomniac/grid_handle_malformed_filenames
fix: don't attempt to parse/upload pcaps with malformed filenames
This commit is contained in:
commit
f03e07f0cf
@ -9,6 +9,7 @@ import os
|
|||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
import glob
|
import glob
|
||||||
|
import re
|
||||||
|
|
||||||
import pwnagotchi.grid as grid
|
import pwnagotchi.grid as grid
|
||||||
from pwnagotchi.utils import StatusFile, WifiInfo, extract_from_pcap
|
from pwnagotchi.utils import StatusFile, WifiInfo, extract_from_pcap
|
||||||
@ -36,6 +37,10 @@ def parse_pcap(filename):
|
|||||||
# /root/handshakes/BSSID.pcap
|
# /root/handshakes/BSSID.pcap
|
||||||
essid, bssid = '', net_id
|
essid, bssid = '', net_id
|
||||||
|
|
||||||
|
mac_re = re.compile('[0-9a-fA-F]{12}')
|
||||||
|
if not mac_re.match(bssid):
|
||||||
|
return '', ''
|
||||||
|
|
||||||
it = iter(bssid)
|
it = iter(bssid)
|
||||||
bssid = ':'.join([a + b for a, b in zip(it, it)])
|
bssid = ':'.join([a + b for a, b in zip(it, it)])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user