shell脚本修复bash漏洞
时间:2014-12-12 01:35来源:linux.it.net.cn 作者:IT
在网上搜资料找到一个大神写的shell修复bash漏洞脚本,觉得很不错,拖到我blog里来共享给大家.
脚本内容:
03 |
#Author Alex Fang. Updates may apply soon. |
07 |
echo "Press anykey to continue..." $anykey ; read anykey |
08 |
echo "BBBBBBBBBBBAAAAAAAAAAAAAAAAAAAASSSSSSSSSSSSSSSSSSHHHHHHHHHHHHHHHHHHHH!" |
09 |
echo "ShellShockFixer v0.1 by Alex Fang. Liscence: GNU GPLv2" |
10 |
echo "######################################################" |
11 |
echo "Select on option:" |
13 |
echo "2) Debian Wheezy" |
14 |
echo "3) Debian Squeeze x64(Provided by Aliyun)" |
15 |
echo "4) Debian Squeeze x32(Provided by Aliyun)" |
17 |
echo "6) OpenSuSE x64(Beta, provided by Aliyun)" |
18 |
echo "7) OpenSuSE x32(Beta Aliyun)" |
19 |
echo "8) Aliyun Linux x64" |
20 |
echo "9) Aliyun Linux x32" |
21 |
echo "0) iptables way" |
22 |
echo "11) Temporily disable bash through chmod" |
23 |
echo "######################################################" |
25 |
if test $x -eq 1; then |
33 |
elif test $x -eq 2; then |
35 |
echo "Fixing for Debian Wheezy..." |
37 |
apt-get -y install --only-upgrade bash |
40 |
elif test $x -eq 3; then |
41 |
echo "Fixing for Debian Squeeze x64..." |
42 |
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 |
45 |
elif test $x -eq 4; then |
46 |
echo "Fixing for Debian Squeeze x32..." |
47 |
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 |
50 |
elif test $x -eq 5; then |
51 |
echo "Fixing for Ubuntu..." |
53 |
apt-get -y install --only-upgrade bash |
56 |
elif test $x -eq 6; then |
57 |
echo "Fixing for OpenSuSE x64" |
58 |
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 |
61 |
elif test $x -eq 7; then |
62 |
echo "Fixing for OpenSuSE x32" |
63 |
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 |
66 |
elif test $x -eq 8; then |
67 |
echo "Fixing for Aliyun Linux x64..." |
68 |
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 |
71 |
elif test $x -eq 9; then |
72 |
echo "Fixing for Aliyun Linux x32..." |
73 |
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 |
75 |
elif test $x -eq 0; then |
76 |
echo "Deploying iptables rules..." |
77 |
iptables --append INPUT -m string --algo kmp --hex-string '|28 29 20 7B|' --jump DROP |
78 |
iptables using -m string --hex-string '|28 29 20 7B|' |
81 |
elif test $x -eq 11; then |
82 |
echo "Chmod way configuring..." |
87 |
echo "Invalid Operation." |
(责任编辑:IT) |
------分隔线----------------------------