@@ -14,9 +14,10 @@ void _send_line_break() {
14
14
wifi_marauder_uart_tx ((uint8_t * )("\n" ), 1 );
15
15
}
16
16
17
+
17
18
void _send_channel_select (int channel ) {
18
19
char command [30 ];
19
- wifi_marauder_uart_tx (( uint8_t * )( "\n" ), 1 );
20
+ _send_line_break ( );
20
21
snprintf (command , sizeof (command ), "channel -s %d\n" , channel );
21
22
wifi_marauder_uart_tx ((uint8_t * )(command ), strlen (command ));
22
23
}
@@ -137,25 +138,42 @@ void _wifi_marauder_script_execute_sniff_esp(
137
138
}
138
139
139
140
void _wifi_marauder_script_execute_sniff_pmkid (
140
- WifiMarauderScriptStageSniffPmkid * stage ,
141
- WifiMarauderScriptWorker * worker ) {
142
- char attack_command [50 ] = "sniffpmkid" ;
143
- int len = strlen (attack_command );
141
+ WifiMarauderScriptStageSniffPmkid * stage ,
142
+ WifiMarauderScriptWorker * worker ) {
143
+
144
+ // If channel hopping is enabled, loop through channels 1-11
145
+ if (stage -> hop_channels ) {
146
+ for (int i = 1 ; i <= 11 ; i ++ ) {
147
+ char attack_command [50 ] = "sniffpmkid" ;
148
+ int len = strlen (attack_command );
149
+
150
+ len += snprintf (attack_command + len , sizeof (attack_command ) - len , " -c %d" , i );
151
+ if (stage -> force_deauth ) {
152
+ len += snprintf (attack_command + len , sizeof (attack_command ) - len , " -d" );
153
+ }
154
+
155
+ len += snprintf (attack_command + len , sizeof (attack_command ) - len , "\n" );
156
+ wifi_marauder_uart_tx ((uint8_t * )attack_command , len );
157
+ _wifi_marauder_script_delay (worker , stage -> timeout );
158
+ _send_stop ();
159
+ }
160
+ } else {
161
+ char attack_command [50 ] = "sniffpmkid" ;
162
+ int len = strlen (attack_command );
144
163
145
- if (stage -> channel > 0 ) {
146
- len +=
147
- snprintf (attack_command + len , sizeof (attack_command ) - len , " -c %d" , stage -> channel );
148
- }
164
+ if (stage -> channel > 0 ) {
165
+ len +=
166
+ snprintf (attack_command + len , sizeof (attack_command ) - len , " -c %d" , stage -> channel );
167
+ }
149
168
150
- if (stage -> force_deauth ) {
151
- len += snprintf (attack_command + len , sizeof (attack_command ) - len , " -d" );
169
+ if (stage -> force_deauth ) {
170
+ len += snprintf (attack_command + len , sizeof (attack_command ) - len , " -d" );
171
+ }
172
+ len += snprintf (attack_command + len , sizeof (attack_command ) - len , "\n" );
173
+ wifi_marauder_uart_tx ((uint8_t * )attack_command , len );
174
+ _wifi_marauder_script_delay (worker , stage -> timeout );
175
+ _send_stop ();
152
176
}
153
-
154
- len += snprintf (attack_command + len , sizeof (attack_command ) - len , "\n" );
155
-
156
- wifi_marauder_uart_tx ((uint8_t * )attack_command , len );
157
- _wifi_marauder_script_delay (worker , stage -> timeout );
158
- _send_stop ();
159
177
}
160
178
161
179
void _wifi_marauder_script_execute_sniff_pwn (
@@ -209,6 +227,7 @@ void _wifi_marauder_script_execute_beacon_ap(
209
227
void _wifi_marauder_script_execute_exec (WifiMarauderScriptStageExec * stage ) {
210
228
if (stage -> command != NULL ) {
211
229
wifi_marauder_uart_tx ((uint8_t * )stage -> command , strlen (stage -> command ));
230
+ _send_line_break ();
212
231
}
213
232
}
214
233
0 commit comments