利用 jmp_buf 结构中的缓冲区溢出

发布于 2024-11-10 07:43:44 字数 340 浏览 5 评论 0原文

我需要帮助来利用 jmp_buf 结构上的缓冲区溢出。

我在堆栈上有以下值(由 gdb 看到):

0xbffffc40:     0xb7fd8ff4      0x080485a0      0x080483f0      0xbffffcf8
0xbffffc50:     0xebf06081      0x1d0a15ee

第二个是下一个 IP(在 setjmp 之后),但如果我修改它,我不会改变程序的行为。

我注意到,只有修改最后一个的值,我才能更改流程(并获得分段)。

但是,我无法理解最后一个词的含义以及如何更改它以获得所需的行为。

I need help to exploit a buffer overflow on a jmp_buf structure.

I have the following values on the stack (seen by gdb):

0xbffffc40:     0xb7fd8ff4      0x080485a0      0x080483f0      0xbffffcf8
0xbffffc50:     0xebf06081      0x1d0a15ee

The second one is the next IP (after the setjmp) but if i modify it i do not change the behavior of my program.

I noticed that I can change the flow (and obtain a Segmentation) only if i modify the value of the last one.

But, I can not understand the meaning of the last word and how to change it to obtain the desired behavior.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

疏忽 2024-11-17 07:43:44

我现在正在尝试做同样的事情 - 我不知道你正在使用什么操作系统,但我找到了以下文档
(@ http://freebsd.active-venture .com/FreeBSD-srctree/newsrc/dev/vinum/vinummemory.c.html)对于 freebsd,它简单地描述了 jmpbuf 结构:

struct JmpBuf {
    int jb_ebx; //in your case --> 0xb7fd8ff4      
    int jb_esp; //in your case --> 0x080485a0
    int jb_ebp; //in your case --> 0x080483f0      
    int jb_esi; //in your case --> 0xbffffcf8
    int jb_edi; //in your case --> 0xebf06081      
    int jb_eip; //in your case --> 0x1d0a15ee
    };

因此0x080485a0 将是存储的 ESP 而不是 EIP,这可以解释您案例中的段错误......

I am trying to do the same at the moment - i do not know what os you are using, but i found the following docu
(@ http://freebsd.active-venture.com/FreeBSD-srctree/newsrc/dev/vinum/vinummemory.c.html) for freebsd which simpy discribes the jmpbuf struct:

struct JmpBuf {
    int jb_ebx; //in your case --> 0xb7fd8ff4      
    int jb_esp; //in your case --> 0x080485a0
    int jb_ebp; //in your case --> 0x080483f0      
    int jb_esi; //in your case --> 0xbffffcf8
    int jb_edi; //in your case --> 0xebf06081      
    int jb_eip; //in your case --> 0x1d0a15ee
    };

Therefore 0x080485a0 would be the stored ESP and not EIP which would explain the segfault in your case...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文