Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Wardriving bugs #11

Merged
merged 26 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5f8ab3a
chore: fix minino path and add link to dev guide
DeimosHall Aug 31, 2024
dd925de
refactor: reset last selected item on menus exit
Otrebor671 Sep 2, 2024
c1bc573
refactor: move menus.h to include dir
DeimosHall Sep 2, 2024
6f336e9
refactor: move kconfig to a component
DeimosHall Sep 2, 2024
183cc76
refactor: menu idx
DeimosHall Sep 2, 2024
dc744aa
refactor: gps help
DeimosHall Sep 3, 2024
af1f4f1
feat: Change version build
JahazielLem Sep 3, 2024
95e061f
feat: increase wardriving csv lines
DeimosHall Sep 5, 2024
0f3e292
feat: hiding menu functions
Otrebor671 Sep 5, 2024
cc95dcd
fix: do not count empty wifi ap
DeimosHall Sep 8, 2024
da1ae3c
fix: clear screen on 128x32 displays
DeimosHall Sep 9, 2024
17c4d1c
feat: general submenus
Otrebor671 Sep 9, 2024
6273d97
feat: Add bitmaps
JahazielLem Sep 10, 2024
81633dc
chore: merge branch 'wardriving' into dev
DeimosHall Sep 10, 2024
c2b6023
chore: merge branch 'main' into dev
DeimosHall Sep 10, 2024
5efa284
feat: simple arrows bitmaps
Otrebor671 Sep 13, 2024
01006e4
refactor: change minino text logo aspect ratio
DeimosHall Sep 17, 2024
7d0cb37
chore: merge remote branch 'dev' into dev
DeimosHall Sep 17, 2024
72f96d5
feat: Fix screens
JahazielLem Sep 19, 2024
615ba16
feat: add wifi animation to wardriving
DeimosHall Sep 19, 2024
bf373df
feat: move wardriving text periodically
DeimosHall Sep 19, 2024
475d4e9
fix: wifi loading size
DeimosHall Sep 19, 2024
b940223
chore: merge branch 'wardriving' into dev
DeimosHall Sep 19, 2024
b15ff5d
chore: reactivate no gps signal screen
DeimosHall Sep 19, 2024
2bddbd6
chore: update minino build files
DeimosHall Sep 19, 2024
339c7cb
feat: compress ota and no ota build files
DeimosHall Sep 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ hardware/minino-backups/

# Firmware binaries
/**/build/
/**/build-ota/
/**/build-noota/
/**/managed_components/
/**/build_files/
/**/build_files.tgz
/**/build_files.zip
/**/minino-*.zip

# IDF sdkconfig
/**/sdkconfig
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ Minino can operate in 6 different technologies:

Inspired by projects such as [Amini Project](https://github.com/Ocelot-Offensive-Security/Arsenal) and [USBNugget](https://github.com/HakCat-Tech/USB-Nugget).

## How to build the firmware

Check the [Developer guide](./firmware/README.md) to learn how to build the firmware from scratch.

## How to contribute <img src="https://electroniccats.com/wp-content/uploads/2018/01/fav.png" height="35"><img src="https://raw.githubusercontent.com/gist/ManulMax/2d20af60d709805c55fd784ca7cba4b9/raw/bcfeac7604f674ace63623106eb8bb8471d844a6/github.gif" height="30">

Contributions are welcome!
Expand Down
2 changes: 1 addition & 1 deletion firmware/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ git clone [email protected]:ElectronicCats/Minino.git
2. Change to the firmware directory:

```bash
cd Minino/examples/minino
cd Minino/firmware
```

3. Set the IDF_PATH environment variable:
Expand Down
1 change: 1 addition & 0 deletions firmware/components/minino_config/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
idf_component_register(SRCS INCLUDE_DIRS)
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ menu "OLED Screen Configuration"

endmenu

menu "KEYBOARD Configuration"
menu "Keyboard Configuration"

config GPIO_RANGE_MAX
int
Expand Down
2 changes: 1 addition & 1 deletion firmware/components/wifi_captive/captive_portal.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ esp_err_t http_404_error_handler(httpd_req_t* req, httpd_err_code_t err) {
static httpd_handle_t start_webserver(void) {
httpd_handle_t server = NULL;
httpd_config_t config = HTTPD_DEFAULT_CONFIG();
config.max_open_sockets = 10;
config.max_open_sockets = 7;
config.lru_purge_enable = true;

// Start the httpd server
Expand Down
50 changes: 37 additions & 13 deletions firmware/get_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,49 @@

PROJECT_NAME="minino"
CONFIG_FILE="sdkconfig"
OTA_BUILD_DIR="build-ota"
NO_OTA_BUILD_DIR="build-noota"
TEMPORARY_BUILD_DIR="build_files"

project_version=$(grep '^CONFIG_PROJECT_VERSION=' "$CONFIG_FILE" | cut -d'=' -f2 | tr -d '"')
# Build the firmware
make compile
PROJECT_VERSION=$(grep '^CONFIG_PROJECT_VERSION=' "$CONFIG_FILE" | cut -d'=' -f2 | tr -d '"')
OTA_BUILD_FINAL_DIR="minino-ota-firmware-$PROJECT_VERSION"
NO_OTA_BUILD_FINAL_DIR="minino-noota-firmware-$PROJECT_VERSION"

mkdir -p build_files/
mkdir -p build_files/partition_table/
mkdir -p build_files/bootloader/
# Build the firmware
echo "Building ota firmware..."
make setup
idf.py @profiles/ota build
mkdir -p $TEMPORARY_BUILD_DIR

# Copy the firmware files to the build directory
echo "Copying firmware files to build directory..."
cp build/$PROJECT_NAME.bin build_files/
cp build/partition_table/partition-table.bin build_files/partition_table/
cp build/bootloader/bootloader.bin build_files/bootloader/
cp build/ota_data_initial.bin build_files/
cp $OTA_BUILD_DIR/$PROJECT_NAME.bin $TEMPORARY_BUILD_DIR
cp $OTA_BUILD_DIR/partition_table/partition-table.bin $TEMPORARY_BUILD_DIR
cp $OTA_BUILD_DIR/bootloader/bootloader.bin $TEMPORARY_BUILD_DIR
cp $OTA_BUILD_DIR/ota_data_initial.bin $TEMPORARY_BUILD_DIR
mv $TEMPORARY_BUILD_DIR $OTA_BUILD_FINAL_DIR

echo "Building no ota firmware..."
idf.py @profiles/noota build
rm -rf $TEMPORARY_BUILD_DIR
mkdir -p $TEMPORARY_BUILD_DIR

echo "Copying firmware files to build directory..."
cp $NO_OTA_BUILD_DIR/$PROJECT_NAME.bin $TEMPORARY_BUILD_DIR
cp $NO_OTA_BUILD_DIR/partition_table/partition-table.bin $TEMPORARY_BUILD_DIR
cp $NO_OTA_BUILD_DIR/bootloader/bootloader.bin $TEMPORARY_BUILD_DIR
mv $TEMPORARY_BUILD_DIR $NO_OTA_BUILD_FINAL_DIR

# Compress build_files and delete directory
echo "Compressing build_files..."
zip -r build_files_$project_version.zip build_files
rm -rf build_files/
echo "Compressing ota build files..."
# zip -r build_files_$PROJECT_VERSION.zip build_files
zip -r $OTA_BUILD_FINAL_DIR.zip $OTA_BUILD_FINAL_DIR
echo "Compressing no ota build files..."
zip -r $NO_OTA_BUILD_FINAL_DIR.zip $NO_OTA_BUILD_FINAL_DIR

echo "Cleaning build files..."
rm -rf $TEMPORARY_BUILD_DIR
rm -rf $OTA_BUILD_FINAL_DIR
rm -rf $NO_OTA_BUILD_FINAL_DIR

echo "Done!"
35 changes: 0 additions & 35 deletions firmware/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,38 +26,3 @@ idf_component_register(
modules/web_file_browser/http_server/style.css
INCLUDE_DIRS
"${headers_dirs}")

# # Append all directories to INCLUDE_DIRS

# file(GLOB_RECURSE ALL_INCLUDE_PATHS "./*")
# set(INCLUDE_DIRS "")

# foreach(path ${ALL_INCLUDE_PATHS})
# get_filename_component(parentDir ${path} DIRECTORY)

# if(IS_DIRECTORY ${parentDir})
# list(APPEND INCLUDE_DIRS ${parentDir})
# endif()
# endforeach()

# list(REMOVE_DUPLICATES INCLUDE_DIRS)

# # Append all source files to SRCS

# file(GLOB_RECURSE ALL_SOURCE_FILES "./*")
# set(SRCS "")

# foreach(file ${ALL_SOURCE_FILES})
# get_filename_component(extension ${file} EXT)
# if(NOT extension STREQUAL "")
# list(APPEND SRCS ${file})
# endif()
# endforeach()

# # Register the component

# idf_component_register(
# SRCS
# ${SRCS}
# INCLUDE_DIRS
# ${INCLUDE_DIRS})
13 changes: 10 additions & 3 deletions firmware/main/apps/ble/spam/spam_screens.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,18 @@ static void ble_screens_display_scanning_animation() {

void ble_screens_start_scanning_animation() {
oled_screen_clear();
oled_screen_display_text_center("BLE SPAM", 0, OLED_DISPLAY_NORMAL);
oled_screen_display_text_center("< Back", 0, OLED_DISPLAY_NORMAL);
oled_screen_display_text_center("BLE SPAM", 1, OLED_DISPLAY_NORMAL);
#ifdef CONFIG_RESOLUTION_128X64
animations_task_run(ble_screens_display_scanning_animation, 100, NULL);
#endif
}

void ble_screens_display_scanning_text(char* name) {
oled_screen_clear_line(0, 7, OLED_DISPLAY_NORMAL);
oled_screen_display_text_center(name, 7, OLED_DISPLAY_INVERT);
int page = 7;
#ifdef CONFIG_RESOLUTION_128X32
page = 2;
#endif
oled_screen_clear_line(0, page, OLED_DISPLAY_NORMAL);
oled_screen_display_text_center(name, page, OLED_DISPLAY_INVERT);
}
2 changes: 1 addition & 1 deletion firmware/main/apps/ble/trackers/trackers_screens.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void module_update_tracker_name(char* tracker_name, uint16_t index) {

void module_display_scanning() {
led_control_run_effect(led_control_pulse_leds);
genera_screen_display_notify_information("Searching", "Looking for devices");
genera_screen_display_notify_information("Searching", "Devices");
}

void module_display_tracker_information(char* title, char* body) {
Expand Down
45 changes: 35 additions & 10 deletions firmware/main/apps/wifi/deauth/deauth_screens.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@
#include "animations_task.h"
#include "esp_wifi.h"
#include "general/bitmaps_general.h"
#include "general/general_screens.h"
#include "oled_screen.h"

#define ITEMOFFSET 2
#ifdef CONFIG_RESOLUTION_128X64
#define ITEMOFFSET 2
#define ITEMSPERSCREEN 4
#else // CONFIG_RESOLUTION_128X32
#define ITEMOFFSET 1
#define ITEMSPERSCREEN 2
#endif

static int ap_count = 0;

Expand Down Expand Up @@ -63,8 +70,10 @@ void deauth_display_menu(uint16_t current_item,
oled_screen_display_text("< Exit", 0, 0, OLED_DISPLAY_NORMAL);

int position = 1;
uint16_t start_item = (current_item / ITEMSPERSCREEN) * ITEMSPERSCREEN;

for (uint16_t i = 0; i < MENUCOUNT; i++) {
for (uint16_t i = start_item;
i < start_item + ITEMSPERSCREEN && i < MENUCOUNT; i++) {
if (deauth_menu[i] == NULL) {
break;
}
Expand Down Expand Up @@ -93,7 +102,7 @@ void deauth_display_menu(uint16_t current_item,
} else {
oled_screen_display_text(item, 0, position, OLED_DISPLAY_NORMAL);
}
position = position + 2;
position = position + ITEMOFFSET;
}
oled_screen_display_show();
}
Expand All @@ -111,16 +120,19 @@ void deauth_display_scanned_ap(wifi_ap_record_t* ap_records,
if (i >= scanned_records) {
break;
}
char ssid[MAX_LINE_CHAR];
general_screen_truncate_text((char*) ap_records[i].ssid, ssid);
if (i == current_option) {
char* prefix = "> ";
char item_text[strlen(prefix) + strlen((char*) ap_records[i].ssid) + 1];

char item_text[strlen(prefix) + strlen((char*) ssid) + 1];
strcpy(item_text, prefix);
strcat(item_text, (char*) ap_records[i].ssid);
strcat(item_text, (char*) ssid);
oled_screen_display_text(item_text, 0, (i + 1) - current_option,
OLED_DISPLAY_INVERT);
} else {
oled_screen_display_text((char*) ap_records[i].ssid, 0,
(i + 1) - current_option, OLED_DISPLAY_NORMAL);
oled_screen_display_text((char*) ssid, 0, (i + 1) - current_option,
OLED_DISPLAY_NORMAL);
}
}
oled_screen_display_show();
Expand All @@ -131,7 +143,11 @@ void deauth_display_attacks(uint16_t current_item,
oled_screen_clear_buffer();
oled_screen_display_text("< Back", 0, 0, OLED_DISPLAY_NORMAL);

for (uint16_t i = 0; i < ATTACKSCOUNT; i++) {
int position = 1;
uint16_t start_item = (current_item / ITEMSPERSCREEN) * ITEMSPERSCREEN;

for (uint16_t i = start_item;
i < start_item + ITEMSPERSCREEN && i < MENUCOUNT; i++) {
if (deauth_attacks[i] == NULL) {
break;
}
Expand All @@ -142,10 +158,11 @@ void deauth_display_attacks(uint16_t current_item,
snprintf(item, 18, "%s", deauth_attacks[i]);
}
if (i == current_item) {
deauth_display_selected_item(item, i + ITEMOFFSET);
deauth_display_selected_item(item, position);
} else {
oled_screen_display_text(item, 0, i + ITEMOFFSET, OLED_DISPLAY_NORMAL);
oled_screen_display_text(item, 0, position, OLED_DISPLAY_NORMAL);
}
position = position + ITEMOFFSET;
}
oled_screen_display_show();
}
Expand Down Expand Up @@ -182,6 +199,7 @@ void deauth_display_captive_waiting() {

void deauth_display_captive_portal_creds(char* ssid, char* user, char* pass) {
oled_screen_clear();
#ifdef CONFIG_RESOLUTION_128X64
oled_screen_display_text_center("Captive Portal", 0, OLED_DISPLAY_NORMAL);
oled_screen_display_text_center("SSID", 1, OLED_DISPLAY_NORMAL);
oled_screen_display_text_center(ssid, 2, OLED_DISPLAY_NORMAL);
Expand All @@ -191,4 +209,11 @@ void deauth_display_captive_portal_creds(char* ssid, char* user, char* pass) {
oled_screen_display_text_center("PASS", 5, OLED_DISPLAY_NORMAL);
oled_screen_display_text_center(pass, 6, OLED_DISPLAY_INVERT);
}
#else // CONFIG_RESOLUTION_128X32
oled_screen_display_text_center(ssid, 0, OLED_DISPLAY_NORMAL);
oled_screen_display_text_center(user, 1, OLED_DISPLAY_INVERT);
if (strcmp(pass, "") != 0) {
oled_screen_display_text_center(pass, 2, OLED_DISPLAY_INVERT);
}
#endif
}
3 changes: 2 additions & 1 deletion firmware/main/drivers/oled_driver/oled_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ void oled_driver_clear_line(oled_driver_t* dev, int x, int page, bool invert) {
// char space[16];
// memset(space, 0x00, sizeof(space));
// oled_driver_display_text(dev, page, space, sizeof(space), invert);
char* space = " ";
// char* space = " ";
char* space = " ";
oled_driver_display_text(dev, page, space, x, invert);
}

Expand Down
12 changes: 6 additions & 6 deletions firmware/main/drivers/oled_driver/oled_driver_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

#include "oled_driver.h"

#define tag "oled_driver_i2c"

#if CONFIG_I2C_PORT_0
#define I2C_NUM I2C_NUM_0
#elif CONFIG_I2C_PORT_1
Expand All @@ -21,6 +19,8 @@
#define I2C_MASTER_FREQ_HZ \
400000 /*!< I2C clock of SH1106 can run at 400 kHz max. */

static const char* TAG = "oled_driver_i2c";

void i2c_master_init(oled_driver_t* dev,
int16_t sda,
int16_t scl,
Expand Down Expand Up @@ -105,9 +105,9 @@ void i2c_init(oled_driver_t* dev, int width, int height) {

esp_err_t espRc = i2c_master_cmd_begin(I2C_NUM, cmd, 10 / portTICK_PERIOD_MS);
if (espRc == ESP_OK) {
ESP_LOGI(tag, "OLED configured successfully");
ESP_LOGI(TAG, "OLED configured successfully");
} else {
ESP_LOGE(tag, "OLED configuration failed. code: 0x%.2X", espRc);
ESP_LOGE(TAG, "OLED configuration failed. code: 0x%.2X", espRc);
}
i2c_cmd_link_delete(cmd);
}
Expand Down Expand Up @@ -260,9 +260,9 @@ void i2c_hardware_scroll(oled_driver_t* dev, oled_driver_scroll_type_t scroll) {
i2c_master_stop(cmd);
espRc = i2c_master_cmd_begin(I2C_NUM, cmd, 10 / portTICK_PERIOD_MS);
if (espRc == ESP_OK) {
ESP_LOGD(tag, "Scroll command succeeded");
ESP_LOGD(TAG, "Scroll command succeeded");
} else {
ESP_LOGE(tag, "Scroll command failed. code: 0x%.2X", espRc);
ESP_LOGE(TAG, "Scroll command failed. code: 0x%.2X", espRc);
}

i2c_cmd_link_delete(cmd);
Expand Down
Loading
Loading