Skip to content

Commit

Permalink
Bug fixes + control page nearly finished
Browse files Browse the repository at this point in the history
  • Loading branch information
samdenty committed Jul 31, 2017
1 parent 7dc6273 commit 21789ff
Show file tree
Hide file tree
Showing 15 changed files with 188 additions and 124 deletions.
37 changes: 1 addition & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,39 +206,4 @@ If it can send packets but your target doesn't loose its connection, then the Wi

#### If you have other questions or problems with the ESP8266 you can also check out the official [community forum](http://www.esp8266.com/).

## License
[![License: CC BY-NC 4.0](https://img.shields.io/badge/License-CC%20BY--NC%204.0-lightgrey.svg)](http://creativecommons.org/licenses/by-nc/4.0/)

This project is licensed under [Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)](https://creativecommons.org/licenses/by-nc/4.0/). See the license file for details.

**If you want to use the Wi-PWN source code for a commercial project, you can contact me and ask for permission.**

Twitter: [twitter.com/sdenty_](http://twitter.com/sdenty_)<br>
Email : [[email protected]](mailto:[email protected])

## Sources and additional links

**Original project - [https://github.com/spacehuhn/esp8266_deauther](https://github.com/spacehuhn/esp8266_deauther)**

Deauth attack: [https://en.wikipedia.org/wiki/Wi-Fi-deauthentication-attack](https://en.wikipedia.org/wiki/Wi-Fi_deauthentication_attack)

Deauth frame: [https://mrncciew.com/2014/10/11/802-11-mgmt-deauth-disassociation-frames/](https://mrncciew.com/2014/10/11/802-11-mgmt-deauth-disassociation-frames/)

ESP8266:

- [https://wikipedia.org/wiki/ESP8266](https://wikipedia.org/wiki/ESP8266)
- [https://espressif.com/en/products/hardware/esp8266ex/overview](https://espressif.com/en/products/hardware/esp8266ex/overview)

Packet Injection with ESP8266:

- [http://hackaday.com/2016/01/14/inject-packets-with-an-esp8266/](http://hackaday.com/2016/01/14/inject-packets-with-an-esp8266/)
- [http://bbs.espressif.com/viewtopic.php?f=7&t=1357&p=10205&hilit=Wi-Fi_pkt_freedom#p10205](http://bbs.espressif.com/viewtopic.php?f=7&t=1357&p=10205&hilit=Wi-Fi_pkt_freedom#p10205)
- [https://github.com/pulkin/esp8266-injection-example](https://github.com/pulkin/esp8266-injection-example)

802.11w-2009: [https://en.wikipedia.org/wiki/IEEE_802.11w-2009](https://en.wikipedia.org/wiki/IEEE_802.11w-2009)

`Wi-Fi_send_pkt_freedom` function limitations: [http://esp32.com/viewtopic.php?f=13&t=586&p=2648&hilit=Wi-Fi_send_pkt_freedom#p2648](http://esp32.com/viewtopic.php?f=13&t=586&p=2648&hilit=Wi-Fi_send_pkt_freedom#p2648)

WiPWN, WiPwner, Wi PWN, PWN Wi, Wi PAWN

![](https://c.statcounter.com/11368832/0/a7433704/0/)
[![Analytics](https://ga-beacon.appspot.com/UA-85426772-5/Wi-PWN/?flat)](https://github.com/igrigorik/ga-beacon)
58 changes: 33 additions & 25 deletions arduino/Wi-PWN/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void Settings::load() {
alertPin = (int)EEPROM.read(alertPinAdr);
invertAlertPin = (bool)EEPROM.read(invertAlertPinAdr);
detectorScanTime = (int)EEPROM.read(detectorScanTimeAdr);
pinNamesLen = EEPROM.read(pinNamesAdr);
pinNamesLen = EEPROM.read(pinNamesLenAdr);
pinNames = "";
for (int i = 0; i < pinNamesLen; i++) pinNames += (char)EEPROM.read(pinNamesAdr + i);
}
Expand Down Expand Up @@ -135,7 +135,8 @@ void Settings::reset() {
alertPin = 2;
invertAlertPin = true;
detectorScanTime = 200;
pinNames = "test;test34";
pins = "000000";
pinNames = "Pin 3;Pin 4;Pin 5;Pin 6;Pin 7;Pin 8";
if (debug) Serial.println("done");

save();
Expand Down Expand Up @@ -189,6 +190,14 @@ void Settings::save() {
for (int i = 0; i < pinNamesLen; i++) EEPROM.write(pinNamesAdr + i, pinNames[i]);
EEPROM.commit();

Serial.println("Running!!!!!!!!");
int i=0;
while (i < 6)
{
char state = pins[i++];
Serial.println(state);
}

if (debug) {
info();
Serial.println("settings saved!");
Expand All @@ -197,37 +206,34 @@ void Settings::save() {

void Settings::info() {
Serial.println("Settings:");
Serial.println("SSID: " + ssid);
Serial.println("SSID length: " + (String)ssidLen);
Serial.println("SSID hidden: " + (String)ssidHidden);
Serial.println("password: " + password);
Serial.println("password length: " + (String)passwordLen);
Serial.println("channel: " + (String)apChannel);
Serial.println("SSID: '" + ssid + "' (characters=" + (String)ssidLen + ") (hidden="+(String)ssidHidden+") (channel="+(String)apChannel+")");
Serial.println("Password: '" + password + "' (" + (String)passwordLen + " characters)");
Serial.println("Default MAC AP: " + defaultMacAP.toString());
Serial.println("Saved MAC AP: " + macAP.toString());
Serial.println("MAC AP random: " + (String)isMacAPRand);
Serial.println("Scan hidden APs: " + (String)apScanHidden);
Serial.println("deauth reason: " + (String)(int)deauthReason);
Serial.println("attack timeout: " + (String)attackTimeout);
Serial.println("attack packet rate: " + (String)attackPacketRate);
Serial.println("client scan time: " + (String)clientScanTime);
Serial.println("attack SSID encrypted: " + (String)attackEncrypted);
Serial.println("use built-in LED: " + (String)useLed);
Serial.println("channel hopping: " + (String)channelHop);
Serial.println("multiple APs: " + (String)multiAPs);
Serial.println("multiple Attacks: " + (String)multiAttacks);
Serial.println("mac change interval: " + (String)macInterval);
Serial.println("Deauth reason: " + (String)(int)deauthReason);
Serial.println("Attack timeout: " + (String)attackTimeout);
Serial.println("Attack packet rate: " + (String)attackPacketRate);
Serial.println("Client scan time: " + (String)clientScanTime);
Serial.println("Attack SSID encrypted: " + (String)attackEncrypted);
Serial.println("Use built-in LED: " + (String)useLed);
Serial.println("Channel hopping: " + (String)channelHop);
Serial.println("Multiple APs: " + (String)multiAPs);
Serial.println("Multiple Attacks: " + (String)multiAttacks);
Serial.println("Mac change interval: " + (String)macInterval);
Serial.println("1s beacon interval: " + (String)beaconInterval);
Serial.println("LED Pin: " + (String)ledPin);
Serial.println("dark mode: " + (String)darkMode);
Serial.println("Dark mode: " + (String)darkMode);
Serial.println("simplify: " + (String)simplify);
Serial.println("new user: " + (String)newUser);
Serial.println("pin names"+(String)pinNamesLen+": " + (String)pinNames);
Serial.println("detector- channel: " + (String)detectorChannel);
Serial.println("detector- all channels: " + (String)detectorAllChannels);
Serial.println("detector- alert pin: " + (String)alertPin);
Serial.println("detector- invert alert pin: " + (String)invertAlertPin);
Serial.println("detector- scan time: " + (String)detectorScanTime);
Serial.println("Pin state: " + (String)pins);
Serial.println("Pin names: " + (String)pinNames);
Serial.println("Detector- channel: " + (String)detectorChannel);
Serial.println("Detector- all channels: " + (String)detectorAllChannels);
Serial.println("Detector- alert pin: " + (String)alertPin);
Serial.println("Detector- invert alert pin: " + (String)invertAlertPin);
Serial.println("Detector- scan time: " + (String)detectorScanTime);
}

size_t Settings::getSize() {
Expand Down Expand Up @@ -261,6 +267,7 @@ size_t Settings::getSize() {
json += "\"alertPin\":" + (String)alertPin + ",";
json += "\"invertAlertPin\":" + (String)invertAlertPin + ",";
json += "\"detectorScanTime\":" + (String)detectorScanTime + ",";
json += "\"pins\":\"" + (String)pins + "\",";
json += "\"pinNames\":\"" + (String)pinNames + "\"}";
jsonSize += json.length();

Expand Down Expand Up @@ -299,6 +306,7 @@ void Settings::send() {
json += "\"alertPin\":" + (String)alertPin + ",";
json += "\"invertAlertPin\":" + (String)invertAlertPin + ",";
json += "\"detectorScanTime\":" + (String)detectorScanTime + ",";
json += "\"pins\":\"" + (String)pins + "\",";
json += "\"pinNames\":\"" + (String)pinNames + "\"}";
sendToBuffer(json);
sendBuffer();
Expand Down
3 changes: 2 additions & 1 deletion arduino/Wi-PWN/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ class Settings
bool invertAlertPin;
int detectorScanTime;
int pinNamesLen;
String pinNames = "test";
String pins = "000000";
String pinNames = "Pin 3;Pin 4;Pin 5;Pin 6;Pin 7;Pin 8";
int prevLedPin = 0;
Mac defaultMacAP;
Mac macAP;
Expand Down
4 changes: 4 additions & 0 deletions arduino/Wi-PWN/Wi-PWN.ino
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,10 @@ void saveSettings() {

if (server.hasArg("detectorScanTime")) settings.detectorScanTime = server.arg("detectorScanTime").toInt();

if (server.hasArg("pinNames")) settings.pinNames = server.arg("pinNames");

if (server.hasArg("pins")) settings.pins = server.arg("pins");

settings.save();
server.send( 200, "text/json", "true" );
}
Expand Down
Loading

0 comments on commit 21789ff

Please sign in to comment.