如果运行下面命令
env x='() { :;}; echo vulnerable' bash -c 'echo hello'
输出结果为:
[root@localhost ~]# env x='() { :;}; echo vulnerable' bash -c 'echo hello'
vulnerable
hello
则有漏洞,需要赶紧修复
修复脚本
bashfix.sh
mkdir src
cd src
wget
#download all patches
for i in $(seq -f "%03g" 0 25); do wget $i; done
tar zxvf bash-4.3.tar.gz
cd bash-4.3
#apply all patches
for i in $(seq -f "%03g" 0 25);do patch -p0 < ../bash43-$i; done
#build and install
./configure && make && make install
cd ..
cd ..
rm -r src
执行脚本:
sh bashfix.sh
然后会自动升级,修复bash的漏洞
再运行
env x='() { :;}; echo vulnerable' bash -c 'echo hello'
如果结果是:
[root@localhost ~]# env x='() { :;}; echo vulnerable' bash -c 'echo hello'
env x='() { :;}; echo vulnerable' bash -c 'echo hello'
bash: warning: x: ignoring function definition attempt
bash: error importing function definition for `x'
hello
证明漏洞修复
阅读(2068) | 评论(0) | 转发(0) |