菜单

修复bash漏洞的shell脚本分享,bash漏洞shell脚本

2019年8月31日 - JavaScript

修复bash漏洞的shell脚本分享,bash漏洞shell脚本

在网上搜资料找到叁个大神写的shell修复bash漏洞脚本,感到很科学,拖到笔者blog里来分享给我们.

本子内容:

复制代码 代码如下:

#/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 “11) 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 29 20
7B|’ –jump DROP
  iptables using -m string –hex-string ‘|28 29 20 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

http://www.bkjia.com/Javascript/936042.htmlwww.bkjia.comtruehttp://www.bkjia.com/Javascript/936042.htmlTechArticle修复bash漏洞的shell脚本分享,bash漏洞shell脚本
在网络搜资料找到一个大神写的shell修复bash漏洞脚本,以为很正确,拖到作者blog里来分享给大家…

else
  echo “Invalid Operation.”
  exit
fi

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!”

剧本内容:

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 “11) 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 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 

clear

#/bin/bash

在网络搜资料找到贰个大神写的shell修复bash漏洞脚本,以为很科学,拖到笔者blog里来分享给我们.

elif test $x -eq 0; then
  echo “Deploying iptables rules…”
  iptables –append INPUT -m string –algo kmp –hex-string ‘|28 29 20
7B|’ –jump DROP
  iptables using -m string –hex-string ‘|28 29 20 7B|’
  echo “Finishing…”
 
elif test $x -eq 11; then
  echo “Chmod way configuring…”
  chmod o-x bash
  echo “Finishing…”

#Author Alex Fang. Updates may apply soon.

相关文章

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图