execle()也规定了环境。这意味着什么?

编程入门 行业动态 更新时间:2024-10-08 10:52:55
本文介绍了execle()也规定了环境。这意味着什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我读了一本书叫黑客:开采的艺术,我碰到这个段落:

  

使用execl的(),现有的环境中使用,但如果你使用execle()  整个环境可以被指定。如果环境阵列仅仅是  外壳code作为第一个字符串(用NULL指针终止列表)时,  只有环境变量将壳code。这使得它的地址容易  计算。在Linux中,地址将是0xbffffffa,减去的长度  壳中的环境code,减去执行的名称的长度  程序。因为此地址将是准确的说,就没有必要为一个NOP雪橇

  • 这是什么意思,通过指定的环境?

  • 什么分类不同的环境?

  • 为什么环境变量的地址计算,方式(或者更具体地说,为什么基址0xbffffffa)?

  • 如果我用EXECL()函数,而不是execle()可能我没有使用的shell code环境变量?

  • 解决方案   

    他们是怎么通过指定的环境呢?

    传递给最后一个参数execle()是字符指针,包含C字符串描述的环境变量执行的程序将看到的数组。 这里是一个例子。

      

    分类什么不同环境?

    我不完全得到这一个。每个程序都有自己的一套环境变量,仅此而已。

      

    为什么环境变量的地址计算,方式(或者更具体地说,为什么基址0xbffffffa)?

    由于Linux内核中实现像这样。

      

    如果我使用了 EXECL()函数代替 execle()可我没有使用的shell code环境变量?

    EXECL()做的不可以让您指定的环境变量,如果这就是你感兴趣的东西。

    I am reading a book called "Hacking: The art of exploitation" and I came across this paragraph:

    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.

  • What do they mean by specifying the environment?

  • What classifies different environments?

  • Why is the address of the environment variable calculated that way (or more specifically why is the base address 0xbffffffa)?

  • If I used the execl() function instead of the execle() could I not have used the shellcode environment variable?

  • 解决方案

    What do they mean by specifying the environment?

    The last argument passed to execle() is an array of char pointers, which contain C strings describing the environment variables the executed program will see. Here is an example.

    What classifies different environments?

    I don't quite get this one. Each program has its own set of environment variables, that's it.

    Why is the address of the environment variable calculated that way (or more specifically why is the base address 0xbffffffa)?

    Because the Linux kernel is implemented like so.

    If I used the execl() function instead of the execle() could I not have used the shellcode environment variable?

    execl() does not let you specify environment variables, if that's what you're interested in.

    更多推荐

    execle()也规定了环境。这意味着什么?

    本文发布于:2023-08-07 22:41:53,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1322207.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:环境   这意味着   规定了   execle

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!