|
@@ -5,20 +5,20 @@ void _wifi_marauder_script_delay(WifiMarauderScriptWorker* worker, uint32_t dela
|
|
|
for(uint32_t i = 0; i < delay_secs && worker->is_running; i++) furi_delay_ms(1000);
|
|
for(uint32_t i = 0; i < delay_secs && worker->is_running; i++) furi_delay_ms(1000);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-void _send_stop() {
|
|
|
|
|
|
|
+void _send_stop(WifiMarauderScriptWorker* worker) {
|
|
|
const char stop_command[] = "stopscan\n";
|
|
const char stop_command[] = "stopscan\n";
|
|
|
- wifi_marauder_uart_tx((uint8_t*)(stop_command), strlen(stop_command));
|
|
|
|
|
|
|
+ wifi_marauder_uart_tx(worker->uart, (uint8_t*)(stop_command), strlen(stop_command));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-void _send_line_break() {
|
|
|
|
|
- wifi_marauder_uart_tx((uint8_t*)("\n"), 1);
|
|
|
|
|
|
|
+void _send_line_break(WifiMarauderScriptWorker* worker) {
|
|
|
|
|
+ wifi_marauder_uart_tx(worker->uart, (uint8_t*)("\n"), 1);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-void _send_channel_select(int channel) {
|
|
|
|
|
|
|
+void _send_channel_select(WifiMarauderScriptWorker* worker, int channel) {
|
|
|
char command[30];
|
|
char command[30];
|
|
|
- _send_line_break();
|
|
|
|
|
|
|
+ _send_line_break(worker);
|
|
|
snprintf(command, sizeof(command), "channel -s %d\n", channel);
|
|
snprintf(command, sizeof(command), "channel -s %d\n", channel);
|
|
|
- wifi_marauder_uart_tx((uint8_t*)(command), strlen(command));
|
|
|
|
|
|
|
+ wifi_marauder_uart_tx(worker->uart, (uint8_t*)(command), strlen(command));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void _wifi_marauder_script_execute_scan(
|
|
void _wifi_marauder_script_execute_scan(
|
|
@@ -27,7 +27,7 @@ void _wifi_marauder_script_execute_scan(
|
|
|
char command[15];
|
|
char command[15];
|
|
|
// Set channel
|
|
// Set channel
|
|
|
if(stage->channel > 0) {
|
|
if(stage->channel > 0) {
|
|
|
- _send_channel_select(stage->channel);
|
|
|
|
|
|
|
+ _send_channel_select(worker, stage->channel);
|
|
|
}
|
|
}
|
|
|
// Start scan
|
|
// Start scan
|
|
|
if(stage->type == WifiMarauderScriptScanTypeAp) {
|
|
if(stage->type == WifiMarauderScriptScanTypeAp) {
|
|
@@ -35,12 +35,14 @@ void _wifi_marauder_script_execute_scan(
|
|
|
} else {
|
|
} else {
|
|
|
snprintf(command, sizeof(command), "scansta\n");
|
|
snprintf(command, sizeof(command), "scansta\n");
|
|
|
}
|
|
}
|
|
|
- wifi_marauder_uart_tx((uint8_t*)(command), strlen(command));
|
|
|
|
|
|
|
+ wifi_marauder_uart_tx(worker->uart, (uint8_t*)(command), strlen(command));
|
|
|
_wifi_marauder_script_delay(worker, stage->timeout);
|
|
_wifi_marauder_script_delay(worker, stage->timeout);
|
|
|
- _send_stop();
|
|
|
|
|
|
|
+ _send_stop(worker);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-void _wifi_marauder_script_execute_select(WifiMarauderScriptStageSelect* stage) {
|
|
|
|
|
|
|
+void _wifi_marauder_script_execute_select(
|
|
|
|
|
+ WifiMarauderScriptStageSelect* stage,
|
|
|
|
|
+ WifiMarauderScriptWorker* worker) {
|
|
|
const char* select_type = NULL;
|
|
const char* select_type = NULL;
|
|
|
switch(stage->type) {
|
|
switch(stage->type) {
|
|
|
case WifiMarauderScriptSelectTypeAp:
|
|
case WifiMarauderScriptSelectTypeAp:
|
|
@@ -79,61 +81,61 @@ void _wifi_marauder_script_execute_select(WifiMarauderScriptStageSelect* stage)
|
|
|
command, sizeof(command), "select %s -f \"%s\"\n", select_type, stage->filter);
|
|
command, sizeof(command), "select %s -f \"%s\"\n", select_type, stage->filter);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- wifi_marauder_uart_tx((uint8_t*)command, command_length);
|
|
|
|
|
|
|
+ wifi_marauder_uart_tx(worker->uart, (uint8_t*)command, command_length);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void _wifi_marauder_script_execute_deauth(
|
|
void _wifi_marauder_script_execute_deauth(
|
|
|
WifiMarauderScriptStageDeauth* stage,
|
|
WifiMarauderScriptStageDeauth* stage,
|
|
|
WifiMarauderScriptWorker* worker) {
|
|
WifiMarauderScriptWorker* worker) {
|
|
|
const char attack_command[] = "attack -t deauth\n";
|
|
const char attack_command[] = "attack -t deauth\n";
|
|
|
- wifi_marauder_uart_tx((uint8_t*)(attack_command), strlen(attack_command));
|
|
|
|
|
|
|
+ wifi_marauder_uart_tx(worker->uart, (uint8_t*)(attack_command), strlen(attack_command));
|
|
|
_wifi_marauder_script_delay(worker, stage->timeout);
|
|
_wifi_marauder_script_delay(worker, stage->timeout);
|
|
|
- _send_stop();
|
|
|
|
|
|
|
+ _send_stop(worker);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void _wifi_marauder_script_execute_probe(
|
|
void _wifi_marauder_script_execute_probe(
|
|
|
WifiMarauderScriptStageProbe* stage,
|
|
WifiMarauderScriptStageProbe* stage,
|
|
|
WifiMarauderScriptWorker* worker) {
|
|
WifiMarauderScriptWorker* worker) {
|
|
|
const char attack_command[] = "attack -t probe\n";
|
|
const char attack_command[] = "attack -t probe\n";
|
|
|
- wifi_marauder_uart_tx((uint8_t*)(attack_command), strlen(attack_command));
|
|
|
|
|
|
|
+ wifi_marauder_uart_tx(worker->uart, (uint8_t*)(attack_command), strlen(attack_command));
|
|
|
_wifi_marauder_script_delay(worker, stage->timeout);
|
|
_wifi_marauder_script_delay(worker, stage->timeout);
|
|
|
- _send_stop();
|
|
|
|
|
|
|
+ _send_stop(worker);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void _wifi_marauder_script_execute_sniff_raw(
|
|
void _wifi_marauder_script_execute_sniff_raw(
|
|
|
WifiMarauderScriptStageSniffRaw* stage,
|
|
WifiMarauderScriptStageSniffRaw* stage,
|
|
|
WifiMarauderScriptWorker* worker) {
|
|
WifiMarauderScriptWorker* worker) {
|
|
|
- const char sniff_command[] = "sniffraw\n";
|
|
|
|
|
- wifi_marauder_uart_tx((uint8_t*)sniff_command, strlen(sniff_command));
|
|
|
|
|
|
|
+ const char sniff_command[] = "sniffraw -serial\n";
|
|
|
|
|
+ wifi_marauder_uart_tx(worker->uart, (uint8_t*)sniff_command, strlen(sniff_command));
|
|
|
_wifi_marauder_script_delay(worker, stage->timeout);
|
|
_wifi_marauder_script_delay(worker, stage->timeout);
|
|
|
- _send_stop();
|
|
|
|
|
|
|
+ _send_stop(worker);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void _wifi_marauder_script_execute_sniff_beacon(
|
|
void _wifi_marauder_script_execute_sniff_beacon(
|
|
|
WifiMarauderScriptStageSniffBeacon* stage,
|
|
WifiMarauderScriptStageSniffBeacon* stage,
|
|
|
WifiMarauderScriptWorker* worker) {
|
|
WifiMarauderScriptWorker* worker) {
|
|
|
- const char sniff_command[] = "sniffbeacon\n";
|
|
|
|
|
- wifi_marauder_uart_tx((uint8_t*)sniff_command, strlen(sniff_command));
|
|
|
|
|
|
|
+ const char sniff_command[] = "sniffbeacon -serial\n";
|
|
|
|
|
+ wifi_marauder_uart_tx(worker->uart, (uint8_t*)sniff_command, strlen(sniff_command));
|
|
|
_wifi_marauder_script_delay(worker, stage->timeout);
|
|
_wifi_marauder_script_delay(worker, stage->timeout);
|
|
|
- _send_stop();
|
|
|
|
|
|
|
+ _send_stop(worker);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void _wifi_marauder_script_execute_sniff_deauth(
|
|
void _wifi_marauder_script_execute_sniff_deauth(
|
|
|
WifiMarauderScriptStageSniffDeauth* stage,
|
|
WifiMarauderScriptStageSniffDeauth* stage,
|
|
|
WifiMarauderScriptWorker* worker) {
|
|
WifiMarauderScriptWorker* worker) {
|
|
|
- const char sniff_command[] = "sniffdeauth\n";
|
|
|
|
|
- wifi_marauder_uart_tx((uint8_t*)sniff_command, strlen(sniff_command));
|
|
|
|
|
|
|
+ const char sniff_command[] = "sniffdeauth -serial\n";
|
|
|
|
|
+ wifi_marauder_uart_tx(worker->uart, (uint8_t*)sniff_command, strlen(sniff_command));
|
|
|
_wifi_marauder_script_delay(worker, stage->timeout);
|
|
_wifi_marauder_script_delay(worker, stage->timeout);
|
|
|
- _send_stop();
|
|
|
|
|
|
|
+ _send_stop(worker);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void _wifi_marauder_script_execute_sniff_esp(
|
|
void _wifi_marauder_script_execute_sniff_esp(
|
|
|
WifiMarauderScriptStageSniffEsp* stage,
|
|
WifiMarauderScriptStageSniffEsp* stage,
|
|
|
WifiMarauderScriptWorker* worker) {
|
|
WifiMarauderScriptWorker* worker) {
|
|
|
- const char sniff_command[] = "sniffesp\n";
|
|
|
|
|
- wifi_marauder_uart_tx((uint8_t*)sniff_command, strlen(sniff_command));
|
|
|
|
|
|
|
+ const char sniff_command[] = "sniffesp -serial\n";
|
|
|
|
|
+ wifi_marauder_uart_tx(worker->uart, (uint8_t*)sniff_command, strlen(sniff_command));
|
|
|
_wifi_marauder_script_delay(worker, stage->timeout);
|
|
_wifi_marauder_script_delay(worker, stage->timeout);
|
|
|
- _send_stop();
|
|
|
|
|
|
|
+ _send_stop(worker);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void _wifi_marauder_script_execute_sniff_pmkid(
|
|
void _wifi_marauder_script_execute_sniff_pmkid(
|
|
@@ -150,10 +152,10 @@ 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, " -d");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- len += snprintf(attack_command + len, sizeof(attack_command) - len, "\n");
|
|
|
|
|
- wifi_marauder_uart_tx((uint8_t*)attack_command, len);
|
|
|
|
|
|
|
+ len += snprintf(attack_command + len, sizeof(attack_command) - len, " -serial\n");
|
|
|
|
|
+ wifi_marauder_uart_tx(worker->uart, (uint8_t*)attack_command, len);
|
|
|
_wifi_marauder_script_delay(worker, stage->timeout);
|
|
_wifi_marauder_script_delay(worker, stage->timeout);
|
|
|
- _send_stop();
|
|
|
|
|
|
|
+ _send_stop(worker);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
char attack_command[50] = "sniffpmkid";
|
|
char attack_command[50] = "sniffpmkid";
|
|
@@ -167,27 +169,27 @@ void _wifi_marauder_script_execute_sniff_pmkid(
|
|
|
if(stage->force_deauth) {
|
|
if(stage->force_deauth) {
|
|
|
len += snprintf(attack_command + len, sizeof(attack_command) - len, " -d");
|
|
len += snprintf(attack_command + len, sizeof(attack_command) - len, " -d");
|
|
|
}
|
|
}
|
|
|
- len += snprintf(attack_command + len, sizeof(attack_command) - len, "\n");
|
|
|
|
|
- wifi_marauder_uart_tx((uint8_t*)attack_command, len);
|
|
|
|
|
|
|
+ len += snprintf(attack_command + len, sizeof(attack_command) - len, " -serial\n");
|
|
|
|
|
+ wifi_marauder_uart_tx(worker->uart, (uint8_t*)attack_command, len);
|
|
|
_wifi_marauder_script_delay(worker, stage->timeout);
|
|
_wifi_marauder_script_delay(worker, stage->timeout);
|
|
|
- _send_stop();
|
|
|
|
|
|
|
+ _send_stop(worker);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void _wifi_marauder_script_execute_sniff_pwn(
|
|
void _wifi_marauder_script_execute_sniff_pwn(
|
|
|
WifiMarauderScriptStageSniffPwn* stage,
|
|
WifiMarauderScriptStageSniffPwn* stage,
|
|
|
WifiMarauderScriptWorker* worker) {
|
|
WifiMarauderScriptWorker* worker) {
|
|
|
- const char sniff_command[] = "sniffpwn\n";
|
|
|
|
|
- wifi_marauder_uart_tx((uint8_t*)sniff_command, strlen(sniff_command));
|
|
|
|
|
|
|
+ const char sniff_command[] = "sniffpwn -serial\n";
|
|
|
|
|
+ wifi_marauder_uart_tx(worker->uart, (uint8_t*)sniff_command, strlen(sniff_command));
|
|
|
_wifi_marauder_script_delay(worker, stage->timeout);
|
|
_wifi_marauder_script_delay(worker, stage->timeout);
|
|
|
- _send_stop();
|
|
|
|
|
|
|
+ _send_stop(worker);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void _wifi_marauder_script_execute_beacon_list(
|
|
void _wifi_marauder_script_execute_beacon_list(
|
|
|
WifiMarauderScriptStageBeaconList* stage,
|
|
WifiMarauderScriptStageBeaconList* stage,
|
|
|
WifiMarauderScriptWorker* worker) {
|
|
WifiMarauderScriptWorker* worker) {
|
|
|
const char clearlist_command[] = "clearlist -s\n";
|
|
const char clearlist_command[] = "clearlist -s\n";
|
|
|
- wifi_marauder_uart_tx((uint8_t*)(clearlist_command), strlen(clearlist_command));
|
|
|
|
|
|
|
+ wifi_marauder_uart_tx(worker->uart, (uint8_t*)(clearlist_command), strlen(clearlist_command));
|
|
|
|
|
|
|
|
char command[100];
|
|
char command[100];
|
|
|
char* ssid;
|
|
char* ssid;
|
|
@@ -195,8 +197,8 @@ void _wifi_marauder_script_execute_beacon_list(
|
|
|
for(int i = 0; i < stage->ssid_count; i++) {
|
|
for(int i = 0; i < stage->ssid_count; i++) {
|
|
|
ssid = stage->ssids[i];
|
|
ssid = stage->ssids[i];
|
|
|
snprintf(command, sizeof(command), "ssid -a -n \"%s\"", ssid);
|
|
snprintf(command, sizeof(command), "ssid -a -n \"%s\"", ssid);
|
|
|
- wifi_marauder_uart_tx((uint8_t*)(command), strlen(command));
|
|
|
|
|
- _send_line_break();
|
|
|
|
|
|
|
+ wifi_marauder_uart_tx(worker->uart, (uint8_t*)(command), strlen(command));
|
|
|
|
|
+ _send_line_break(worker);
|
|
|
}
|
|
}
|
|
|
if(stage->random_ssids > 0) {
|
|
if(stage->random_ssids > 0) {
|
|
|
char add_random_command[50];
|
|
char add_random_command[50];
|
|
@@ -205,27 +207,30 @@ void _wifi_marauder_script_execute_beacon_list(
|
|
|
sizeof(add_random_command),
|
|
sizeof(add_random_command),
|
|
|
"ssid -a -r -g %d\n",
|
|
"ssid -a -r -g %d\n",
|
|
|
stage->random_ssids);
|
|
stage->random_ssids);
|
|
|
- wifi_marauder_uart_tx((uint8_t*)add_random_command, strlen(add_random_command));
|
|
|
|
|
|
|
+ wifi_marauder_uart_tx(
|
|
|
|
|
+ worker->uart, (uint8_t*)add_random_command, strlen(add_random_command));
|
|
|
}
|
|
}
|
|
|
const char attack_command[] = "attack -t beacon -l\n";
|
|
const char attack_command[] = "attack -t beacon -l\n";
|
|
|
- wifi_marauder_uart_tx((uint8_t*)(attack_command), strlen(attack_command));
|
|
|
|
|
|
|
+ wifi_marauder_uart_tx(worker->uart, (uint8_t*)(attack_command), strlen(attack_command));
|
|
|
_wifi_marauder_script_delay(worker, stage->timeout);
|
|
_wifi_marauder_script_delay(worker, stage->timeout);
|
|
|
- _send_stop();
|
|
|
|
|
|
|
+ _send_stop(worker);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void _wifi_marauder_script_execute_beacon_ap(
|
|
void _wifi_marauder_script_execute_beacon_ap(
|
|
|
WifiMarauderScriptStageBeaconAp* stage,
|
|
WifiMarauderScriptStageBeaconAp* stage,
|
|
|
WifiMarauderScriptWorker* worker) {
|
|
WifiMarauderScriptWorker* worker) {
|
|
|
const char command[] = "attack -t beacon -a\n";
|
|
const char command[] = "attack -t beacon -a\n";
|
|
|
- wifi_marauder_uart_tx((uint8_t*)command, strlen(command));
|
|
|
|
|
|
|
+ wifi_marauder_uart_tx(worker->uart, (uint8_t*)command, strlen(command));
|
|
|
_wifi_marauder_script_delay(worker, stage->timeout);
|
|
_wifi_marauder_script_delay(worker, stage->timeout);
|
|
|
- _send_stop();
|
|
|
|
|
|
|
+ _send_stop(worker);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-void _wifi_marauder_script_execute_exec(WifiMarauderScriptStageExec* stage) {
|
|
|
|
|
|
|
+void _wifi_marauder_script_execute_exec(
|
|
|
|
|
+ WifiMarauderScriptStageExec* stage,
|
|
|
|
|
+ WifiMarauderScriptWorker* worker) {
|
|
|
if(stage->command != NULL) {
|
|
if(stage->command != NULL) {
|
|
|
- wifi_marauder_uart_tx((uint8_t*)stage->command, strlen(stage->command));
|
|
|
|
|
- _send_line_break();
|
|
|
|
|
|
|
+ wifi_marauder_uart_tx(worker->uart, (uint8_t*)stage->command, strlen(stage->command));
|
|
|
|
|
+ _send_line_break(worker);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -248,8 +253,8 @@ void wifi_marauder_script_execute_start(void* context) {
|
|
|
sizeof(command),
|
|
sizeof(command),
|
|
|
"settings -s EnableLED %s",
|
|
"settings -s EnableLED %s",
|
|
|
script->enable_led ? "enable" : "disable");
|
|
script->enable_led ? "enable" : "disable");
|
|
|
- wifi_marauder_uart_tx((uint8_t*)command, strlen(command));
|
|
|
|
|
- _send_line_break();
|
|
|
|
|
|
|
+ wifi_marauder_uart_tx(worker->uart, (uint8_t*)command, strlen(command));
|
|
|
|
|
+ _send_line_break(worker);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Enables or disables PCAP saving according to script settings
|
|
// Enables or disables PCAP saving according to script settings
|
|
@@ -259,8 +264,8 @@ void wifi_marauder_script_execute_start(void* context) {
|
|
|
sizeof(command),
|
|
sizeof(command),
|
|
|
"settings -s SavePCAP %s",
|
|
"settings -s SavePCAP %s",
|
|
|
script->save_pcap ? "enable" : "disable");
|
|
script->save_pcap ? "enable" : "disable");
|
|
|
- wifi_marauder_uart_tx((uint8_t*)command, strlen(command));
|
|
|
|
|
- _send_line_break();
|
|
|
|
|
|
|
+ wifi_marauder_uart_tx(worker->uart, (uint8_t*)command, strlen(command));
|
|
|
|
|
+ _send_line_break(worker);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -274,7 +279,7 @@ void wifi_marauder_script_execute_stage(WifiMarauderScriptStage* stage, void* co
|
|
|
_wifi_marauder_script_execute_scan((WifiMarauderScriptStageScan*)stage_data, worker);
|
|
_wifi_marauder_script_execute_scan((WifiMarauderScriptStageScan*)stage_data, worker);
|
|
|
break;
|
|
break;
|
|
|
case WifiMarauderScriptStageTypeSelect:
|
|
case WifiMarauderScriptStageTypeSelect:
|
|
|
- _wifi_marauder_script_execute_select((WifiMarauderScriptStageSelect*)stage_data);
|
|
|
|
|
|
|
+ _wifi_marauder_script_execute_select((WifiMarauderScriptStageSelect*)stage_data, worker);
|
|
|
break;
|
|
break;
|
|
|
case WifiMarauderScriptStageTypeDeauth:
|
|
case WifiMarauderScriptStageTypeDeauth:
|
|
|
_wifi_marauder_script_execute_deauth((WifiMarauderScriptStageDeauth*)stage_data, worker);
|
|
_wifi_marauder_script_execute_deauth((WifiMarauderScriptStageDeauth*)stage_data, worker);
|
|
@@ -315,7 +320,7 @@ void wifi_marauder_script_execute_stage(WifiMarauderScriptStage* stage, void* co
|
|
|
(WifiMarauderScriptStageBeaconAp*)stage_data, worker);
|
|
(WifiMarauderScriptStageBeaconAp*)stage_data, worker);
|
|
|
break;
|
|
break;
|
|
|
case WifiMarauderScriptStageTypeExec:
|
|
case WifiMarauderScriptStageTypeExec:
|
|
|
- _wifi_marauder_script_execute_exec((WifiMarauderScriptStageExec*)stage_data);
|
|
|
|
|
|
|
+ _wifi_marauder_script_execute_exec((WifiMarauderScriptStageExec*)stage_data, worker);
|
|
|
break;
|
|
break;
|
|
|
case WifiMarauderScriptStageTypeDelay:
|
|
case WifiMarauderScriptStageTypeDelay:
|
|
|
_wifi_marauder_script_execute_delay((WifiMarauderScriptStageDelay*)stage_data, worker);
|
|
_wifi_marauder_script_execute_delay((WifiMarauderScriptStageDelay*)stage_data, worker);
|