HTSHELLS - 通过 .htaccess 文件实现的自包含 Web Shell 及其他攻击。
攻击的命名方式为 module.attack.htaccess,并按攻击类型分组存放在目录中。选择你需要的攻击,将其复制到一个新文件并命名为 .htaccess,检查文件以确认在上传前是否需要编辑。除非文件另有说明,Web Shell 通过查询参数 c 执行命令。
要准备攻击,运行 ./prepare.sh file 生成待上传的 .htaccess 文件。示例:
$ ./prepare.sh shell/mod_php.shell.htaccess
┬ ┬┌┬┐┌─┐┬ ┬┌─┐┬ ┬ ┌─┐
├─┤ │ └─┐├─┤├┤ │ │ └─┐
┴ ┴ ┴ └─┘┴ ┴└─┘┴─┘┴─┘└─┘
justanotherhacker.com
.htaccess file is ready
$ curl -F '[email protected]' -k https://target/upload.php
$ curl -k https://target/uploads/.htaccess?c=id
...
# uid=33(www-data) gid=33(www-data) groups=33(www-data)
== DOS/ # 拒绝服务攻击
apache.dos.htaccess 使所有请求返回 500 内部服务器错误
mod_rewrite.dos.htaccess mod_rewrite 中的正则表达式拒绝服务条件会消耗一个子进程
== INFO/ # 信息泄露攻击
modcheck/ 包含额外的响应头以指示哪些 Apache 模块处于活动状态
mod_caucho.info.htaccess 未测试 针对 mod_caucho Resin Java 服务器模块的服务器状态绑定
mod_clamav.info.htaccess Clamav 状态页面绑定
mod_info.info.htaccess 针对 Apache 的服务器信息绑定
mod_ldap.info.htaccess 未测试 针对 mod_ldap 服务器模块的服务器状态绑定
mod_perl.info.htaccess 显示 mod_perl 状态页面
mod_php.info.htaccess 使所有 PHP 页面显示源代码而非执行
mod_status.info.htacces 针对 Apache 的服务器状态绑定
== SHELL/ # 交互式命令执行
mod_caucho.shell.htaccess 未测试 基于 JSP 的 Web Shell
mod_cgi.shell.bash.htaccess 使用 bash 在 CGI 处理器下运行的 Shell,需要在 .htaccess 文件上设置 exec 标志。
mod_cgi.shell.windows.htaccess 未测试 通过 Apache CGI 配置指令,利用 php.exe 提供 Shell
mod_include.shell.htaccess 基于服务器端包含的 Web Shell
mod_multi.shell.htaccess 单个 .htaccess 文件中的多个 Shell,一个攻击适配所有情况
mod_perl.shell.htaccess 未完成 TODO
mod_php.shell.htaccess 基于 PHP 的 Web Shell,通过 http://domain/path/.htaccess?c=command 访问
mod_php.shell2.htaccess 从 .htaccess 文件调用 PHP Shell 的另一种方法
mod_php.stealth.shell.htaccess 基于 PHP 的隐身后门 - 参见 http://www.justanotherhacker.com/2011/12/writing-a-stealth-web-shell.html 教程
mod_python.shell.htaccess
mod_ruby.shell.htaccess
mod_suphp.shell.htaccess
== TRAVERSAL/ # 目录遍历攻击
mod_hitlog.traversal.htaccess 通过 hitlog 模块进行的目录遍历攻击,尝试读取 /etc/passwd
mod_layout.traversal.htaccess 目录遍历攻击,读取 /etc/passwd
== ./ # 其他攻击
mod_auth_remote.phish.htaccess 未测试 将基本认证凭据转发到你选择的服务器
mod_badge.admin.htaccess mod_badge 管理员页面绑定
mod_sendmail.rce.htaccess 未测试 通过指定 "sendmail" 二进制的路径和参数,执行 .htaccess 文件中配置的命令
Wireghoul - http://www.justanotherhacker.com