WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Scapy does not transmit / inject wifi packets - sniffing works #2076

@marc-y-marc

Description

@marc-y-marc

Brief description

The issue is that Scapy does not send any packets. No errors appear. I've tried 2 examples (beacons + answering machine) and both do not seem to work. Receiving in scapy works.

My adapter does support monitor mode & injection. If i run aireplay-ng and i perform a death attack or any other option, i can see the broadcasted packets using my second adapter as sniffer.

Environment

How to reproduce

  • Install clean raspbian on RPI3B+
  • Install driver (see above)
  • Put adapters in montitor mode using iwconfig / ifconfig
  • Install python3 via apt-get
  • Install pip3 via apt-get,
  • update pip using sudo python3 -m pip install --upgrade pip
  • install scapy[basic] using sudo python3 -m pip install --pre scapy[basic]

Example 1: Beacons

`
#!/usr/bin/python3

from scapy.all import *

netSSID = 'testSSID'    #Network name here
iface = 'wlan1'         #Interface name here

conf.use_pcap = True

dot11 = Dot11FCS(type=0, subtype=8, addr1='ff:ff:ff:ff:ff:ff',
addr2='22:22:22:22:22:22', addr3='33:33:33:33:33:33')
beacon = Dot11Beacon(cap='ESS+privacy')
essid = Dot11Elt(ID='SSID',info=netSSID, len=len(netSSID))
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)

frame = RadioTap()/dot11/beacon/essid/rsn

frame.show()
print("\nHexdump of frame:")
hexdump(frame)

input("\nPress enter to start\n")

sendp(frame, iface=iface, inter=0.100, loop=1, monitor=True)
`

I tried to play with the conf.use_pcap=True and the sendp(monitor=True). However they don't seem to have any influence.

Actual result

###[ RadioTap dummy ]###
version = 0
pad = 0
len = None
present = Flags
Flags = FCS
notdecoded= ''
###[ 802.11-FCS ]###
subtype = 8
type = Management
proto = 0
FCfield =
ID = 0
addr1 = ff:ff:ff:ff:ff:ff
addr2 = 22:22:22:22:22:22
addr3 = 33:33:33:33:33:33
SC = 0
fcs = None
###[ 802.11 Beacon ]###
timestamp = 0
beacon_interval= 100
cap = ESS+privacy
###[ 802.11 Information Element ]###
ID = SSID
len = 8
info = 'testSSID'
###[ 802.11 Information Element ]###
ID = RSNinfo
len = None
info = '\x01\x00\x00\x0f\xc2\xac\x02\x02\x00\x00\x0f\xc2\xac\x04\x00\x0f\xc2\xac\x02\x01\x00\x00\x0f\xc2\xac\x02\x00\x00'

Hexdump of frame:
0000 00 00 09 00 02 00 00 00 10 80 00 00 00 FF FF FF ................
0010 FF FF FF 22 22 22 22 22 22 33 33 33 33 33 33 00 ...""""""333333.
0020 00 00 00 00 00 00 00 00 00 64 00 11 00 00 08 74 .........d.....t
0030 65 73 74 53 53 49 44 30 1C 01 00 00 0F C2 AC 02 estSSID0........
0040 02 00 00 0F C2 AC 04 00 0F C2 AC 02 01 00 00 0F ................
0050 C2 AC 02 00 00 64 0C 04 AC .....d...

Expected result

Expected that the packetis sent using wlan1 - so it can be sniffed with wlan2 operating both on the same channel. However they are not broadcasted. No error occurs when i pressed enter to start the transmit.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions