Last active
October 3, 2016 14:34
-
-
Save hugsy/c83db6802955ca3511904228ad26a274 to your computer and use it in GitHub Desktop.
CSAW - rock - rev 100
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
# @_hugsy_ | |
# $ python bf.py | |
# Pass 0 | |
# [...] | |
# Pass 27 | |
# Pass 28 | |
# Pass 29 | |
# ///////////////////////////////// | |
# Do not be angry. Happy Hacking :) | |
# ///////////////////////////////// | |
# Flag{IoDJuvwxy\tuvyxwxvwzx{\z{vwxyz} | |
from pwn import * | |
import string | |
context.log_level = "critical" | |
def guess_char(prefix, i): | |
for c in string.printable: | |
r = process("./rock") | |
line = prefix + c + "A"*(29-len(prefix)) | |
r.sendline(line) | |
r.recvuntil("Checking....\n") | |
l = r.recv(1024) | |
if "Pass %d"%i in l: | |
print l | |
r.close() | |
return c | |
r.close() | |
return "" | |
f = "" | |
for i in range(30): | |
c = guess_char(f, i) | |
if c == "": | |
raise Exception("fooooooo") | |
f+= c | |
print f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment