Bash vulnerability shell script repair in Linux

Source: Internet
Author: User
Tags chmod iptables aliyun
The code is as follows Copy Code

#/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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.