Created
May 21, 2018 02:04
-
-
Save CreateRemoteThread/8755a5e495a0f720888b8d1d39ed6ec6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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