1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| from pwn import * from string import printable p=process("encsh") p.recvuntil(">") p.sendline("key") p.sendline("mykeymykeyhackergoawayyourkeyyou") flag="" tryflag="" idx=0 enc=[227, 83, 162, 17, 197, 102, 127, 119, 94, 208, 82, 187, 221, 191, 112, 186, 0, 170, 191, 44, 233, 242, 209, 114, 70, 116, 203, 80, 72, 65, 254, 111, 119, 146, 95, 180, 182, 77, 140, 110, 204, 249, 76, 34, 229, 39, 30, 12, 248, 89, 158, 103, 170] for _ in range(0xff): if tryflag.endswith("}"): p.close() exit() for j in printable: p.recvuntil(">") p.sendline("enc") tryflag=flag+j p.sendline(tryflag) out=eval(p.recvline().decode().strip()) if out[idx]==enc[idx]: for i in range(idx,len(enc)): if out[i]!=enc[i]: idx=i break flag=tryflag print(flag) break
|