Skip to content

Commit

Permalink
update wifi marauder app
Browse files Browse the repository at this point in the history
by Willy-JL
  • Loading branch information
xMasterX committed Feb 22, 2024
1 parent 0f10921 commit 287ac5c
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 19 deletions.
2 changes: 1 addition & 1 deletion base_pack/wifi_marauder_companion/application.fam
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
App(
appid="esp32_wifi_marauder",
name="[ESP32] WiFi Marauder",
fap_version=(6,6),
fap_version=(7, 0),
apptype=FlipperAppType.EXTERNAL,
entry_point="wifi_marauder_app",
requires=["gui"],
Expand Down
9 changes: 9 additions & 0 deletions base_pack/wifi_marauder_companion/docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## v0.7.0

Unified serial update! No more complicated wiring of 2x UART connections - all your boards are supported now, with PCAPs and text both going over just ONE, SINGLE serial channel! Thanks to @Willy-JL for adding this amazing feature and fixing up the app for the new APIs.

Requires Marauder **FW v0.13.7** (or newer) flashed to your wifi board: https://github.com/justcallmekoko/ESP32Marauder/releases/latest

<3 @0xchocolate (cococode)


## v0.6.6

Bug fixes and new BLE spam commands! Thanks to @justcallmekoko for adding the new commands! I also fixed the script user input bug where it would hang after selecting "save".
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@ char* _wifi_marauder_get_prefix_from_cmd(const char* command) {
}

bool _wifi_marauder_is_save_pcaps_enabled(WifiMarauderApp* app) {
if(!app->ok_to_save_pcaps) {
return false;
}
// If it is a script that contains a sniff function
if(app->script != NULL) {
if(app->script->save_pcap == WifiMarauderScriptBooleanFalse) {
return false;
}
if(app->script->save_pcap == WifiMarauderScriptBooleanUndefined) {
if(!app->ok_to_save_pcaps) {
return false;
}
}
return wifi_marauder_script_has_stage(app->script, WifiMarauderScriptStageTypeSniffRaw) ||
wifi_marauder_script_has_stage(
app->script, WifiMarauderScriptStageTypeSniffBeacon) ||
Expand All @@ -24,6 +29,9 @@ bool _wifi_marauder_is_save_pcaps_enabled(WifiMarauderApp* app) {
app->script, WifiMarauderScriptStageTypeSniffPmkid) ||
wifi_marauder_script_has_stage(app->script, WifiMarauderScriptStageTypeSniffPwn);
}
if(!app->ok_to_save_pcaps) {
return false;
}
// If it is a sniff function
return app->is_command && app->selected_tx_string &&
strncmp("sniff", app->selected_tx_string, strlen("sniff")) == 0;
Expand Down Expand Up @@ -152,12 +160,17 @@ void wifi_marauder_scene_console_output_on_enter(void* context) {

// Send command with newline '\n'
if(app->selected_tx_string) {
wifi_marauder_uart_tx(
app->uart, (uint8_t*)(app->selected_tx_string), strlen(app->selected_tx_string));
if(app->is_writing_pcap) {
wifi_marauder_uart_tx(app->uart, (uint8_t*)(" -serial\n"), strlen(" -serial\n"));
} else {
wifi_marauder_uart_tx(app->uart, (uint8_t*)("\n"), 1);
if(app->script == NULL) {
wifi_marauder_uart_tx(
app->uart,
(uint8_t*)(app->selected_tx_string),
strlen(app->selected_tx_string));
if(app->is_writing_pcap) {
wifi_marauder_uart_tx(
app->uart, (uint8_t*)(" -serial\n"), strlen(" -serial\n"));
} else {
wifi_marauder_uart_tx(app->uart, (uint8_t*)("\n"), 1);
}
}
if(send_html && the_html) {
wifi_marauder_uart_tx(app->uart, the_html, html_size);
Expand Down
2 changes: 1 addition & 1 deletion base_pack/wifi_marauder_companion/script/cJSON.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ double string_to_double(const char* str, char** endptr) {
/* Parse the input text to generate a number, and populate the result into item. */
static cJSON_bool parse_number(cJSON* const item, parse_buffer* const input_buffer) {
double number = 0;
unsigned char* after_end = NULL;
unsigned char* volatile after_end = NULL;
unsigned char number_c_string[64];
unsigned char decimal_point = get_decimal_point();
size_t i = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,35 +105,55 @@ void _wifi_marauder_script_execute_probe(
void _wifi_marauder_script_execute_sniff_raw(
WifiMarauderScriptStageSniffRaw* stage,
WifiMarauderScriptWorker* worker) {
const char sniff_command[] = "sniffraw -serial\n";
const char sniff_command[] = "sniffraw";
wifi_marauder_uart_tx(worker->uart, (uint8_t*)sniff_command, strlen(sniff_command));
if(((WifiMarauderScript*)worker->context)->save_pcap != WifiMarauderScriptBooleanFalse) {
wifi_marauder_uart_tx(worker->uart, (uint8_t*)(" -serial\n"), strlen(" -serial\n"));
} else {
wifi_marauder_uart_tx(worker->uart, (uint8_t*)("\n"), 1);
}
_wifi_marauder_script_delay(worker, stage->timeout);
_send_stop(worker);
}

void _wifi_marauder_script_execute_sniff_beacon(
WifiMarauderScriptStageSniffBeacon* stage,
WifiMarauderScriptWorker* worker) {
const char sniff_command[] = "sniffbeacon -serial\n";
const char sniff_command[] = "sniffbeacon";
wifi_marauder_uart_tx(worker->uart, (uint8_t*)sniff_command, strlen(sniff_command));
if(((WifiMarauderScript*)worker->context)->save_pcap != WifiMarauderScriptBooleanFalse) {
wifi_marauder_uart_tx(worker->uart, (uint8_t*)(" -serial\n"), strlen(" -serial\n"));
} else {
wifi_marauder_uart_tx(worker->uart, (uint8_t*)("\n"), 1);
}
_wifi_marauder_script_delay(worker, stage->timeout);
_send_stop(worker);
}

void _wifi_marauder_script_execute_sniff_deauth(
WifiMarauderScriptStageSniffDeauth* stage,
WifiMarauderScriptWorker* worker) {
const char sniff_command[] = "sniffdeauth -serial\n";
const char sniff_command[] = "sniffdeauth";
wifi_marauder_uart_tx(worker->uart, (uint8_t*)sniff_command, strlen(sniff_command));
if(((WifiMarauderScript*)worker->context)->save_pcap != WifiMarauderScriptBooleanFalse) {
wifi_marauder_uart_tx(worker->uart, (uint8_t*)(" -serial\n"), strlen(" -serial\n"));
} else {
wifi_marauder_uart_tx(worker->uart, (uint8_t*)("\n"), 1);
}
_wifi_marauder_script_delay(worker, stage->timeout);
_send_stop(worker);
}

void _wifi_marauder_script_execute_sniff_esp(
WifiMarauderScriptStageSniffEsp* stage,
WifiMarauderScriptWorker* worker) {
const char sniff_command[] = "sniffesp -serial\n";
const char sniff_command[] = "sniffesp";
wifi_marauder_uart_tx(worker->uart, (uint8_t*)sniff_command, strlen(sniff_command));
if(((WifiMarauderScript*)worker->context)->save_pcap != WifiMarauderScriptBooleanFalse) {
wifi_marauder_uart_tx(worker->uart, (uint8_t*)(" -serial\n"), strlen(" -serial\n"));
} else {
wifi_marauder_uart_tx(worker->uart, (uint8_t*)("\n"), 1);
}
_wifi_marauder_script_delay(worker, stage->timeout);
_send_stop(worker);
}
Expand All @@ -152,7 +172,12 @@ void _wifi_marauder_script_execute_sniff_pmkid(
len += snprintf(attack_command + len, sizeof(attack_command) - len, " -d");
}

len += snprintf(attack_command + len, sizeof(attack_command) - len, " -serial\n");
if(((WifiMarauderScript*)worker->context)->save_pcap !=
WifiMarauderScriptBooleanFalse) {
len += snprintf(attack_command + len, sizeof(attack_command) - len, " -serial\n");
} else {
len += snprintf(attack_command + len, sizeof(attack_command) - len, "\n");
}
wifi_marauder_uart_tx(worker->uart, (uint8_t*)attack_command, len);
_wifi_marauder_script_delay(worker, stage->timeout);
_send_stop(worker);
Expand All @@ -169,7 +194,11 @@ void _wifi_marauder_script_execute_sniff_pmkid(
if(stage->force_deauth) {
len += snprintf(attack_command + len, sizeof(attack_command) - len, " -d");
}
len += snprintf(attack_command + len, sizeof(attack_command) - len, " -serial\n");
if(((WifiMarauderScript*)worker->context)->save_pcap != WifiMarauderScriptBooleanFalse) {
len += snprintf(attack_command + len, sizeof(attack_command) - len, " -serial\n");
} else {
len += snprintf(attack_command + len, sizeof(attack_command) - len, "\n");
}
wifi_marauder_uart_tx(worker->uart, (uint8_t*)attack_command, len);
_wifi_marauder_script_delay(worker, stage->timeout);
_send_stop(worker);
Expand All @@ -179,8 +208,13 @@ void _wifi_marauder_script_execute_sniff_pmkid(
void _wifi_marauder_script_execute_sniff_pwn(
WifiMarauderScriptStageSniffPwn* stage,
WifiMarauderScriptWorker* worker) {
const char sniff_command[] = "sniffpwn -serial\n";
const char sniff_command[] = "sniffpwn";
wifi_marauder_uart_tx(worker->uart, (uint8_t*)sniff_command, strlen(sniff_command));
if(((WifiMarauderScript*)worker->context)->save_pcap != WifiMarauderScriptBooleanFalse) {
wifi_marauder_uart_tx(worker->uart, (uint8_t*)(" -serial\n"), strlen(" -serial\n"));
} else {
wifi_marauder_uart_tx(worker->uart, (uint8_t*)("\n"), 1);
}
_wifi_marauder_script_delay(worker, stage->timeout);
_send_stop(worker);
}
Expand Down
2 changes: 1 addition & 1 deletion base_pack/wifi_marauder_companion/wifi_marauder_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
extern "C" {
#endif

#define WIFI_MARAUDER_APP_VERSION "v0.6.6"
#define WIFI_MARAUDER_APP_VERSION "v0.7.0"

typedef struct WifiMarauderApp WifiMarauderApp;

Expand Down

0 comments on commit 287ac5c

Please sign in to comment.