return to lib_c buffer overflow exercise issue

后端 未结 2 1510
伪装坚强ぢ
伪装坚强ぢ 2020-12-13 20:46

I\'m supposed to come up with a program that exploits the \"return to libc buffer overflow\". This is, when executed, it cleanly exits and brings up a SHELL prompt. The pr

2条回答
  •  北荒
    北荒 (楼主)
    2020-12-13 21:05

    You can search in libc for a fixed address of a /bin/sh string. Run you program in gdb then:

    > (gdb) break main
    > 
    > (gdb) run   
    >
    > (gdb) print &system  
    > $1 = (*) 0xf7e68250 
    > 
    > (gdb) find &system,+9999999,"/bin/sh"  
    > 0xf7f86c4c
    > warning: Unable to access target memory at 0xf7fd0fd4, halting search. 
    > 1 pattern found.
    

    Good luck.

提交回复
热议问题