环境:
服务器Centos:192.168.195.130
攻击机bt5:192.168.195.130
1、找到漏洞利用程序
必须web服务器支持cgi
这里是测试的bug.sh代码
#!/bin/bash 第一行要特别注意! echo "Content-type: text/html" echo "" echo '<html>' echo '<head>' echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">' echo '<title>PoC</title>' echo '</head>' echo '<body>' echo '<pre>' /usr/bin/env echo '</pre>' echo '</body>' echo '</html>' exit 0
2、攻击过程
使用nc监听本地某个端口,我这里监听4444端口
使用curl访问漏洞代码,当然也可以使用浏览器访问;建议使用curl,涨知识的嘛!
执行上面的代码
这里会返回一个Apache权限的shell;
未完待续:接下来会写扫描cgi的代码以及其他测试利用方法!