linux中bash漏洞shell脚本修复
2019/10/10/17:45:24 阅读:1818 来源:谷歌SEO算法 标签:
云计算
在网上搜资料找到一个大神写的shell修复bash漏洞脚本,觉得很不错,拖到我blog里来共享给大家,脚本内容代码如下:
- #/bin/bash
- #AuthorAlexFang.Updatesmayapplysoon.
- clear
- echo"Pressanykeytocontinue..."$anykey;readanykey
- echo"BBBBBBBBBBBAAAAAAAAAAAAAAAAAAAASSSSSSSSSSSSSSSSSSHHHHHHHHHHHHHHHHHHHH!"
- echo"ShellShockFixerv0.1byAlexFang.Liscence:GNUGPLv2"
- echo"######################################################"
- echo"Selectonoption:"
- echo"1)CentOS"
- echo"2)DebianWheezy"
- echo"3)DebianSqueezex64(ProvidedbyAliyun)"
- echo"4)DebianSqueezex32(ProvidedbyAliyun)"
- echo"5)Ubuntu"
- echo"6)OpenSuSEx64(Beta,providedbyAliyun)"
- echo"7)OpenSuSEx32(BetaAliyun)"
- echo"8)AliyunLinuxx64"
- echo"9)AliyunLinuxx32"
- echo"0)iptablesway"
- echo"11)Temporilydisablebashthroughchmod"
- echo"######################################################"
- readx
- iftest$x-eq1;then
- clear
- echo"Fixing......"
- yumcleanall
- yummakecache
- yumupdatebash
- echo"Finished!"
- eliftest$x-eq2;then
- clear
- echo"FixingforDebianWheezy..."
- apt-getupdate
- apt-get-yinstall--only-upgradebash
- echo"Finished!"
- eliftest$x-eq3;then
- echo"FixingforDebianSqueezex64..."
- wgethttp://mirrors.aliyun.com/debian/pool/main/b/bash/bash_4.1-3+deb6u2_amd64.deb&&dpkg-ibash_4.1-3+deb6u2_amd64.deb
- echo"Finished!"
- eliftest$x-eq4;then
- echo"FixingforDebianSqueezex32..."
- wgethttp://mirrors.aliyun.com/debian/pool/main/b/bash/bash_4.1-3+deb6u2_i386.deb&&dpkg-ibash_4.1-3+deb6u2_i386.deb
- echo"Finished!"
- eliftest$x-eq5;then
- echo"FixingforUbuntu..."
- apt-getupdate
- apt-get-yinstall--only-upgradebash
- echo"Finished!"
- eliftest$x-eq6;then
- echo"FixingforOpenSuSEx64"
- wgethttp://mirrors.aliyun.com/fix_stuff/bash-4.2-68.4.1.x86_64.rpm&&rpm-Uvhbash-4.2-68.4.1.x86_64.rpm
- echo"Finished!"
- eliftest$x-eq7;then
- echo"FixingforOpenSuSEx32"
- wgethttp://mirrors.aliyun.com/fix_stuff/bash-4.2-68.4.1.i586.rpm&&rpm-Uvhbash-4.2-68.4.1.i586.rpm
- echo"Finished!"
- eliftest$x-eq8;then
- echo"FixingforAliyunLinuxx64..."
- wgethttp://mirrors.aliyun.com/centos/5/updates/x86_64/RPMS/bash-3.2-33.el5_10.4.x86_64.rpm&&rpm-Uvhbash-3.2-33.el5_10.4.x86_64.rpm
- echo"Finished!"
- eliftest$x-eq9;then
- echo"FixingforAliyunLinuxx32..."
- wgethttp://mirrors.aliyun.com/centos/5/updates/i386/RPMS/bash-3.2-33.el5_10.4.i386.rpm&&rpm-Uvhbash-3.2-33.el5_10.4.i386.rpm
- eliftest$x-eq0;then
- echo"Deployingiptablesrules..."
- iptables--appendINPUT-mstring--algokmp--hex-string'|2829207B|'--jumpDROP
- iptablesusing-mstring--hex-string'|2829207B|'
- echo"Finishing..."//phpfensi.com
- eliftest$x-eq11;then
- echo"Chmodwayconfiguring..."
- chmodo-xbash
- echo"Finishing..."
- else
- echo"InvalidOperation."
- exit
- fi
热门评论