Jeija / esp32free80211

Send arbitrary IEEE 802.11 frames with Espressif's ESP32
488 stars 72 forks source link

Can't send deauth tyep frame #6

Open AppLeU0 opened 7 years ago

AppLeU0 commented 7 years ago

can't send other type frame.I try send beacon,it's ok. But i try other type, deauth frame's fun return value is -2. wireshark can't find deauth packet and wifi doesn't reconnect.

my code:


uint8_t deauthPacket[26] = {
  /*  0 - 1  */ 0xC0, 0x00, //type, subtype c0: deauth (a0: disassociate)
  /*  2 - 3  */ 0x00, 0x00, //duration (SDK takes care of that)
  /*  4 - 9  */ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,//reciever (target)
  /* 10 - 15 */ 0xD1, 0xE1, 0x01, 0x21, 0x41, 0x11, //source (ap)
  /* 16 - 21 */ 0xD1, 0xE1, 0x01, 0x21, 0x41, 0x11, //BSSID (ap)
  /* 22 - 23 */ 0x00, 0x00, //fragment & squence number
  /* 24 - 25 */ 0x01, 0x00 //reason code (1 = unspecified reason)
};

void spam_task(void *pvParameter) {
    for (;;) {
        vTaskDelay(50);
        int result = free80211_send(deauthPacket, sizeof(deauthPacket));
        printf("deauthPacket:%d\r\n", result);
        }
}
atlascoder commented 6 years ago

Hello! Is there a way to send deauth packet?

geekspeed commented 6 years ago

00 - 01 has 0xC0 0x00 not 0xC0 0xA0

geekspeed commented 6 years ago

An actually it should be 0x00 0x0A for a disassociate frame and then set 25 to 0x06 ...6 is: Frame Received from Unauthenticated STA

sst2001 commented 6 years ago

So is it possible or not? do we get "unsupport frame type" here?

malaimoo commented 6 years ago

@sst2001 Of course It is unsupport, In other words, you can not send some type frames.

sst2001 commented 6 years ago

Thank you for your reply, is there a reason for that? why would you limit to certain frame tymes only? if you are concerned about security than DDOS can happen with beacon frame only, same with others etc. It is like a knife company cannot sell knives due to security, but the knife has good and bad usages...
Also, if an attacker wants to do it, he has his ways to do it even if you unsupport certain frames... Please explain. Thank you.

risinek commented 3 years ago

This restriction is implemented directly in ESP-IDF. There is a project that bypassed this restriction in https://github.com/GANESH-ICMC/esp32-deauther