如何利用php的漏洞?
我从未在实时操作中见过缓冲区溢出漏洞。假设我发现一台服务器似乎存在漏洞。我在哪里可以获得概念证明代码(最好是 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 我是一名学生,我唯一的愿望就是学习
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信您有些未能理解目录遍历错误的本质。
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).