Skip to content

Instantly share code, notes, and snippets.

@CreateRemoteThread
Created May 21, 2018 02:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CreateRemoteThread/8755a5e495a0f720888b8d1d39ed6ec6 to your computer and use it in GitHub Desktop.
Save CreateRemoteThread/8755a5e495a0f720888b8d1d39ed6ec6 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import pwn
pwn.context.log_level = "error"
key = {}
for c in "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-{}":
p = pwn.process("./babyre")
p.sendline("test 16")
p.sendline("%c" % c)
data = p.recvall()
x = data[20:28]
try:
key[int(x,16)] = c
except:
print "missing: %s" % x
# print "%c:%s" % (c,x)
p.close()
out = ""
f = open("out")
for l_ in f.readlines():
l = l_.rstrip()
leftword = l[0:8]
rightword = l[8:]
out += key[int(leftword,16)]
out += key[int(rightword,16)]
# print leftword
# print rightword
f.close()
print out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment