Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pwn import *
- def oracle_decrypt(ct):
- io.sendline(ct.hex())
- response = io.recvline()
- #print(response)
- if b"adding is incorrect" in response:
- return False
- return True
- io=remote("padding-oracle.chall.srdnlen.it", 443, ssl=True)
- io.recvuntil(b"flag")
- iv_and_flag=io.recvuntil(b"What do you want to decrypt (in hex)?").decode().strip()
- iv_and_flag=iv_and_flag[:192]
- iv_and_flag=bytes.fromhex(iv_and_flag) #ora è di 96
- array = [iv_and_flag[i] for i in range(0, len(iv_and_flag))]
- print(array)
- orig_arr_80=array[79]
- for i in range(0, 256):
- if i == orig_arr_80:
- continue
- array[79] = i
- if oracle_decrypt(bytes(array)):
- t1=i
- print(i)
- x1 = (t1) ^ 1
- p1 = x1 ^ orig_arr_80
- print(p1)
- io.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement