import logging import argparse from sys import exit from time import sleep from datetime…
- User
import logging import argparse
from sys import exit from time import sleep from datetime import datetime from signal import signal, SIGINT from subprocess import call, PIPE
Usage python3.10 wireEye.py -h
Wireless Eye (WireEye)
set logging level for scapy
logging.getLogger("scapy").setLevel(logging.CRITICAL)
from scapy.all import sniff from scapy.layers import dot11
TAG_IDENTIFIER = "" WIREEYE_VERSION = "v0.5.0"
view 802.11 probe request/response
view 802.11 beacon frames (AP's advertising themselves)
ST_TIME = None INTERRUPT_ID = None
known_bssids = [] hidden_ssids = []
TOTAL_PROBE_REQUESTS = 0 TOTAL_PROBE_RESPONSES = 0
ESCAPE = "\033[0;m"
GREY = "\033[90;3m" BOLD_GREY = "\033[90;1m" BLUE = "\033[0;34m" BOLD_RED = "\033[31;1m" BOLD_YELLOW = "\033[93;1m" YELLOW = "\033[0;33m"
GREEN = "\033[0;32m" BRIGHT_GREEN = "\033[92;1m" FAINT_GREEN = "\033[32;2m" BOLD_GREEN = "\033[32;1m"
ANSI ESCAPE SEQUENCES
RA_POOR = f"{BOLD_RED}POOR{ESCAPE}" # red RA_FAIR = f"{BOLD_YELLOW}FAIR{ESCAPE}" # yellow RA_AVERAGE = f"{GREEN}AVERAGE{ESCAPE}" # green RA_EXCELLENT = f"{BRIGHT_GREEN}EXCELLENT{ESCAPE}" # blue
probe_request_run_count = 0 probe_response_run_count = 0
pretty sure probe responses are unicast
def probe_response_handler(pR80211_frame): global INTERRUPT_ID, TOTAL_PROBE_RESPONSES
code# print("## PROBE RESPONSE HANDLER: Listening...") if pR80211_frame.haslayer(dot11.Dot11ProbeResp): TOTAL_PROBE_RESPONSES = TOTAL_PROBE_RESPONSES + 1 if probe_response_run_count == 0: INTERRUPT_ID = 2 probe_response_run_count + 1 elif probe_response_run_count == 1: pass poas = datetime.now() packet_ts = f"{poas.month}-{poas.day}-{poas.year} {poas.hour}:{poas.minute}:{poas.second}" sta_addr_str = pR80211_frame[dot11.Dot11].addr1 # dst (wireless STA) sta_addr = f"{GREY}{sta_addr_str.upper()}{ESCAPE}" # dst (wireless STA) ap_addr = f"{GREEN}{(pR80211_frame[dot11.Dot11].addr2).upper()}{ESCAPE}" # source address (AP (real || rogue)) ap_ssid_str = pR80211_frame[dot11.Dot11Elt].info ap_ssid = f"{FAINT_GREEN}({ap_ssid_str.decode()}){ESCAPE}" print(f"[{packet_ts}] WireEye::probe_resp #{TOTAL_PROBE_RESPONSES} {ap_addr} {ap_ssid} responds to wireless STA => {sta_addr}") # need a database to store data # if an area is frequented we can use that data to point which devices are connected to which networks and sending probes, etc - Assistant