Compare commits

...

19 Commits

Author SHA1 Message Date
Just Call Me Koko
fa4d3bf3e2 Fix status bar 2020-05-14 22:34:25 -04:00
Just Call Me Koko
bf9baee37b Add status bar 2020-05-14 15:15:07 -04:00
Just Call Me Koko
1612ac4bf0 Add Neopixel support 2020-04-23 19:23:00 -04:00
Just Call Me Koko
418a8ebf41 new release 2020-04-15 14:25:01 -04:00
Just Call Me Koko
1e1f6f6b19 temp sensor and battery level 2020-04-15 12:33:41 -04:00
Just Call Me Koko
35b10ac9be Merge branch 'master' of https://github.com/justcallmekoko/ESP32Marauder 2020-03-24 15:52:06 -04:00
Just Call Me Koko
10d5767ffa Release v0.6.2 2020-03-24 15:52:03 -04:00
Just Call Me Koko
269e848a16 Update README.md 2020-03-24 09:28:33 -04:00
Just Call Me Koko
3ab8432443 Update README.md 2020-03-24 00:03:43 -04:00
Just Call Me Koko
9e07722292 Add compatibility with hcxtools 2020-03-24 00:02:30 -04:00
Just Call Me Koko
5e5313a008 Release new bin 2020-03-21 21:40:26 -04:00
Just Call Me Koko
3ce996d9e2 Add EAPOL sniff
There were a lot of stupid issues caused by the battery interface code. Got rid of it and I will not be adding any code to make it work. Fuck that shit.
2020-03-21 21:31:14 -04:00
Just Call Me Koko
96957a2cc1 Revert Changes 2020-03-21 20:20:52 -04:00
Just Call Me Koko
ca4048983f stuff 2020-03-21 20:20:25 -04:00
Just Call Me Koko
a2fa6759a8 Revert "Create ESP32_Marauder_Enclosure_body_3_antenna_sd.stl"
This reverts commit 56acee78e4.
2020-03-21 20:19:15 -04:00
Just Call Me Koko
40e11b71f0 Capture EAPOL packets 2020-03-21 18:54:14 -04:00
Just Call Me Koko
56acee78e4 Create ESP32_Marauder_Enclosure_body_3_antenna_sd.stl 2020-03-19 12:29:42 -04:00
Just Call Me Koko
470371adc1 Update README.md 2020-03-18 16:11:03 -04:00
Just Call Me Koko
fc5d27b4b6 All scanners save pcap files 2020-03-18 15:30:08 -04:00
33 changed files with 952 additions and 73 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -3,7 +3,7 @@
<!---[![Build Status](https://travis-ci.com/justcallmekoko/ESP32Marauder.svg?branch=master)](https://travis-ci.com/justcallmekoko/ESP32Marauder)--->
<!---Shields/Badges https://shields.io/--->
# ESP32 Marauder v0.5.3
# ESP32 Marauder v0.6.4
<p align="center"><img alt="Marauder logo" src="https://github.com/justcallmekoko/ESP32Marauder/blob/master/pictures/marauder3L.jpg?raw=true" width="300"></p>
<p align="center">
<b>A suite of WiFi/Bluetooth offensive and defensive tools for the ESP32</b>
@@ -56,6 +56,7 @@ You can check out the marauder article written [here](https://www.hackster.io/ne
- Bluetooth Sniffer: Sniff bluetooth devices within range
- Detect Card Skimmers: Detect bluetooth enabled credit card skimmers
- Packet Monitor: Show WiFi packet density on a given channel using a time bar graph
- EAPOL/PMKID Scan: Capture EAPOL/PMKID frames
- Deauth Sniff: Detect deauthentication packets sent on all channels
- Draw: Just doodle on the screen or whatever
- Update Firmware: Update Marauder firmware over the air via web interface or with SD card
@@ -134,6 +135,7 @@ If you own an ESP32 Marauder (v0.4.0 or later) and have not build the project, y
- Marauder will automatically reboot once the update has been applied
### SD Update
*Using a Samsung MicroSD card will cause Marauder not to boot*
1. Download the [latest release](https://github.com/justcallmekoko/ESP32Marauder/releases/latest) of the Marauder firmware
2. Copy the bin file you downloaded to the root of an SD card
3. Rename the bin file on the SD card to `update.bin`

View File

@@ -3,6 +3,8 @@
#define jquery_min_js_v3_2_1_gz_len 30178
PROGMEM static const unsigned char menu_icons[][66] = {
{0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x37, 0xFF, 0xFF, 0x3A, // Attack: 0
0xFF, 0xFF, 0x39, 0xFF, 0xBF, 0x3C, 0xFF, 0x7F, 0x3E, 0xFF, 0x2F, 0x3F,
@@ -129,7 +131,19 @@ PROGMEM static const unsigned char menu_icons[][66] = {
0xDD, 0xB6, 0x2D, 0xED, 0xB6, 0x2B, 0xED, 0xB6, 0x2B, 0x01, 0x00, 0x20,
0xED, 0xB6, 0x2B, 0xDD, 0xB6, 0x2D, 0xDB, 0xB6, 0x35, 0xDB, 0x96, 0x35,
0x07, 0x00, 0x38, 0x6F, 0x55, 0x3D, 0xDF, 0x94, 0x3E, 0x3F, 0x23, 0x3F,
0xFF, 0xC0, 0x3F, 0xFF, 0xFF, 0x3F}
0xFF, 0xC0, 0x3F, 0xFF, 0xFF, 0x3F},
{0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3B, 0xFF, 0xFF, 0x39, // EAPOL: 21
0xFF, 0xFF, 0x3C, 0xFF, 0x7F, 0x3A, 0xFF, 0x3F, 0x37, 0xFF, 0x9F, 0x3E,
0xFF, 0xCF, 0x3D, 0xFF, 0xE7, 0x3F, 0xFF, 0xF3, 0x3F, 0xCF, 0xF9, 0x3F,
0xB7, 0xFC, 0x3F, 0x77, 0xFE, 0x3F, 0xF7, 0xFE, 0x3F, 0xEF, 0xFD, 0x3F,
0xDF, 0xFB, 0x3F, 0xBF, 0xFB, 0x3F, 0x7F, 0xFC, 0x3F, 0xFF, 0xFF, 0x3F,
0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F},
{0xFF, 0xFF, 0x3F, 0xFC, 0x9F, 0xF9, 0xDF, 0xFB, 0xDF, 0xFB, 0x1F, 0xF8, // Battery: 22
0x1F, 0xF8, 0x1F, 0xF8, 0x1F, 0xF8, 0x1F, 0xF8, 0x1F, 0xF8, 0x1F, 0xF8,
0x1F, 0xF8, 0x1F, 0xF8, 0x1F, 0xF8, 0xFF, 0xFF},
{0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0x07, 0xF8, 0x07, 0xF0, 0x07, 0xE0, // SD: 23
0x67, 0xE7, 0x97, 0xE9, 0x17, 0xE9, 0x67, 0xE9, 0x87, 0xE9, 0x97, 0xE9,
0x67, 0xE7, 0x07, 0xE0, 0x07, 0xE0, 0xFF, 0xFF}
};

View File

@@ -0,0 +1,43 @@
#include "BatteryInterface.h"
BatteryInterface::BatteryInterface() {
}
void BatteryInterface::main(uint32_t currentTime) {
if (currentTime != 0) {
if (currentTime - initTime >= 3000) {
//Serial.println("Checking Battery Level");
this->initTime = millis();
int8_t new_level = this->getBatteryLevel();
//this->battery_level = this->getBatteryLevel();
if (this->battery_level != new_level) {
Serial.println("Battery Level changed: " + (String)new_level);
this->battery_level = new_level;
}
}
}
}
void BatteryInterface::RunSetup() {
Wire.begin(I2C_SDA, I2C_SCL);
this->initTime = millis();
}
int8_t BatteryInterface::getBatteryLevel() {
Wire.beginTransmission(IP5306_ADDR);
Wire.write(0x78);
if (Wire.endTransmission(false) == 0 &&
Wire.requestFrom(0x75, 1)) {
this->i2c_supported = true;
switch (Wire.read() & 0xF0) {
case 0xE0: return 25;
case 0xC0: return 50;
case 0x80: return 75;
case 0x00: return 100;
default: return 0;
}
}
this->i2c_supported = false;
return -1;
}

View File

@@ -0,0 +1,28 @@
#ifndef BatteryInterface_h
#define BatteryInterface_h
#include <Arduino.h>
#include <Wire.h>
#define I2C_SDA 33
#define I2C_SCL 22
#define IP5306_ADDR 0x75
class BatteryInterface {
private:
uint32_t initTime = 0;
public:
int8_t battery_level = 0;
int8_t old_level = 0;
bool i2c_supported = false;
BatteryInterface();
void RunSetup();
void main(uint32_t currentTime);
int8_t getBatteryLevel();
};
#endif

View File

@@ -5,10 +5,10 @@ Buffer::Buffer(){
bufB = (uint8_t*)malloc(BUF_SIZE);
}
void Buffer::open(fs::FS* fs){
void Buffer::open(fs::FS* fs, String fn){
int i=0;
do{
fileName = "/"+(String)i+".pcap";
fileName = "/"+fn+"_"+(String)i+".pcap";
i++;
} while(fs->exists(fileName));

View File

@@ -13,7 +13,7 @@
class Buffer {
public:
Buffer();
void open(fs::FS* fs);
void open(fs::FS* fs, String fn = "");
void close(fs::FS* fs);
void addPacket(uint8_t* buf, uint32_t len);
void save(fs::FS* fs);

View File

@@ -40,6 +40,10 @@ void Display::RunSetup()
//tft.fillScreen(TFT_BLACK);
clearScreen();
Serial.println("SPI_FREQUENCY: " + (String)SPI_FREQUENCY);
Serial.println("SPI_READ_FREQUENCY: " + (String)SPI_READ_FREQUENCY);
Serial.println("SPI_TOUCH_FREQUENCY: " + (String)SPI_TOUCH_FREQUENCY);
// Initialize file system
// This should probably have its own class
@@ -73,6 +77,13 @@ void Display::tftDrawGraphObjects(byte x_scale)
tft.setCursor(3, 228); tft.print("0"); // "-" at bottom of y axis
}
void Display::tftDrawEapolColorKey()
{
//Display color key
tft.setTextSize(1); tft.setTextColor(TFT_WHITE);
tft.fillRect(14, 0, 15, 8, TFT_CYAN); tft.setCursor(30, 0); tft.print(" - EAPOL");
}
void Display::tftDrawColorKey()
{
//Display color key
@@ -220,8 +231,8 @@ void Display::twoPartDisplay(String center_text)
void Display::touchToExit()
{
tft.setTextColor(TFT_BLACK, TFT_LIGHTGREY);
tft.fillRect(0,16,HEIGHT_1,16, TFT_LIGHTGREY);
tft.drawCentreString("Touch screen to exit",120,16,2);
tft.fillRect(0,32,HEIGHT_1,16, TFT_LIGHTGREY);
tft.drawCentreString("Touch screen to exit",120,32,2);
}
@@ -248,6 +259,7 @@ void Display::displayBuffer(bool do_clear)
delay(print_delay_1);
yDraw = scroll_line(TFT_RED);
tft.setCursor(xPos, yDraw);
tft.setTextColor(TFT_GREEN, TFT_BLACK);
tft.print(display_buffer->shift());
printing = false;
delay(print_delay_2);
@@ -325,7 +337,10 @@ int Display::scroll_line(uint32_t color) {
// Function to setup hardware scroll for TFT screen
void Display::setupScrollArea(uint16_t tfa, uint16_t bfa) {
Serial.println("setupScrollAread()");
Serial.println("setupScrollArea()");
Serial.println(" tfa: " + (String)tfa);
Serial.println(" bfa: " + (String)bfa);
Serial.println("yStart: " + (String)this->yStart);
tft.writecommand(ILI9341_VSCRDEF); // Vertical scroll definition
tft.writedata(tfa >> 8); // Top Fixed Area line count
tft.writedata(tfa);
@@ -635,12 +650,12 @@ void Display::updateBanner(String msg)
this->buildBanner(msg, current_banner_pos);
this->img.pushSprite(0, 0);
this->img.pushSprite(0, STATUS_BAR_WIDTH);
current_banner_pos--;
if (current_banner_pos <= 0)
current_banner_pos = SCREEN_WIDTH;
current_banner_pos = SCREEN_WIDTH + 2;
}

View File

@@ -23,7 +23,7 @@
#define STANDARD_FONT_CHAR_LIMIT 40 // number of characters on a single line with normal font
#define TEXT_HEIGHT 16 // Height of text to be printed and scrolled
#define BOT_FIXED_AREA 0 // Number of lines in bottom fixed area (lines counted from bottom of screen)
#define TOP_FIXED_AREA 16 // Number of lines in top fixed area (lines counted from top of screen)
#define TOP_FIXED_AREA 48 // Number of lines in top fixed area (lines counted from top of screen)
#define YMAX 320 // Bottom of screen area
#define minimum(a,b) (((a) < (b)) ? (a) : (b))
//#define MENU_FONT NULL
@@ -32,6 +32,9 @@
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_ARRAY_LEN 7
#define STATUS_BAR_WIDTH 16
#define STATUSBAR_COLOR 0x4A49
class Display
@@ -56,14 +59,14 @@ class Display
TFT_eSPI tft = TFT_eSPI();
TFT_eSprite img = TFT_eSprite(&tft);
TFT_eSPI_Button key[BUTTON_ARRAY_LEN];
String version_number = "v0.5.3";
String version_number = "v0.6.5";
bool printing = false;
bool loading = false;
bool tteBar = false;
bool draw_tft = false;
int TOP_FIXED_AREA_2 = 32;
int TOP_FIXED_AREA_2 = 48;
int print_delay_1, print_delay_2 = 10;
int current_banner_pos = SCREEN_WIDTH;
@@ -82,9 +85,9 @@ class Display
uint16_t xPos = 0;
// The initial y coordinate of the top of the scrolling area
uint16_t yStart = TOP_FIXED_AREA;
uint16_t yStart = TOP_FIXED_AREA_2;
// yArea must be a integral multiple of TEXT_HEIGHT
uint16_t yArea = YMAX - TOP_FIXED_AREA - BOT_FIXED_AREA;
uint16_t yArea = YMAX - TOP_FIXED_AREA_2 - BOT_FIXED_AREA;
// We have to blank the top line each time the display is scrolled, but this takes up to 13 milliseconds
// for a full width line, meanwhile the serial buffer may be filling... and overflowing
@@ -92,6 +95,7 @@ class Display
int blank[19]; // We keep all the strings pixel lengths to optimise the speed of the top line blanking
void tftDrawGraphObjects(byte x_scale);
void tftDrawEapolColorKey();
void tftDrawColorKey();
void tftDrawXScaleButtons(byte x_scale);
void tftDrawYScaleButtons(byte y_scale);

View File

@@ -0,0 +1,41 @@
#include "LedInterface.h"
LedInterface::LedInterface() {
}
void LedInterface::RunSetup() {
Serial.println("Setting neopixel to black...");
strip.begin();
strip.setBrightness(50);
strip.setPixelColor(0, strip.Color(0, 0, 0));
strip.show();
delay(100);
strip.setPixelColor(0, strip.Color(255, 0, 0));
strip.show();
this->initTime = millis();
}
void LedInterface::main(uint32_t currentTime) {
strip.setPixelColor(0, this->Wheel((0 * 256 / 100 + this->wheel_pos) % 256));
strip.show();
this->current_fade_itter++;
this->wheel_pos = this->wheel_pos - this->wheel_speed;
if (this->wheel_pos < 0)
this->wheel_pos = 255;
};
uint32_t LedInterface::Wheel(byte WheelPos) {
WheelPos = 255 - WheelPos;
if(WheelPos < 85) {
return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
}
if(WheelPos < 170) {
WheelPos -= 85;
return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
}
WheelPos -= 170;
return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}

View File

@@ -0,0 +1,31 @@
#ifndef LedInterface_h
#define LedInterface_h
#include <Arduino.h>
#include <Adafruit_NeoPixel.h>
#define PIN 25
#define Pixels 1
extern Adafruit_NeoPixel strip;
class LedInterface {
private:
uint32_t initTime = 0;
int current_fade_itter = 1;
int wheel_pos = 255;
int wheel_speed = 1; // lower = slower
uint32_t Wheel(byte WheelPos);
public:
LedInterface();
void RunSetup();
void main(uint32_t currentTime);
};
#endif

View File

@@ -8,7 +8,7 @@ MenuFunctions::MenuFunctions()
}
// Function to check menu input
void MenuFunctions::main()
void MenuFunctions::main(uint32_t currentTime)
{
if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_OFF) ||
(wifi_scan_obj.currentScanMode == OTA_UPDATE) ||
@@ -17,9 +17,20 @@ void MenuFunctions::main()
this->orientDisplay();
wifi_scan_obj.orient_display = false;
}
//if ((display_obj.current_banner_pos <= 0) || (display_obj.current_banner_pos == SCREEN_WIDTH))
//{
// this->drawStatusBar();
//}
display_obj.updateBanner(current_menu->name);
}
if (currentTime != 0) {
if (currentTime - initTime >= 100) {
this->initTime = millis();
this->updateStatusBar();
}
}
//this->displayCurrentMenu();
boolean pressed = false;
@@ -59,7 +70,6 @@ void MenuFunctions::main()
// Stop the current scan
if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_PROBE) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_AP) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ST) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ALL) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_DEAUTH) ||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_BEACON_SPAM) ||
@@ -144,6 +154,133 @@ void MenuFunctions::main()
y = -1;
}
void MenuFunctions::updateStatusBar()
{
uint16_t the_color;
// Draw temp info
if (temp_obj.current_temp < 70)
the_color = TFT_GREEN;
else if ((temp_obj.current_temp >= 70) && (temp_obj.current_temp < 80))
the_color = TFT_YELLOW;
else if ((temp_obj.current_temp >= 80) && (temp_obj.current_temp < 90))
the_color = TFT_ORANGE;
else if ((temp_obj.current_temp >= 90) && (temp_obj.current_temp < 100))
the_color = TFT_RED;
else
the_color = TFT_MAROON;
display_obj.tft.setTextColor(the_color, STATUSBAR_COLOR);
if (temp_obj.current_temp != temp_obj.old_temp) {
temp_obj.old_temp = temp_obj.current_temp;
display_obj.tft.fillRect(0, 0, 50, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
display_obj.tft.drawString((String)temp_obj.current_temp + " C", 4, 0, 2);
}
display_obj.tft.setTextColor(TFT_WHITE, STATUSBAR_COLOR);
// Draw battery info
if (battery_obj.i2c_supported)
{
if ((String)battery_obj.battery_level != "25")
the_color = TFT_GREEN;
else
the_color = TFT_RED;
if (battery_obj.battery_level != battery_obj.old_level) {
battery_obj.old_level = battery_obj.battery_level;
display_obj.tft.fillRect(204, 0, SCREEN_WIDTH, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
display_obj.tft.setCursor(0, 1);
display_obj.tft.drawXBitmap(186,
0,
menu_icons[STATUS_BAT],
16,
16,
STATUSBAR_COLOR,
the_color);
display_obj.tft.drawString((String)battery_obj.battery_level + "%", 204, 0, 2);
}
}
// Draw SD info
if (sd_obj.supported)
the_color = TFT_GREEN;
else
the_color = TFT_RED;
display_obj.tft.drawXBitmap(170,
0,
menu_icons[STATUS_SD],
16,
16,
STATUSBAR_COLOR,
the_color);
//display_obj.tft.print((String)battery_obj.battery_level + "%");
}
void MenuFunctions::drawStatusBar()
{
display_obj.tft.fillRect(0, 0, 240, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
//display_obj.tft.fillRect(0, STATUS_BAR_WIDTH + 1, 240, 1, TFT_DARKGREY);
display_obj.tft.setTextColor(TFT_WHITE, STATUSBAR_COLOR);
//display_obj.tft.setTextSize(2);
uint16_t the_color;
// Draw temp info
if (temp_obj.current_temp < 70)
the_color = TFT_GREEN;
else if ((temp_obj.current_temp >= 70) && (temp_obj.current_temp < 80))
the_color = TFT_YELLOW;
else if ((temp_obj.current_temp >= 80) && (temp_obj.current_temp < 90))
the_color = TFT_ORANGE;
else if ((temp_obj.current_temp >= 90) && (temp_obj.current_temp < 100))
the_color = TFT_RED;
else
the_color = TFT_MAROON;
display_obj.tft.setTextColor(the_color, STATUSBAR_COLOR);
temp_obj.old_temp = temp_obj.current_temp;
display_obj.tft.fillRect(0, 0, 50, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
display_obj.tft.drawString((String)temp_obj.current_temp + " C", 4, 0, 2);
display_obj.tft.setTextColor(TFT_WHITE, STATUSBAR_COLOR);
// Draw battery info
if (battery_obj.i2c_supported)
{
if ((String)battery_obj.battery_level != "25")
the_color = TFT_GREEN;
else
the_color = TFT_RED;
battery_obj.old_level = battery_obj.battery_level;
display_obj.tft.fillRect(204, 0, SCREEN_WIDTH, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
display_obj.tft.setCursor(0, 1);
display_obj.tft.drawXBitmap(186,
0,
menu_icons[STATUS_BAT],
16,
16,
STATUSBAR_COLOR,
the_color);
display_obj.tft.drawString((String)battery_obj.battery_level + "%", 204, 0, 2);
}
// Draw SD info
if (sd_obj.supported)
the_color = TFT_GREEN;
else
the_color = TFT_RED;
display_obj.tft.drawXBitmap(170,
0,
menu_icons[STATUS_SD],
16,
16,
STATUSBAR_COLOR,
the_color);
//display_obj.tft.print((String)battery_obj.battery_level + "%");
}
void MenuFunctions::orientDisplay()
{
display_obj.tft.init();
@@ -234,20 +371,22 @@ void MenuFunctions::RunSetup()
// Build WiFi sniffer Menu
wifiSnifferMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
addNodes(&wifiSnifferMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(wifiSnifferMenu.parentMenu);});
addNodes(&wifiSnifferMenu, "Probe Request Sniff", TFT_CYAN, NULL, PROBE_SNIFF, [this](){wifi_scan_obj.StartScan(WIFI_SCAN_PROBE, TFT_CYAN);});
addNodes(&wifiSnifferMenu, "Beacon Sniff", TFT_MAGENTA, NULL, BEACON_SNIFF, [this](){wifi_scan_obj.StartScan(WIFI_SCAN_AP, TFT_MAGENTA);});
addNodes(&wifiSnifferMenu, "Deauth Sniff", TFT_RED, NULL, DEAUTH_SNIFF, [this](){wifi_scan_obj.StartScan(WIFI_SCAN_DEAUTH, TFT_RED);});
addNodes(&wifiSnifferMenu, "Probe Request Sniff", TFT_CYAN, NULL, PROBE_SNIFF, [this](){display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_PROBE, TFT_CYAN);});
addNodes(&wifiSnifferMenu, "Beacon Sniff", TFT_MAGENTA, NULL, BEACON_SNIFF, [this](){display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_AP, TFT_MAGENTA);});
addNodes(&wifiSnifferMenu, "Deauth Sniff", TFT_RED, NULL, DEAUTH_SNIFF, [this](){display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_DEAUTH, TFT_RED);});
// Build WiFi scanner Menu
wifiScannerMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
addNodes(&wifiScannerMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(wifiScannerMenu.parentMenu);});
addNodes(&wifiScannerMenu, "Packet Monitor", TFT_BLUE, NULL, PACKET_MONITOR, [this](){wifi_scan_obj.StartScan(WIFI_PACKET_MONITOR, TFT_BLUE);});
addNodes(&wifiScannerMenu, "EAPOL/PMKID Scan", TFT_VIOLET, NULL, EAPOL, [this](){wifi_scan_obj.StartScan(WIFI_SCAN_EAPOL, TFT_VIOLET);});
// Build WiFi attack menu
wifiAttackMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
addNodes(&wifiAttackMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(wifiAttackMenu.parentMenu);});
addNodes(&wifiAttackMenu, "Beacon Spam Random", TFT_ORANGE, NULL, BEACON_SPAM, [this](){wifi_scan_obj.StartScan(WIFI_ATTACK_BEACON_SPAM, TFT_ORANGE);});
addNodes(&wifiAttackMenu, "Rick Roll Beacon", TFT_YELLOW, NULL, RICK_ROLL, [this](){wifi_scan_obj.StartScan(WIFI_ATTACK_RICK_ROLL, TFT_YELLOW);});
addNodes(&wifiAttackMenu, "Beacon Spam Random", TFT_ORANGE, NULL, BEACON_SPAM, [this](){display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_ATTACK_BEACON_SPAM, TFT_ORANGE);});
addNodes(&wifiAttackMenu, "Rick Roll Beacon", TFT_YELLOW, NULL, RICK_ROLL, [this](){display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_ATTACK_RICK_ROLL, TFT_YELLOW);});
// Build Bluetooth Menu
bluetoothMenu.parentMenu = &mainMenu; // Second Menu is third menu parent
@@ -258,12 +397,12 @@ void MenuFunctions::RunSetup()
// Build bluetooth sniffer Menu
bluetoothSnifferMenu.parentMenu = &bluetoothMenu; // Second Menu is third menu parent
addNodes(&bluetoothSnifferMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(bluetoothSnifferMenu.parentMenu);});
addNodes(&bluetoothSnifferMenu, "Bluetooth Sniffer", TFT_GREEN, NULL, BLUETOOTH_SNIFF, [this](){wifi_scan_obj.StartScan(BT_SCAN_ALL, TFT_GREEN);});
addNodes(&bluetoothSnifferMenu, "Bluetooth Sniffer", TFT_GREEN, NULL, BLUETOOTH_SNIFF, [this](){display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(BT_SCAN_ALL, TFT_GREEN);});
// Build bluetooth scanner Menu
bluetoothScannerMenu.parentMenu = &bluetoothMenu; // Second Menu is third menu parent
addNodes(&bluetoothScannerMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(bluetoothScannerMenu.parentMenu);});
addNodes(&bluetoothScannerMenu, "Detect Card Skimmers", TFT_MAGENTA, NULL, CC_SKIMMERS, [this](){wifi_scan_obj.StartScan(BT_SCAN_SKIMMERS, TFT_MAGENTA);});
addNodes(&bluetoothScannerMenu, "Detect Card Skimmers", TFT_MAGENTA, NULL, CC_SKIMMERS, [this](){display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(BT_SCAN_SKIMMERS, TFT_MAGENTA);});
// General apps menu
generalMenu.parentMenu = &mainMenu;
@@ -304,6 +443,8 @@ void MenuFunctions::RunSetup()
// Set the current menu to the mainMenu
changeMenu(&mainMenu);
this->initTime = millis();
}
// Function to change menu
@@ -381,6 +522,7 @@ void MenuFunctions::displayCurrentMenu()
Serial.println("Displaying current menu...");
display_obj.clearScreen();
display_obj.tft.setTextColor(TFT_LIGHTGREY, TFT_DARKGREY);
this->drawStatusBar();
//display_obj.tft.fillRect(0,0,240,16, TFT_DARKGREY);
//display_obj.tft.drawCentreString(" ESP32 Marauder ",120,0,2);
//Serial.println("Getting size...");

View File

@@ -3,11 +3,15 @@
#include "WiFiScan.h"
#include "Display.h"
#include "BatteryInterface.h"
#include "SDInterface.h"
#include "Web.h"
extern Display display_obj;
extern WiFiScan wifi_scan_obj;
extern Web web_obj;
extern SDInterface sd_obj;
extern BatteryInterface battery_obj;
// Keypad start position, key sizes and spacing
#define KEY_X 120 // Centre of key
@@ -46,6 +50,9 @@ extern Web web_obj;
#define DEVICE_INFO 18
#define SD_UPDATE 19
#define WEB_UPDATE 20
#define EAPOL 21
#define STATUS_BAT 22
#define STATUS_SD 23
struct Menu;
@@ -73,6 +80,8 @@ class MenuFunctions
private:
String u_result = "";
uint32_t initTime = 0;
Menu* current_menu;
@@ -106,6 +115,8 @@ class MenuFunctions
//TFT_eSPI_Button key[BUTTON_ARRAY_LEN];
void addNodes(Menu* menu, String name, uint16_t color, Menu* child, int place, std::function<void()> callable);
void drawStatusBar();
void updateStatusBar();
void showMenuList(Menu* menu, int layer);
void orientDisplay();
@@ -118,7 +129,7 @@ class MenuFunctions
void buildButtons(Menu* menu);
void changeMenu(Menu* menu);
void displayCurrentMenu();
void main();
void main(uint32_t currentTime);
void RunSetup();
};

View File

@@ -63,9 +63,9 @@ void SDInterface::addPacket(uint8_t* buf, uint32_t len) {
}
}
void SDInterface::openCapture() {
void SDInterface::openCapture(String file_name) {
if (this->supported)
buffer_obj.open(&SD);
buffer_obj.open(&SD, file_name);
}
void SDInterface::runUpdate() {
@@ -162,7 +162,7 @@ void SDInterface::performUpdate(Stream &updateSource, size_t updateSize) {
void SDInterface::main() {
if ((this->supported) && (this->do_save)) {
//Serial.println("Saving packet...");
buffer_obj.save(&SD);
buffer_obj.forceSave(&SD);
}
}

View File

@@ -29,7 +29,7 @@ class SDInterface {
bool initSD();
void addPacket(uint8_t* buf, uint32_t len);
void openCapture();
void openCapture(String file_name = "");
void runUpdate();
void performUpdate(Stream &updateSource, size_t updateSize);
void main();

View File

@@ -0,0 +1,33 @@
#include "TemperatureInterface.h"
#ifdef __cplusplus
extern "C" {
#endif
uint8_t temprature_sens_read();
#ifdef __cplusplus
}
#endif
uint8_t temprature_sens_read();
TemperatureInterface::TemperatureInterface() {
}
void TemperatureInterface::RunSetup() {
this->initTime = millis();
this->current_temp = this->getCurrentTemp();
}
uint8_t TemperatureInterface::getCurrentTemp() {
return ((temprature_sens_read() - 32) / 1.8);
}
void TemperatureInterface::main(uint32_t currentTime) {
if (currentTime != 0) {
if (currentTime - initTime >= 100) {
//Serial.println("Checking Battery Level");
this->initTime = millis();
this->current_temp = this->getCurrentTemp();
}
}
}

View File

@@ -0,0 +1,22 @@
#ifndef TemperatureInterface_h
#define TemperatureInterface_h
#include <Arduino.h>
class TemperatureInterface {
private:
uint32_t initTime = 0;
public:
TemperatureInterface();
uint8_t current_temp = 0;
uint8_t old_temp = 0;
uint8_t getCurrentTemp();
void RunSetup();
void main(uint32_t currentTime);
};
#endif

View File

@@ -6,6 +6,7 @@
int num_beacon = 0;
int num_deauth = 0;
int num_probe = 0;
int num_eapol = 0;
class bluetoothScanAllCallback: public BLEAdvertisedDeviceCallbacks {
@@ -127,6 +128,8 @@ void WiFiScan::StartScan(uint8_t scan_mode, uint16_t color)
StopScan(scan_mode);
else if (scan_mode == WIFI_SCAN_PROBE)
RunProbeScan(scan_mode, color);
else if (scan_mode == WIFI_SCAN_EAPOL)
RunEapolScan(scan_mode, color);
else if (scan_mode == WIFI_SCAN_AP)
RunBeaconScan(scan_mode, color);
else if (scan_mode == WIFI_SCAN_DEAUTH)
@@ -150,7 +153,7 @@ void WiFiScan::StopScan(uint8_t scan_mode)
{
if ((currentScanMode == WIFI_SCAN_PROBE) ||
(currentScanMode == WIFI_SCAN_AP) ||
(currentScanMode == WIFI_SCAN_ST) ||
(currentScanMode == WIFI_SCAN_EAPOL) ||
(currentScanMode == WIFI_SCAN_ALL) ||
(currentScanMode == WIFI_SCAN_DEAUTH) ||
(currentScanMode == WIFI_ATTACK_BEACON_SPAM) ||
@@ -160,7 +163,13 @@ void WiFiScan::StopScan(uint8_t scan_mode)
Serial.println("Ahhh yes...promiscuity will end");
esp_wifi_set_promiscuous(false);
WiFi.mode(WIFI_OFF);
esp_wifi_set_mode(WIFI_MODE_NULL);
esp_wifi_stop();
esp_wifi_deinit();
}
else if ((currentScanMode == BT_SCAN_ALL) ||
(currentScanMode == BT_SCAN_SKIMMERS))
{
@@ -263,22 +272,30 @@ void WiFiScan::RunInfo()
//display_obj.tft.println(" Station MAC: " + sta_mac);
//display_obj.tft.println(" AP MAC: " + ap_mac);
display_obj.tft.println(" Firmware: Marauder");
display_obj.tft.println(" Version: " + display_obj.version_number + "\n");
display_obj.tft.println(" " + free_ram);
display_obj.tft.println(" Firmware: Marauder");
display_obj.tft.println(" Version: " + display_obj.version_number + "\n");
display_obj.tft.println(" " + free_ram);
if (sd_obj.supported) {
display_obj.tft.println(" SD Card: Connected");
display_obj.tft.print("SD Card Size: ");
display_obj.tft.println(" SD Card: Connected");
display_obj.tft.print(" SD Card Size: ");
display_obj.tft.print(sd_obj.card_sz);
display_obj.tft.println("MB");
}
else {
display_obj.tft.println(" SD Card: Not Connected");
display_obj.tft.print("SD Card Size: 0");
}
display_obj.tft.println(" SD Card: Not Connected");
display_obj.tft.println(" SD Card Size: 0");
}
battery_obj.battery_level = battery_obj.getBatteryLevel();
if (battery_obj.i2c_supported) {
display_obj.tft.println(" IP5306 I2C: supported");
display_obj.tft.println(" Battery Lvl: " + (String)battery_obj.battery_level + "%");
}
else
display_obj.tft.println(" IP5306 I2C: not supported");
display_obj.tft.println("Internal temp: " + (String)temp_obj.current_temp + " C");
}
void WiFiScan::RunPacketMonitor(uint8_t scan_mode, uint16_t color)
@@ -287,7 +304,7 @@ void WiFiScan::RunPacketMonitor(uint8_t scan_mode, uint16_t color)
display_obj.tft.setRotation(1);
display_obj.tft.fillScreen(TFT_BLACK);
sd_obj.openCapture();
sd_obj.openCapture("packet_monitor");
#ifdef TFT_SHIELD
uint16_t calData[5] = { 391, 3491, 266, 3505, 7 }; // Landscape TFT Shield
@@ -326,19 +343,65 @@ void WiFiScan::RunPacketMonitor(uint8_t scan_mode, uint16_t color)
uint32_t initTime = millis();
}
void WiFiScan::RunEapolScan(uint8_t scan_mode, uint16_t color)
{
num_eapol = 0;
display_obj.tft.init();
display_obj.tft.setRotation(1);
display_obj.tft.fillScreen(TFT_BLACK);
sd_obj.openCapture("eapol");
#ifdef TFT_SHIELD
uint16_t calData[5] = { 391, 3491, 266, 3505, 7 }; // Landscape TFT Shield
Serial.println("Using TFT Shield");
#else if defined(TFT_DIY)
uint16_t calData[5] = { 213, 3469, 320, 3446, 1 }; // Landscape TFT DIY
Serial.println("Using TFT DIY");
#endif
display_obj.tft.setTouch(calData);
//display_obj.tft.setFreeFont(1);
display_obj.tft.setFreeFont(NULL);
display_obj.tft.setTextSize(1);
display_obj.tft.fillRect(127, 0, 193, 28, TFT_BLACK); // Buttons
display_obj.tft.fillRect(12, 0, 90, 32, TFT_BLACK); // color key
delay(10);
display_obj.tftDrawGraphObjects(x_scale); //draw graph objects
display_obj.tftDrawEapolColorKey();
//display_obj.tftDrawXScaleButtons(x_scale);
//display_obj.tftDrawYScaleButtons(y_scale);
display_obj.tftDrawChannelScaleButtons(set_channel);
display_obj.tftDrawExitScaleButtons();
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
esp_wifi_init(&cfg);
esp_wifi_set_storage(WIFI_STORAGE_RAM);
esp_wifi_set_mode(WIFI_MODE_NULL);
esp_wifi_start();
esp_wifi_set_promiscuous(true);
esp_wifi_set_promiscuous_filter(&filt);
esp_wifi_set_promiscuous_rx_cb(&eapolSnifferCallback);
esp_wifi_set_channel(set_channel, WIFI_SECOND_CHAN_NONE);
initTime = millis();
}
void WiFiScan::RunRickRoll(uint8_t scan_mode, uint16_t color)
{
//Serial.println("Rick Roll...");
display_obj.TOP_FIXED_AREA_2 = 32;
display_obj.TOP_FIXED_AREA_2 = 48;
display_obj.tteBar = true;
display_obj.print_delay_1 = 15;
display_obj.print_delay_2 = 10;
display_obj.clearScreen();
//display_obj.clearScreen();
display_obj.initScrollValues(true);
display_obj.tft.setTextWrap(false);
display_obj.tft.setTextColor(TFT_BLACK, color);
display_obj.tft.fillRect(0,0,240,16, color);
display_obj.tft.drawCentreString(" Rick Roll Beacon ",120,0,2);
display_obj.tft.fillRect(0,16,240,16, color);
display_obj.tft.drawCentreString(" Rick Roll Beacon ",120,16,2);
display_obj.touchToExit();
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
packets_sent = 0;
@@ -357,16 +420,16 @@ void WiFiScan::RunRickRoll(uint8_t scan_mode, uint16_t color)
void WiFiScan::RunBeaconSpam(uint8_t scan_mode, uint16_t color)
{
//Serial.println("Beacon Spam...");
display_obj.TOP_FIXED_AREA_2 = 32;
display_obj.TOP_FIXED_AREA_2 = 48;
display_obj.tteBar = true;
display_obj.print_delay_1 = 15;
display_obj.print_delay_2 = 10;
display_obj.clearScreen();
//display_obj.clearScreen();
display_obj.initScrollValues(true);
display_obj.tft.setTextWrap(false);
display_obj.tft.setTextColor(TFT_BLACK, color);
display_obj.tft.fillRect(0,0,240,16, color);
display_obj.tft.drawCentreString(" Beacon Spam Random ",120,0,2);
display_obj.tft.fillRect(0,16,240,16, color);
display_obj.tft.drawCentreString(" Beacon Spam Random ",120,16,2);
display_obj.touchToExit();
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
packets_sent = 0;
@@ -384,16 +447,18 @@ void WiFiScan::RunBeaconSpam(uint8_t scan_mode, uint16_t color)
// Function to start running a beacon scan
void WiFiScan::RunBeaconScan(uint8_t scan_mode, uint16_t color)
{
display_obj.TOP_FIXED_AREA_2 = 32;
sd_obj.openCapture("beacon");
display_obj.TOP_FIXED_AREA_2 = 48;
display_obj.tteBar = true;
display_obj.print_delay_1 = 15;
display_obj.print_delay_2 = 10;
display_obj.clearScreen();
//display_obj.clearScreen();
display_obj.initScrollValues(true);
display_obj.tft.setTextWrap(false);
display_obj.tft.setTextColor(TFT_WHITE, color);
display_obj.tft.fillRect(0,0,240,16, color);
display_obj.tft.drawCentreString(" Beacon Sniffer ",120,0,2);
display_obj.tft.fillRect(0,16,240,16, color);
display_obj.tft.drawCentreString(" Beacon Sniffer ",120,16,2);
display_obj.touchToExit();
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA);
@@ -411,16 +476,18 @@ void WiFiScan::RunBeaconScan(uint8_t scan_mode, uint16_t color)
void WiFiScan::RunDeauthScan(uint8_t scan_mode, uint16_t color)
{
display_obj.TOP_FIXED_AREA_2 = 32;
sd_obj.openCapture("deauth");
display_obj.TOP_FIXED_AREA_2 = 48;
display_obj.tteBar = true;
display_obj.print_delay_1 = 15;
display_obj.print_delay_2 = 10;
display_obj.clearScreen();
//display_obj.clearScreen();
display_obj.initScrollValues(true);
display_obj.tft.setTextWrap(false);
display_obj.tft.setTextColor(TFT_BLACK, color);
display_obj.tft.fillRect(0,0,240,16, color);
display_obj.tft.drawCentreString(" Deauthentication Sniffer ",120,0,2);
display_obj.tft.fillRect(0,16,240,16, color);
display_obj.tft.drawCentreString(" Deauthentication Sniffer ",120,16,2);
display_obj.touchToExit();
display_obj.tft.setTextColor(TFT_RED, TFT_BLACK);
display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA);
@@ -440,16 +507,18 @@ void WiFiScan::RunDeauthScan(uint8_t scan_mode, uint16_t color)
// Function for running probe request scan
void WiFiScan::RunProbeScan(uint8_t scan_mode, uint16_t color)
{
display_obj.TOP_FIXED_AREA_2 = 32;
sd_obj.openCapture("probe");
display_obj.TOP_FIXED_AREA_2 = 48;
display_obj.tteBar = true;
display_obj.print_delay_1 = 15;
display_obj.print_delay_2 = 10;
display_obj.clearScreen();
//display_obj.clearScreen();
display_obj.initScrollValues(true);
display_obj.tft.setTextWrap(false);
display_obj.tft.setTextColor(TFT_BLACK, color);
display_obj.tft.fillRect(0,0,240,16, color);
display_obj.tft.drawCentreString(" Probe Request Sniffer ",120,0,2);
display_obj.tft.fillRect(0,16,240,16, color);
display_obj.tft.drawCentreString(" Probe Request Sniffer ",120,16,2);
display_obj.touchToExit();
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA);
@@ -492,14 +561,14 @@ void WiFiScan::RunBluetoothScan(uint8_t scan_mode, uint16_t color)
pBLEScan = BLEDevice::getScan(); //create new scan
if (scan_mode == BT_SCAN_ALL)
{
display_obj.TOP_FIXED_AREA_2 = 32;
display_obj.TOP_FIXED_AREA_2 = 48;
display_obj.tteBar = true;
display_obj.clearScreen();
//display_obj.clearScreen();
display_obj.initScrollValues(true);
display_obj.tft.setTextWrap(false);
display_obj.tft.setTextColor(TFT_BLACK, color);
display_obj.tft.fillRect(0,0,240,16, color);
display_obj.tft.drawCentreString(" Bluetooth Sniff ",120,0,2);
display_obj.tft.fillRect(0,16,240,16, color);
display_obj.tft.drawCentreString(" Bluetooth Sniff ",120,16,2);
display_obj.touchToExit();
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA);
@@ -511,13 +580,13 @@ void WiFiScan::RunBluetoothScan(uint8_t scan_mode, uint16_t color)
{
display_obj.TOP_FIXED_AREA_2 = 160;
display_obj.tteBar = true;
display_obj.clearScreen();
//display_obj.clearScreen();
display_obj.tft.fillScreen(TFT_DARKGREY);
display_obj.initScrollValues(true);
display_obj.tft.setTextWrap(false);
display_obj.tft.setTextColor(TFT_BLACK, color);
display_obj.tft.fillRect(0,0,240,16, color);
display_obj.tft.drawCentreString(" Detect Card Skimmers ",120,0,2);
display_obj.tft.fillRect(0,16,240,16, color);
display_obj.tft.drawCentreString(" Detect Card Skimmers ",120,16,2);
display_obj.twoPartDisplay("Scanning for\nBluetooth-enabled skimmers\nHC-03, HC-05, and HC-06...");
display_obj.tft.setTextColor(TFT_BLACK, TFT_DARKGREY);
display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA);
@@ -555,6 +624,7 @@ void WiFiScan::beaconSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type
if (type == WIFI_PKT_MGMT)
{
len -= 4;
int fctl = ntohs(frameControl->fctl);
const wifi_ieee80211_packet_t *ipkt = (wifi_ieee80211_packet_t *)snifferPacket->payload;
const WifiMgmtHdr *hdr = &ipkt->hdr;
@@ -598,6 +668,8 @@ void WiFiScan::beaconSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type
Serial.println();
sd_obj.addPacket(snifferPacket->payload, len);
}
}
}
@@ -613,6 +685,7 @@ void WiFiScan::deauthSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type
if (type == WIFI_PKT_MGMT)
{
len -= 4;
int fctl = ntohs(frameControl->fctl);
const wifi_ieee80211_packet_t *ipkt = (wifi_ieee80211_packet_t *)snifferPacket->payload;
const WifiMgmtHdr *hdr = &ipkt->hdr;
@@ -652,6 +725,8 @@ void WiFiScan::deauthSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type
Serial.println();
sd_obj.addPacket(snifferPacket->payload, len);
}
}
}
@@ -666,6 +741,7 @@ void WiFiScan::probeSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
if (type == WIFI_PKT_MGMT)
{
len -= 4;
int fctl = ntohs(frameControl->fctl);
const wifi_ieee80211_packet_t *ipkt = (wifi_ieee80211_packet_t *)snifferPacket->payload;
const WifiMgmtHdr *hdr = &ipkt->hdr;
@@ -710,6 +786,8 @@ void WiFiScan::probeSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
}
Serial.println();
sd_obj.addPacket(snifferPacket->payload, len);
}
}
}
@@ -859,7 +937,344 @@ void WiFiScan::wifiSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
}
sd_obj.addPacket(snifferPacket->payload, len);
if (( (snifferPacket->payload[30] == 0x88 && snifferPacket->payload[31] == 0x8e)|| ( snifferPacket->payload[32] == 0x88 && snifferPacket->payload[33] == 0x8e) ))
Serial.println("Oh god mgmt EAPOL");
}
if (( (snifferPacket->payload[30] == 0x88 && snifferPacket->payload[31] == 0x8e)|| ( snifferPacket->payload[32] == 0x88 && snifferPacket->payload[33] == 0x8e) )){
Serial.println("EAPOL!!");
//sd_obj.addPacket(snifferPacket->payload, len);
}
}
void WiFiScan::eapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
{
/*
wifi_promiscuous_pkt_t *snifferPacket = (wifi_promiscuous_pkt_t*)buf;
WifiMgmtHdr *frameControl = (WifiMgmtHdr*)snifferPacket->payload;
wifi_pkt_rx_ctrl_t ctrl = (wifi_pkt_rx_ctrl_t)snifferPacket->rx_ctrl;
int len = snifferPacket->rx_ctrl.sig_len;
String display_string = "";
if (type == WIFI_PKT_MGMT)
{
len -= 4;
int fctl = ntohs(frameControl->fctl);
const wifi_ieee80211_packet_t *ipkt = (wifi_ieee80211_packet_t *)snifferPacket->payload;
const WifiMgmtHdr *hdr = &ipkt->hdr;
}
if (( (snifferPacket->payload[30] == 0x88 && snifferPacket->payload[31] == 0x8e)|| ( snifferPacket->payload[32] == 0x88 && snifferPacket->payload[33] == 0x8e) )){
delay(random(0, 10));
Serial.print((String)random(0, 5) + "EAPOL: ");
char srcaddr[] = "00:00:00:00:00:00";
getMAC(srcaddr, snifferPacket->payload, 10);
Serial.print(srcaddr);
display_string.concat(srcaddr);
Serial.print(" -> ");
display_string.concat(" -> ");
char desaddr[] = "00:00:00:00:00:00";
getMAC(desaddr, snifferPacket->payload, 4);
Serial.print(desaddr);
display_string.concat(desaddr);
// Print spaces because of the rotating lines of the hardware scroll.
// The same characters print from previous lines so I just overwrite them
// with spaces.
for (int i = 0; i < 19 - snifferPacket->payload[37]; i++)
{
display_string.concat(" ");
}
if (display_obj.display_buffer->size() == 0)
{
//while (display_obj.printing)
// delay(1);
display_obj.loading = true;
display_obj.display_buffer->add(display_string);
display_obj.loading = false;
}
Serial.println();
sd_obj.addPacket(snifferPacket->payload, len);
}
*/
wifi_promiscuous_pkt_t *snifferPacket = (wifi_promiscuous_pkt_t*)buf;
WifiMgmtHdr *frameControl = (WifiMgmtHdr*)snifferPacket->payload;
wifi_pkt_rx_ctrl_t ctrl = (wifi_pkt_rx_ctrl_t)snifferPacket->rx_ctrl;
int len = snifferPacket->rx_ctrl.sig_len;
if (len == 173) {
Serial.println("Maybe the PMKID");
//sd_obj.addPacket(snifferPacket->payload, len);
}
if (type == WIFI_PKT_MGMT)
{
len -= 4;
int fctl = ntohs(frameControl->fctl);
const wifi_ieee80211_packet_t *ipkt = (wifi_ieee80211_packet_t *)snifferPacket->payload;
const WifiMgmtHdr *hdr = &ipkt->hdr;
// If we dont the buffer size is not 0, don't write or else we get CORRUPT_HEAP
/*
if (snifferPacket->payload[0] == 0x80)
{
num_beacon++;
}
else if ((snifferPacket->payload[0] == 0xA0 || snifferPacket->payload[0] == 0xC0 ))
{
num_deauth++;
}
else if (snifferPacket->payload[0] == 0x40)
{
num_probe++;
}
*/
//sd_obj.addPacket(snifferPacket->payload, len);
if (( (snifferPacket->payload[30] == 0x88 && snifferPacket->payload[31] == 0x8e)|| ( snifferPacket->payload[32] == 0x88 && snifferPacket->payload[33] == 0x8e) ))
Serial.println("Oh god mgmt EAPOL");
}
if (( (snifferPacket->payload[30] == 0x88 && snifferPacket->payload[31] == 0x8e)|| ( snifferPacket->payload[32] == 0x88 && snifferPacket->payload[33] == 0x8e) )){
Serial.println("EAPOL!!");
//sd_obj.addPacket(snifferPacket->payload, len);
num_eapol++;
}
sd_obj.addPacket(snifferPacket->payload, len);
}
void WiFiScan::eapolMonitorMain(uint32_t currentTime)
{
//---------MAIN 'FOR' LOOP! THIS IS WHERE ALL THE ACTION HAPPENS! HAS TO BE FAST!!!!!---------\\
// for (x_pos = (11 + x_scale); x_pos <= 320; x_pos += x_scale) //go along every point on the x axis and do something, start over when finished
for (x_pos = (11 + x_scale); x_pos <= 320; x_pos = x_pos)
{
currentTime = millis();
do_break = false;
y_pos_x = 0;
y_pos_y = 0;
y_pos_z = 0;
boolean pressed = false;
uint16_t t_x = 0, t_y = 0; // To store the touch coordinates
// Do the touch stuff
pressed = display_obj.tft.getTouch(&t_x, &t_y);
if (pressed) {
Serial.print("Got touch | X: ");
Serial.print(t_x);
Serial.print(" Y: ");
Serial.println(t_y);
}
// Check buttons for presses
for (uint8_t b = 0; b < BUTTON_ARRAY_LEN; b++)
{
if (pressed && display_obj.key[b].contains(t_x, t_y))
{
display_obj.key[b].press(true);
} else {
display_obj.key[b].press(false);
}
}
// Which buttons pressed
for (uint8_t b = 0; b < BUTTON_ARRAY_LEN; b++)
{
if (display_obj.key[b].justPressed())
{
Serial.println("Bro, key pressed");
//do_break = true;
}
if (display_obj.key[b].justReleased())
{
do_break = true;
/*
// X - button pressed
if (b == 0) {
if (x_scale > 1) {
x_scale--;
delay(70);
display_obj.tft.fillRect(127, 0, 193, 28, TFT_BLACK);
display_obj.tftDrawXScaleButtons(x_scale);
display_obj.tftDrawYScaleButtons(y_scale);
display_obj.tftDrawChannelScaleButtons(set_channel);
display_obj.tftDrawExitScaleButtons();
break;
}
}
// X + button pressed
else if (b == 1) {
if (x_scale < 6) {
x_scale++;
delay(70);
display_obj.tft.fillRect(127, 0, 193, 28, TFT_BLACK);
display_obj.tftDrawXScaleButtons(x_scale);
display_obj.tftDrawYScaleButtons(y_scale);
display_obj.tftDrawChannelScaleButtons(set_channel);
display_obj.tftDrawExitScaleButtons();
break;
}
}
// Y - button pressed
else if (b == 2) {
if (y_scale > 1) {
y_scale--;
delay(70);
display_obj.tft.fillRect(127, 0, 193, 28, TFT_BLACK);
display_obj.tftDrawXScaleButtons(x_scale);
display_obj.tftDrawYScaleButtons(y_scale);
display_obj.tftDrawChannelScaleButtons(set_channel);
display_obj.tftDrawExitScaleButtons();
//updateMidway();
break;
}
}
// Y + button pressed
else if (b == 3) {
if (y_scale < 9) {
y_scale++;
delay(70);
display_obj.tft.fillRect(127, 0, 193, 28, TFT_BLACK);
display_obj.tftDrawXScaleButtons(x_scale);
display_obj.tftDrawYScaleButtons(y_scale);
display_obj.tftDrawChannelScaleButtons(set_channel);
display_obj.tftDrawExitScaleButtons();
//updateMidway();
break;
}
}*/
// Channel - button pressed
//else if (b == 4) {
if (b == 4) {
if (set_channel > 1) {
Serial.println("Shit channel down");
set_channel--;
delay(70);
display_obj.tft.fillRect(127, 0, 193, 28, TFT_BLACK);
//display_obj.tftDrawXScaleButtons(x_scale);
//display_obj.tftDrawYScaleButtons(y_scale);
display_obj.tftDrawChannelScaleButtons(set_channel);
display_obj.tftDrawExitScaleButtons();
changeChannel();
break;
}
}
// Channel + button pressed
else if (b == 5) {
if (set_channel < MAX_CHANNEL) {
Serial.println("Shit channel up");
set_channel++;
delay(70);
display_obj.tft.fillRect(127, 0, 193, 28, TFT_BLACK);
//display_obj.tftDrawXScaleButtons(x_scale);
//display_obj.tftDrawYScaleButtons(y_scale);
display_obj.tftDrawChannelScaleButtons(set_channel);
display_obj.tftDrawExitScaleButtons();
changeChannel();
break;
}
}
else if (b == 6) {
Serial.println("Exiting packet monitor...");
this->StartScan(WIFI_SCAN_OFF);
//display_obj.tft.init();
this->orient_display = true;
return;
}
}
}
if (currentTime - initTime >= (GRAPH_REFRESH * 5)) {
//Serial.println("-----------------------------------------");
//Serial.println("Time elapsed: " + (String)(currentTime - initTime) + "ms");
x_pos += x_scale;
initTime = millis();
y_pos_x = ((-num_eapol * (y_scale * 3)) + (HEIGHT_1 - 2)); // GREEN
if (y_pos_x >= HEIGHT_1) {
Serial.println("Max EAPOL number reached. Adjusting...");
num_eapol = 0;
}
//y_pos_y = ((-num_deauth * (y_scale * 3)) + (HEIGHT_1 - 2)); // RED
//y_pos_z = ((-num_probe * (y_scale * 3)) + (HEIGHT_1 - 2)); // BLUE
//Serial.println("num_beacon: " + (String)num_beacon);
//Serial.println("num_deauth: " + (String)num_deauth);
//Serial.println(" num_probe: " + (String)num_probe);
//num_beacon = 0;
//num_probe = 0;
//num_deauth = 0;
//CODE FOR PLOTTING CONTINUOUS LINES!!!!!!!!!!!!
//Plot "X" value
display_obj.tft.drawLine(x_pos - x_scale, y_pos_x_old, x_pos, y_pos_x, TFT_CYAN);
//Plot "Z" value
//display_obj.tft.drawLine(x_pos - x_scale, y_pos_z_old, x_pos, y_pos_z, TFT_BLUE);
//Plot "Y" value
//display_obj.tft.drawLine(x_pos - x_scale, y_pos_y_old, x_pos, y_pos_y, TFT_RED);
//Draw preceding black 'boxes' to erase old plot lines, !!!WEIRD CODE TO COMPENSATE FOR BUTTONS AND COLOR KEY SO 'ERASER' DOESN'T ERASE BUTTONS AND COLOR KEY!!!
//if ((x_pos <= 90) || ((x_pos >= 198) && (x_pos <= 320))) //above x axis
if ((x_pos <= 90) || ((x_pos >= 117) && (x_pos <= 320))) //above x axis
{
display_obj.tft.fillRect(x_pos+1, 28, 10, 93, TFT_BLACK); //compensate for buttons!
}
else
{
display_obj.tft.fillRect(x_pos+1, 0, 10, 121, TFT_BLACK); //don't compensate for buttons!
}
//if ((x_pos >= 254) && (x_pos <= 320)) //below x axis
//if (x_pos <= 90)
if (x_pos < 0) // below x axis
{
//tft.fillRect(x_pos+1, 121, 10, 88, TFT_BLACK);
display_obj.tft.fillRect(x_pos+1, 121, 10, 88, TFT_CYAN);
}
else
{
//tft.fillRect(x_pos+1, 121, 10, 119, TFT_BLACK);
display_obj.tft.fillRect(x_pos+1, 121, 10, 118, TFT_BLACK);
}
//tftDisplayTime();
if ( (y_pos_x == 120) || (y_pos_y == 120) || (y_pos_z == 120) )
{
display_obj.tft.drawFastHLine(10, 120, 310, TFT_WHITE); // x axis
}
y_pos_x_old = y_pos_x; //set old y pos values to current y pos values
//y_pos_y_old = y_pos_y;
//y_pos_z_old = y_pos_z;
//delay(50);
}
sd_obj.main();
}
display_obj.tft.fillRect(127, 0, 193, 28, TFT_BLACK); //erase XY buttons and any lines behind them
//tft.fillRect(56, 0, 66, 32, TFT_ORANGE); //erase time and color key and any stray lines behind them
display_obj.tft.fillRect(12, 0, 90, 32, TFT_BLACK); // key
//display_obj.tftDrawXScaleButtons(x_scale); //redraw stuff
//display_obj.tftDrawYScaleButtons(y_scale);
display_obj.tftDrawChannelScaleButtons(set_channel);
display_obj.tftDrawExitScaleButtons();
display_obj.tftDrawEapolColorKey();
display_obj.tftDrawGraphObjects(x_scale);
}
void WiFiScan::packetMonitorMain(uint32_t currentTime)
@@ -1121,7 +1536,6 @@ void WiFiScan::main(uint32_t currentTime)
// WiFi operations
if ((currentScanMode == WIFI_SCAN_PROBE) ||
(currentScanMode == WIFI_SCAN_AP) ||
(currentScanMode == WIFI_SCAN_ST) ||
(currentScanMode == WIFI_SCAN_DEAUTH) ||
(currentScanMode == WIFI_SCAN_ALL))
{
@@ -1135,6 +1549,10 @@ void WiFiScan::main(uint32_t currentTime)
{
packetMonitorMain(currentTime);
}
else if (currentScanMode == WIFI_SCAN_EAPOL)
{
eapolMonitorMain(currentTime);
}
else if ((currentScanMode == WIFI_ATTACK_BEACON_SPAM))
{
// Need this for loop because getTouch causes ~10ms delay
@@ -1153,6 +1571,7 @@ void WiFiScan::main(uint32_t currentTime)
displayString.concat(packets_sent);
for (int x = 0; x < STANDARD_FONT_CHAR_LIMIT; x++)
displayString2.concat(" ");
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
display_obj.showCenterText(displayString2, 160);
display_obj.showCenterText(displayString, 160);
packets_sent = 0;
@@ -1181,6 +1600,7 @@ void WiFiScan::main(uint32_t currentTime)
displayString.concat(packets_sent);
for (int x = 0; x < STANDARD_FONT_CHAR_LIMIT; x++)
displayString2.concat(" ");
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
display_obj.showCenterText(displayString2, 160);
display_obj.showCenterText(displayString, 160);
packets_sent = 0;

View File

@@ -14,6 +14,8 @@
#include "Display.h"
#include "SDInterface.h"
#include "Buffer.h"
#include "BatteryInterface.h"
#include "TemperatureInterface.h"
//#include "MenuFunctions.h"
#define bad_list_length 3
@@ -23,7 +25,7 @@
#define WIFI_SCAN_OFF 0
#define WIFI_SCAN_PROBE 1
#define WIFI_SCAN_AP 2
#define WIFI_SCAN_ST 3
#define WIFI_SCAN_EAPOL 3
#define WIFI_SCAN_DEAUTH 4
#define WIFI_SCAN_ALL 5
#define WIFI_PACKET_MONITOR 6
@@ -32,13 +34,15 @@
#define BT_SCAN_ALL 9
#define BT_SCAN_SKIMMERS 10
#define GRAPH_REFRESH 50
#define GRAPH_REFRESH 100
#define MAX_CHANNEL 14
extern Display display_obj;
extern SDInterface sd_obj;
extern Buffer buffer_obj;
extern BatteryInterface battery_obj;
extern TemperatureInterface temp_obj;
esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len, bool en_sys_seq);
@@ -115,6 +119,7 @@ class WiFiScan
};
void packetMonitorMain(uint32_t currentTime);
void eapolMonitorMain(uint32_t currentTime);
void changeChannel();
void updateMidway();
void tftDrawXScalButtons();
@@ -128,6 +133,7 @@ class WiFiScan
void RunBeaconSpam(uint8_t scan_mode, uint16_t color);
void RunBeaconScan(uint8_t scan_mode, uint16_t color);
void RunDeauthScan(uint8_t scan_mode, uint16_t color);
void RunEapolScan(uint8_t scan_mode, uint16_t color);
void RunProbeScan(uint8_t scan_mode, uint16_t color);
void RunPacketMonitor(uint8_t scan_mode, uint16_t color);
void RunBluetoothScan(uint8_t scan_mode, uint16_t color);
@@ -154,6 +160,7 @@ class WiFiScan
static void beaconSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
static void deauthSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
static void probeSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
static void eapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
static void wifiSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
};
#endif

View File

@@ -23,14 +23,33 @@ https://www.online-utility.org/image/convert/to/XBM
#include "SDInterface.h"
#include "Web.h"
#include "Buffer.h"
#include "BatteryInterface.h"
#include "TemperatureInterface.h"
#include "LedInterface.h"
//#include "icons.h"
/*
#ifdef __cplusplus
extern "C" {
#endif
uint8_t temprature_sens_read();
#ifdef __cplusplus
}
#endif
uint8_t temprature_sens_read();
*/
Display display_obj;
WiFiScan wifi_scan_obj;
MenuFunctions menu_function_obj;
SDInterface sd_obj;
Web web_obj;
Buffer buffer_obj;
BatteryInterface battery_obj;
TemperatureInterface temp_obj;
LedInterface led_obj;
Adafruit_NeoPixel strip = Adafruit_NeoPixel(Pixels, PIN, NEO_GRB + NEO_KHZ800);
uint32_t currentTime = 0;
@@ -44,6 +63,8 @@ void setup()
// Preset SPI CS pins to avoid bus conflicts
digitalWrite(TFT_CS, HIGH);
digitalWrite(SD_CS, HIGH);
Serial.begin(115200);
Serial.begin(115200);
Serial.println("\n\n--------------------------------\n");
@@ -52,6 +73,11 @@ void setup()
Serial.println(" By: justcallmekoko\n");
Serial.println("--------------------------------\n\n");
//Serial.println("Internal Temp: " + (String)((temprature_sens_read() - 32) / 1.8));
// Do some LED stuff
led_obj.RunSetup();
// Do some SD stuff
if(sd_obj.initSD())
Serial.println("SD Card supported");
@@ -63,12 +89,27 @@ void setup()
// Build menus
menu_function_obj.RunSetup();
// Battery stuff
battery_obj.RunSetup();
// Temperature stuff
temp_obj.RunSetup();
battery_obj.battery_level = battery_obj.getBatteryLevel();
if (battery_obj.i2c_supported) {
Serial.println("IP5306 I2C Supported: true");
}
else
Serial.println("IP5306 I2C Supported: false");
Serial.println(wifi_scan_obj.freeRAM());
}
void loop()
{
// get the current time
//if ((wifi_scan_obj.currentScanMode != WIFI_ATTACK_BEACON_SPAM))
currentTime = millis();
@@ -81,9 +122,13 @@ void loop()
display_obj.main();
wifi_scan_obj.main(currentTime);
sd_obj.main();
battery_obj.main(currentTime);
temp_obj.main(currentTime);
//led_obj.main(currentTime);
//if ((wifi_scan_obj.currentScanMode != WIFI_ATTACK_BEACON_SPAM))
if (wifi_scan_obj.currentScanMode != WIFI_PACKET_MONITOR)
menu_function_obj.main();
if ((wifi_scan_obj.currentScanMode != WIFI_PACKET_MONITOR) &&
(wifi_scan_obj.currentScanMode != WIFI_SCAN_EAPOL))
menu_function_obj.main(currentTime);
if (wifi_scan_obj.currentScanMode == OTA_UPDATE)
web_obj.main();
delay(1);

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
pictures/icons/eapol_22.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
pictures/icons/sd_16.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,6 @@
#define 1589480361777_width 16
#define 1589480361777_height 16
static char 1589480361777_bits[] = {
0xFF, 0xFF, 0x3F, 0xFC, 0x9F, 0xF9, 0xDF, 0xFB, 0xDF, 0xFB, 0x1F, 0xF8,
0x1F, 0xF8, 0x1F, 0xF8, 0x1F, 0xF8, 0x1F, 0xF8, 0x1F, 0xF8, 0x1F, 0xF8,
0x1F, 0xF8, 0x1F, 0xF8, 0x1F, 0xF8, 0xFF, 0xFF, };

View File

@@ -0,0 +1,9 @@
#define 1584799606553_width 22
#define 1584799606553_height 22
static char 1584799606553_bits[] = {
0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3B, 0xFF, 0xFF, 0x39,
0xFF, 0xFF, 0x3C, 0xFF, 0x7F, 0x3A, 0xFF, 0x3F, 0x37, 0xFF, 0x9F, 0x3E,
0xFF, 0xCF, 0x3D, 0xFF, 0xE7, 0x3F, 0xFF, 0xF3, 0x3F, 0xCF, 0xF9, 0x3F,
0xB7, 0xFC, 0x3F, 0x77, 0xFE, 0x3F, 0xF7, 0xFE, 0x3F, 0xEF, 0xFD, 0x3F,
0xDF, 0xFB, 0x3F, 0xBF, 0xFB, 0x3F, 0x7F, 0xFC, 0x3F, 0xFF, 0xFF, 0x3F,
0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F, };

6
pictures/xbm/sd_16.XBM Normal file
View File

@@ -0,0 +1,6 @@
#define 1589480446253_width 16
#define 1589480446253_height 16
static char 1589480446253_bits[] = {
0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0x07, 0xF8, 0x07, 0xF0, 0x07, 0xE0,
0x67, 0xE7, 0x97, 0xE9, 0x17, 0xE9, 0x67, 0xE9, 0x87, 0xE9, 0x97, 0xE9,
0x67, 0xE7, 0x07, 0xE0, 0x07, 0xE0, 0xFF, 0xFF, };