Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pwn import *
- sh = remote('challenges.metactfjo.com', 666)
- #Header lines
- print sh.recvline()
- print sh.recvline()
- print sh.recvline()
- #End header lines
- import base64
- def get_answer():
- r = sh.recvline()
- print r
- r = ' '.join(r.split(' ')[3:]).strip()
- isbinary=True
- for c in r:
- if c not in '01':
- isbinary=False
- break
- isdecimal=True
- for c in r:
- if c not in '1234567890 ':
- isdecimal=False
- ishexa=True
- for c in r:
- if c not in '1234567890abcdef':
- ishexa=False
- rez = ''
- if isbinary==True:
- rez = ('%x'%int(r,2)).decode('hex')
- elif isdecimal==True:
- for c in r.split(' '):
- if c=='':
- continue
- rez += chr(int(c))
- elif ishexa==True:
- rez = r.decode('hex')
- else:
- rez = base64.b64decode(r)
- return rez
- for i in range(49):
- sh.sendline(get_answer())
- sh.recvline()
- sh.sendline(get_answer())
- sh.interactive()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement