<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[静怡家园]]></title> 
<link>http://www.zhanghaijun.com/index.php</link> 
<description><![CDATA[书山有路勤为径，学海无涯苦作舟！]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[静怡家园]]></copyright>
<item>
<link>http://www.zhanghaijun.com/post//</link>
<title><![CDATA[Bash Code Injection Vulnerability via Specially Crafted Environment Variables]]></title> 
<author>碟舞飞扬 &lt;webmaster@zhanghaijun.com&gt;</author>
<category><![CDATA[安全相关]]></category>
<pubDate>Thu, 25 Sep 2014 08:41:36 +0000</pubDate> 
<guid>http://www.zhanghaijun.com/post//</guid> 
<description>
<![CDATA[ 
	一、漏洞概述<br/>在GNU bash环境变量中定义一个函数之后，如果后续还有其它字符串，bash在解析这些字符串的时候存在一个缺陷，允许远程攻击者执行任意的命令，只要攻击者 构建一个特殊的环境变量即可。攻击者可以利用此缺陷重写或绕过环境变量的限制执行shell命令，从而导致信息泄漏、未授权的恶意修改、服务中断。 <br/><br/>二、受影响版本<br/><br/>&nbsp;&nbsp;目前GNU bash4.3及以下版本存在此问题。<br/><br/>三、利用场景<br/><br/>如下业务场景中都会受此缺陷影响：<br/>1、OpenSSHsshd使用了ForceCommand特性<br/><br/>ForceCommand特性用来给远程用户提供受限的命令执行能力，因此使用了此特性的如git、subversion等都会受影响。<br/><br/>2、Apache HTTP Server使用了modcgi和mod_cgid模块；<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>在Apache Server启用了modcgi和mod_cgid模块时，只要CGI脚本是由bash编写，或者使用了派生的subshell都会受影响。能够产生这样的subshell的包括：<br/>C语言的system/popen，Python的os.system/os.popen，PHP的system/exec，Perl的open/system。<br/><br/>四、修复方法<br/><br/>yum clean all <br/>yum --enablerepo=updates install bash <br/><br/>五、验证方法<br/><br/>验证是否存在次漏洞的方法： <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>[root@localhost]# env x='() &#123; :;&#125;; echo vulnerable' bash -c "echo this is a test"<br/>vulnerable<br/>this is a test <br/><br/>漏洞修复之后，再执行该命令： <br/>[root@localhost]# env x='() &#123; :;&#125;; echo vulnerable' bash -c "echo this is a test"<br/>&nbsp;&nbsp;&nbsp;&nbsp; bash: warning: x: ignoring function definition attempt <br/>&nbsp;&nbsp;&nbsp;&nbsp; bash: error importing function definition for `x' <br/>&nbsp;&nbsp;&nbsp;&nbsp; this is a test <br/><br/>六、参考链接<br/><a href="https://www.invisiblethreat.ca/2014/09/cve-2014-6271/" target="_blank">https://www.invisiblethreat.ca/2014/09/cve-2014-6271/</a><br/><a href="https://access.redhat.com/node/1200223" target="_blank">https://access.redhat.com/node/1200223</a><br/>Tags - <a href="http://www.zhanghaijun.com/tags/linux/" rel="tag">linux</a> , <a href="http://www.zhanghaijun.com/tags/bash/" rel="tag">bash</a>
]]>
</description>
</item><item>
<link>http://www.zhanghaijun.com/post//#blogcomment</link>
<title><![CDATA[[评论] Bash Code Injection Vulnerability via Specially Crafted Environment Variables]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.zhanghaijun.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>