Linux超级Bash漏洞(Shellshock)修复方法,内附Debian服务器详细方法

近日,Linux社区爆出了关于Linux Bash的安全漏洞,该漏洞源于你调用的bash shell之前创建的特殊的环境变量,这些变量可以包含代码,同时会被bash执行。 不同于之前的SSL的HeartBlood漏洞,这个Bash漏洞能让黑客通过嵌入恶意命令完全控制目标机器,而不像HeartBlood只是可以嗅探敏感信息。

对于所有安装GNU bash 版本小于或者等于4.3的Linux操作系统都应该检测并修复该漏洞,以免造成不必要的损失。

检测方法:

命令行中输入:

env x='() { :;}; echo vulnerable' bash -c "echo this is a test"

如果显示了如下红色加粗内容,说明你的linux系统存在该漏洞,请立即修复。

vulnerable
this is a test

 

修补方案:

Centos修补方案(执行如下命令,不用重启):

yum clean all 
yum makecache 
yum -y update bash 

Ubuntu修补方案(执行如下命令,不用重启):

apt-get update 
apt-get -y install --only-upgrade bash  
 

Debian稍微复杂一点

先输入如下命令查看Debian系统版本号:

cat /etc/issue

比如我的是Debian GNU/Linux 7 \n \l

 

再查看是32bit还是64bit的

file /bin/ls

/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=0x55f1e005df252708d4c456dcc2c7dccea1006553, stripped

 

debian: 7.X 64bit && 32bit  (最终解决方案)

apt-get update 
apt-get -y install --only-upgrade bash  

 

6.0.x 64bit

wget http://mirrors.aliyun.com/debian/pool/main/b/bash/bash_4.1-3+deb6u2_amd64.deb 
dpkg -i bash_4.1-3+deb6u2_amd64.deb  
 

6.0.x 32bit

wget http://mirrors.aliyun.com/debian/pool/main/b/bash/bash_4.1-3+deb6u2_i386.deb 
dpkg -i bash_4.1-3+deb6u2_i386.deb 

 

最后确认是否修复,输入

env x='() { :;}; echo vulnerable' bash -c "echo this is a test"

如果看不到vulnerable,就说明修复成功了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值