构建具有一些内核内存泄露的应用程序

发布于 2024-09-07 15:25:37 字数 512 浏览 11 评论 0原文

我想构建一个 C 应用程序,然后可以利用它从内核内存中获取一些机密信息。

问题是我真的不明白从哪里开始...我发现在没有对返回值进行适当检查的情况下使用 copy_to_user() 可能会导致此类问题,但我不明白它是如何发生的然后就可以被利用了。 如果您能给我一些指导,以便我能够进步,那就太好了。

编辑:我想要的是一种像这样的利用: http://inj3ct0r.com/ exploits/7837 ,其中最终转储了 X 字节的内核内存。

事实上,我不需要任何 SCTP 套接字或任何东西,但“仅”是重新创建此机密信息转储的最简单方法。

为了与缓冲区溢出进行并行,我想创建文件 vuln.c ,它将使用 gets() 函数,然后构建将完成这项工作的特殊字符串......在披露的情况下,我认为这将是另一个 C 文件。

我希望这是有道理的......

最好的。

I'd like to build a C application that I can then exploit to get some confidential information from the kernel memory.

The issue is that I don't really understand where to start... I've found that the use of copy_to_user() without appropriate checks on the return value could lead to this sort of issue, but I don't understand how it can be then exploitable.
If you could give me some pointers so I can progress, it would be great.

Edit : What I'd like to have, is a kind of exploit like this : http://inj3ct0r.com/exploits/7837 , where there is X bytes of kernel memory that are finally dumped.

The fact is I don't want any SCTP socket or anything, but "only" the easiest way to recreate this dump of confidential information.

To make a parallel with a buffer overflow, I 'd like to create the file vuln.c which would be using the gets() function, and then build the special string that will do the job... In the case of disclosure, I think that it will be another C file.

I hope this makes sense...

Best.

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

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

发布评论

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

评论(2

往日 2024-09-14 15:25:37

现实情况是,有多种方法可以继续,具体取决于您想要学习的漏洞类型。

  1. 您想通过缓冲区溢出和返回指针更改来注入代码吗?
  2. 是否已经有调用您想要利用的 copy_to_user,使用关闭一个错误
  3. 你想使用面向返回的编程来代替代码注入
  4. 许多其他的,其中一些列于此处

The reality is that there are a number of ways to proceed depending on what sort of exploit you are trying to learn.

  1. Do you want to inject code through a buffer overflow and change of return pointer?
  2. Is there already a call to copy_to_user that you want to exploit using an off by one error?
  3. Do you want to use return oriented programming instead of code injection
  4. Many others, some of which are listed here
风苍溪 2024-09-14 15:25:37

假设您不关心内核内部结构,请查看此问题

Assuming you're not after kernel internals, take a look at this question.

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