Compare commits

...

6 Commits

Author SHA1 Message Date
Just Call Me Koko
a2eab76caa New release 2020-01-28 20:30:24 -05:00
Just Call Me Koko
0a4bb9c2b8 Added packet monitor 2020-01-24 23:11:45 -05:00
Just Call Me Koko
7edc57f92d Scrolling Text 2020-01-22 18:03:31 -05:00
Just Call Me Koko
e3d2086863 Update README.md 2020-01-21 10:29:42 -05:00
Just Call Me Koko
22dc0ff396 Scrolling text 2020-01-19 12:25:49 -05:00
Just Call Me Koko
7b2b1b2fe9 Created deauth sniff 2020-01-17 17:37:25 -05:00
11 changed files with 679 additions and 39 deletions

View File

@@ -1,4 +1,4 @@
# ESP32 Marauder
# ESP32 Marauder v0.3.0
<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>
@@ -13,7 +13,7 @@
- [Do It Yourself](#do-it-yourself)
- [Hardware](#hardware)
- [Flashing Firmware](#flashing-firmware)
- [Setting Up Arduino IDE](#setting-up-arduino-ide)
- [Using Arduino IDE](#setting-up-arduino-ide)
- [Under Development](#under-development)
- [Special Thanks](#special-thanks)
- [For Sale Soon](#for-sale-soon)
@@ -49,7 +49,7 @@ This project requires the following hardware in order to work:
- 2.8" TFT Touch Screen w/ ili9341
## Flashing Firmware
### Setting Up Arduino IDE
### Using Arduino IDE
1. Install the [Arduino IDE](https://www.arduino.cc/en/main/software)
2. In the Arduino IDE, go to `File`>`Preferences`
3. Add the following URL to `Additional Boards Manager URLs:`

View File

@@ -52,6 +52,137 @@ void Display::RunSetup()
delay(5000);
}
void Display::tftDrawGraphObjects(byte x_scale)
{
//draw the graph objects
tft.fillRect(11, 5, x_scale+1, 120, TFT_BLACK); // positive start point
tft.fillRect(11, 121, x_scale+1, 119, TFT_BLACK); // negative start point
tft.drawFastVLine(10, 5, 230, TFT_WHITE); // y axis
tft.drawFastHLine(10, HEIGHT_1 - 1, 310, TFT_WHITE); // x axis
tft.setTextColor(TFT_YELLOW); tft.setTextSize(1); // set parameters for y axis labels
//tft.setCursor(3, 116); tft.print(midway); // "0" at center of ya axis
tft.setCursor(3, 6); tft.print("+"); // "+' at top of y axis
tft.setCursor(3, 228); tft.print("0"); // "-" at bottom of y axis
}
void Display::tftDrawColorKey()
{
//Display color key
tft.setTextSize(1); tft.setTextColor(TFT_WHITE);
tft.fillRect(14, 0, 15, 8, TFT_GREEN); tft.setCursor(30, 0); tft.print(" - Beacons");
tft.fillRect(14, 8, 15, 8, TFT_RED); tft.setCursor(30, 8); tft.print(" - Deauths");
tft.fillRect(14, 16, 15, 8, TFT_BLUE); tft.setCursor(30, 16); tft.print(" - Probes");
}
void Display::tftDrawXScaleButtons(byte x_scale)
{
tft.drawFastVLine(234, 0, 20, TFT_WHITE);
tft.setCursor(208, 21); tft.setTextColor(TFT_WHITE); tft.setTextSize(1); tft.print("X Scale:"); tft.print(x_scale);
key[0].initButton(&tft, // x - box
220,
10, // x, y, w, h, outline, fill, text
20,
20,
TFT_BLACK, // Outline
TFT_CYAN, // Fill
TFT_BLACK, // Text
"-",
2);
key[1].initButton(&tft, // x + box
249,
10, // x, y, w, h, outline, fill, text
20,
20,
TFT_BLACK, // Outline
TFT_CYAN, // Fill
TFT_BLACK, // Text
"+",
2);
key[0].drawButton();
key[1].drawButton();
}
void Display::tftDrawYScaleButtons(byte y_scale)
{
tft.drawFastVLine(290, 0, 20, TFT_WHITE);
tft.setCursor(265, 21); tft.setTextColor(TFT_WHITE); tft.setTextSize(1); tft.print("Y Scale:"); tft.print(y_scale);
key[2].initButton(&tft, // y - box
276,
10, // x, y, w, h, outline, fill, text
20,
20,
TFT_BLACK, // Outline
TFT_MAGENTA, // Fill
TFT_BLACK, // Text
"-",
2);
key[3].initButton(&tft, // y + box
305,
10, // x, y, w, h, outline, fill, text
20,
20,
TFT_BLACK, // Outline
TFT_MAGENTA, // Fill
TFT_BLACK, // Text
"+",
2);
key[2].drawButton();
key[3].drawButton();
}
void Display::tftDrawChannelScaleButtons(int set_channel)
{
tft.drawFastVLine(178, 0, 20, TFT_WHITE);
tft.setCursor(145, 21); tft.setTextColor(TFT_WHITE); tft.setTextSize(1); tft.print("Channel:"); tft.print(set_channel);
key[4].initButton(&tft, // channel - box
164,
10, // x, y, w, h, outline, fill, text
20,
20,
TFT_BLACK, // Outline
TFT_BLUE, // Fill
TFT_BLACK, // Text
"-",
2);
key[5].initButton(&tft, // channel + box
193,
10, // x, y, w, h, outline, fill, text
20,
20,
TFT_BLACK, // Outline
TFT_BLUE, // Fill
TFT_BLACK, // Text
"+",
2);
key[4].drawButton();
key[5].drawButton();
}
void Display::tftDrawExitScaleButtons()
{
//tft.drawFastVLine(178, 0, 20, TFT_WHITE);
//tft.setCursor(145, 21); tft.setTextColor(TFT_WHITE); tft.setTextSize(1); tft.print("Channel:"); tft.print(set_channel);
key[6].initButton(&tft, // Exit box
137,
10, // x, y, w, h, outline, fill, text
20,
20,
TFT_ORANGE, // Outline
TFT_RED, // Fill
TFT_BLACK, // Text
"X",
2);
key[6].drawButton();
}
void Display::twoPartDisplay(String center_text)
{
tft.setTextColor(TFT_BLACK, TFT_YELLOW);
@@ -474,8 +605,55 @@ void Display::listDir(fs::FS &fs, const char * dirname, uint8_t levels) {
}
#endif
void Display::main()
void Display::updateBanner(String msg)
{
this->img.deleteSprite();
this->img.setColorDepth(8);
this->img.createSprite(SCREEN_WIDTH, TEXT_HEIGHT);
this->buildBanner(msg, current_banner_pos);
this->img.pushSprite(0, 0);
current_banner_pos--;
if (current_banner_pos <= 0)
current_banner_pos = SCREEN_WIDTH;
}
void Display::buildBanner(String msg, int xpos)
{
int h = TEXT_HEIGHT;
// We could just use fillSprite(color) but lets be a bit more creative...
// Fill with rainbow stripes
//while (h--) img.drawFastHLine(0, h, SCREEN_WIDTH, 255);
// Draw some graphics, the text will apear to scroll over these
//img.fillRect (SCREEN_WIDTH / 2 - 20, TEXT_HEIGHT / 2 - 10, 40, 20, TFT_YELLOW);
//img.fillCircle(SCREEN_WIDTH / 2, TEXT_HEIGHT / 2, 10, TFT_ORANGE);
// Now print text on top of the graphics
img.setTextSize(2); // Font size scaling is x1
img.setTextFont(0); // Font 4 selected
img.setTextColor(TFT_WHITE); // Black text, no background colour
img.setTextWrap(false); // Turn of wrap so we can print past end of sprite
// Need to print twice so text appears to wrap around at left and right edges
img.setCursor(xpos, 2); // Print text at xpos
img.print(msg);
img.setCursor(xpos - SCREEN_WIDTH, 2); // Print text at xpos - sprite width
img.print(msg);
}
void Display::main()
{
return;
}
// End SPIFFS_functions

View File

@@ -14,6 +14,8 @@
#define SCREEN_WIDTH 240
#define SCREEN_HEIGHT 320
#define HEIGHT_1 240
#define WIDTH_1 320
#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)
@@ -25,6 +27,7 @@
//#define MENU_FONT &FreeMonoBold9pt7b
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_ARRAY_LEN 7
class Display
@@ -47,7 +50,9 @@ class Display
public:
Display();
TFT_eSPI tft = TFT_eSPI();
String version_number = "v0.1";
TFT_eSprite img = TFT_eSprite(&tft);
TFT_eSPI_Button key[BUTTON_ARRAY_LEN];
String version_number = "v0.3.0";
bool printing = false;
bool loading = false;
@@ -56,6 +61,7 @@ class Display
int TOP_FIXED_AREA_2 = 32;
int print_delay_1, print_delay_2 = 10;
int current_banner_pos = SCREEN_WIDTH;
//Menu* current_menu;
@@ -80,7 +86,14 @@ class Display
// for a full width line, meanwhile the serial buffer may be filling... and overflowing
// We can speed up scrolling of short text lines by just blanking the character we drew
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 tftDrawColorKey();
void tftDrawXScaleButtons(byte x_scale);
void tftDrawYScaleButtons(byte y_scale);
void tftDrawChannelScaleButtons(int set_channel);
void tftDrawExitScaleButtons();
void buildBanner(String msg, int xpos);
void clearScreen();
void displayBuffer(bool do_clear = false);
void drawJpeg(const char *filename, int xpos, int ypos);
@@ -99,5 +112,6 @@ class Display
void showCenterText(String text, int y);
void touchToExit();
void twoPartDisplay(String center_text);
void updateBanner(String msg);
};
#endif

View File

@@ -8,6 +8,16 @@ MenuFunctions::MenuFunctions()
// Function to check menu input
void MenuFunctions::main()
{
if (wifi_scan_obj.currentScanMode == WIFI_SCAN_OFF) {
if (wifi_scan_obj.orient_display) {
this->orientDisplay();
wifi_scan_obj.orient_display = false;
}
display_obj.updateBanner(current_menu->name);
}
//this->displayCurrentMenu();
boolean pressed = false;
// This is code from bodmer's keypad example
uint16_t t_x = 0, t_y = 0; // To store the touch coordinates
@@ -40,6 +50,7 @@ void MenuFunctions::main()
(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) ||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_RICK_ROLL) ||
(wifi_scan_obj.currentScanMode == BT_SCAN_ALL) ||
@@ -68,24 +79,24 @@ void MenuFunctions::main()
{
// Need this to set all keys to false
for (uint8_t b = 0; b < BUTTON_ARRAY_LEN; b++) {
if (pressed && key[b].contains(t_x, t_y)) {
key[b].press(true); // tell the button it is pressed
if (pressed && display_obj.key[b].contains(t_x, t_y)) {
display_obj.key[b].press(true); // tell the button it is pressed
} else {
key[b].press(false); // tell the button it is NOT pressed
display_obj.key[b].press(false); // tell the button it is NOT pressed
}
}
// Check if any key has changed state
for (uint8_t b = 0; b < current_menu->list->size(); b++) {
display_obj.tft.setFreeFont(MENU_FONT);
if (key[b].justPressed()) {
key[b].drawButton2(current_menu->list->get(b).name, true); // draw invert
if (display_obj.key[b].justPressed()) {
display_obj.key[b].drawButton2(current_menu->list->get(b).name, true); // draw invert
}
// If button was just release, execute the button's function
if (key[b].justReleased())
if (display_obj.key[b].justReleased())
{
key[b].drawButton2(current_menu->list->get(b).name); // draw normal
display_obj.key[b].drawButton2(current_menu->list->get(b).name); // draw normal
current_menu->list->get(b).callable();
}
display_obj.tft.setFreeFont(NULL);
@@ -95,6 +106,23 @@ void MenuFunctions::main()
y = -1;
}
void MenuFunctions::orientDisplay()
{
display_obj.tft.init();
display_obj.tft.setRotation(0); // Portrait
display_obj.tft.setCursor(0, 0);
uint16_t calData[5] = { 275, 3494, 361, 3528, 4 }; // tft.setRotation(0); // Portrait
display_obj.tft.setTouch(calData);
//display_obj.clearScreen();
changeMenu(current_menu);
}
// Function to build the menus
void MenuFunctions::RunSetup()
@@ -136,45 +164,47 @@ void MenuFunctions::RunSetup()
// Build WiFi Menu
wifiMenu.parentMenu = &mainMenu; // Main Menu is second menu parent
addNodes(&wifiMenu, "Back", TFT_RED, NULL, 0, [this](){changeMenu(wifiMenu.parentMenu);});
addNodes(&wifiMenu, "Sniffers", TFT_LIGHTGREY, NULL, 1, [this](){changeMenu(&wifiSnifferMenu);});
addNodes(&wifiMenu, "Scanners", TFT_YELLOW, NULL, 1, [this](){changeMenu(&wifiScannerMenu);});
addNodes(&wifiMenu, "Attacks", TFT_ORANGE, NULL, 1, [this](){changeMenu(&wifiAttackMenu);});
addNodes(&wifiMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(wifiMenu.parentMenu);});
addNodes(&wifiMenu, "Sniffers", TFT_YELLOW, NULL, 1, [this](){changeMenu(&wifiSnifferMenu);});
addNodes(&wifiMenu, "Scanners", TFT_ORANGE, NULL, 1, [this](){changeMenu(&wifiScannerMenu);});
addNodes(&wifiMenu, "Attacks", TFT_RED, NULL, 1, [this](){changeMenu(&wifiAttackMenu);});
// Build WiFi sniffer Menu
wifiSnifferMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
addNodes(&wifiSnifferMenu, "Back", TFT_RED, NULL, 0, [this](){changeMenu(wifiSnifferMenu.parentMenu);});
addNodes(&wifiSnifferMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(wifiSnifferMenu.parentMenu);});
addNodes(&wifiSnifferMenu, "Probe Request Sniff", TFT_CYAN, NULL, 2, [this](){wifi_scan_obj.StartScan(WIFI_SCAN_PROBE, TFT_CYAN);});
addNodes(&wifiSnifferMenu, "Beacon Sniff", TFT_MAGENTA, NULL, 3, [this](){wifi_scan_obj.StartScan(WIFI_SCAN_AP, TFT_MAGENTA);});
addNodes(&wifiSnifferMenu, "Deauth Sniff", TFT_RED, NULL, 4, [this](){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_RED, NULL, 0, [this](){changeMenu(wifiScannerMenu.parentMenu);});
addNodes(&wifiScannerMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(wifiScannerMenu.parentMenu);});
addNodes(&wifiScannerMenu, "Packet Monitor", TFT_BLUE, NULL, 1, [this](){wifi_scan_obj.StartScan(WIFI_PACKET_MONITOR, TFT_BLUE);});
// Build WiFi attack menu
wifiAttackMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
addNodes(&wifiAttackMenu, "Back", TFT_RED, NULL, 0, [this](){changeMenu(wifiAttackMenu.parentMenu);});
addNodes(&wifiAttackMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(wifiAttackMenu.parentMenu);});
addNodes(&wifiAttackMenu, "Beacon Spam Random", TFT_ORANGE, NULL, 1, [this](){wifi_scan_obj.StartScan(WIFI_ATTACK_BEACON_SPAM, TFT_ORANGE);});
addNodes(&wifiAttackMenu, "Rick Roll Beacon", TFT_YELLOW, NULL, 1, [this](){wifi_scan_obj.StartScan(WIFI_ATTACK_RICK_ROLL, TFT_YELLOW);});
// Build Bluetooth Menu
bluetoothMenu.parentMenu = &mainMenu; // Second Menu is third menu parent
addNodes(&bluetoothMenu, "Back", TFT_RED, NULL, 0, [this](){changeMenu(bluetoothMenu.parentMenu);});
addNodes(&bluetoothMenu, "Sniffers", TFT_LIGHTGREY, NULL, 1, [this](){changeMenu(&bluetoothSnifferMenu);});
addNodes(&bluetoothMenu, "Scanners", TFT_YELLOW, NULL, 1, [this](){changeMenu(&bluetoothScannerMenu);});
addNodes(&bluetoothMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(bluetoothMenu.parentMenu);});
addNodes(&bluetoothMenu, "Sniffers", TFT_YELLOW, NULL, 1, [this](){changeMenu(&bluetoothSnifferMenu);});
addNodes(&bluetoothMenu, "Scanners", TFT_ORANGE, NULL, 1, [this](){changeMenu(&bluetoothScannerMenu);});
// Build bluetooth sniffer Menu
bluetoothSnifferMenu.parentMenu = &bluetoothMenu; // Second Menu is third menu parent
addNodes(&bluetoothSnifferMenu, "Back", TFT_RED, NULL, 0, [this](){changeMenu(bluetoothSnifferMenu.parentMenu);});
addNodes(&bluetoothSnifferMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(bluetoothSnifferMenu.parentMenu);});
addNodes(&bluetoothSnifferMenu, "Bluetooth Sniffer", TFT_GREEN, NULL, 1, [this](){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_RED, NULL, 0, [this](){changeMenu(bluetoothScannerMenu.parentMenu);});
addNodes(&bluetoothScannerMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(bluetoothScannerMenu.parentMenu);});
addNodes(&bluetoothScannerMenu, "Detect Card Skimmers", TFT_MAGENTA, NULL, 2, [this](){wifi_scan_obj.StartScan(BT_SCAN_SKIMMERS, TFT_MAGENTA);});
generalMenu.parentMenu = &mainMenu;
addNodes(&generalMenu, "Back", TFT_RED, NULL, 0, [this](){display_obj.draw_tft = false; changeMenu(generalMenu.parentMenu);});
addNodes(&generalMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){display_obj.draw_tft = false; changeMenu(generalMenu.parentMenu);});
addNodes(&generalMenu, "Draw", TFT_WHITE, NULL, 1, [this](){display_obj.clearScreen(); display_obj.draw_tft = true;});
@@ -234,7 +264,7 @@ void MenuFunctions::buildButtons(Menu* menu)
TFT_eSPI_Button new_button;
char buf[menu->list->get(i).name.length() + 1] = {};
menu->list->get(i).name.toCharArray(buf, menu->list->get(i).name.length() + 1);
key[i].initButton(&display_obj.tft,
display_obj.key[i].initButton(&display_obj.tft,
KEY_X + 0 * (KEY_W + KEY_SPACING_X),
KEY_Y + i * (KEY_H + KEY_SPACING_Y), // x, y, w, h, outline, fill, text
KEY_W,
@@ -254,7 +284,7 @@ void MenuFunctions::displayCurrentMenu()
Serial.println("Displaying current menu...");
display_obj.clearScreen();
display_obj.tft.setTextColor(TFT_LIGHTGREY, TFT_DARKGREY);
display_obj.tft.fillRect(0,0,240,16, TFT_DARKGREY);
//display_obj.tft.fillRect(0,0,240,16, TFT_DARKGREY);
//display_obj.tft.drawCentreString(" ESP32 Marauder ",120,0,2);
//Serial.println("Getting size...");
//char buf[&current_menu->parentMenu->name.length() + 1] = {};
@@ -262,13 +292,13 @@ void MenuFunctions::displayCurrentMenu()
//current_menu->parentMenu->name.toCharArray(buf, current_menu->parentMenu->name.length() + 1);
//String current_name = &current_menu->parentMenu->name;
//Serial.println("gottem");
display_obj.tft.drawCentreString(current_menu->name,120,0,2);
//display_obj.tft.drawCentreString(current_menu->name,120,0,2);
if (current_menu->list != NULL)
{
display_obj.tft.setFreeFont(MENU_FONT);
for (int i = 0; i < current_menu->list->size(); i++)
{
key[i].drawButton2(current_menu->list->get(i).name);
display_obj.key[i].drawButton2(current_menu->list->get(i).name);
}
display_obj.tft.setFreeFont(NULL);
}

View File

@@ -15,7 +15,7 @@ extern WiFiScan wifi_scan_obj;
#define KEY_SPACING_X 0 // X and Y gap
#define KEY_SPACING_Y 1
#define KEY_TEXTSIZE 1 // Font size multiplier
#define BUTTON_ARRAY_LEN 5
//#define BUTTON_ARRAY_LEN 5
#define FLASH_BUTTON 0
@@ -62,10 +62,11 @@ class MenuFunctions
Menu bluetoothSnifferMenu;
Menu bluetoothScannerMenu;
TFT_eSPI_Button key[BUTTON_ARRAY_LEN];
//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 showMenuList(Menu* menu, int layer);
void orientDisplay();
public:
MenuFunctions();

View File

@@ -2,6 +2,11 @@
//esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len, bool en_sys_seq);
//int num_beacon = 0;
int num_beacon = 0;
int num_deauth = 0;
int num_probe = 0;
class bluetoothScanAllCallback: public BLEAdvertisedDeviceCallbacks {
void onResult(BLEAdvertisedDevice advertisedDevice) {
String display_string = "";
@@ -120,6 +125,10 @@ void WiFiScan::StartScan(uint8_t scan_mode, uint16_t color)
RunProbeScan(scan_mode, color);
else if (scan_mode == WIFI_SCAN_AP)
RunBeaconScan(scan_mode, color);
else if (scan_mode == WIFI_SCAN_DEAUTH)
RunDeauthScan(scan_mode, color);
else if (scan_mode == WIFI_PACKET_MONITOR)
RunPacketMonitor(scan_mode, color);
else if (scan_mode == WIFI_ATTACK_BEACON_SPAM)
RunBeaconSpam(scan_mode, color);
else if (scan_mode == WIFI_ATTACK_RICK_ROLL)
@@ -139,13 +148,13 @@ void WiFiScan::StopScan(uint8_t scan_mode)
(currentScanMode == WIFI_SCAN_AP) ||
(currentScanMode == WIFI_SCAN_ST) ||
(currentScanMode == WIFI_SCAN_ALL) ||
(currentScanMode == WIFI_SCAN_DEAUTH) ||
(currentScanMode == WIFI_ATTACK_BEACON_SPAM) ||
(currentScanMode == WIFI_ATTACK_RICK_ROLL))
{
esp_wifi_set_promiscuous(false);
WiFi.mode(WIFI_OFF);
}
else if ((currentScanMode == BT_SCAN_ALL) ||
(currentScanMode == BT_SCAN_SKIMMERS))
{
@@ -161,6 +170,41 @@ void WiFiScan::StopScan(uint8_t scan_mode)
display_obj.tteBar = false;
}
void WiFiScan::RunPacketMonitor(uint8_t scan_mode, uint16_t color)
{
display_obj.tft.init();
display_obj.tft.setRotation(1);
display_obj.tft.fillScreen(TFT_BLACK);
uint16_t calData[5] = { 391, 3491, 266, 3505, 7 };
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.tftDrawColorKey();
display_obj.tftDrawXScaleButtons(x_scale);
display_obj.tftDrawYScaleButtons(y_scale);
display_obj.tftDrawChannelScaleButtons(set_channel);
display_obj.tftDrawExitScaleButtons();
Serial.println("Running packet scan...");
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_set_promiscuous(true);
esp_wifi_set_promiscuous_filter(&filt);
esp_wifi_set_promiscuous_rx_cb(&wifiSnifferCallback);
esp_wifi_set_channel(set_channel, WIFI_SECOND_CHAN_NONE);
uint32_t initTime = millis();
}
void WiFiScan::RunRickRoll(uint8_t scan_mode, uint16_t color)
{
//Serial.println("Rick Roll...");
@@ -241,6 +285,32 @@ void WiFiScan::RunBeaconScan(uint8_t scan_mode, uint16_t color)
initTime = millis();
}
void WiFiScan::RunDeauthScan(uint8_t scan_mode, uint16_t color)
{
display_obj.TOP_FIXED_AREA_2 = 32;
display_obj.tteBar = true;
display_obj.print_delay_1 = 15;
display_obj.print_delay_2 = 10;
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.touchToExit();
display_obj.tft.setTextColor(TFT_RED, TFT_BLACK);
display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA);
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_set_promiscuous(true);
esp_wifi_set_promiscuous_filter(&filt);
esp_wifi_set_promiscuous_rx_cb(&deauthSnifferCallback);
esp_wifi_set_channel(set_channel, WIFI_SECOND_CHAN_NONE);
initTime = millis();
}
// Function for running probe request scan
void WiFiScan::RunProbeScan(uint8_t scan_mode, uint16_t color)
@@ -364,6 +434,61 @@ void WiFiScan::beaconSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type
display_string.concat((char)snifferPacket->payload[i + 38]);
}
int temp_len = display_string.length();
for (int i = 0; i < 40 - temp_len; i++)
{
display_string.concat(" ");
}
Serial.print(" ");
if (display_obj.display_buffer->size() == 0)
{
display_obj.loading = true;
display_obj.display_buffer->add(display_string);
display_obj.loading = false;
}
Serial.println();
}
}
}
void WiFiScan::deauthSnifferCallback(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)
{
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] == 0xA0 || snifferPacket->payload[0] == 0xC0 ) && (display_obj.display_buffer->size() == 0))
{
delay(random(0, 10));
Serial.print("RSSI: ");
Serial.print(snifferPacket->rx_ctrl.rssi);
Serial.print(" Ch: ");
Serial.print(snifferPacket->rx_ctrl.channel);
Serial.print(" BSSID: ");
char addr[] = "00:00:00:00:00:00";
getMAC(addr, snifferPacket->payload, 10);
Serial.print(addr);
display_string.concat(" RSSI: ");
display_string.concat(snifferPacket->rx_ctrl.rssi);
display_string.concat(" ");
display_string.concat(addr);
for (int i = 0; i < 19 - snifferPacket->payload[37]; i++)
{
display_string.concat(" ");
@@ -559,11 +684,262 @@ void WiFiScan::broadcastRandomSSID(uint32_t currentTime) {
}
void WiFiScan::wifiSnifferCallback(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;
if (type == WIFI_PKT_MGMT)
{
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++;
}
}
}
void WiFiScan::packetMonitorMain()
{
//---------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
{
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 < 6) {
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 (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;
}
}
}
y_pos_x = ((-num_beacon * (y_scale * 10)) + (HEIGHT_1 - 2)); // GREEN
y_pos_y = ((-num_deauth * (y_scale * 10)) + (HEIGHT_1 - 2)); // RED
y_pos_z = ((-num_probe * (y_scale * 10)) + (HEIGHT_1 - 2)); // BLUE
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_GREEN);
//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);
}
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.tftDrawColorKey();
display_obj.tftDrawGraphObjects(x_scale);
}
//void WiFiScan::sniffer_callback(void* buf, wifi_promiscuous_pkt_type_t type) {
// wifi_promiscuous_pkt_t *snifferPacket = (wifi_promiscuous_pkt_t*)buf;
// showMetadata(snifferPacket, type);
//}
void WiFiScan::changeChannel()
{
esp_wifi_set_channel(set_channel, WIFI_SECOND_CHAN_NONE);
delay(1);
}
// Function to cycle to the next channel
void WiFiScan::channelHop()
{
@@ -583,6 +959,7 @@ void WiFiScan::main(uint32_t currentTime)
if ((currentScanMode == WIFI_SCAN_PROBE) ||
(currentScanMode == WIFI_SCAN_AP) ||
(currentScanMode == WIFI_SCAN_ST) ||
(currentScanMode == WIFI_SCAN_DEAUTH) ||
(currentScanMode == WIFI_SCAN_ALL))
{
if (currentTime - initTime >= 1000)
@@ -591,6 +968,10 @@ void WiFiScan::main(uint32_t currentTime)
channelHop();
}
}
else if (currentScanMode == WIFI_PACKET_MONITOR)
{
packetMonitorMain();
}
else if ((currentScanMode == WIFI_ATTACK_BEACON_SPAM))
{
// Need this for loop because getTouch causes ~10ms delay

View File

@@ -18,11 +18,15 @@
#define WIFI_SCAN_PROBE 1
#define WIFI_SCAN_AP 2
#define WIFI_SCAN_ST 3
#define WIFI_SCAN_ALL 4
#define WIFI_ATTACK_BEACON_SPAM 5
#define WIFI_ATTACK_RICK_ROLL 6
#define BT_SCAN_ALL 7
#define BT_SCAN_SKIMMERS 8
#define WIFI_SCAN_DEAUTH 4
#define WIFI_SCAN_ALL 5
#define WIFI_PACKET_MONITOR 6
#define WIFI_ATTACK_BEACON_SPAM 7
#define WIFI_ATTACK_RICK_ROLL 8
#define BT_SCAN_ALL 9
#define BT_SCAN_SKIMMERS 10
#define MAX_CHANNEL 14
extern Display display_obj;
@@ -31,6 +35,23 @@ esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len, b
class WiFiScan
{
private:
int x_pos; //position along the graph x axis
float y_pos_x; //current graph y axis position of X value
float y_pos_x_old = 120; //old y axis position of X value
float y_pos_y; //current graph y axis position of Y value
float y_pos_y_old = 120; //old y axis position of Y value
float y_pos_z; //current graph y axis position of Z value
float y_pos_z_old = 120; //old y axis position of Z value
int midway = 0;
byte x_scale = 1; //scale of graph x axis, controlled by touchscreen buttons
byte y_scale = 1;
bool do_break = false;
//int num_beacon = 0; // GREEN
//int num_probe = 0; // BLUE
//int num_deauth = 0; // RED
uint32_t initTime = 0;
bool run_setup = true;
int set_channel = 1;
@@ -83,18 +104,30 @@ class WiFiScan
/*36*/ 0x00
};
void packetMonitorMain();
void changeChannel();
void updateMidway();
void tftDrawXScalButtons();
void tftDrawYScaleButtons();
void tftDrawChannelScaleButtons();
void tftDrawColorKey();
void tftDrawGraphObjects();
void broadcastRandomSSID(uint32_t currentTime);
void broadcastSetSSID(uint32_t current_time, char* ESSID);
void RunRickRoll(uint8_t scan_mode, uint16_t color);
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 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);
static void scanCompleteCB(BLEScanResults scanResults);
public:
WiFiScan();
bool orient_display = false;
void channelHop();
@@ -105,6 +138,8 @@ class WiFiScan
static void getMAC(char *addr, uint8_t* data, uint16_t offset);
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 wifiSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
};
#endif

View File

@@ -56,7 +56,8 @@ void loop()
display_obj.main();
wifi_scan_obj.main(currentTime);
//if ((wifi_scan_obj.currentScanMode != WIFI_ATTACK_BEACON_SPAM))
menu_function_obj.main();
if (wifi_scan_obj.currentScanMode != WIFI_PACKET_MONITOR)
menu_function_obj.main();
delay(1);
}
else

Binary file not shown.