Skip to content

Commit

Permalink
Version 8.0
Browse files Browse the repository at this point in the history
## What's new
- Device information is now available on the `Info` Page, these include
   - Memory Usage (realtime updates)
   - Bootloader version & boot mode
   - Wi-PWN version & ESP8266 SDK version
   - Flash & Chip unique identifiers (IDs)
- Wi-PWN now displays correctly on Firefox & Iceweasel *(Oh, and Internet Explorer)*
- Fixed Input bug where the input label would overlap the input text
- Animation improvements, the body only fades in once elements are fully loaded (Implemented on settings page)
- Fixed Wi-PWN failing to load 404 elements if in a subdirectory (URLs use direct instead of relative paths)
- Minor UI updates

## Android App updates
- Now includes extra navigation items to different pages (including the useful, new info page)
- Fixed `Open in browser` action menu bug
- Added Discord & Github links to navigation pane
*NOTE: The app publisher name was updated from `mirumcode.wi_pwn` to `samdd.wipwn`, if you had the previous version installed you will find yourself with duplicate apps*
  • Loading branch information
samdenty committed Aug 19, 2017
1 parent 0f4493f commit e6a1433
Show file tree
Hide file tree
Showing 11 changed files with 109 additions and 32 deletions.
6 changes: 2 additions & 4 deletions arduino/Wi-PWN/Settings.cpp
Expand Up @@ -304,9 +304,8 @@ void Settings::send() {
size_t Settings::getSysInfoSize() {
String json = "{";
size_t jsonSize = 0;
uint32_t free = system_get_free_heap_size();

json += "\"availableram\":\"" + (String)free + "\",";
json += "\"freememory\":\"" + (String)ESP.getFreeHeap() + "\",";
json += "\"bootmode\":\"" + (String)ESP.getBootMode() + "\",";
json += "\"bootversion\":\"" + (String)ESP.getBootVersion() + "\",";
json += "\"sdkversion\":\"" + (String)ESP.getSdkVersion() + "\",";
Expand All @@ -322,10 +321,9 @@ size_t Settings::getSysInfoSize() {
void Settings::sendSysInfo() {
if (debug) Serial.println("getting sysinfo json");
sendHeader(200, "text/json", getSysInfoSize());
uint32_t free = system_get_free_heap_size();

String json = "{";
json += "\"availableram\":\"" + (String)free + "\",";
json += "\"freememory\":\"" + (String)ESP.getFreeHeap() + "\",";
json += "\"bootmode\":\"" + (String)ESP.getBootMode() + "\",";
json += "\"bootversion\":\"" + (String)ESP.getBootVersion() + "\",";
json += "\"sdkversion\":\"" + (String)ESP.getSdkVersion() + "\",";
Expand Down
15 changes: 9 additions & 6 deletions arduino/Wi-PWN/Wi-PWN.ino
Expand Up @@ -9,7 +9,7 @@
************************************************
*/

// Including some libraries we need //se
// Including some libraries we need //
#include <Arduino.h>

#include <ESP8266WiFi.h>
Expand All @@ -22,10 +22,11 @@

// Settings //

//#define USE_DISPLAY /* <-- uncomment that if you want to use the display */
#define resetPin 4 /* <-- comment out or change if you need GPIO 4 for other purposes */
//#define USE_LED16 /* <-- for the Pocket ESP8266 which has a LED on GPIO 16 to indicate if it's running */
//#define USE_CAPTIVE_PORTAL /* <-- enable captive portal (redirects all pages to 192.168.4.1) - most devices flood the ESP8266 with requests */
//#define USE_DISPLAY /* <-- uncomment that if you want to use the display */
//#define GPIO0_DEAUTH_BUTTON /* <-- Enable using GPIO0 (Flash button on NodeMCUs) as a deauth attack toggle (CAN LEAD TO BLINKING OF LED ON STARTUP!)*/
#define resetPin 4 /* <-- comment out or change if you need GPIO 4 for other purposes */
//#define USE_LED16 /* <-- for the Pocket ESP8266 which has a LED on GPIO 16 to indicate if it's running */
//#define USE_CAPTIVE_PORTAL /* <-- enable captive portal (redirects all pages to 192.168.4.1) - most devices flood the ESP8266 with requests */


// Including everything for the OLED //
Expand Down Expand Up @@ -781,11 +782,13 @@ void loop() {
}

#ifndef USE_DISPLAY
#ifdef GPIO0_DEAUTH_BUTTON
if(digitalRead(0) == LOW) {
Serial.println("FLASH button (GPIO0) pressed, executing action...");
Serial.println("FLASH button (GPIO0) pressed, toggling deauth attack...");
attack.start(0);
delay(400);
}
#endif
#endif


Expand Down
Binary file modified arduino/Wi-PWN/Wi-PWN.ino.nodemcu.bin
Binary file not shown.
10 changes: 5 additions & 5 deletions arduino/Wi-PWN/data.h

Large diffs are not rendered by default.

Binary file modified arduino/Wi-PWN/xOptional_Wi-PWN.apk
Binary file not shown.
4 changes: 3 additions & 1 deletion web_server/html/dark.css
Expand Up @@ -42,7 +42,9 @@ button:hover, .reboot:hover {
fill: #fff
}
.WiFi span:nth-child(1) {
box-shadow: inset 0 0 15px rgba(0, 0, 0, .15), 0 0 4px rgba(0,0,0,.15)
box-shadow: inset 0 0 15px rgba(0, 0, 0, .15), 0 0 4px rgba(0,0,0,.15);
-webkit-filter: initial;
filter: initial;
}
.WiFi span:nth-child(2) {
-webkit-filter: none;
Expand Down
38 changes: 32 additions & 6 deletions web_server/html/info.html
Expand Up @@ -28,20 +28,46 @@
<div class="main-wrap">
<div class="container">
<div class="card-container">
<div class="settingsHeader">Wi-PWN</div>
<div class="settingsHeader">Wi-PWN creator</div>
<div class="card">
<div class="card-content">

<p>
Wi-PWN was designed by <a href="https://samdenty99.github.io/about"><b>Sam Denty</b></a>, from the original project by spacehuhn. Wi-PWN is released under the <a href="https://creativecommons.org/licenses/by-nc/4.0/">CC BY-NC 4.0</a> license.
</p>
<a href="https://samdenty99.github.io">
<h2 class="center a light-text">
https://samdd.me
</h2>
</a>
</div>
<div class="card-action">
<a href="https://samdenty99.github.io/r?github" target="blank_">Github</a><a href="https://samdenty99.github.io/projects" class="right" target="blank_">Other projects</a>
</div>
</div>
</div>
<div class="card-container">
<div class="settingsHeader">Wi-PWN</div>
<div class="card">
<table>
<tr>
<td>Installed version</td>
<td>Wi-PWN version</td>
<td id="version"></td>
<td><button onclick="checkUpdate()">Check for updates</button></td>
<td><button onclick="checkUpdate()" class="onlgr">Check for updates</button><button onclick="checkUpdate()" class="onsmr">Update</button></td>
</tr>
<tr>
<td>Free memory</td>
<td id="freememory"></td>
<td id="flashsize"></td>
</tr>
<tr>
<td>Versions</td>
<td>Boot <b>v.<span id="bootversion"></span></b>_m.<span id="bootmode"></span></td>
<td>SDK <b id="sdk"></b></td>
</tr>
<tr>
<td>Available RAM</td>
<td id="availableram"></td>
<td>Flash &amp; Chip ID</td>
<td><span id="flashid"></span></td>
<td><span id="chipid"></span></td>
</tr>
</table>
<div class="card-action">
Expand Down
6 changes: 1 addition & 5 deletions web_server/html/js/functions.js
@@ -1,4 +1,4 @@
var version = "7.1",
var version = "8.0",
sL = getE('spinner-container'),
notification = document.getElementById("notification"),
themeColor = getComputedStyle(document.body),
Expand Down Expand Up @@ -159,10 +159,6 @@ function fadeIn() {
setTimeout(function(){document.getElementsByClassName('main-wrap')[0].classList.add('animation')}, 1000)
}

function checkUpdate() {
window.open("https://samdenty99.github.io/r?https://Wi-PWN.samdd.me/update?installed="+version,'_blank');
}

/* Set meta color */
defaultMetaColor();

Expand Down
36 changes: 34 additions & 2 deletions web_server/html/js/info.js
@@ -1,13 +1,45 @@
var versionCell = getE("version"),
availableram = getE("availableram");
freememory = getE("freememory"),
flashsize = getE("flashsize"),
bootversion = getE("bootversion"),
chipid = getE("chipid"),
flashid = getE("flashid"),
sdk = getE("sdk"),
bootmode = getE("bootmode"),
fm, fz, bm, bv, fi, ci, sk;

function getData() {
getResponse("sysinfo.json", function(responseText) {
var res = JSON.parse(responseText);
availableram.innerHTML = res.availableram;
fm = res.freememory.replace(/(.)(?=(\d{3})+$)/g,'$1,');
fz = res.flashchipsize;
bm = res.bootmode;
bv = res.bootversion;
fi = res.flashchipid;
ci = res.chipid;
sk = res.sdkversion;

freememory.innerHTML = "<b>" + fm + "</b> / 64,000";
flashsize.innerHTML = bytesToSize(fz) + " flash";
bootmode.innerHTML = bm;
bootversion.innerHTML = bv;
flashid.innerHTML = fi;
chipid.innerHTML = ci;
sdk.innerHTML = "v." + sk;
});
}

function bytesToSize(bytes) {
var sizes = [' bytes', 'KB', 'MB', 'GB', 'TB'];
if (bytes == 0) return '0 Byte';
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
return Math.round(bytes / Math.pow(1024, i), 2) + '' + sizes[i];
};

function checkUpdate() {
window.open("https://samdenty99.github.io/r?https://Wi-PWN.samdd.me/update?installed="+version+"&sdk="+sk+"&freememory="+fm+"&flashsize="+fz+"&bootmode="+bm+"&bootversion="+bv+"&flashid="+fi+"&chipid="+ci,'_blank');
}

getData();
versionCell.innerHTML = version;
document.getElementsByClassName('main-wrap')[0].className = 'main-wrap fadeIn'
Expand Down
24 changes: 22 additions & 2 deletions web_server/html/main.css
Expand Up @@ -457,6 +457,11 @@ img, nav, td {
font-size: 11px;
text-transform: uppercase;
}
.light-text {
font-weight: 400;
-webkit-margin-before: 0.4em;
-webkit-margin-after: 0.4em;
}
a, .a {
cursor: pointer;
text-decoration: none;
Expand Down Expand Up @@ -539,7 +544,7 @@ hr.small {
font-size: 1rem;
line-height: 36px;
height: 36px;
padding: 0 2rem;
padding: 0 1.5rem;
cursor: pointer;
transition: .3s ease;
transition: box-shadow .3s ease, background .3s ease;
Expand Down Expand Up @@ -1014,6 +1019,11 @@ footer a {
margin-top: 5px !important;
}
}
@media (min-width:1000px) {
.onsmr {
display: none !important;
}
}

/************************ Tablet & mobile only styles *************************/
@media (max-width:520px) {
Expand Down Expand Up @@ -1048,6 +1058,14 @@ footer a {
margin-top: 80px !important;
opacity: 1 !important;
}
.onsmr {
padding: 0 1.3rem;
}
}
@media (max-width:1000px) {
.onlgr {
display: none !important;
}
}

/***************************** Mobile only styles *****************************/
Expand Down Expand Up @@ -1090,7 +1108,7 @@ footer a {
margin-bottom: 15px !important;
}
}
@media (max-width:300px) {
@media (max-width:260px) {
button.button-header {
margin-bottom: 30px !important;
}
Expand Down Expand Up @@ -1130,6 +1148,8 @@ footer a {
border-top-left-radius: 0;
background: rgba(0, 0, 0, .1);
box-shadow: inset 0 0 15px rgba(0, 0, 0, .15);
-webkit-filter: grayscale(45%);
filter: grayscale(45%);
}
.pointUp span:nth-child(1) {
-webkit-transform: rotate(45deg);
Expand Down
2 changes: 1 addition & 1 deletion web_server/html/sysinfo.json
@@ -1,5 +1,5 @@
{
"availableram":"6816",
"freememory":"6816",
"bootmode":"1",
"bootversion":"31",
"sdkversion":"1.3.0",
Expand Down

0 comments on commit e6a1433

Please sign in to comment.