如果你是 CentOS 3.x 版,還是要升級,但現在大部份的 yum repo 來源都沒了
所以可以透過 tarball 處理安裝
GNU 還是有提供 patch
安裝編譯
wget https://ftp.gnu.org/pub/gnu/bash/bash-2.05b.tar.gz --no-check-certificate tar zxvf bash-2.05b.tar.gz cd bash-2.05b
從第一個 patch 一個一個 patch 上來 (這版本有 001 到 010)
for i in `seq 1 10` do x=`printf %02d $i` aaa="curl -k https://ftp.gnu.org/pub/gnu/bash/bash-2.05b-patches/bash205b-0$x | patch -p0" echo $aaa eval $aaa done
編譯不安裝
./configure make
rename 舊的,更新的
mv /bin/bash /bin/bash.xxxxxxxxxxxxxxxxxxxxxxx.old cp -rp bash /bin/bash
測試,可別出現 Game over,不然就真的 over 了
su - env ls="() { echo 'Game over'; }" bash -c ls
參考 How to Manually Update Bash to Patch Shellshock Bug on Older Fedora-Based Systems
留言