由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - 那些用buffer overflow来attack的人是怎么计算出要覆盖的内存地址的阿?
相关主题
跟你们科班的差太远了Python里边file writer的问题
MinGW在win7上就是一个垃圾pointer overflow
为什么会有recursion stack overflow这个问题?程序中的各个变量/数组的内存地址是否会混在一起?
关于buffer overflowa question about bitwise operation
请教个C++问题请问多个线程同时访问同一个内存地址会不会使得程序变慢
面试题:debug: 函数return to a wrong place这个printf结果是什么?
代码开源了does the system guarantee this? (转载)
一个101的面试题multi-thread 一问,
相关话题的讨论汇总
话题: overflow话题: buffer话题: 内存地址话题: cpu话题: 覆盖
进入Programming版参与讨论
1 (共1页)
s*i
发帖数: 388
1
自己也用过好几个exploit的程序,搞fedora获得root。但是不知道那些牛人们,用
buffer
overflow来attack的人是怎么计算出要覆盖的内存地址的阿?
难道那些heap ram地址不是动态的么?怎么能那么精准的计算出需要覆盖的位置阿?
s********k
发帖数: 6180
2
我知道的buffer overflow都是在stack上作文章,不是heap。比如写个子函
数开个byte a[10],最后用指针指向*(a+11),当然这个是最简单的,不过原理
应该就是这样。
还有就是现在的编译器基本都有功能避免buffer overflow,VC,GCC只需要
在编译选项中设定一下就可以了

人们,用
位置阿?

【在 s*i 的大作中提到】
: 自己也用过好几个exploit的程序,搞fedora获得root。但是不知道那些牛人们,用
: buffer
: overflow来attack的人是怎么计算出要覆盖的内存地址的阿?
: 难道那些heap ram地址不是动态的么?怎么能那么精准的计算出需要覆盖的位置阿?

t****t
发帖数: 6806
3
why it's heap? buffer overflow usually happens on stack.
and why you think it's "dynamic"?

【在 s*i 的大作中提到】
: 自己也用过好几个exploit的程序,搞fedora获得root。但是不知道那些牛人们,用
: buffer
: overflow来attack的人是怎么计算出要覆盖的内存地址的阿?
: 难道那些heap ram地址不是动态的么?怎么能那么精准的计算出需要覆盖的位置阿?

t****t
发帖数: 6806
4
it's not avoid buffer overflow, it's avoid execution on data segment. and
CPU provided the function, not compiler.

【在 s********k 的大作中提到】
: 我知道的buffer overflow都是在stack上作文章,不是heap。比如写个子函
: 数开个byte a[10],最后用指针指向*(a+11),当然这个是最简单的,不过原理
: 应该就是这样。
: 还有就是现在的编译器基本都有功能避免buffer overflow,VC,GCC只需要
: 在编译选项中设定一下就可以了
:
: 人们,用
: 位置阿?

s********k
发帖数: 6180
5
是CPU提供的?我怎么记得是compiler?或者compiler告诉CPU?能详细讲讲
CPU怎么避免的吗?另外如果只是个单片机之类的,CPU也有这个功能?

data segment. and

【在 t****t 的大作中提到】
: it's not avoid buffer overflow, it's avoid execution on data segment. and
: CPU provided the function, not compiler.

s*i
发帖数: 388
6
well, technically both heap and stack are growing towards each other, so
there
is no much difference wrt exploit.
u can
int *p = malloc(10); //heap
p[11] = 100;
or
int p[10]; //stack
p[11] = 100;
and basically u r gonna access some other place.
"dynamic" means, if your executable is complicated enough, each time the OS
is
gonna allocate different place in the ram to it. not "fix".

【在 t****t 的大作中提到】
: why it's heap? buffer overflow usually happens on stack.
: and why you think it's "dynamic"?

t****t
发帖数: 6806
7
堆栈上溢出了会冲掉返回地址, 堆上溢出有什么用?
至于每次是不是分配不同的地址, 你为什么不写个程序把地址打印出来看看?

【在 s*i 的大作中提到】
: well, technically both heap and stack are growing towards each other, so
: there
: is no much difference wrt exploit.
: u can
: int *p = malloc(10); //heap
: p[11] = 100;
: or
: int p[10]; //stack
: p[11] = 100;
: and basically u r gonna access some other place.

t****t
发帖数: 6806
8
google DEP

【在 s********k 的大作中提到】
: 是CPU提供的?我怎么记得是compiler?或者compiler告诉CPU?能详细讲讲
: CPU怎么避免的吗?另外如果只是个单片机之类的,CPU也有这个功能?
:
: data segment. and

M**u
发帖数: 10158
9
主要就是写一堆binary,把return address给覆盖了之类

【在 s********k 的大作中提到】
: 我知道的buffer overflow都是在stack上作文章,不是heap。比如写个子函
: 数开个byte a[10],最后用指针指向*(a+11),当然这个是最简单的,不过原理
: 应该就是这样。
: 还有就是现在的编译器基本都有功能避免buffer overflow,VC,GCC只需要
: 在编译选项中设定一下就可以了
:
: 人们,用
: 位置阿?

1 (共1页)
进入Programming版参与讨论
相关主题
multi-thread 一问,请教个C++问题
OpenGL能否方便实现自定义图形的移动,擦除和分层显示?面试题:debug: 函数return to a wrong place
新人5个包子请教问题,redhat读写文件的内存问题 (转载)代码开源了
问一个vim的问题一个101的面试题
跟你们科班的差太远了Python里边file writer的问题
MinGW在win7上就是一个垃圾pointer overflow
为什么会有recursion stack overflow这个问题?程序中的各个变量/数组的内存地址是否会混在一起?
关于buffer overflowa question about bitwise operation
相关话题的讨论汇总
话题: overflow话题: buffer话题: 内存地址话题: cpu话题: 覆盖