8
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

amazon linuxでbashの脆弱性対策にパッチを当ててソースビルド #shellshock

Last updated at Posted at 2014-09-25

概要

やってみた

$ env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
vulnerable
this is a test
### なるほどだめだ

$ sudo su -
# yum install patch
### patch入ってなかった...

# cd /usr/local/src
# wget https://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz
# tar zxf bash-4.3.tar.gz
# cd bash-4.3
# wget http://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-{001..025}
# cat bash43-{001..025} |patch -p0
### パッチを全部あてる

# export PATH="/usr/bin:$PATH"
# ./configure
# make
# make install
### ただしbashは/usr/local/bin/bashに入る(普段のは/bin/bash)

# mv /bin/bash /bin/bash.old
# ln -s /usr/local/bin/bash /bin/bash
### 取り急ぎ移動させとく

# env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
bash: warning: x: ignoring function definition attempt
bash: error importing function definition for `x'
this is a test
### やったぜ

 
以上。あとから手順作ったので順番右往左往してたらめんご。

8
8
7

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?