Search on the Internet to find a great God wrote Shell Repair Bash Vulnerability script, feel very good, dragged to my blog to share to everyone.
Script content:
Copy Code code as follows:
#/bin/bash
#Author Alex Fang. Updates may apply soon.
Clear
echo "Press AnyKey to continue ..." $anykey; Read AnyKey
echo "bbbbbbbbbbbaaaaaaaaaaaaaaaaaaaasssssssssssssssssshhhhhhhhhhhhhhhhhhhh!"
echo "Shellshockfixer v0.1 by Alex Fang. Liscence:gnu GPLv2 "
echo "######################################################"
echo "Select on Option:"
echo "1) CentOS"
echo "2) Debian wheezy"
echo "3" Debian squeeze x64 (provided by Aliyun) "
echo "4" Debian squeeze x32 (provided by Aliyun) "
echo "5 Ubuntu"
echo "6" OpenSuSE x64 (Beta, provided by Aliyun) "
echo "7" OpenSuSE x32 (Beta Aliyun) "
echo "8" Aliyun Linux x64 "
echo "9" Aliyun Linux x32 "
echo "0) Iptables Way"
echo "one) temporily disable bash through chmod"
echo "######################################################"
Read X
if test $x-eq 1; Then
Clear
echo "Fixing ..."
Yum Clean All
Yum Makecache
Yum Update bash
echo "finished!"
Elif test $x-eq 2; Then
Clear
echo "Fixing for Debian wheezy ..."
Apt-get Update
Apt-get-y Install--only-upgrade Bash
echo "finished!"
Elif test $x-eq 3; Then
echo "Fixing for Debian squeeze x64 ..."
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
echo "finished!"
Elif test $x-eq 4; Then
echo "Fixing for Debian squeeze x32 ..."
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
echo "finished!"
Elif test $x-eq 5; Then
echo "Fixing for Ubuntu ..."
Apt-get Update
Apt-get-y Install--only-upgrade Bash
echo "finished!"
Elif test $x-eq 6; Then
echo "Fixing for OpenSuSE x64"
wget http://mirrors.aliyun.com/fix_stuff/bash-4.2-68.4.1.x86_64.rpm && RPM-UVH bash-4.2-68.4.1.x86_64.rpm
echo "finished!"
Elif test $x-eq 7; Then
echo "Fixing for OpenSuSE x32"
wget http://mirrors.aliyun.com/fix_stuff/bash-4.2-68.4.1.i586.rpm && RPM-UVH bash-4.2-68.4.1.i586.rpm
echo "finished!"
Elif test $x-eq 8; Then
echo "Fixing for Aliyun Linux x64 ..."
wget http://mirrors.aliyun.com/centos/5/updates/x86_64/RPMS/bash-3.2-33.el5_10.4.x86_64.rpm && RPM-UVH bash-3.2-33.el5_10.4.x86_64.rpm
echo "finished!"
Elif test $x-eq 9; Then
echo "Fixing for Aliyun Linux x32 ..."
wget http://mirrors.aliyun.com/centos/5/updates/i386/RPMS/bash-3.2-33.el5_10.4.i386.rpm && RPM-UVH bash-3.2-33.el5_10.4.i386.rpm
Elif test $x-eq 0; Then
echo "Deploying Iptables rules ..."
Iptables--append input-m string--algo kmp--hex-string ' |28 7b| '--jump DROP
Iptables using-m string--hex-string ' |28 7b| '
echo "Finishing ..."
Elif test $x-eq 11; Then
echo "Chmod Way Configuring ..."
chmod o-x Bash
echo "Finishing ..."
Else
echo "Invalid Operation."
Exit
Fi