-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathejemplo15.py
More file actions
executable file
·61 lines (51 loc) · 2.02 KB
/
Copy pathejemplo15.py
File metadata and controls
executable file
·61 lines (51 loc) · 2.02 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
intfmon='mon0'
verbose=1
count=30
dst = 'ff:ff:ff:ff:ff:ff'
apssid='testAP'
bssid = src = '00:01:02:03:04:05'
apsecurity='wpa2'
if apsecurity == 'wep':
beacon = Dot11Beacon(cap='ESS+privacy')
rsn=''
elif apsecurity == 'wpa':
beacon = Dot11Beacon(cap='ESS+privacy')
rsn = Dot11Elt(ID='RSNinfo', info=(
'\x01\x00' # RSN Version 1
'\x00\x0f\xac\x02' # Group Cipher Suite : 00-0f-ac TKIP
'\x02\x00' # 2 Pairwise Cipher Suites (next two lines)
'\x00\x0f\xac\x04' # AES Cipher
'\x00\x0f\xac\x02' # TKIP Cipher
'\x01\x00' # 1 Authentication Key Managment Suite (line below)
'\x00\x0f\xac\x02' # Pre-Shared Key
'\x00\x00')) # RSN Capabilities (no extra capabilities)
elif apsecurity == 'wpa2':
beacon = Dot11Beacon(cap='ESS+privacy')
rsn = Dot11Elt(ID='RSNinfo', info=(
'\x01\x00' # RSN Version 1
'\x00\x0f\xac\x02' # Group Cipher Suite : 00-0f-ac TKIP
'\x02\x00' # 2 Pairwise Cipher Suites (next two lines)
'\x00\x0f\xac\x04' # AES Cipher
'\x00\x0f\xac\x02' # TKIP Cipher
'\x01\x00' # 1 Authentication Key Managment Suite (line below)
'\x00\x0f\xac\x02' # Pre-Shared Key
'\x00\x00')) # RSN Capabilities (no extra capabilities)
else:
rsn=''
beacon=Dot11Beacon(cap='ESS')
essid = Dot11Elt(ID='SSID',info=apssid, len=len(apssid))
dsset = Dot11Elt(ID='DSset',info='\x01')
tim = Dot11Elt(ID='TIM',info='\x00\x01\x00\x00')
rates = Dot11Elt(ID='Rates',info="\x03\x12\x96\x18\x24\x30\x48\x60")
pkt = RadioTap()/Dot11(proto=0,type=0,subtype=8,addr1=dst,addr2=src,addr3=bssid)/beacon/essid/rsn/rates/dsset/tim
if verbose: print 'Sending %d frames (802.11 Beacon) with SSID=[%s], BSSID=%s, SEC=%s' % (count,apssid,bssid,apsecurity)
if verbose: print pkt.command()
try:
sendp(pkt,iface=intfmon,count=count,inter=0.100,verbose=1)
except:
raise