From d95d7c7aa7f9c279a869dc3a43fda6f65fac2284 Mon Sep 17 00:00:00 2001 From: Spacehuhn Date: Mon, 11 Jan 2021 18:04:59 +0100 Subject: [PATCH] Visual improvements for web interface --- LICENSE | 2 +- web_interface/attack.html | 209 ++++++++++++++++++--------------- web_interface/index.html | 102 ++++++++-------- web_interface/info.html | 201 ++++++++++++++++++------------- web_interface/js/attack.js | 32 ++--- web_interface/js/scan.js | 222 ++++++++++++++++++----------------- web_interface/js/settings.js | 38 +++--- web_interface/js/site.js | 102 ++++++++-------- web_interface/js/ssids.js | 96 +++++++-------- web_interface/license | 23 ---- web_interface/scan.html | 208 ++++++++++++++++---------------- web_interface/settings.html | 118 ++++++++++--------- web_interface/ssids.html | 206 ++++++++++++++++---------------- web_interface/style.css | 60 ++++++---- 14 files changed, 844 insertions(+), 775 deletions(-) delete mode 100644 web_interface/license diff --git a/LICENSE b/LICENSE index a47d336..6b380e6 100644 --- a/LICENSE +++ b/LICENSE @@ -2,7 +2,7 @@ Do not redistribute, advertise or sell this software as a "jammer"!!! MIT License -Copyright (c) 2018 Stefan Kremser +Copyright (c) 2020 Spacehuhn Technologies Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/web_interface/attack.html b/web_interface/attack.html index 691776a..a0bc570 100644 --- a/web_interface/attack.html +++ b/web_interface/attack.html @@ -1,104 +1,121 @@ + + - - - - - - - ESP8266 Deauther - - - - - - -
-
-
-
-

Attacks

- -

- INFO:
- + + + + + + + + ESP8266 Deauther + + + + + + + +

+ +
+ +
+
+
+

Attacks

+ +

+ INFO:
+ - You might lose connection when starting an attack!
- You need to select a target for the deauth attack.
- You need a saved SSID for the beacon and probe attack.
- Click reload to refresh the packet rate.
-
- In case of an unexpected error, please reload the site and look at the serial monitor for further debugging.
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttacksTargetsPkts/sSTART / STOP
Deauth00/0
Beacon00/0
Probe00/0
All Pkts/s:0
- -

Deauth

-

- Closes the connection of WiFi devices by sending deauthentication frames to access points and client devices you selected.
- This is only possible because a lot of devices don't use the 802.11w-2009 standard that offers a protection against this attack.
- Please only select one target! When you select multiple targets that run on different channels and start the attack, - it will quickly switch between those channels and you have no chance to reconnect to the access point that hosts this web interface. -

- -

Beacon

-

- Beacon packets are used to advertise access points. By continuously sending beacon packets out, it will look like you created new WiFi networks.
- You can specify the network names under SSIDs.
-

- -

Probe

-

- Probe requests are sent by client devices to ask if a known network is nearby.
- Use this attack to confuse WiFi trackers by asking for networks that you specified in the SSID list.
- It's unlikely you will see any impact by this attack with your home network.
-

- - -
+ + In case of an unexpected error, please reload the site and + look at the serial monitor for further debugging.
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttacksTargetsPkts/sSTART / STOP
Deauth00/0 +
Beacon00/0 +
Probe00/0 +
All Pkts/s:0
+ +

Deauth

+

+ Closes the connection of WiFi devices by sending deauthentication frames to access points and client + devices you selected.
+ This is only possible because a lot of devices don't use the 802.11w-2009 standard that offers a + protection against this attack.
+ Please only select one target! When you select multiple targets that run on different channels and + start the attack, + it will quickly switch between those channels and you have no chance to reconnect to the access + point that hosts this web interface. +

+ +

Beacon

+

+ Beacon packets are used to advertise access points. By continuously sending beacon packets out, it + will look like you created new WiFi networks.
+ You can specify the network names under SSIDs.
+

+ +

Probe

+

+ Probe requests are sent by client devices to ask if a known network is nearby.
+ Use this attack to confuse WiFi trackers by asking for networks that you specified in the SSID + list.
+ It's unlikely you will see any impact by this attack with your home network.
+

- - +
+ + + + \ No newline at end of file diff --git a/web_interface/index.html b/web_interface/index.html index 5cfe6c0..b5d0f28 100644 --- a/web_interface/index.html +++ b/web_interface/index.html @@ -1,52 +1,60 @@ + + - - - - - - - ESP8266 Deauther - - - - -
-
-
-
-

WARNING

-

- This project is a proof of concept for testing and educational purposes.
- Neither the ESP8266, nor its SDK was meant or build for such purposes. Bugs can occur!
-
- Use it only against your own networks and devices!
-
- It uses valid Wi-Fi frames described in the IEEE 802.11 standard and does not block or disrupt any frequencies.
- Please check the legal regulations in your country before using it.
-
- Please don't refer to this project as "jammer", that totally undermines the real purpose of this project!
- If you do, it only proves that you didn't understand anything of what this project stands for.
- Publishing content about this without without a proper explanation shows that you only do it for the clicks, - fame and/or money and have no respect for intellectual property, the community behind it and the fight for a better WiFi standard.
-
- For more information visit: -

-

- github.com/spacehuhn/esp8266_deauther
-
-
- I have read and understood the notice above -

- -
+ + + + + + + + ESP8266 Deauther + + + + + + +
+
+
+

WARNING

+

+ This project is a proof of concept for testing and educational purposes.
+ Neither the ESP8266, nor its SDK was meant or build for such purposes. Bugs can occur!
+
+ Use it only against your own networks and devices!
+
+ It uses valid Wi-Fi frames described in the IEEE 802.11 standard and does not block or disrupt any + frequencies.
+ Please check the legal regulations in your country before using it.
+
+ Please don't refer to this project as "jammer", as it undermines the real purpose of this + project!
+ If you do, it only proves that you didn't understand anything of what this project stands for.
+ Publishing content about this without without a proper explanation shows that you only do it for the + clicks, + fame and/or money and have no respect for intellectual property, the community behind it and the + fight for a better WiFi standard.
+
+ For more information visit:
+ github.com/spacehuhntech/esp8266_deauther +

+

+ I have read and understood the + notice above +

- +
+ + + \ No newline at end of file diff --git a/web_interface/info.html b/web_interface/info.html index f1a112f..98388a0 100644 --- a/web_interface/info.html +++ b/web_interface/info.html @@ -1,88 +1,121 @@ + + - - - - - - - ESP8266 Deauther - - - - - -
-
-
-
-

Info

- -

ESP8266 Deauther

-

- Copyright (c) 2018 Stefan Kremser
-
- This project is licensed under the MIT License. See the license file for details.
- The source code is available on GitHub.
-
- Use it only for testing or educational purposes against your own networks and devices!
-
- Please don't refer to this project as "jammer", that totally undermines the real purpose of this project! -

- -

Credits

-

- A huge thanks to:
-

- for helping out with various things regarding this project and keeping it alive!
-
- I also want to thank Espressif and their community for this awesome chip and all the software and hardware projects around it and the countless tutorials you can find online!
-
- Shoutout to everyone working on the libraries used for this project:
- -
- Also thanks to everyone that supports this project by donating], beeing my patron or buying one of the official Deauther boards from DSTIKE.
-

- -

Contact

-

- Web: spacehuhn.com
- GitHub: github.com/spacehuhn
- Twitter: @spacehuhn
- E-mail: mail@spacehuhn.com
-
- If you would like to support me with my projects, please consider becoming a patron on patreon.com/spacehuhn.
-
- Or buy the official hardware for this project from DSTIKE on tindie.com/stores/lspoplove. -

- - -
+ + + + + + + + ESP8266 Deauther + + + + + + + + +
+ +
+
+
+

Credits

+ +

Disclaimer

+

+ This project is a proof of concept for testing and educational purposes.
+ Neither the ESP8266, nor its SDK was meant or build for such purposes. Bugs can occur!
+
+ Use it only against your own networks and devices!
+
+ It uses valid Wi-Fi frames described in the IEEE 802.11 standard and does not block or disrupt any + frequencies.
+ Please check the legal regulations in your country before using it.
+
+ Please don't refer to this project as "jammer", as it undermines the real purpose of this + project!
+ If you do, it only proves that you didn't understand anything of what this project stands for.
+ Publishing content about this without without a proper explanation shows that you only do it for the + clicks, + fame and/or money and have no respect for intellectual property, the community behind it and the + fight for a better WiFi standard.
+
+ For more information visit:
+ github.com/spacehuhntech/esp8266_deauther +

+ +

Acknowledgements

+

+ A huge thanks to:
+

+ for helping out with various things regarding this project and keeping it alive!
+
+ Also thanks to everyone working on the libraries used for this project:
+ + We also thank Espressif and their community for this awesome chip and all the software and + hardware projects around it and the countless tutorials you can find online!
+

+ +

License

+

+ In regards to the firmware:
+
+ MIT License
+ Copyright (c) 2020 Spacehuhn Technologies
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and + associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all copies or substantial + portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT + NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES + OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

- - +
+ + + + \ No newline at end of file diff --git a/web_interface/js/attack.js b/web_interface/js/attack.js index 6edc414..66bc76e 100644 --- a/web_interface/js/attack.js +++ b/web_interface/js/attack.js @@ -1,23 +1,25 @@ -var attackJSON = [[false,0,0],[false,0,0],[false,0,0]]; - -function draw(){ +/* This software is licensed under the MIT License: https://github.com/spacehuhntech/esp8266_deauther */ + +var attackJSON = [[false, 0, 0], [false, 0, 0], [false, 0, 0]]; + +function draw() { getE("deauth").innerHTML = attackJSON[0][0] ? lang("stop") : lang("start"); getE("beacon").innerHTML = attackJSON[1][0] ? lang("stop") : lang("start"); getE("probe").innerHTML = attackJSON[2][0] ? lang("stop") : lang("start"); - - getE("deauthTargets").innerHTML = esc(attackJSON[0][1]+""); - getE("beaconTargets").innerHTML = esc(attackJSON[1][1]+""); - getE("probeTargets").innerHTML = esc(attackJSON[2][1]+""); - + + getE("deauthTargets").innerHTML = esc(attackJSON[0][1] + ""); + getE("beaconTargets").innerHTML = esc(attackJSON[1][1] + ""); + getE("probeTargets").innerHTML = esc(attackJSON[2][1] + ""); + getE("deauthPkts").innerHTML = esc(attackJSON[0][2] + "/" + attackJSON[0][3]); getE("beaconPkts").innerHTML = esc(attackJSON[1][2] + "/" + attackJSON[1][3]); getE("probePkts").innerHTML = esc(attackJSON[2][2] + "/" + attackJSON[2][3]); - - getE("allpkts").innerHTML = esc(attackJSON[3]+""); + + getE("allpkts").innerHTML = esc(attackJSON[3] + ""); } -function start(mode){ - switch(mode){ +function start(mode) { + switch (mode) { case 0: attackJSON[0][0] = !attackJSON[0][0]; break; @@ -28,13 +30,13 @@ function start(mode){ attackJSON[2][0] = !attackJSON[2][0]; break; } - getFile("run?cmd=attack"+(attackJSON[0][0] ? " -d":"")+(attackJSON[1][0] ? " -b":"")+(attackJSON[2][0] ? " -p":""),function(){ + getFile("run?cmd=attack" + (attackJSON[0][0] ? " -d" : "") + (attackJSON[1][0] ? " -b" : "") + (attackJSON[2][0] ? " -p" : ""), function () { draw(); }); } -function load(){ - getFile("attack.json",function(response){ +function load() { + getFile("attack.json", function (response) { attackJSON = JSON.parse(response); draw(); }); diff --git a/web_interface/js/scan.js b/web_interface/js/scan.js index 0ed28ef..e3379b4 100644 --- a/web_interface/js/scan.js +++ b/web_interface/js/scan.js @@ -1,13 +1,15 @@ +/* This software is licensed under the MIT License: https://github.com/spacehuhntech/esp8266_deauther */ + var nameJson = []; -var scanJson = {aps:[],stations:[]}; - -function drawScan(){ +var scanJson = { aps: [], stations: [] }; + +function drawScan() { var html; var selected; var width; var color; var macVendor; - + // Access Points getE("apNum").innerHTML = scanJson.aps.length; html = "" @@ -23,34 +25,34 @@ function drawScan(){ + "" + "" + ""; - - for(var i=0;i" : "") - + ""+i+"" // ID - + ""+esc(scanJson.aps[i][0])+"" // SSID - + ""+(scanJson.aps[i][1].length > 0 ? esc(scanJson.aps[i][1]) : "")+"" // Name - + ""+esc(scanJson.aps[i][2])+"" // Ch + + "" + i + "" // ID + + "" + esc(scanJson.aps[i][0]) + "" // SSID + + "" + (scanJson.aps[i][1].length > 0 ? esc(scanJson.aps[i][1]) : "") + "" // Name + + "" + esc(scanJson.aps[i][2]) + "" // Ch // RSSI - + "
" + scanJson.aps[i][3] + "
" - + ""+esc(scanJson.aps[i][4])+"" // ENC - + ""+(scanJson.aps[i][4] == "-" ? "":"🔒")+"" // Lock Emoji - + ""+esc(scanJson.aps[i][5])+"" // MAC - + ""+esc(scanJson.aps[i][6])+"" // Vendor + + "
" + scanJson.aps[i][3] + "
" + + "" + esc(scanJson.aps[i][4]) + "" // ENC + + "" + (scanJson.aps[i][4] == "-" ? "" : "🔒") + "" // Lock Emoji + + "" + esc(scanJson.aps[i][5]) + "" // MAC + + "" + esc(scanJson.aps[i][6]) + "" // Vendor // Select - + "" - + "" // Remove + + "" + + "" // Remove + ""; } - + getE("apTable").innerHTML = html; - + // Stations getE("stNum").innerHTML = scanJson.stations.length; html = "" @@ -65,35 +67,35 @@ function drawScan(){ + "" + "" + ""; - - for(var i=0;i= 0) + if (scanJson.stations[i][5] >= 0) ap = esc(scanJson.aps[scanJson.stations[i][5]][0]); - + html += (selected ? "" : "") - + ""+i+"" // ID - + ""+esc(scanJson.stations[i][3])+"" // Vendor - + ""+esc(scanJson.stations[i][0])+"" // MAC - + ""+esc(scanJson.stations[i][1])+"" // Ch - + ""+(scanJson.stations[i][2].length > 0 ? esc(scanJson.stations[i][2]) : "")+"" // Name - + ""+esc(scanJson.stations[i][4])+"" // Pkts - + ""+ap+"" // AP - + ""+esc(scanJson.stations[i][6])+"" // Last seen + + "" + i + "" // ID + + "" + esc(scanJson.stations[i][3]) + "" // Vendor + + "" + esc(scanJson.stations[i][0]) + "" // MAC + + "" + esc(scanJson.stations[i][1]) + "" // Ch + + "" + (scanJson.stations[i][2].length > 0 ? esc(scanJson.stations[i][2]) : "") + "" // Name + + "" + esc(scanJson.stations[i][4]) + "" // Pkts + + "" + ap + "" // AP + + "" + esc(scanJson.stations[i][6]) + "" // Last seen // Select - + "" - + "" // Remove + + "" + + "" // Remove + ""; } - + getE("stTable").innerHTML = html; } -function drawNames(){ +function drawNames() { var html; var selected; - + // Names getE("nNum").innerHTML = nameJson.length; html = "" @@ -107,32 +109,32 @@ function drawNames(){ + "" + "" + ""; - - for(var i=0;i" : "") - + ""+i+"" // ID - + ""+esc(nameJson[i][0])+"" // MAC - + ""+esc(nameJson[i][1])+"" // Vendor - + ""+esc(nameJson[i][2].substring(0,16))+"" // Name - + ""+esc(nameJson[i][3])+"" // AP-BSSID - + ""+esc(nameJson[i][4])+"" // Ch - + "" // Save + + "" + i + "" // ID + + "" + esc(nameJson[i][0]) + "" // MAC + + "" + esc(nameJson[i][1]) + "" // Vendor + + "" + esc(nameJson[i][2].substring(0, 16)) + "" // Name + + "" + esc(nameJson[i][3]) + "" // AP-BSSID + + "" + esc(nameJson[i][4]) + "" // Ch + + "" // Save // Select - + "" - + "" // Remove + + "" + + "" // Remove + ""; } - + getE("nTable").innerHTML = html; } - + var duts; var elxtime; -function scan(type){ +function scan(type) { getE('RButton').disabled = true; - switch(type){ + switch (type) { case 0: getE('scanOne').disabled = true; getE('scanZero').style.visibility = 'hidden'; @@ -141,17 +143,17 @@ function scan(type){ case 1: getE('scanZero').disabled = true; getE('scanOne').style.visibility = 'hidden'; - elxtime = parseInt(getE("scanTime").value+"000") + 1500; + elxtime = parseInt(getE("scanTime").value + "000") + 1500; } var cmdStr = "scan " - + (type == 0 ? "aps " : "stations -t "+getE("scanTime").value+"s") - + " -ch "+getE("ch").options[getE("ch").selectedIndex].value; - getFile("run?cmd="+cmdStr); + + (type == 0 ? "aps " : "stations -t " + getE("scanTime").value + "s") + + " -ch " + getE("ch").options[getE("ch").selectedIndex].value; + getFile("run?cmd=" + cmdStr); duts = parseInt(type); setTimeout(buttonFunc, elxtime) } -function buttonFunc(){ +function buttonFunc() { switch (duts) { case 0: getE('scanZero').style.visibility = 'visible'; @@ -164,128 +166,128 @@ function buttonFunc(){ getE('RButton').disabled = false; } -function load(){ +function load() { // APs and Stations - getFile("run?cmd=save scan", function(){ - getFile("scan.json",function(res){ + getFile("run?cmd=save scan", function () { + getFile("scan.json", function (res) { scanJson = JSON.parse(res); drawScan(); }); }); // Names - getFile("run?cmd=save names", function(){ - getFile("names.json",function(res){ + getFile("run?cmd=save names", function () { + getFile("names.json", function (res) { nameJson = JSON.parse(res); drawNames(); }); }); } -function selectRow(type,id,selected){ - switch(type){ +function selectRow(type, id, selected) { + switch (type) { case 0: scanJson.aps[id][7] = selected; drawScan(); - getFile("run?cmd="+(selected ? "":"de")+"select ap "+id); + getFile("run?cmd=" + (selected ? "" : "de") + "select ap " + id); break; case 1: scanJson.stations[id][7] = selected; drawScan(); - getFile("run?cmd="+(selected ? "":"de")+"select station "+id); + getFile("run?cmd=" + (selected ? "" : "de") + "select station " + id); break; case 2: save(id); nameJson[id][5] = selected; drawNames(); - getFile("run?cmd="+(selected ? "":"de")+"select name "+id); + getFile("run?cmd=" + (selected ? "" : "de") + "select name " + id); } } -function remove(type,id){ - switch(type){ +function remove(type, id) { + switch (type) { case 0: scanJson.aps.splice(id, 1); drawScan(); - getFile("run?cmd=remove ap "+id); + getFile("run?cmd=remove ap " + id); break; case 1: scanJson.stations.splice(id, 1); drawScan(); - getFile("run?cmd=remove station "+id); + getFile("run?cmd=remove station " + id); break; case 2: nameJson.splice(id, 1); drawNames(); - getFile("run?cmd=remove name "+id); + getFile("run?cmd=remove name " + id); } } -function save(id){ - var mac = getE("name_"+id+"_mac").innerHTML.replace("
",""); - var name = getE("name_"+id+"_name").innerHTML.replace("
",""); - var apbssid = getE("name_"+id+"_apbssid").innerHTML.replace("
",""); - var ch = getE("name_"+id+"_ch").innerHTML.replace("
",""); +function save(id) { + var mac = getE("name_" + id + "_mac").innerHTML.replace("
", ""); + var name = getE("name_" + id + "_name").innerHTML.replace("
", ""); + var apbssid = getE("name_" + id + "_apbssid").innerHTML.replace("
", ""); + var ch = getE("name_" + id + "_ch").innerHTML.replace("
", ""); var changed = mac != nameJson[id][0] || name != nameJson[id][2] || apbssid != nameJson[id][3] || ch != nameJson[id][4]; - if(changed){ + if (changed) { nameJson[id][0] = mac; nameJson[id][2] = name; nameJson[id][3] = apbssid; nameJson[id][4] = ch; - - if(nameJson[id][0].length != 17){ + + if (nameJson[id][0].length != 17) { showMessage("ERROR: MAC invalid"); return; } - - getFile("run?cmd=replace name "+id+" -n \""+nameJson[id][2]+"\" -m \""+nameJson[id][0]+"\" -ch "+nameJson[id][4]+" -b \""+nameJson[id][3]+"\" "+(nameJson[id][5] ? "-s" : "")); - + + getFile("run?cmd=replace name " + id + " -n \"" + nameJson[id][2] + "\" -m \"" + nameJson[id][0] + "\" -ch " + nameJson[id][4] + " -b \"" + nameJson[id][3] + "\" " + (nameJson[id][5] ? "-s" : "")); + drawNames(); } } -function add(type,id){ - if(nameJson.length >= 25){ +function add(type, id) { + if (nameJson.length >= 25) { showMessage("Device Name List is full!"); return; - } - - switch(type){ + } + + switch (type) { case 0: - getFile("run?cmd=add name \""+scanJson.aps[id][0]+"\" -ap "+id); + getFile("run?cmd=add name \"" + scanJson.aps[id][0] + "\" -ap " + id); scanJson.aps[id][1] = scanJson.aps[id][0]; // name = SSID - nameJson.push([scanJson.aps[id][5],scanJson.aps[id][6],scanJson.aps[id][0],"",scanJson.aps[id][2],false]); + nameJson.push([scanJson.aps[id][5], scanJson.aps[id][6], scanJson.aps[id][0], "", scanJson.aps[id][2], false]); drawScan(); break; case 1: - getFile("run?cmd=add name \""+scanJson.stations[id][0]+"\" station "+id); - scanJson.stations[id][2] = "device_"+nameJson.length; // name = device_ - nameJson.push([scanJson.stations[id][0],scanJson.stations[id][3],"device_"+nameJson.length,scanJson.aps[scanJson.stations[id][5]][5],scanJson.stations[id][1],false]); + getFile("run?cmd=add name \"" + scanJson.stations[id][0] + "\" station " + id); + scanJson.stations[id][2] = "device_" + nameJson.length; // name = device_ + nameJson.push([scanJson.stations[id][0], scanJson.stations[id][3], "device_" + nameJson.length, scanJson.aps[scanJson.stations[id][5]][5], scanJson.stations[id][1], false]); drawScan(); break; case 2: - getFile("run?cmd=add name device_"+nameJson.length+" -m 00:00:00:00:00:00 -ch 1"); - nameJson.push(["00:00:00:00:00:00","","device_"+nameJson.length,"",1,false]); + getFile("run?cmd=add name device_" + nameJson.length + " -m 00:00:00:00:00:00 -ch 1"); + nameJson.push(["00:00:00:00:00:00", "", "device_" + nameJson.length, "", 1, false]); drawNames(); } - + drawNames(); } -function selectAll(type,select){ - switch(type){ +function selectAll(type, select) { + switch (type) { case 0: - getFile("run?cmd="+(select ? "":"de")+"select aps"); - for(var i=0;i" - + "" + + "" + "
" + "
"; - - if(typeof settingsJson[key] == "boolean"){ - html += ""; - }else if(typeof settingsJson[key] == "number"){ - html += ""; - }else if(typeof settingsJson[key] == "string"){ - html += ""; + + if (typeof settingsJson[key] == "boolean") { + html += ""; + } else if (typeof settingsJson[key] == "number") { + html += ""; + } else if (typeof settingsJson[key] == "string") { + html += ""; } - + html += "
" + "
" + "
" + "
" - + "

"+lang("setting_"+key)+"

" + + "

" + lang("setting_" + key) + "

" + "
" + "
" + "
"; @@ -39,12 +41,12 @@ function draw(){ getE("settingsList").innerHTML = html; } -function save(key, value){ - if(key){ +function save(key, value) { + if (key) { settingsJson[key] = value; - getFile("run?cmd=set "+key+" \""+value+"\""); - }else{ - getFile("run?cmd=save settings",function(res){ + getFile("run?cmd=set " + key + " \"" + value + "\""); + } else { + getFile("run?cmd=save settings", function (res) { load(); }); } diff --git a/web_interface/js/site.js b/web_interface/js/site.js index 54665e7..4d2d398 100644 --- a/web_interface/js/site.js +++ b/web_interface/js/site.js @@ -1,11 +1,13 @@ +/* This software is licensed under the MIT License: https://github.com/spacehuhntech/esp8266_deauther */ + var langJson = {}; -function getE(name){ +function getE(name) { return document.getElementById(name); } function esc(str) { - if(str){ + if (str) { return str.toString() .replace(/&/g, '&') .replace(/'); + str = str.replace(/(?:\r\n|\r|\n)/g, '
'); return str; } return ""; } -function showMessage(msg, closeAfter){ - var elmt = getE("error"); - elmt.innerHTML = esc(msg)+"x"; - - elmt.classList.remove('hide'); - elmt.classList.add('show'); - - if(closeAfter !== undefined){ - setTimeout(closeMessage(),closeAfter); - } +function showMessage(msg, closeAfter) { + getE("status").style.backgroundColor = "#d33"; + console.error("disconnected (" + msg + ")"); + getE("status").innerHTML = "disconnected"; } -function closeMessage(){ - var elmt = getE("error"); - elmt.innerHTML = ""; - elmt.classList.remove('show'); - elmt.classList.add('hide'); -} - -function getFile(adr, callback, timeout, method, onTimeout, onError){ +function getFile(adr, callback, timeout, method, onTimeout, onError) { /* fallback stuff */ - if(adr === undefined) return; - if(callback === undefined) callback = function(){}; - if(timeout === undefined) timeout = 8000; - if(method === undefined) method = "GET"; - if(onTimeout === undefined) { - onTimeout = function(){ - showMessage("ERROR: timeout loading file "+adr); + if (adr === undefined) return; + if (callback === undefined) callback = function () { }; + if (timeout === undefined) timeout = 8000; + if (method === undefined) method = "GET"; + if (onTimeout === undefined) { + onTimeout = function () { + showMessage("ERROR: timeout loading file " + adr); }; } - if(onError === undefined){ - onError = function(){ - showMessage("ERROR: loading file: "+adr); + if (onError === undefined) { + onError = function () { + showMessage("ERROR: loading file: " + adr); }; } - + /* create request */ var request = new XMLHttpRequest(); - + /* set parameter for request */ request.open(method, encodeURI(adr), true); request.timeout = timeout; request.ontimeout = onTimeout; - request.onerror = onError; + request.onerror = onError; request.overrideMimeType("application/json"); - - request.onreadystatechange = function() { - if(this.readyState == 4){ - if(this.status == 200){ + + request.onreadystatechange = function () { + if (this.readyState == 4) { + if (this.status == 200) { callback(this.responseText); } } }; - + /* send request */ request.send(); - + console.log(adr); } -function lang(key){ +function lang(key) { return convertLineBreaks(esc(langJson[key])); } -function parseLang(fileStr){ +function parseLang(fileStr) { langJson = JSON.parse(fileStr); - if(langJson["lang"] != "en"){// no need to update the HTML + if (langJson["lang"] != "en") {// no need to update the HTML var elements = document.querySelectorAll("[data-translate]"); for (i = 0; i < elements.length; i++) { var element = elements[i]; element.innerHTML = lang(element.getAttribute("data-translate")); } } - document.querySelector('html').setAttribute("lang", langJson["lang"] ); - if(typeof load !== 'undefined') load(); + document.querySelector('html').setAttribute("lang", langJson["lang"]); + if (typeof load !== 'undefined') load(); } -function loadLang(){ +function loadLang() { var language = "default"; //navigator.language.slice(0, 2); - getFile("lang/" + language + ".lang", - parseLang, + getFile("lang/" + language + ".lang", + parseLang, 2000, "GET", - function(){ - getFile("lang/en.lang", parseLang); - }, function(){ - getFile("lang/en.lang", parseLang); + function () { + getFile("lang/en.lang", parseLang); + }, function () { + getFile("lang/en.lang", parseLang); } ); } + +window.addEventListener('load', function () { + getE("status").style.backgroundColor = "#3c5"; + getE("status").innerHTML = "connected"; +}); \ No newline at end of file diff --git a/web_interface/js/ssids.js b/web_interface/js/ssids.js index dd2ac32..3275bdf 100644 --- a/web_interface/js/ssids.js +++ b/web_interface/js/ssids.js @@ -1,17 +1,19 @@ -var ssidJson = {"random":false,"ssids":[]}; - -function load(){ - getFile("run?cmd=save ssids", function(){ - getFile("ssids.json",function(res){ +/* This software is licensed under the MIT License: https://github.com/spacehuhntech/esp8266_deauther */ + +var ssidJson = { "random": false, "ssids": [] }; + +function load() { + getFile("run?cmd=save ssids", function () { + getFile("ssids.json", function (res) { ssidJson = JSON.parse(res); draw(); }); }); } -function draw(){ +function draw() { var html; - + html = "" + "" + "" @@ -19,87 +21,87 @@ function draw(){ + "" + "" + ""; - - for(var i=0;i"+i+"" // ID - + ""+esc(ssidJson.ssids[i][0].substring(0,ssidJson.ssids[i][2]))+"" // SSID - + ""+(ssidJson.ssids[i][1] ? "🔒" : "-")+"" // Enc - + "" // Save - + "" // Remove + + "" + i + "" // ID + + "" + esc(ssidJson.ssids[i][0].substring(0, ssidJson.ssids[i][2])) + "" // SSID + + "" + (ssidJson.ssids[i][1] ? "🔒" : "-") + "" // Enc + + "" // Save + + "" // Remove + ""; } - + getE("randomBtn").innerHTML = ssidJson.random ? lang("disable_random") : lang("enable_random"); - + getE("ssidTable").innerHTML = html; } -function remove(id){ +function remove(id) { ssidJson.ssids.splice(id, 1); - getFile("run?cmd=remove ssid "+id); + getFile("run?cmd=remove ssid " + id); draw(); } -function add(){ +function add() { var ssidStr = getE("ssid").value; var wpa2 = getE("enc").checked; var clones = getE("ssidNum").value; var force = getE("overwrite").checked; - - if(ssidStr.length > 0){ - var cmdStr = "add ssid \""+ssidStr+"\""+(force ? " -f":" ")+" -cl "+clones; - if(wpa2) cmdStr += " -wpa2"; - - getFile("run?cmd="+cmdStr); - - for(var i=0;i= 60) ssidJson.ssids.splice(0,1); - ssidJson.ssids.push([ssidStr,wpa2]); + + if (ssidStr.length > 0) { + var cmdStr = "add ssid \"" + ssidStr + "\"" + (force ? " -f" : " ") + " -cl " + clones; + if (wpa2) cmdStr += " -wpa2"; + + getFile("run?cmd=" + cmdStr); + + for (var i = 0; i < clones; i++) { + if (ssidJson.ssids.length >= 60) ssidJson.ssids.splice(0, 1); + ssidJson.ssids.push([ssidStr, wpa2]); } - + draw(); } } -function enableRandom(){ - if(ssidJson.random){ - getFile("run?cmd=disable random",function(){ +function enableRandom() { + if (ssidJson.random) { + getFile("run?cmd=disable random", function () { load(); }); - }else{ - getFile("run?cmd=enable random "+getE("interval").value,function(){ + } else { + getFile("run?cmd=enable random " + getE("interval").value, function () { load(); }); } - + } -function disableRandom(){ - +function disableRandom() { + } -function addSelected(){ - getFile("run?cmd=add ssid -s"+(getE("overwrite").checked ? " -f":"")); +function addSelected() { + getFile("run?cmd=add ssid -s" + (getE("overwrite").checked ? " -f" : "")); } -function changeEnc(id){ +function changeEnc(id) { ssidJson.ssids[id][1] = !ssidJson.ssids[id][1]; draw(); save(id); } -function removeAll(){ +function removeAll() { ssidJson.ssids = []; getFile("run?cmd=remove ssids"); draw(); } -function save(id){ - var name = getE("ssid_"+id).innerHTML.replace("
","").substring(0,32); +function save(id) { + var name = getE("ssid_" + id).innerHTML.replace("
", "").substring(0, 32); var wpa2 = ssidJson.ssids[id][1]; - ssidJson.ssids[id] = [name,wpa2]; - - getFile("run?cmd=replace ssid "+id+" -n \""+name+"\" "+(wpa2 ? "-wpa2" : "")); + ssidJson.ssids[id] = [name, wpa2]; + + getFile("run?cmd=replace ssid " + id + " -n \"" + name + "\" " + (wpa2 ? "-wpa2" : "")); } diff --git a/web_interface/license b/web_interface/license deleted file mode 100644 index 8d6c3c8..0000000 --- a/web_interface/license +++ /dev/null @@ -1,23 +0,0 @@ -MIT License - -Copyright (c) 2018 Stefan Kremser - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -Do not redistribute, advertising or sell of this softwae as "jammer"! - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/web_interface/scan.html b/web_interface/scan.html index e445328..e5ad347 100644 --- a/web_interface/scan.html +++ b/web_interface/scan.html @@ -1,110 +1,120 @@ + + - - - - - - - ESP8266 Deauther - - - - - - -
-
-
-
-

Scan

- - - -
-
-
-
- -
-
- -
-
-
-
- -
-
- s -
-
-
-
-

- INFO:
- - - Click Scan and wait until the blue LED on your board turns off (or changes to green), then click on Reload.
- - The web interface will be unavailable during a station scan and you will have to reconnect!
- - Please select only one target!
-
- In case of an unexpected error, please reload the site and look at the serial monitor for further debugging. -

+ + + + -
+ + ESP8266 Deauther -

Access Points:

-
- - + + + + -
+ + -

Stations:

-
- - +
-
+
+
+
+

Scan

-

Saved Devices:

-
- - - - - -
+ + +
- - +
+
+ +
+
+ +
+
+
+
+ +
+
+ s +
+
+
+
+

+ INFO:
+ + - Click Scan and wait until the blue LED on your board turns off (or changes to green), then + click on Reload.
+ - The web interface will be unavailable during a station scan and you will have to + reconnect!
+ - Please select only one target!
+
+ In case of an unexpected error, please reload the site and + look at the serial monitor for further debugging. +

+ +
+ +

Access Points:

+
+ + + +
+ +

Stations:

+
+ + + +
+ +

Saved Devices:

+
+ + + +
+
+
+ + + + \ No newline at end of file diff --git a/web_interface/settings.html b/web_interface/settings.html index 339a010..23aa414 100644 --- a/web_interface/settings.html +++ b/web_interface/settings.html @@ -1,64 +1,66 @@ + + - - - - - - - ESP8266 Deauther - - - - - - -
-
-
-
-

Settings

- - - - - -

- INFO:
- + + + + + + + + ESP8266 Deauther + + + + + + + +

+ +
+ +
+
+
+

Settings

+ + + + + +

+ INFO:
+ - Some settings require a reboot.
- Click save to make sure that your changes are applied.
-
- In case of an unexpected error, please reload the site and look at the serial monitor for further debugging.
-

- - - -
-
- -
- -
-
- - - - -
+ + In case of an unexpected error, please reload the site and + look at the serial monitor for further debugging.
+

+ + +
- - + +
+
+ + + + \ No newline at end of file diff --git a/web_interface/ssids.html b/web_interface/ssids.html index d377756..3f64748 100644 --- a/web_interface/ssids.html +++ b/web_interface/ssids.html @@ -1,114 +1,120 @@ + + - - - - - - - ESP8266 Deauther - - - - - - -
-
-
-
-

SSIDs

-
+ + + + + + + + ESP8266 Deauther + + + + + + + + + +
+ +
+
+
+

SSIDs

-
-
- -
-
- -
+
+
+
+
-
-
- -
-
- -
+
+
-
-
- -
-
- -
+
+
+
+
-
-
- -
-
- -
+
+
-
-
- - -
+
+
+
+
-
-
- -

- INFO:
- +

+ +
+
+
+
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +

+ INFO:
+ - This SSID list is used for the beacon and probe attack.
- Each SSID can be up to 32 characters.
- Don't forget to click save when you edited a SSID.
- You have to click Reload after cloning SSIDs.
-
- In case of an unexpected error, please reload the site and look at the serial monitor for further debugging.
-

-
-
-
-
-
- -
-
- s -
-
-
-
- -

Enable the random mode to generate a random SSID list in a given interval.

-
-
- -
-
- -
-
- -
+ + In case of an unexpected error, please reload the site and + look at the serial monitor for further debugging.
+

+
- - +
+
+ +
+
+ s +
+
+
+
+ +

Enable the random mode to generate a random SSID list in a given + interval.

+
+
+ +
+
+
+ + + + \ No newline at end of file diff --git a/web_interface/style.css b/web_interface/style.css index b1bd0cd..d3168af 100644 --- a/web_interface/style.css +++ b/web_interface/style.css @@ -1,3 +1,5 @@ +/* This software is licensed under the MIT License: https://github.com/spacehuhntech/esp8266_deauther */ + /* Global */ body { background: #36393e; @@ -13,7 +15,7 @@ h1 { color: #bfbfbb; padding: 0.2em 1em; border-radius: 3px; - border-left: solid #4974a9 5px; + border-left: solid #20c20e 5px; font-weight: 100; } @@ -24,7 +26,7 @@ h2 { color: #bfbfbb; padding: 0.4em 1.8em; border-radius: 3px; - border-left: solid #4974a9 5px; + border-left: solid #20c20e 5px; font-weight: 100; } @@ -84,13 +86,14 @@ p{ text-decoration: underline; } -#error { - text-align: center; - color: #fff; - background: #af3535; - border-radius: 5px; - padding: 10px; - margin-top: 10px; +#status { + text-align: center; + text-transform: capitalize; + padding: 5px; + color: #fff; + position: sticky; + top: 0; + z-index: 99; } #closeError{ @@ -100,8 +103,8 @@ p{ cursor: pointer; } -#copyright{ - font-size: 0.95em; +footer { + font-size: .95em; text-align: center; margin-top: 3em; margin-bottom: 3em; @@ -274,24 +277,35 @@ th, td { } } -/* Navigation bar */ nav { display: block; - padding: 8px 10px; - background: #2f3136; + background: #1d2236 + font-weight: bold; + padding: 0 10px; } - + nav a { - color: #bfbfbf; - padding: 0.5em; - display: inline-block; - text-decoration: none; + color: inherit; + padding: 0 .5em; } -nav a:hover{ - background: #36393f; - color:#cecece; - border-radius: 4px; +.menu { + list-style-type: none; + margin: 0; + padding: 0; + margin: 0 auto; + display: flex; + flex-direction: row; + display:block; +} + +.menu li { + margin: 10px 20px 10px 0; + display: inline-block; +} + +.menu li:last-child { + float: right; } /* Inputs and buttons */