본문으로 바로가기

Remote exploit vulnerability in bash CVE-2014-6271

http://www.csoonline.com/article/2687265/application-security/remote-exploit-in-bash-cve-2014-6271.html


처음에 리눅스만 말하는 줄 알았다. bash는 대부분 운영체제에 다 있잖아. 업데이트 다 해야 된다. redhat, debian, centos, ubuntu, solaris, aix, hpux 운영체제에서 GNU bash 사용하고 있다면 확인해야 한다.


취약한 버전인지 확인하는 법. 

# env x='() { :;}; echo vulnerable' bash -c "echo this is a test"

vulnerable

this is a test


vulnerable 이라는 단어 출력되면 끝. 업데이트 해야 함. 


업데이트 방법

# yum -y update bash

# up2date -u bash


# env x='() { :;}; echo vulnerable' bash -c "echo this is a test"

vulnerable

this is a test


# rpm -qa bash

bash-4.1.2-15.el6_4.x86_64


# yum -y update bash

Loaded plugins: fastestmirror, refresh-packagekit, security

Determining fastest mirrors

 * base: centos.mirror.cdnetworks.com

 * extras: centos.mirror.cdnetworks.com

 * updates: centos.mirror.cdnetworks.com

base                                                                       | 3.7 kB     00:00

extras                                                                     | 3.3 kB     00:00

extras/primary_db                                                          |  19 kB     00:00

pgdg90                                                                     | 3.6 kB     00:00

pgdg90/primary_db                                                          |  83 kB     00:00

updates                                                                    | 3.4 kB     00:00

updates/primary_db                                                         | 5.3 MB     00:01

Setting up Update Process

Resolving Dependencies

--> Running transaction check

---> Package bash.x86_64 0:4.1.2-15.el6_4 will be updated

---> Package bash.x86_64 0:4.1.2-15.el6_5.1 will be an update

--> Finished Dependency Resolution


Dependencies Resolved


==========================================================================

 Package           Arch                Version                         Repository            Size

==========================================================================

Updating:

 bash              x86_64              4.1.2-15.el6_5.1                updates              905 k


Transaction Summary

==========================================================================

Upgrade       1 Package(s)


Total download size: 905 k

Downloading Packages:

bash-4.1.2-15.el6_5.1.x86_64.rpm                                           | 905 kB     00:00

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Warning: RPMDB altered outside of yum.

  Updating   : bash-4.1.2-15.el6_5.1.x86_64                                                   1/2

  Cleanup    : bash-4.1.2-15.el6_4.x86_64                                                     2/2

  Verifying  : bash-4.1.2-15.el6_5.1.x86_64                                                   1/2

  Verifying  : bash-4.1.2-15.el6_4.x86_64                                                     2/2


Updated:

  bash.x86_64 0:4.1.2-15.el6_5.1


Complete!


# rpm -qa bash

bash-4.1.2-15.el6_5.1.x86_64


# 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


CentOS 6은 업데이트 후 테스트 하면 경고문이 나온다. CentOS 5의 경우 업데이트하면 경고문이 나오지 않는다. 


급한대로 방화벽에서 막아도 된다. 그러나 근본적인 해결 방법은 아니다.

# iptables -A INPUT -m string --algo bm --hex-string '|28 29 20 7B|' -j DROP

# ip6tables -A INPUT -m string --algo bm --hex-string '|28 29 20 7B|' -j DROP


CentOS 5기준으로 bash-4.1.2-15.el6_5.1.x86_64이 먼저 올라왔는데 warning 메세지 뿌린다. 어떤 시스템에서 bash-4.1.2-15.el6_5.2.x86_64 로 업데이트 된다. 최종 bash-4.1.2-15.el6_5.2.x86_64에서 warning 메세지와 취약점 해결 될 모양이다.



레드햇 사이트 취약점 보고와 해결법

https://access.redhat.com/solutions/1207723

https://access.redhat.com/articles/1200223



***** AIX 업데이트

ftp://www.oss4aix.org/RPMS/bash/ 에서 최신버전 다운로드해서 패치한다.


AIX는 기본 설치시 bash를 포함하지 않고 있다. GNU RPM 설치했을 경우 최신본을 설치하면 된다.



2014.10.08 관련 취약점에 계속 보고 되고 있다. 키사 고지 참조

http://krcert.or.kr/kor/data/secNoticeView.jsp?p_bulletin_writing_sequence=22005