mirror of
https://github.com/SpacehuhnTech/esp8266_deauther.git
synced 2025-12-24 15:39:58 +01:00
Removed maxCh setting
This commit is contained in:
@@ -240,7 +240,7 @@ void Attack::deauthAllUpdate() {
|
||||
void Attack::probeUpdate() {
|
||||
if (probe.active && (probe.maxPkts > 0) && (probe.packetCounter < probe.maxPkts)) {
|
||||
if (probe.time <= currentTime - (1000 / probe.maxPkts)) {
|
||||
if (settings.getBeaconChannel()) setWifiChannel(probe.tc % settings.getMaxCh());
|
||||
if (settings.getBeaconChannel()) setWifiChannel(probe.tc % 11);
|
||||
probe.tc += sendProbe(probe.tc);
|
||||
|
||||
if (probe.tc >= ssids.count()) probe.tc = 0;
|
||||
@@ -334,7 +334,7 @@ bool Attack::deauthDevice(uint8_t* apMac, uint8_t* stMac, uint8_t reason, uint8_
|
||||
}
|
||||
|
||||
bool Attack::sendBeacon(uint8_t tc) {
|
||||
if (settings.getBeaconChannel()) setWifiChannel(tc % settings.getMaxCh());
|
||||
if (settings.getBeaconChannel()) setWifiChannel(tc % 11);
|
||||
mac[5] = tc;
|
||||
return sendBeacon(mac, ssids.getName(tc).c_str(), wifi_channel, ssids.getWPA2(tc));
|
||||
}
|
||||
@@ -379,7 +379,7 @@ bool Attack::sendBeacon(uint8_t* mac, const char* ssid, uint8_t ch, bool wpa2) {
|
||||
}
|
||||
|
||||
bool Attack::sendProbe(uint8_t tc) {
|
||||
if (settings.getBeaconChannel()) setWifiChannel(tc % settings.getMaxCh());
|
||||
if (settings.getBeaconChannel()) setWifiChannel(tc % 11);
|
||||
mac[5] = tc;
|
||||
return sendProbe(mac, ssids.getName(tc).c_str(), wifi_channel);
|
||||
}
|
||||
|
||||
@@ -45,8 +45,6 @@ void Settings::load() {
|
||||
|
||||
if (data.containsKey(keyword(S_LEDENABLED))) setLedEnabled(data.get<bool>(keyword(S_LEDENABLED)));
|
||||
|
||||
if (data.containsKey(keyword(S_MAXCH))) setMaxCh(data.get<uint8_t>(keyword(S_MAXCH)));
|
||||
|
||||
if (data.containsKey(keyword(S_MACAP))) setMacAP(data.get<String>(keyword(S_MACAP)));
|
||||
|
||||
if (data.containsKey(keyword(S_MACST))) setMacSt(data.get<String>(keyword(S_MACST)));
|
||||
@@ -122,7 +120,6 @@ void Settings::reset() {
|
||||
setWebInterface(true);
|
||||
setWebSpiffs(false);
|
||||
setLedEnabled(true);
|
||||
setMaxCh(14);
|
||||
wifi_get_macaddr(STATION_IF, macSt);
|
||||
wifi_get_macaddr(SOFTAP_IF, macAP);
|
||||
|
||||
@@ -168,7 +165,6 @@ String Settings::getJsonStr() {
|
||||
data.set(keyword(S_WEBINTERFACE), webInterface);
|
||||
data.set(keyword(S_WEB_SPIFFS), webSpiffs);
|
||||
data.set(keyword(S_LEDENABLED), ledEnabled);
|
||||
data.set(keyword(S_MAXCH), maxCh);
|
||||
data.set(keyword(S_MACAP), macToStr(getMacAP()));
|
||||
data.set(keyword(S_MACST), macToStr(getMacSt()));
|
||||
|
||||
@@ -245,7 +241,6 @@ void Settings::set(const char* str, String value) {
|
||||
else if (eqls(str, S_AUTOSAVETIME)) setAutosaveTime(value.toInt());
|
||||
else if (eqls(str, S_DEAUTHSPERTARGET)) setDeauthsPerTarget(value.toInt());
|
||||
else if (eqls(str, S_CHTIME)) setChTime(value.toInt());
|
||||
else if (eqls(str, S_MAXCH)) setMaxCh(value.toInt());
|
||||
else if (eqls(str, S_CHANNEL)) setChannel(value.toInt());
|
||||
else if (eqls(str, S_DEAUTHREASON)) setDeauthReason(value.toInt());
|
||||
else if (eqls(str, S_ATTACKTIMEOUT)) setAttackTimeout(value.toInt());
|
||||
@@ -298,7 +293,6 @@ String Settings::get(const char* str) {
|
||||
else if (eqls(str, S_DEAUTHSPERTARGET)) return (String)deauthsPerTarget;
|
||||
else if (eqls(str, S_CHTIME)) return (String)chTime;
|
||||
else if (eqls(str, S_ATTACKTIMEOUT)) return (String)attackTimeout;
|
||||
else if (eqls(str, S_MAXCH)) return (String)maxCh;
|
||||
else if (eqls(str, S_CHANNEL)) return (String)channel;
|
||||
else if (eqls(str, S_DEAUTHREASON)) return (String)deauthReason;
|
||||
else if (eqls(str, S_PROBESPERSSID)) return (String)probesPerSSID;
|
||||
@@ -351,9 +345,7 @@ uint32_t Settings::getAutosaveTime() {
|
||||
return autosaveTime;
|
||||
}
|
||||
|
||||
uint8_t Settings::getMaxCh() {
|
||||
return maxCh;
|
||||
}
|
||||
|
||||
|
||||
bool Settings::getBeaconInterval() {
|
||||
return beaconInterval;
|
||||
@@ -473,26 +465,20 @@ void Settings::setAutosaveTime(uint32_t autosaveTime) {
|
||||
changed = true;
|
||||
}
|
||||
|
||||
void Settings::setMaxCh(uint8_t maxCh) {
|
||||
Settings::maxCh = maxCh;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
void Settings::setBeaconInterval(bool beaconInterval) {
|
||||
Settings::beaconInterval = beaconInterval;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
void Settings::setChannel(uint8_t channel) {
|
||||
if ((channel >= 1) && (channel <= maxCh)) {
|
||||
if ((channel >= 1) && (channel <= 14)) {
|
||||
Settings::channel = channel;
|
||||
setWifiChannel(channel);
|
||||
changed = true;
|
||||
prnt(S_CHANNEL_CHANGE);
|
||||
prntln(channel);
|
||||
} else {
|
||||
prnt(S_CHANNEL_ERROR);
|
||||
prntln(maxCh);
|
||||
prntln(S_CHANNEL_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ class Settings {
|
||||
uint8_t getForcePackets();
|
||||
bool getAutosave();
|
||||
uint32_t getAutosaveTime();
|
||||
uint8_t getMaxCh();
|
||||
bool getBeaconInterval();
|
||||
uint8_t getChannel();
|
||||
String getSSID();
|
||||
@@ -73,7 +72,6 @@ class Settings {
|
||||
void setForcePackets(uint8_t forcePackets);
|
||||
void setAutosave(bool autosave);
|
||||
void setAutosaveTime(uint32_t autosaveTime);
|
||||
void setMaxCh(uint8_t maxCh);
|
||||
void setBeaconInterval(bool beaconInterval);
|
||||
void setChannel(uint8_t channel);
|
||||
void setSSID(String ssid);
|
||||
@@ -121,7 +119,6 @@ class Settings {
|
||||
uint16_t chTime = 384;
|
||||
uint16_t minDeauths = 3;
|
||||
uint8_t forcePackets = 1;
|
||||
uint8_t maxCh = 13;
|
||||
uint8_t channel = 1;
|
||||
uint8_t deauthReason = 1;
|
||||
uint8_t* macSt;
|
||||
|
||||
@@ -360,7 +360,6 @@ const char S_WEBINTERFACE[] PROGMEM = "web/interface";
|
||||
const char S_AUTOSAVETIME[] PROGMEM = "autosavetime";
|
||||
const char S_DEAUTHSPERTARGET[] PROGMEM = "deauthspertarget";
|
||||
const char S_CHTIME[] PROGMEM = "chtime";
|
||||
const char S_MAXCH[] PROGMEM = "maxch";
|
||||
const char S_DEAUTHREASON[] PROGMEM = "deauthReason";
|
||||
const char S_MACST[] PROGMEM = "macSt";
|
||||
const char S_MACAP[] PROGMEM = "macAP";
|
||||
|
||||
Reference in New Issue
Block a user