Shell script tips for fixing bash Vulnerabilities

Source: Internet
Author: User
This article mainly introduces the shell scripts used to fix bash vulnerabilities. This article is applicable to common linux server systems, such as CentOS, Debian, Ubuntu, OpenSuSE, and Aliyun, you can find a shell script to fix the bash vulnerability by searching for information on the Internet. I think it is good. I will drag it to my blog to share it with you.


Script content:


The Code is as follows:


#/Bin/bash

# Author Alex Fang. Updates may apply soon.

Clear

Echo "Press anykey to continue..." $ anykey; read anykey
Echo "bbbbbbbbbbbbbaaaaaaaaaaaaaaaaaaaasssssssssssssssssssshhhhhhhhhhhhhhhhhh! "
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 processing ing ..."
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.