게시물 1,376건
   
[Fedora18] CVE-2014-6271 bash bug fix
글쓴이 : 최고관리자 날짜 : 2014-09-29 (월) 14:50 조회 : 5339
글주소 :
bash-4.2.45-1.fc18.x86_64.rpm (992.3K), Down : 2, 2014-09-29 15:01:41
                                
현재 Fedora 배포판에서는 19~21버전에서만 취약점에 대한 패치가 제공되고 있으며 Fedora18 이하버전은 yum 업데이트가 중단되어서 이번 bash 쉘 취약점에 대해 패치버전을 제공하지 않고 있습니다. 따라서 아래와 같은 방법으로 업데이트가 가능하오니 참고하세요.



# cat /etc/redhat-release  
Fedora release 18 (Spherical Cow)

# uname -a
Linux 115-68-200-23 3.11.10-100.fc18.x86_64 #1 SMP Mon Dec 2 20:28:38 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

# rpm -q bash
bash-4.2.45-1.fc18.x86_64


bash 쉘 취약점 여부 확인
# env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
vulnerable
this is a test


bash 소스 RPM 다운로드
# yumdownloader --source bash


bash 취약점 패치버전 다운로드
cd /root/rpmbuild/SOURCE
# wget http://ftp.gnu.org/gnu/bash/bash-4.2-patches/bash42-048


패치소스 수정 
 :: Fedora18 에서의 bash 버전이 4.2.45이기에 해당버전 레벨로 수정
# vim bash42-048
*** 26,30 ****
     looks for to find the patch level (for the sccs version string). */

! #define PATCHLEVEL 45

  #endif /* _PATCHLEVEL_H_ */


빌드프로세서에 대한 spec 파일 편집
# cd /root/rpmbuild/SPECS/
# vim bash.spec
61 라인
Patch045: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-045
Patch048: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-048
Patch049: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-049

192 라인
%patch045 -p0 -b .045
%patch048 -p0 -b .048
%patch049 -p0 -b .049


신규 bash 패키지 설치
# rpmbuild -bb bash.spec
# rpm -Uhv /root/rpmbuild/RPMS/x86_64/bash-4.2.45-1.fc18.x86_64.rpm --force
Preparing...                          ################################# [100%]
Updating / installing...
   1:bash-4.2.45-1.fc18               ################################# [100%]


bash 버전 확인
# bash -version
GNU bash, version 4.2.49(1)-release (x86_64-redhat-linux-gnu)


패치여부 확인
# 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

※ Fedora18 x86_64버전에는 첨부된 파일로 설치하면 됩니다.


아래와같이 소스로 패치버전 컴파일 방법
소스컴파일 : https://shellshocker.net

Building From Source

You can patch bash with one command using our bash patcher, just run the following command and you should be good to go!
Make sure you have patch installed before you run this command. sudo apt-get install patch (yum install patch) etc...

curl https://shellshocker.net/fixbash | sh
If you want to do it yourself, feel free. Here are all the commands you'll need.

 cd ~/
mkdir bash
cd bash
wget https://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz
#download all patches
for i in $(seq -f "%03g" 1 27); do wget     https://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-$i; done
tar zxvf bash-4.3.tar.gz 
cd bash-4.3
for i in $(seq -f "%03g" 1 27);do patch -p0 < ../bash43-$i; done
./configure && make && make install

이름 패스워드
비밀글 (체크하면 글쓴이만 내용을 확인할 수 있습니다.)
왼쪽의 글자를 입력하세요.
   

 



 
사이트명 : 모지리네 | 대표 : 이경현 | 개인커뮤니티 : 랭키닷컴 운영체제(OS) | 경기도 성남시 분당구 | 전자우편 : mojily골뱅이chonnom.com Copyright ⓒ www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.