什么是地址空间布局随机化 [英] what is Address space layout randomization

查看:117
本文介绍了什么是地址空间布局随机化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
内存随机化是应用程序安全性的增强吗?

Possible Duplicate:
Memory randomization as application security enhancement?

能请我解释一下什么是地址空间布局随机化以及如何实现.该技术如何影响堆栈,堆和静态数据.我也对解释地址空间布局随机化的任何论文感兴趣.

Can some explain me please what address space Layout Randomization is and how is it implemented. How does this technique affect the stack, heap and static data. Also I am interested in any papers that explain about the address space Layout Randomization.

感谢&问候

鼠标.

推荐答案

ASLR是一种技术,旨在通过在各个段之间移动一些片段来使各种类型的缓冲区溢出变得更加难以利用.堆栈可能会移位几个字节(或页面),程序的各个部分(甚至代码使用的库)也可以加载到不同的地址,等等.

ASLR is a technique designed to make various types of buffer overruns more difficult to exploit, by moving segments around a bit. The stack could be shifted a few bytes (or pages), the sections of your program (and even the libraries your code uses) can be loaded at different addresses, etc.

缓冲区溢出通常通过诱使CPU在某个地址(通常在堆栈上)运行代码来起作用. ASLR使地址更难预测,从而使地址复杂化,因为它可以在程序每次运行时对其进行更改.因此,程序通常会崩溃,而不是运行任意代码.这显然是一件坏事,但没有允许一些随机小丑控制您的服务器那样糟糕.

Buffer overflows usually work by tricking the CPU into running code at a certain address (often on the stack). ASLR complicates that by making the address harder to predict, since it can change each and every time the program runs. So often, instead of running arbitrary code, the program will just crash. This is obviously a bad thing, but not as bad as if some random joker were allowed to take control of your server.

一种非常简单的粗略形式的ASLR实际上可以在没有操作系统任何帮助的情况下实现,只需从堆栈指针中减去少量即可. (在高级语言中这样做有点棘手,但是在C语言中则更简单-在ASM中则是微不足道的.)但是,这只能防止使用堆栈的溢出.操作系统更有帮助;如果有感觉,它可以改变各种东西.不过,这取决于您的操作系统.

A very simple, crude form of ASLR can actually be implemented without any help from the OS, by simply subtracting some small amount from the stack pointer. (It's a little tricky to do in higher-level languages, but somewhat simpler in C -- and downright trivial in ASM.) That'll only protect against overflows that use the stack, though. The OS is more helpful; it can change all sorts of stuff if it feels like. It depends on your OS as to how much it does, though.

这篇关于什么是地址空间布局随机化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆