Skip to content

Instantly share code, notes, and snippets.

@realsung
Created August 16, 2019 13:32
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 realsung/4b18c6543a60fd26f381943119a652c3 to your computer and use it in GitHub Desktop.
Save realsung/4b18c6543a60fd26f381943119a652c3 to your computer and use it in GitHub Desktop.
from pwn import *
from ast import literal_eval
p = remote('218.158.141.182',52387)
for i in range(100):
payload=""
print p.recvuntil('Step : ' + str(i+1) + "\n\n")
text = p.recvline()
text = list(text)
del(text[-1])
heigth = p.recvline()
table = p.recvline()
table = table[9:]
dictionary = literal_eval(table)
value = list(dictionary.keys())
while len(text) != 0:
for i in range(1,5):
tmp = text[:i]
tmp2 = ''.join(i for i in tmp)
for j in range(5):
if tmp2 == dictionary[value[j]]:
payload += value[j]
del text[:i]
print payload
p.sendline(payload)
p.interactive()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment