我目前正在用 scapy 在 python 中制作简单的 AP。当我发送探测响应时出现问题,客户端没有发送关联请求。
代码:
def send_response(client_addr):
dot11 = Dot11(subtype=5, addr1=client_addr, addr2=bssid, addr3=bssid)
probeReq = Dot11ProbeResp(cap='ESS+privacy')
dot11elt = Dot11Elt(ID='SSID', info=netSSID, len=len(netSSID))\
/Dot11Elt(ID='Rates', info='\x82\x84\x8b\x96\x0c\x12\x18')\
/Dot11Elt(ID='DSSS Set', info=chr(CHANNEL))\
/Dot11Elt(ID='ESRates', info='\x30\x48\x60\x6c')
frame = RadioTap(len=18, present='Rate+Channel+dBm_AntSignal+RadiotapNS+RXFlags',\
Rate = 1.0,\
ChannelFrequency= get_frequency(CHANNEL),\
ChannelFlags= 'CCK+2GHz',\
dBm_AntSignal= -66,\
)/dot11/probeReq/dot11elt
sendp(frame, iface=iface, count = 1)
包:
###[ RadioTap ]###
version = 0
pad = 0
len = 18
present = Rate+Channel+dBm_AntSignal+RXFlags+RadiotapNS
Rate = 1.0 Mbps
ChannelFrequency= 2412
ChannelFlags= CCK+2GHz
dBm_AntSignal= -66 dBm
RXFlags =
notdecoded= ''
###[ 802.11 ]###
subtype = Probe Response
type = Management
proto = 0
FCfield =
ID = 0
addr1 = 60:43:c0:d5:5a:b9 (RA=DA)
addr2 = fc:94:35:52:3a:99 (TA=SA)
addr3 = fc:94:35:52:3a:99 (BSSID/STA)
SC = 0
###[ 802.11 Probe Response ]###
timestamp = 0
beacon_interval= 100
cap = ESS+privacy
###[ 802.11 Information Element ]###
ID = SSID
len = 4
info = 'test'
###[ 802.11 Rates ]###
ID = Supported Rates
len = 11
rates = [33.0(B) Mbps, 1.0(B) Mbps, 33.0(B) Mbps, 2.0(B) Mbps, 33.0(B) Mbps, 5.5(B) Mbps, 33.0(B) Mbps, 11.0(B) Mbps, 6.0 Mbps, 9.0 Mbps, 12.0 Mbps]
###[ 802.11 DSSS Parameter Set ]###
ID = DSSS Set
len = 1
channel = 1
###[ 802.11 Rates ]###
ID = Extended Supported Rates
len = 4
rates = [24.0 Mbps, 36.0 Mbps, 48.0 Mbps, 54.0 Mbps]
此外,scapy 发送多个设置了 TX_FAIL 标志的数据包
谢谢指教!