我正在读一本名为“黑客:剥削的艺术”的书,我看到了这段话:
With execl(), the existing environment is used, but if you use execle(), the entire environment can be specified. If the environment array is just the shellcode as the first string (with a NULL pointer to terminate the list), the only environment variable will be the shellcode. This makes its address easy to calculate. In Linux, the address will be 0xbffffffa, minus the length of the shellcode in the environment, minus the length of the name of the executed program. Since this address will be exact, there is no need for a NOP sled.
指定环境是什么意思?
什么对不同的环境进行分类?
为什么环境变量的地址是这样计算的(或者更具体地说,为什么基地址是 0xbffffffa)?
如果我使用 execl() 函数而不是 execle() 函数,我是否可以不使用 shellcode 环境变量?
最佳答案
What do they mean by specifying the environment?
传递给 execle()
的最后一个参数是一个字符指针数组,其中包含描述执行程序将看到的环境变量的 C 字符串。 Here是一个例子。
What classifies different environments?
我不太明白这个。每个程序都有自己的一组环境变量,仅此而已。
Why is the address of the environment variable calculated that way (or more specifically why is the base address 0xbffffffa)?
因为Linux内核是这样实现的。
If I used the
execl()
function instead of theexecle()
could I not have used the shellcode environment variable?
execl()
不让您指定环境变量,如果您对此感兴趣的话。
关于c - execle() 还指定了环境。这意味着什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16864812/