-
-
Save MrMugiwara/c777d972c8a806457d9b803ad7cacc06 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
#Faid Mohammed Amine | |
#Fb : piratuer | |
from pwn import * | |
import sys | |
def main(): | |
con = remote('misc.chal.csaw.io', 4239) | |
con.recvline() | |
while True: | |
bins = con.recvline().strip() | |
assert bins[0] == '0' | |
assert bins[-1] == '1' | |
bs = map(int, list(bins))[1:-1] | |
pty = bs[-1] | |
cs = bs[:-1] | |
if cs.count(1) % 2 == pty: | |
sys.stdout.write(chr(int(bins[1:-2], 2))) | |
con.sendline('1') | |
else: | |
con.sendline('0') | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment