mirror of
https://github.com/SpacehuhnTech/esp8266_deauther.git
synced 2025-12-23 06:59:59 +01:00
minor improvements
This commit is contained in:
@@ -6,7 +6,7 @@ Attack::Attack(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Attack::generate(){
|
void Attack::generate(){
|
||||||
if(debug) Serial.print("generating Macs");
|
if(debug) Serial.print("generating Macs...");
|
||||||
|
|
||||||
Mac _randomBeaconMac;
|
Mac _randomBeaconMac;
|
||||||
uint8_t _randomMacBuffer[6];
|
uint8_t _randomMacBuffer[6];
|
||||||
@@ -16,7 +16,7 @@ void Attack::generate(){
|
|||||||
getRandomVendorMac(_randomMacBuffer);
|
getRandomVendorMac(_randomMacBuffer);
|
||||||
for(int i=0;i<6;i++) _randomBeaconMac.setAt(_randomMacBuffer[i],i);
|
for(int i=0;i<6;i++) _randomBeaconMac.setAt(_randomMacBuffer[i],i);
|
||||||
}while(beaconAdrs.add(_randomBeaconMac) >= 0);
|
}while(beaconAdrs.add(_randomBeaconMac) >= 0);
|
||||||
if(debug) Serial.println(" done");
|
if(debug) Serial.println("done");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Attack::buildDeauth(Mac _ap, Mac _client, uint8_t type, uint8_t reason){
|
void Attack::buildDeauth(Mac _ap, Mac _client, uint8_t type, uint8_t reason){
|
||||||
@@ -165,9 +165,7 @@ void Attack::run(){
|
|||||||
Mac _broadcast;
|
Mac _broadcast;
|
||||||
_broadcast.set(0xFF,0xFF,0xFF,0xFF,0xFF,0xFF);
|
_broadcast.set(0xFF,0xFF,0xFF,0xFF,0xFF,0xFF);
|
||||||
|
|
||||||
wifi_set_channel(_ch);
|
//wifi_set_channel(_ch);
|
||||||
|
|
||||||
//int _selectedClients = 0;
|
|
||||||
|
|
||||||
for(int c=0;c<macListLen/apScan.selectedSum;c++){
|
for(int c=0;c<macListLen/apScan.selectedSum;c++){
|
||||||
String _apName = _ssid;
|
String _apName = _ssid;
|
||||||
@@ -177,31 +175,17 @@ void Attack::run(){
|
|||||||
_apName = " "+_apName;
|
_apName = " "+_apName;
|
||||||
for(int d=0;d<(_restSSIDLen-1)-c/2;d++) _apName += " ";//e.g. " SAMPLEAP "
|
for(int d=0;d<(_restSSIDLen-1)-c/2;d++) _apName += " ";//e.g. " SAMPLEAP "
|
||||||
}else if(c < _restSSIDLen*3){
|
}else if(c < _restSSIDLen*3){
|
||||||
_apName += ".";
|
_apName = "."+_apName;
|
||||||
for(int d=0;d<(_restSSIDLen-1)-c/3;d++) _apName += " ";//e.g. ".SAMPLEAP "
|
for(int d=0;d<(_restSSIDLen-1)-c/3;d++) _apName += " ";//e.g. ".SAMPLEAP "
|
||||||
} else{
|
} else{
|
||||||
for(int d=0; d < _restSSIDLen-1; d++) _apName += " ";
|
for(int d=0; d < _restSSIDLen-2; d++) _apName += " ";
|
||||||
_apName += (String)c;//e.g. "SAMPLEAP 78"
|
_apName += (String)c;//e.g. "SAMPLEAP 78"
|
||||||
}
|
}
|
||||||
|
|
||||||
//build a broadcast packet for this AP & SSID
|
|
||||||
buildBeacon(beaconAdrs._get(c),_broadcast,_apName,_ch,apScan.getAPEncryption(a) != "none");
|
buildBeacon(beaconAdrs._get(c),_broadcast,_apName,_ch,apScan.getAPEncryption(a) != "none");
|
||||||
|
|
||||||
/*
|
|
||||||
for(int b=0;b<clientScan.results;b++){
|
|
||||||
if(clientScan.getClientSelected(b)){
|
|
||||||
_selectedClients++;
|
|
||||||
|
|
||||||
//change packet to adress only the selected client
|
|
||||||
for(int i=0;i<6;i++) packet[4+i] = clientScan.getClientMac(b)._get(i);
|
|
||||||
|
|
||||||
if(send()) packetsCounter[1]++;
|
if(send()) packetsCounter[1]++;
|
||||||
}
|
}
|
||||||
}*/
|
|
||||||
|
|
||||||
//if no clients are selected send the broadcast packet
|
|
||||||
/*if(_selectedClients == 0)*/ if(send()) packetsCounter[1]++;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ extern "C" {
|
|||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
|
|
||||||
#define attacksNum 2
|
#define attacksNum 2
|
||||||
#define macListLen 50 //max 80 - see MacList.h
|
#define macListLen 80
|
||||||
|
|
||||||
extern void PrintHex8(uint8_t *data, uint8_t length);
|
extern void PrintHex8(uint8_t *data, uint8_t length);
|
||||||
extern void getRandomVendorMac(uint8_t *buf);
|
extern void getRandomVendorMac(uint8_t *buf);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -53,6 +53,7 @@
|
|||||||
var selectedAPs = document.getElementById("selectedAPs");
|
var selectedAPs = document.getElementById("selectedAPs");
|
||||||
var selectedClients = document.getElementById("selectedClients");
|
var selectedClients = document.getElementById("selectedClients");
|
||||||
var table = document.getElementsByTagName("table")[0];
|
var table = document.getElementsByTagName("table")[0];
|
||||||
|
var resultInterval;
|
||||||
|
|
||||||
function getResults(){
|
function getResults(){
|
||||||
getResponse("attackInfo.json",function(responseText){
|
getResponse("attackInfo.json",function(responseText){
|
||||||
@@ -79,6 +80,9 @@
|
|||||||
tr += "</tr>";
|
tr += "</tr>";
|
||||||
}
|
}
|
||||||
table.innerHTML = tr;
|
table.innerHTML = tr;
|
||||||
|
},function(){
|
||||||
|
clearInterval(resultInterval);
|
||||||
|
alert("timeout error. Please reload the site");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,6 +97,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
getResults();
|
getResults();
|
||||||
setInterval(getResults,3000);
|
resultInterval = setInterval(getResults,3000);
|
||||||
</script>
|
</script>
|
||||||
</html>
|
</html>
|
||||||
@@ -130,12 +130,13 @@
|
|||||||
|
|
||||||
function changeName(id){
|
function changeName(id){
|
||||||
var newName = prompt("Name for "+res.clients[id].mac);
|
var newName = prompt("Name for "+res.clients[id].mac);
|
||||||
|
if(newName != null){
|
||||||
getResponse("setName.json?id="+id+"&name="+newName,function(responseText){
|
getResponse("setName.json?id="+id+"&name="+newName,function(responseText){
|
||||||
if(responseText == "true") getResults();
|
if(responseText == "true") getResults();
|
||||||
else alert("error");
|
else alert("error");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
getResponse("ClientScanTime.json",function(responseText){
|
getResponse("ClientScanTime.json",function(responseText){
|
||||||
scanTime.value = responseText;
|
scanTime.value = responseText;
|
||||||
|
|||||||
Reference in New Issue
Block a user