Bash安全漏洞——通过专门制作的环境变量注入漏洞

 

2014-09-25,早上,看到群上和红帽的网站上出现bash的安全漏洞,所以要赶快升级bash的版本。

新版本:确保了,不允许在命令结束后,执行一个bash函数。

 

测试漏洞:

 

[root@ ~]# env x='() { :;}; echo vulnerable'  bash -c "echo this is a test"

vulnerable

this is a test

 

         如出现上面问题,则新需要更新bash。

 

更新bash

 

yum update bash -y

 

测试是否存在漏洞:

 

[root@ ~]# env x='() { :;}; echo vulnerable' bash   -c "echo this is a test"

bash: warning: x: ignoring function definition attempt

bash: error importing function definition for `x'

this is a test

 

         如果显示如上,表示已经修补了漏洞。

 

         目前使用bash的多线程脚本,更新了100+的服务器了。