Skip to content

Conversation

@rriggio
Copy link

@rriggio rriggio commented Dec 2, 2019

This patch adds support for frame injection on 802.11n Wi-Fi cards. The patch has been tested with kernel 4.4 (the current stable OpenWRT kernel) and it should work with any recent kernel.

The patch requires support for frame injection by the specific Wi-Fi driver you are using and has been tested extensively only with the ath9k. The patch will not work for VHT rates (11ac) and in general with the ath10k driver.

The radiotap parsing code is from the upstream radiotap project.

A new SetTXRateHT element has been added to allow frame injection at arbitrary MCS (0-15).

The RadiotapEncap/Decap element now supports retry chains, however, the corresponding kernel patch has not yet been merged into upstream. All chains following the first one are thus ignored. If you need the kernel patch adding support for longer retry chains please message me.

Sample script for frame injection:

RatedSource(<9999>, RATE 1, LIMIT 100)
-> EtherEncap(0x06BB, 00:15:6D:84:13:5D, FF:FF:FF:FF:FF:FF)
-> WifiEncap(0x00, 0:0:0:0:0:0)
-> SetTXRateHT(MCS 0, TRIES 1)
-> RadiotapEncap()
-> Print()
-> ToDevice (moni0)

This assumes that moni0 is in monitor mode on a supported driver.

Sample script for rx:

FromDevice(moni0, PROMISC false, OUTBOUND true, SNIFFER false)
->RadiotapDecap()
->FilterPhyErr()
->WifiDupeFilter()
->ToDump(/tmp/tmp.pcap, ENCAP 802_11, SNAPLEN 0)

@rriggio
Copy link
Author

rriggio commented Dec 17, 2019

Checks failed due to some apt-get error which does not seem related to my patch.

@tbarbette
Copy link
Collaborator

I will fix Travis, than you can rebase ;)

@tbarbette
Copy link
Collaborator

@rriggio you can rebase now ;) (git fetch origin && git rebase origin/master)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants