mirror of
https://github.com/SpacehuhnTech/esp8266_deauther.git
synced 2025-12-22 14:40:05 +01:00
Added LedPin Setting to HTML
This commit is contained in:
@@ -185,7 +185,8 @@ void Settings::send() {
|
|||||||
json += "\"multiAPs\":" + (String)multiAPs + ",";
|
json += "\"multiAPs\":" + (String)multiAPs + ",";
|
||||||
json += "\"multiAttacks\":" + (String)multiAttacks + ",";
|
json += "\"multiAttacks\":" + (String)multiAttacks + ",";
|
||||||
json += "\"macInterval\":" + (String)macInterval + ",";
|
json += "\"macInterval\":" + (String)macInterval + ",";
|
||||||
json += "\"beaconInterval\":" + (String)beaconInterval + "}";
|
json += "\"beaconInterval\":" + (String)beaconInterval + ",";
|
||||||
|
json += "\"ledPin\":" + (String)ledPin + "}";
|
||||||
sendToBuffer(json);
|
sendToBuffer(json);
|
||||||
sendBuffer();
|
sendBuffer();
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -31,8 +31,6 @@
|
|||||||
#define selectBtn 14 //GPIO 14 = D5
|
#define selectBtn 14 //GPIO 14 = D5
|
||||||
#define displayBtn 0 //GPIO 0 = FLASH BUTTON
|
#define displayBtn 0 //GPIO 0 = FLASH BUTTON
|
||||||
|
|
||||||
#define buttonDelay 180 //delay in ms
|
|
||||||
|
|
||||||
//render settings
|
//render settings
|
||||||
#define fontSize 8
|
#define fontSize 8
|
||||||
#define rowsPerSite 8
|
#define rowsPerSite 8
|
||||||
@@ -425,7 +423,8 @@ void saveSettings() {
|
|||||||
if (server.arg("multiAttacks") == "false") settings.multiAttacks = false;
|
if (server.arg("multiAttacks") == "false") settings.multiAttacks = false;
|
||||||
else settings.multiAttacks = true;
|
else settings.multiAttacks = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (server.hasArg("ledPin")) settings.ledPin = server.arg("ledPin").toInt();
|
||||||
if(server.hasArg("macInterval")) settings.macInterval = server.arg("macInterval").toInt();
|
if(server.hasArg("macInterval")) settings.macInterval = server.arg("macInterval").toInt();
|
||||||
|
|
||||||
settings.save();
|
settings.save();
|
||||||
@@ -440,25 +439,13 @@ void resetSettings() {
|
|||||||
void setup() {
|
void setup() {
|
||||||
|
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
|
|
||||||
if(debug){
|
if(debug){
|
||||||
delay(2000);
|
delay(2000);
|
||||||
Serial.println("\nStarting...\n");
|
Serial.println("\nStarting...\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_DISPLAY
|
|
||||||
display.init();
|
|
||||||
display.setFont(Roboto_Mono_8);
|
|
||||||
display.flipScreenVertically();
|
|
||||||
drawInterface();
|
|
||||||
pinMode(upBtn, INPUT_PULLUP);
|
|
||||||
pinMode(downBtn, INPUT_PULLUP);
|
|
||||||
pinMode(selectBtn, INPUT_PULLUP);
|
|
||||||
pinMode(displayBtn, INPUT_PULLUP);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
attackMode = "START";
|
attackMode = "START";
|
||||||
pinMode(settings.ledPin, OUTPUT);
|
|
||||||
digitalWrite(settings.ledPin, HIGH);
|
|
||||||
|
|
||||||
EEPROM.begin(4096);
|
EEPROM.begin(4096);
|
||||||
SPIFFS.begin();
|
SPIFFS.begin();
|
||||||
@@ -468,11 +455,6 @@ void setup() {
|
|||||||
nameList.load();
|
nameList.load();
|
||||||
ssidList.load();
|
ssidList.load();
|
||||||
|
|
||||||
#ifdef resetPin
|
|
||||||
pinMode(resetPin, INPUT_PULLUP);
|
|
||||||
if(digitalRead(resetPin) == LOW) settings.reset();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
startWifi();
|
startWifi();
|
||||||
attack.stopAll();
|
attack.stopAll();
|
||||||
attack.generate();
|
attack.generate();
|
||||||
@@ -530,6 +512,26 @@ void setup() {
|
|||||||
server.on("/enableRandom.json",enableRandom);
|
server.on("/enableRandom.json",enableRandom);
|
||||||
|
|
||||||
server.begin();
|
server.begin();
|
||||||
|
|
||||||
|
#ifdef USE_DISPLAY
|
||||||
|
display.init();
|
||||||
|
display.setFont(Roboto_Mono_8);
|
||||||
|
display.flipScreenVertically();
|
||||||
|
pinMode(upBtn, INPUT_PULLUP);
|
||||||
|
pinMode(downBtn, INPUT_PULLUP);
|
||||||
|
pinMode(selectBtn, INPUT_PULLUP);
|
||||||
|
if(displayBtn == 0) pinMode(displayBtn, INPUT);
|
||||||
|
else pinMode(displayBtn, INPUT_PULLUP);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef resetPin
|
||||||
|
pinMode(resetPin, INPUT_PULLUP);
|
||||||
|
if(digitalRead(resetPin) == LOW) settings.reset();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
pinMode(settings.ledPin, OUTPUT);
|
||||||
|
digitalWrite(settings.ledPin, HIGH);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
@@ -600,11 +602,11 @@ void loop() {
|
|||||||
apScan.select(curRow - 3);
|
apScan.select(curRow - 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// ===== DISPLAY =====
|
||||||
else if (buttonPressed == 3) {
|
else if (buttonPressed == 3) {
|
||||||
displayOn = !displayOn;
|
displayOn = !displayOn;
|
||||||
display.clear();
|
display.clear();
|
||||||
display.display();
|
display.display();
|
||||||
Serial.println("BUTTON PRESSED!");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
drawInterface();
|
drawInterface();
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ var cMac = getE('cMac');
|
|||||||
var cName = getE('cName');
|
var cName = getE('cName');
|
||||||
var macInterval = getE('macInterval');
|
var macInterval = getE('macInterval');
|
||||||
var beaconInterval = getE('beaconInterval');
|
var beaconInterval = getE('beaconInterval');
|
||||||
|
var ledPin = getE('ledPin');
|
||||||
var res;
|
var res;
|
||||||
|
|
||||||
function getData() {
|
function getData() {
|
||||||
@@ -44,6 +45,7 @@ function getData() {
|
|||||||
multiAttacks.checked = res.multiAttacks;
|
multiAttacks.checked = res.multiAttacks;
|
||||||
macInterval.value = res.macInterval;
|
macInterval.value = res.macInterval;
|
||||||
beaconInterval.checked = res.beaconInterval;
|
beaconInterval.checked = res.beaconInterval;
|
||||||
|
ledPin.value = res.ledPin;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,6 +68,7 @@ function saveSettings() {
|
|||||||
url += "&multiAttacks="+multiAttacks.checked;
|
url += "&multiAttacks="+multiAttacks.checked;
|
||||||
url += "&macInterval="+macInterval.value;
|
url += "&macInterval="+macInterval.value;
|
||||||
url += "&beaconInterval="+beaconInterval.checked;
|
url += "&beaconInterval="+beaconInterval.checked;
|
||||||
|
url += "&ledPin="+ledPin.value;
|
||||||
|
|
||||||
getResponse(url, function(responseText) {
|
getResponse(url, function(responseText) {
|
||||||
if (responseText == "true") {
|
if (responseText == "true") {
|
||||||
|
|||||||
@@ -111,6 +111,22 @@
|
|||||||
<input type="number" id="timeout" min="-1" max="65536"> s
|
<input type="number" id="timeout" min="-1" max="65536"> s
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-6">
|
||||||
|
<label for="useLed">Use LED</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
<input type="checkbox" id="useLed" value="false">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-6">
|
||||||
|
<label for="ledPin">LED Pin (restart needed)</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
<input type="number" id="ledPin" min="0" max="18">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<label for="ssidEnc">WPA2 Beacons</label>
|
<label for="ssidEnc">WPA2 Beacons</label>
|
||||||
@@ -127,14 +143,6 @@
|
|||||||
<input type="checkbox" id="beaconInterval" value="false">
|
<input type="checkbox" id="beaconInterval" value="false">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
|
||||||
<div class="col-6">
|
|
||||||
<label for="useLed">Use LED</label>
|
|
||||||
</div>
|
|
||||||
<div class="col-6">
|
|
||||||
<input type="checkbox" id="useLed" value="false">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<label for="deauthReason">Deauth Reason-Code</label>
|
<label for="deauthReason">Deauth Reason-Code</label>
|
||||||
|
|||||||
Reference in New Issue
Block a user