发信人: go88 (旧友重来), 信区: SanFrancisco 标 题: Re: macOS/Linux 巨大安全漏洞 shellshock 发信站: BBS 未名空间站 (Fri Sep 26 04:55:57 2014, 美东) 谢谢楼主的贴。这么大的新闻居然没人讨论? 这里是这次事情的wiki,整个事情还在不断更新 http://en.wikipedia.org/w/index.php?title=Shellshock_%28softwar 上班的电脑不算,我自己的电脑自从N年前开始就只用linux了。结果今晚我根据 wiki上给出的命令做了个测试,结果我的这个比较新的某linux distribution也有问题 ,当然,目前所有没有patch的linux系统应该全都有问题。。。 我记得很早的时候,unix上default的shell是sh,csh, tcsh这样的shell, bash是后来随 着linux才开始流行起来的,现在需要看看这次这个bash的漏洞,那个env variable使 用上的漏洞,是从bash最初版本就有的,还是随着linux从linux的open source阵营带 进来的,什么时候带进来的具体check-in,我还没更多阅读,冒昧臆测的话,不知是否 如同上次那个heartbleed,也有可能是人故意埋的bug,上次那个heartbleed是个德国 人某年的新年夜check-in的,而且他的其他open-ssl的chek-in也被发现有问题。。。 如果仔细看的话,上次那个heartbleed和这次这个漏洞的风格和手法非常类似。。。 附:漏洞具体内容 CVE-2014-6271 vulnerability details Bash supports exporting Bash function definitions inside environment variables. For example, the following defines a "hello world" function inside environment variable named, "HELLO_WORLD_VAR" HELLO_WORLD_VAR=() {echo "Hello World";}; Note that the function is defined only, not executed, when Bash starts. The bug is that Bash did not stop parsing at the end of the function, but instead, continued interpreting. So if an attacker could set the value of the environment variable to, for example, HELLO_WORLD_VAR=() {echo "Hello World";}; rm /path/to/file Then Bash first would define, but not execute, the function (only defining it is harmless), but immediately, execute the malicious command "rm /path/to /file", effectively giving shell access to the attacker. The attacker would still have to get his code inserted into an environment variable, but many Internet-facing daemons will insert user-supplied code into an environment variable, since it normally would be considered harmless. 貌似这个在环境变量里设置函数定义的做法,几乎就是为网站类网络互动action量身定 做的,新闻里提到的cgi就是典型,我过去出于娱乐简单做过一个用leobbs开发的网站 ,就是cgi based,黑客就可以用这样的手段在其登录或者发帖的code里远段设定一些 非常无辜的环境变量,里面函数设定,比如笑脸表情加动态条件等等,然后后面就可以 跟邪恶的命令了,比如动态改动admin权限的cgi scrip内容,短暂取消权限限制,然后 下一个类似动作再改回去,呵呵。。。所以非常有必要看看这个bash的漏洞是什么时候 ,被谁带进来的。。。 cgi是比较旧的东西了,我也不是做纯网络应用的,不知道现在其他新的网站管理软件 是否有类似问题,像咱们大家一般用linux如果只是简单用户,不做网站什么的,应该 不会有太大问题。当然,新闻里说ssh也有问题,我还没仔细阅读,但是想必如果我们 disable ssh,总之一般的linux普通用户,不知道有多大影响。。。