angr써보려햇으나 결과값이 잘 안맞아서 그냥 디버깅

잘 돌리면 될거같은데 지금생각해보니 null byte때문에 삑난거 같은데 angr아웃풋 말고 /tmp/.starcraft파일을 봤으면

angr로 풀렸겠다 ㄷ_ㄷ


.starcraft는 ltrace해보면 바로 보인다


fread함수 bp 다걸어놓고 한줄씩 결과 프린트 비교하면서 찾아갔다.


from pwn import *
import struct
import time

#doesn't work just reversing with ida scripting
def angr_find():
    import angr

    p=angr.Project('./prophecy',load_options={"auto_load_libs":False})
    pg=p.factory.path_group(threads=4)
    pg.explore(find=0x40307b)#40330A)#40390A)
    print pg.found[0].state.posix.dumps(1).encode('hex')


#context(arch='i386', os='linux', log_level='debug')
def testgo():

    r=process('./prophecy')

    r.sendline('.starcraft')
    r.recvuntil('[*]Give me the key to unlock the prophecy')
    #raw_input()
    pay=p32(0x17202508)
    pay+='AA\x00AAAAA'
    pay+='\x5a'
    pay+='\x03'
    pay+='\x93\xea\xe4'
    #input
    pay+='\x00'
    pay+='\x5a\x45\x52\x41\x54\x55\x4c'
    pay+='\x00\x53\x41\x56\x45\x44'#0x444556415300
    pay+=p32(0x4C4C4100)

    raw_input()

    r.sendline(pay)
    raw_input()
#angr_find()
testgo()
#angr_find()



+ Recent posts