ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

execle()也指定了环境.那是什么意思?

2019-06-29 14:38:10  阅读:242  来源: 互联网

标签:c-3 linux exec exploit shellcode


我正在读一本名为“黑客:剥削艺术”的书,我看到了这一段:

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()的最后一个参数是一个char指针数组,它包含描述执行程序将看到的环境变量的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 the execle() could I not have used the shellcode environment variable?

execl()不允许您指定环境变量,如果这是您感兴趣的内容.

标签:c-3,linux,exec,exploit,shellcode
来源: https://codeday.me/bug/20190629/1327012.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有