Skip to content

Instantly share code, notes, and snippets.

@teknoraver
Created July 31, 2014 14:52
Show Gist options
  • Save teknoraver/232984ce8ce2ef8a8f8e to your computer and use it in GitHub Desktop.
Save teknoraver/232984ce8ce2ef8a8f8e to your computer and use it in GitHub Desktop.
#!/usr/bin/python
from scapy.all import *
mgmt = "\x89D!!\0\0\0\0d\0\x01\x04\0\x01x\x01\x08\x82\x84\x8b\x96\x0c\x12\x18$\x03\x01\x01\x05\x04\x01\x02\0\02\x040H`l"
beacon = RadioTap()/Dot11()/Dot11Beacon(mgmt)
beacon.payload.addr1 = "ff:ff:ff:ff:ff:ff"
# read a file with words to use as ESSID
dict = open("/usr/share/dict/italian", "r")
words = dict.read().split("\n")
dict.close()
while True:
# set a fake but valid mac address
mac = [ random.randint(0x00, 0xff),
random.randint(0x00, 0xff),
random.randint(0x00, 0xff),
random.randint(0x00, 0xff),
random.randint(0x00, 0xff),
random.randint(0x00, 0xff) ]
mac[0] |= 2
mac[0] &= 0xfe
mac = ':'.join(map(lambda x: "%02x" % x, mac))
beacon.payload.addr2 = mac
beacon.payload.addr3 = mac
# select the ESSID to a dictionary word
word = random.choice(words)
beacon.payload.payload.payload.info = word
beacon.payload.payload.payload.len = len(word)
sendp(beacon, iface="mon0")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment