Linux Bash 超級(jí)安全漏洞至新修復(fù)方法
近日,Linux社區(qū)爆出了關(guān)于Linux Bash的安全漏洞,該漏洞源于你調(diào)用的bash shell之前創(chuàng)建的特殊的環(huán)境變量,這些變量可以包含代碼,同時(shí)會(huì)被bash執(zhí)行。 不同于之前的SSL的HeartBlood漏洞,這個(gè)Bash漏洞能讓克極客通過(guò)嵌入惡意命令完全控制目標(biāo)機(jī)器,而不像HeartBlood只是可以嗅探敏感信息。
對(duì)于所有安裝GNU bash 版本小于或者等于4.3的Linux操作系統(tǒng)都應(yīng)該檢測(cè)并修復(fù)該漏洞,以免造成不必要的損失。
檢測(cè)方法:
命令行中輸入:
env x='() { :;}; echo vulnerable' bash -c "echo this is a test"如果顯示了如下紅色加粗內(nèi)容,說(shuō)明你的linux系統(tǒng)存在該漏洞,請(qǐng)立即修復(fù)。
vulnerable
this is a test
修補(bǔ)方案:
Centos修補(bǔ)方案(執(zhí)行如下命令,不用重啟):
yum clean all
yum makecache
yum -y update bash
Ubuntu修補(bǔ)方案(執(zhí)行如下命令,不用重啟):
apt-get update
apt-get -y install --only-upgrade bash
Debian稍微復(fù)雜一點(diǎn)
先輸入如下命令查看Debian系統(tǒng)版本號(hào):
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
至后確認(rèn)是否修復(fù),輸入
env x='() { :;}; echo vulnerable' bash -c "echo this is a test"如果看不到vulnerable,就說(shuō)明修復(fù)成功了。