[转载]ShellShock 漏洞及 OS X 紧急修复方法
说明:原ruby-china.org帖子的链接:https://ruby-china.org/topics/21720苹果提供的bash更新链接:http://support.apple.com/kb/DL1769
---------------------------------------------
资料更新
CVE-2014-6127的公开被视为ShellShock,而这几天真是“余震”不断。非常遗憾的告诉大家,目前一共上报了5个相关的Bug:
CVE-2014-6127
CVE-2014-7169
CVE-2014-7186
CVE-2014-7187
CVE-2014-6277(细节尚未公开)
下面是一些相关资料:
ShellShock - Wikipedia 持续更新
https://raw.githubusercontent.com/citypw/DNFWAH/master/4/d4_0x07_DNFWAH_shellshock_bash_story_cve-2014-6271.txt
https://access.redhat.com/security/cve/CVE-2014-6271
https://access.redhat.com/security/cve/CVE-2014-7169
https://access.redhat.com/articles/1200223
关于ShellShock:CVE-2014-6271
一个被指比“心脏出血”还要严重的Linux安全漏洞被发现,尽管还没有发现利用该漏洞进行的攻击,但是比“心脏出血”更低的操作门槛让它比前者更加危险。
GNU Bash through 4.3 processes trailing strings after function definitions in the values of environment variables, which allows remote attackers to execute arbitrary code via a crafted environment, as demonstrated by vectors involving the ForceCommand feature in OpenSSH sshd, the mod_cgi and mod_cgid modules in the Apache HTTP Server, scripts executed by unspecified DHCP clients, and other situations in which setting the environment occurs across a privilege boundary from Bash execution.
如何验证
在终端中运行下面的命令:
# CVE-2014-6271
$ env x='() { :;}; echo vulnerable' bash -c 'echo hello'
# CVE-2014-7169
$ cd /tmp; rm -f /tmp/echo; env 'x=() { (a)=>\' bash -c "echo date"; cat /tmp/echo
其中:
CVE-2014-6271:返回中含有vulnerable说明中枪。
CVE-2014-7169:返回中含有类似Sat Sep 27 03:58:41 CST 2014这样的时间说明中枪。
把命令中的bash替换成其他类型的shell,可以检查机器上其他shell是否中枪。
修复Bug
不明觉厉的话,升级就对了。
GNU官方补丁所在地址:http://seclists.org/oss-sec/2014/q3/650
OS X下修复Bug的方法:http://apple.stackexchange.com/questions/146849/how-do-i-recompile-bash-to-avoid-the-remote-exploit-cve-2014-6271
Linux发行版:目前各大发行版都已经放出相应的升级包,请通过各自的包管理器安装最新版本的bash。
越狱过的iOS:用过Cydia更新。 # 没事不要乱root、越狱。
【重要】用Mac的童鞋在更新后别忘了把旧的bash和sh取消运行权限:
# 根据实际路径及文件名
$ sudo chmod a-x /bin/bash.old /bin/sh.old
【重要】有人偷懒,用其他的shell去替换bash,这样不靠谱,一是这样做就是自己给别人留后门,二是其他的shell也存在这样的Bug。
感谢:
@williamherry 最早贡献出Bug的应用实例
@Tony612 提醒新的Bug出现 https://ruby-china.org/topics/21742
页:
[1]