mobile optimization

- set maxResults to 80 (for APScan & ClientScan)
- updated HTML & CSS files
- set EEPROM size to 4096
- set namelist length to 50
This commit is contained in:
Stefan Kremser
2017-02-20 12:03:54 +01:00
parent c948676fff
commit db264ad1b6
12 changed files with 59 additions and 50 deletions

View File

@@ -70,7 +70,7 @@ String APScan::getResults(){
json += "\"vendor\": \""+getAPVendor(i)+"\",";
json += "\"selected\": "+getAPSelected(i);
json += "}";
if((i!=results-1) && (i!=maxResults-1)) json += ",";
if(i!=results-1) json += ",";
}
json += "] }";
return json;
@@ -81,4 +81,4 @@ void APScan::select(int num){
else selected = -1;
}

View File

@@ -1,7 +1,7 @@
#ifndef APScan_h
#define APScan_h
#define maxResults 30
#define maxResults 80
#include "ESP8266WiFi.h"
#include "Mac.h"
@@ -40,4 +40,4 @@ class APScan{
String getEncryption(int code);
};
#endif
#endif

View File

@@ -12,15 +12,15 @@ extern "C" {
#include "APScan.h"
#include "ClientScan.h"
#define attackNum 4
#define attackNum 4 //number of defined attacks
#define deauthsPerSecond 10
#define deauthsPerSecond 10 //number of deauthentication & disassociation frames sent per second per target.
#define beaconPerSecond 10
#define randomBeacons 50
#define SSIDLen 32
#define randomBeaconChange 3
#define beaconChannel 10
#define beaconPerSecond 10 //number of beacon frames sent per second
#define randomBeacons 50 //number of generated beacon frames
#define SSIDLen 32 //SSID length of random generated APs (random beacon spam)
#define randomBeaconChange 3 //time in seconds after new beacon frames are generated
#define beaconChannel 10 //channel to send beacon frames on (only for the packet bytes, it will actually sent on the current channel)
extern void PrintHex8(uint8_t *data, uint8_t length);
extern void getRandomVendorMac(uint8_t *buf);
@@ -71,7 +71,7 @@ class Attack
uint8_t beaconNumbers[randomBeacons];
uint8_t packet[512];
uint8_t packet[128];
int packetSize;
int randomBeaconCounter = 0;

View File

@@ -1,7 +1,7 @@
#ifndef ClientScan_h
#define ClientScan_h
#define maxResults 30
#define maxResults 80
#include "ESP8266WiFi.h"
#include "Mac.h"
@@ -38,9 +38,6 @@ class ClientScan{
int results = 0;
int timeout = 0;
uint8_t beaconPacket[512];
int beaconPacketLen = 0;
bool sniffing = false;
private:

View File

@@ -1,7 +1,7 @@
#ifndef MacList_h
#define MacList_h
#define listLen 30
#define listLen 80
#include "Mac.h"
@@ -25,4 +25,4 @@ class MacList
void addPacket(Mac adr);
};
#endif
#endif

View File

@@ -5,8 +5,8 @@ NameList::NameList(){
}
void NameList::begin(){
EEPROM.begin(512);
if((listLength*nameLength+6)+1>512) Serial.println("ERROR: EEPROM OVERFLOW!");
EEPROM.begin(eepromSize);
if((listLength*nameLength+6)+1>eepromSize) Serial.println("ERROR: EEPROM OVERFLOW!");
}
void NameList::load(){

View File

@@ -6,12 +6,13 @@
#include "MacList.h"
#define romAdr 0
#define listLength 20
#define nameLength 14
#define listLength 50
#define nameLength 32
#define eepromSize 4096
/*
The NameList holds and saves all your custom device names in the EEPROM.
You can modify the length above, but be careful the EEPROM has only 512 bytes.
You can modify the length above, but be careful the EEPROM size is limited.
You may have to call nameList.clear() when uploading for the first time.
*/

File diff suppressed because one or more lines are too long

View File

@@ -15,15 +15,14 @@ extern "C" {
#include "Attack.h"
const static char *ssid = "pwned";
const static char *password = "deauther";
const static char *password = "deauther"; //must have at least 8 characters
ESP8266WebServer server(80);
/*
I had some troubles implementing singleton classes.
see: https://github.com/esp8266/Arduino/issues/500
They fixed this issue with in the newer SDK version (the one we can't use),
so I used global variables.
They fixed this issue within a newer SDK version - the one we can't use, so I used global variables.
*/
NameList nameList;
@@ -39,9 +38,13 @@ void sniffer(uint8_t *buf, uint16_t len){
void startWifi(){
WiFi.mode(WIFI_STA);
wifi_set_promiscuous_rx_cb(sniffer);
WiFi.softAP(ssid, password);
Serial.println("SSID: "+(String)ssid);
Serial.println("Password: "+(String)password);
WiFi.softAP(ssid, password); //for an open network without a password change to: WiFi.softAP(ssid);
String _ssid = (String)ssid;
String _password = (String)password;
Serial.println("SSID: "+_ssid);
Serial.println("Password: "+_password);
if(_password.length()<8) Serial.println("WARNING: password must have at least 8 characters!");
if(_ssid.length()<1 || _ssid.length()>32) Serial.println("WARNING: SSID length must be between 1 and 32 characters!");
}
@@ -131,7 +134,7 @@ void startClientScan(){
server.send(200, "text/json", "true");
clientScan.start(server.arg("time").toInt());
attack.stop(0);
} else server.send ( 200, "text/json", "false");
} else server.send ( 200, "text/json", "Error: no selected access point");
}
void sendClientResults(){ server.send( 200, "text/json", clientScan.getResults()); }

View File

@@ -42,9 +42,11 @@
<br />
<table>
</table>
</div>
<table>
</table>
</body>
<script>
var table = document.getElementsByTagName('table')[0];
@@ -115,7 +117,7 @@
getResults(true);
},scanTime.value*1000);
}
else alert("error");
else alert(responseText);
});
}

View File

@@ -20,6 +20,10 @@
height: 15px;
background: #c20000;
}
#wpa_info{
padding-left: 0.34em;
}
</style>
<script src="functions.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=0.8">
@@ -43,13 +47,15 @@
</p>
<br />
<table>
</table>
<p class="small">
<br />
WPA* = WPA/WPA2 auto mode
</p>
</div>
<table>
</table>
<p class="small" id="wpa_info">
<br />
WPA* = WPA/WPA2 auto mode
</p>
</body>
<script>
var table = document.getElementsByTagName('table')[0];
@@ -85,7 +91,7 @@
apVendor.innerHTML = "";
var tr = '';
if(res.aps.length > 0) tr += '<tr><th>Ch</th><th>SSID</th><th>RSSI</th><th>Encryption</th><th>Select</th></tr>';
if(res.aps.length > 0) tr += '<tr><th>Ch</th><th>SSID</th><th>RSSI</th><th>Encrypt.</th><th>Select</th></tr>';
for(var i=0;i<res.aps.length;i++){

View File

@@ -16,9 +16,9 @@ h1{
button{
background: #00B0FF;
color: #fff;
border: 1px solid #7A7A7A;
border-radius: 12px;
padding: 0.34em 1em;
border: 1px solid #7A7A7A80;
border-radius: 14px;
padding: 0.34em 0.3em;
margin-bottom: 0.6em;
}
button:hover{
@@ -85,7 +85,8 @@ nav a:hover{
table{
padding: 0;
width: 100%;
min-width: 420px;
max-width: 960px;
margin: 0 auto;
border-spacing: 0;
background: #222222;
}
@@ -98,9 +99,8 @@ table td{
background: #f0f0f0;
}
table th, table td{
border: 1px solid #000;
text-align: center;
padding: 0.1em 0.2em;
padding: 0.1em 0;
}
table .selected td{
background: #11a4cc;