“破壳”漏洞深度剖析
2015-03-26郭瑞



【 摘 要 】 著名Shell软件Bash的“破壳”漏洞席卷全球,引起业内人士的全面关注。文章从该漏洞的披露过程出发,深入剖析漏洞的工作原理和可被利用的攻击方式。通过分析该漏洞所造成的影响,提出与漏洞处理的技术手段相比,漏洞处理的机制问题更值得反思。
【 关键词 】 “破壳”漏洞;Bash;env;CVE
Deep Analysis of “Shellshock”
Guo Rui
(Guangzhou School of Administration, Information and Network Center GuangdongGuangzhou 510070 )
【 Abstract 】 “Shellshock” vulnerability of Bash shocks the global network, and IT insiders focus on it all over the world. This thesis shows the discovery process of the vulnerability, and deeply analyses the work theory and attack methods of it. After discussing the influence of the vulnerability, it shows that the processing mechanism of vulnerability is more important than the technical method.
【 Keywords 】 "shellshock"; bash; env; cve
1 引言
2014年9月24日,NVD(美国国家漏洞库)披露了著名Shell软件GNU Bash的一个严重漏洞(CVE-2014-6271),该漏洞将导致远程攻击者在受影响系统上执行任意代码,被形象地称为“破壳”(Shellshock)。
该漏洞由法国GNU/Linux研究者StéphaneChazelas发现,影响目前主流的Linux和Mac OS操作系统平台,同时影响到与Bash交互的多种应用,包括Apache、OpenSSH、DHCP等。该漏洞存在于Bash 4.3及之前的所有版本中,已存在约20年,全球至少150万台主机受其影响。NVD将该漏洞的严重性定义为10级(最高),而上半年席卷全球三分之二服务器的OpenSSL“心脏出血”漏洞(CVE-2014-0160)才被定义为5级,其严重程度可想而知。
2 漏洞原理
在计算机科学领域,Shell俗称为“壳”,用于区别于内核,是作为使用者的人机接口界面软件。Bash最早是GNU计划为Unix系统编写的一个命令行式Shell,现在已经作为主流Linux平台的内定Shell被广泛使用。Shell作为操作系统的命令解析器,将操作者输入的命令行指令和脚本进行解析后,交给操作系统内核进行处理。
此次发现的“破壳”漏洞正是发生在Bash解析命令行指令的时候,可以运行以下代码来检测其是否存在:
env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
若该版本Bash存在“破壳”漏洞,将出现如下结果:
“破壳”漏洞公布之后,Bash成为全球黑客瞄准的目标,大家争相寻找Bash的其他漏洞。于是,Bash的其它漏……