Created
September 17, 2017 14:39
-
-
Save anonymous/5e37c34fa0c0fea5b3c0578466af65fa 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
from pwn import * | |
from Crypto.Util.number import * | |
p = remote('misc.chal.csaw.io', 4239) | |
flag = "" | |
k = 0 | |
data = p.recv().split('\n')[1] | |
parity = data[9] | |
data = data[1:9] | |
if data.count('1') % 2 == parity: | |
flag+= long_to_bytes(int(data,2)) | |
print flag | |
k+= 1 | |
else: | |
p.sendline("0") | |
while k < 100: | |
data = p.recv() | |
parity = int(data[9]) | |
data = data[1:9] | |
if data.count('1') % 2 == parity: | |
p.sendline("1") | |
flag+= long_to_bytes(int(data,2)) | |
print flag | |
k+= 1 | |
else: | |
p.sendline("0") | |
print flag |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment