如何利用php的漏洞?

发布于 2024-08-25 13:25:29 字数 422 浏览 5 评论 0 原文

我从未在实时操作中见过缓冲区溢出漏洞。假设我发现一台服务器似乎存在漏洞。我在哪里可以获得概念证明代码(最好是 c/c++ 形式)以利用该漏洞?例如,我发现了此漏洞

Multiple directory traversal vulnerabilities in 
    functions such as 'posix_access()', 'chdir()', 'ftok()'
    may allow a remote attacker to bypass 'safe_mode' 
    restrictions. (CVE-2008-2665 and CVE-2008-2666).  

如何获得用于教育目的的概念验证代码

PS 我是一名学生,我唯一的愿望就是学习

I have never seen a buffer overflow exploit in live action. Suppose I found a server that seems to have vulnerabilities. Where can I get proof of the concept code preferably in c/c++ to exploit the vulnerability? eg I found this vulnerability

Multiple directory traversal vulnerabilities in 
    functions such as 'posix_access()', 'chdir()', 'ftok()'
    may allow a remote attacker to bypass 'safe_mode' 
    restrictions. (CVE-2008-2665 and CVE-2008-2666).  

How can I get proof of concept code for educational purposes

PS
I am a student and my only desire is to learn

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

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

发布评论

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

评论(1

指尖上得阳光 2024-09-01 13:25:29

我相信您有些未能理解目录遍历错误的本质。

PHP 中的 safe_mode 意味着只允许打开本地文件路径,而不允许任何可识别的协议,例如 http:// 路径。验证路径是否为本地文件的 safe_mode 检查可能会被欺骗以接受 HTTP URL(和其他协议)并错误地将它们识别为本地路径,从而允许一系列安全漏洞,具体取决于具体的实现(但远程我想到的是代码包含或 XSS 攻击)。

通常,您使用 PHP 脚本来利用 PHP 错误,因为错误实际上是在解释器中。缓冲区溢出实际上不会发生在 PHP 代码中,而是发生在 PHP 编译器的某些特定函数中,要利用它,您需要找到一个使用用户提供的参数调用该函数的脚本(即浏览流行的开源代码)软件)或简单地创建您自己的有意利用脚本并上传到您希望利用的位置,例如您的网络托管提供商。

当谈到 PHP 解释器中的错误时,它本质上是您通过 PHP 函数调用来利用的 Web 服务器/PHP 模块,而不是通过书面漏洞利用(除非它们只是向 PHP 站点发出 HTTP 请求的应用程序)。

I believe you have somewhat failed to understand the nature of the directory traversal bug.

safe_mode in PHP means that only local filepaths are allowed to be open, rather than allowing any recognizeable protocol such as for example http:// paths. The safe_mode check that verifies wether or not the path is a local file can be tricked to accept HTTP URLs (and other protocols) and wrongfully identifying them as local paths, there by allowing a range of security holes depending on the exact implementation (but remote code inclusion or XSS attacks are what comes to mind).

In general you use PHP scripts to exploit PHP bugs, since the bugs are actually in the interpreter. A buffer overflow can't really occur in your PHP code, but rather in some specific function of the PHP compiler and to exploit it you need to either find a script that calls that function with a user supplied argument (i.e. browse through popular open source software) or simple create your own intentional exploit script and upload to the location you wish to exploit, for example your webhosting provider.

When it comes to bugs in the PHP interpreter it's essentially the webserver/PHP module you're exploiting via PHP function calls, not through written exploits (unless they are simply applications doing HTTP requests to the PHP site).

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