메뉴 닫기

‘배쉬 쉘 버그’ 보안결함 대처 방법

3462607995_150a6b2624_m

출처 : Torkild Retvedt

 

 

 

리눅스는 물론 애플 OS X 와 같은 유닉스 기반 운영체제 (OS) 에서 사용되는 쉘 프로그램인 ‘배쉬 (Bash)’ 에서 발견된

보안 취약점인 ‘쉘 쇼크 (Shellsock)’를 악용한 공격이 처음으로 발견되었다.

쉘쇼크는 직접 웹서버에 악성코드를 심거나 악성명령을 내릴 수 있다는 점에서 문제가 더 심각하다는 전문가들의 평가다.

해당 취약점은 ‘CVE-2014-6271’ 이라는 이름으로 공식 분류되었다.

배쉬 쉘 명령어는 HTTP 나 CGI 와 같은 웹 상 경로를 활용해 누구나 명령을 내릴 수 있어 해커들이 훨씬 쉽게 접근할 수 있기 때문에 심각성은 크다 할 수 있다.

 

전세계 서버 50% ‘배시 버그’ 위협..구글·아마존 대응 [이데일리, 2014.09.26]

http://media.daum.net/economic/world/newsview?newsid=20140926093905897

베쉬 쉘 버그에 영향을 받는 배포판은 광범위 하며, 다음 배포판은 그에 해당 한다.

 – Red Hat Enterprise Linux (버전 4 ~ 버전 7) , Fedora 배포판
 – CentOS (버전 5 ~ 버전 7)
 – Ubuntu 10.04 LTS, 12.04 LTS, 14.04 LTS
 – Debian

버그 테스트는 간단한 명령어로 쉘 상에서 확인할 수 있다.

 

1) Bash 버전 확인

[smileserv-cdn] $ /bin/bash -version
GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

2) 배쉬 셀 취약점 확인

[smileserv-cdn] $ ]
vulnerable
this is a test

위와 같이 나타난다면 취약점이 있는 버전이므로 즉각 패치를 실행한다.

3) yum update 를 통해 최신 버전을 다운로드 받아 패치하면 된다.

[smileserv-cdn] $ yum update

Loaded plugins: fastestmirror, security
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* base: ftp.daum.net
* extras: ftp.daum.net
* updates: ftp.daum.net
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
—> Package hwloc.x86_64 0:1.5-2.el6_5 will be updated
—> Package hwloc.x86_64 0:1.5-3.el6_5 will be an update
—> Package kpartx.x86_64 0:0.4.9-72.el6_5.3 will be updated
—> Package kpartx.x86_64 0:0.4.9-72.el6_5.4 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
hwloc x86_64 1.5-3.el6_5 updates 1.4 M
kpartx x86_64 0.4.9-72.el6_5.4 updates 59 k

Transaction Summary
===========================================================================================================================================================================
Upgrade 3 Package(s)

Total download size: 2.4 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): bash-4.1.2-15.el6_5.1.x86_64.rpm | 905 kB 00:00
(2/3): hwloc-1.5-3.el6_5.x86_64.rpm | 1.4 MB 00:00
(3/3): kpartx-0.4.9-72.el6_5.4.x86_64.rpm | 59 kB 00:00
—————————————————————————————————————————————————————————————————————
Total 4.9 MB/s | 2.4 MB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : bash-4.1.2-15.el6_5.1.x86_64 1/6
Updating : hwloc-1.5-3.el6_5.x86_64 2/6
Updating : kpartx-0.4.9-72.el6_5.4.x86_64 3/6
Cleanup : hwloc-1.5-2.el6_5.x86_64 4/6
Cleanup : bash-4.1.2-15.el6_4.x86_64 5/6
Cleanup : kpartx-0.4.9-72.el6_5.3.x86_64 6/6
Verifying : kpartx-0.4.9-72.el6_5.4.x86_64 1/6
Verifying : bash-4.1.2-15.el6_5.1.x86_64 2/6
Verifying : hwloc-1.5-3.el6_5.x86_64 3/6
Verifying : bash-4.1.2-15.el6_4.x86_64 4/6
Verifying : kpartx-0.4.9-72.el6_5.3.x86_64 5/6
Verifying : hwloc-1.5-2.el6_5.x86_64 6/6

Updated:
bash.x86_64 0:4.1.2-15.el6_5.1 hwloc.x86_64 0:1.5-3.el6_5 kpartx.x86_64 0:0.4.9-72.el6_5.4

Complete!

4) Bash 버전 업데이트 이후에는 버그가 패치되었는지 2)에서 내렸던 명령을 통해 확인한다.

[smileserv-cdn] $ 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

 

관련 자료 :
CVE-2014-6271
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-6271

Bug in Bash shell creates big security hole on anything with *nix in it [Updated]
http://arstechnica.com/security/2014/09/bug-in-bash-shell-creates-big-security-hole-on-anything-with-nix-in-it/

Bash specially-crafted environment variables code injection attack
https://securityblog.redhat.com/2014/09/24/bash-specially-crafted-environment-variables-code-injection-attack/

The Bash Bug: What you need to know about the latest security flaw
http://www.vox.com/2014/9/25/6843949/the-bash-bug-explained

 

[polldaddy rating=”7739789″]

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x