aboutsummaryrefslogblamecommitdiffstats
path: root/viensamoi/send_beacon.py
blob: 5e354cc438c0bc8246945363fe1e213ae6e25c76 (plain) (tree)






















                                                                                                                                                                                                                                                             
import sys
import time
from scapy.all import *

def usage():
  print "usage: %s if_name ap_name ap_mac" % sys.argv[0]

if __name__ == '__main__':
  args = sys.argv
  if len(args) < 4:
    usage()
    sys.exit(1)

  if_name = sys.argv[1]
  ap_name = sys.argv[2]
  ap_mac = sys.argv[3]

  conf.iface=if_name
  pkt = Dot11(addr1='ff:ff:ff:ff:ff:ff', addr2=ap_mac, addr3=ap_mac)/Dot11Beacon(cap="ESS")/Dot11Elt(ID="SSID", len=9,info=ap_name)/Dot11Elt(ID="Rates",info='\x82\x84\x0b\x16')/Dot11Elt(ID="DSset",info="\x03") #Dot11Elt(ID="TIM",info="\x00\x01\x00\x00")
  print "Creating AP on %s named %s mac %s" % (if_name, ap_name, ap_mac)
  while True:
    send(pkt, count=10)
    time.sleep(1)