Skip to content

Commit

Permalink
Removed remnants of forcePackets setting
Browse files Browse the repository at this point in the history
The setting was already removed in 2019 with the rewrite of  the settings module. In my tests, it didn't make the performance better, but added complexity and made the web interface unstable.
  • Loading branch information
Spacehuhn committed Jan 17, 2021
1 parent abf56ca commit 333e3eb
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 50 deletions.
19 changes: 8 additions & 11 deletions esp8266_deauther/Attack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ bool Attack::deauthDevice(uint8_t* apMac, uint8_t* stMac, uint8_t reason, uint8_
// send deauth frame
deauthpkt[0] = 0xc0;

if (sendPacket(deauthpkt, packetSize, ch, 1, true)) {
if (sendPacket(deauthpkt, packetSize, ch, true)) {
success = true;
deauth.packetCounter++;
}
Expand All @@ -315,7 +315,7 @@ bool Attack::deauthDevice(uint8_t* apMac, uint8_t* stMac, uint8_t reason, uint8_

disassocpkt[0] = 0xa0;

if (sendPacket(disassocpkt, packetSize, ch, 1, false)) {
if (sendPacket(disassocpkt, packetSize, ch, false)) {
success = true;
deauth.packetCounter++;
}
Expand All @@ -330,15 +330,15 @@ bool Attack::deauthDevice(uint8_t* apMac, uint8_t* stMac, uint8_t reason, uint8_
// send deauth frame
disassocpkt[0] = 0xc0;

if (sendPacket(disassocpkt, packetSize, ch, 1, false)) {
if (sendPacket(disassocpkt, packetSize, ch, false)) {
success = true;
deauth.packetCounter++;
}

// send disassociate frame
disassocpkt[0] = 0xa0;

if (sendPacket(disassocpkt, packetSize, ch, 1, false)) {
if (sendPacket(disassocpkt, packetSize, ch, false)) {
success = true;
deauth.packetCounter++;
}
Expand Down Expand Up @@ -383,7 +383,7 @@ bool Attack::sendBeacon(uint8_t* mac, const char* ssid, uint8_t ch, bool wpa2) {
tmpPacket[37] = ssidLen; // update SSID length byte
memcpy(&tmpPacket[38 + ssidLen], &beaconPacket[70], wpa2 ? 39 : 13); // copy second half of packet into buffer

bool success = sendPacket(tmpPacket, tmpPacketSize, ch, 1, false);
bool success = sendPacket(tmpPacket, tmpPacketSize, ch, false);

if (success) {
beacon.time = currentTime;
Expand Down Expand Up @@ -411,7 +411,7 @@ bool Attack::sendProbe(uint8_t* mac, const char* ssid, uint8_t ch) {
memcpy(&probePacket[10], mac, 6);
memcpy(&probePacket[26], ssid, ssidLen);

if (sendPacket(probePacket, packetSize, ch, 1, false)) {
if (sendPacket(probePacket, packetSize, ch, false)) {
probe.time = currentTime;
probe.packetCounter++;
return true;
Expand All @@ -420,7 +420,7 @@ bool Attack::sendProbe(uint8_t* mac, const char* ssid, uint8_t ch) {
return false;
}

bool Attack::sendPacket(uint8_t* packet, uint16_t packetSize, uint8_t ch, uint16_t tries, bool force_ch) {
bool Attack::sendPacket(uint8_t* packet, uint16_t packetSize, uint8_t ch, bool force_ch) {
// Serial.println(bytesToStr(packet, packetSize));

// set channel
Expand All @@ -429,10 +429,7 @@ bool Attack::sendPacket(uint8_t* packet, uint16_t packetSize, uint8_t ch, uint16
// sent out packet
bool sent = wifi_send_pkt_freedom(packet, packetSize, 0) == 0;

// try again until it's sent out
for (int i = 0; i < tries && !sent; i++) sent = wifi_send_pkt_freedom(packet, packetSize, 0) == 0;

if (sent) tmpPacketRate++;
if (sent) ++tmpPacketRate;

return sent;
}
Expand Down
2 changes: 1 addition & 1 deletion esp8266_deauther/Attack.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Attack {
bool sendProbe(uint8_t tc);
bool sendProbe(uint8_t* mac, const char* ssid, uint8_t ch);

bool sendPacket(uint8_t* packet, uint16_t packetSize, uint8_t ch, uint16_t tries, bool force_ch);
bool sendPacket(uint8_t* packet, uint16_t packetSize, uint8_t ch, bool force_ch);

bool isRunning();

Expand Down
2 changes: 1 addition & 1 deletion esp8266_deauther/CLI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ void CLI::runCommand(String input) {
for (int i = 0; i < packetSize; i++) packet[i] = strtoul((packetStr.substring(i * 2,
i * 2 + 2)).c_str(), NULL, 16);

if (attack.sendPacket(packet, packetSize, wifi_channel, 10, true)) {
if (attack.sendPacket(packet, packetSize, wifi_channel, true)) {
prntln(CLI_CUSTOM_SENT);
counter++;
} else {
Expand Down
8 changes: 0 additions & 8 deletions settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
- [`chTime`](#ch-time)
- [`minDeauths`](#mindeauths)
- [`attackTimeout`](#attacktimeout)
- [`forcePackets`](#force-packets)
- [`deauthsPerTarget`](#deauths-per-target)
- [`deauthReason`](#deauth-reason)
- [`beaconChannel`](#beacon-channel)
Expand Down Expand Up @@ -132,13 +131,6 @@ Minimum number of deauthentication frames when scanning to change the LED to dea
After what amount of time (in seconds) the attack will stop automatically.
Set it to 0 to disable it.

## FORCE-PACKETS
`uint8_t forcePackets = 1;`
How many attempts to send out a packet.
Set this value higher if you want to achieve a better packet rate in a busy area.
Be careful this setting could make the device slower or more unstable.
**Max value is 255**.

## DEAUTHS-PER-TARGET
`uint16_t deauthsPerTarget = 10;`
How many deauthentication and disassociation frames are sent out for each target.
Expand Down
57 changes: 28 additions & 29 deletions web_interface/settings.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
{
"version":"over9000",
"ssid":"pwned",
"password":"deauther",
"channel":1,
"hidden":false,
"captivePortal":true,
"lang": "en",
"autosave":true,
"autosavetime":30000,
"display":false,
"displayTimeout":600,
"serial":true,
"serialEcho":true,
"web":true,
"led":true,
"maxch":14,
"macSt":"aa:bb:cc:dd:ee:ff",
"macAP":"00:11:22:33:44:55",
"chtime":384,
"minDeauths":3,
"attacktimeout":600,
"forcepackets":3,
"deauthspertarget":20,
"deauthReason":1,
"beaconchannel":false,
"beaconInterval":false,
"randomTX":false,
"probesPerSSID":1
{
"version": "over9000",
"ssid": "pwned",
"password": "deauther",
"channel": 1,
"hidden": false,
"captivePortal": true,
"lang": "en",
"autosave": true,
"autosavetime": 30000,
"display": false,
"displayTimeout": 600,
"serial": true,
"serialEcho": true,
"web": true,
"led": true,
"maxch": 14,
"macSt": "aa:bb:cc:dd:ee:ff",
"macAP": "00:11:22:33:44:55",
"chtime": 384,
"minDeauths": 3,
"attacktimeout": 600,
"deauthspertarget": 20,
"deauthReason": 1,
"beaconchannel": false,
"beaconInterval": false,
"randomTX": false,
"probesPerSSID": 1
}

0 comments on commit 333e3eb

Please sign in to comment.