关于bash漏洞的事及修复方法

你妈,一个BASH的漏洞,可以通过漏洞获取很大的权限,解决的方法很简单,就是升级bash。

下面是官网拔下来的,当然用的翻译。

在Linux中,环境变量提供了一种软件的行为对系统的影响。对于很多程序在后台运行bash shell是很常见的。它经常被用来向远程用户提供壳(通过SSH,Telnet,例如),提供一个CGI脚本解析器(Apache,等)甚至提供有限的命令执行的支持(GIT,等)

回到主题,变量与特制的值调用Shell之前。这些变量可以包含代码,壳被调用执行。这些特制的变量的名称并不重要,只是含量。作为一个结果,这个漏洞是在许多环境中暴露出来,例如:

forcecommand用于sshd脚本提供有限的命令的执行能力,为远程用户。这个缺陷可以用于旁路,并提供任意命令执行。一些Git和颠覆部署使用限制炮弹。OpenSSH的定期使用,不是因为用户已经访问的影响。

Apache服务器使用mod_cgi如果CGI脚本或mod_cgid是写在bash的影响,或产生的亚层。这样子shell的隐式使用的C / popen系统,通过os.system/os.popen Python,PHP /执行系统(当运行CGI模式),和打开/系统在Perl中如果使用外壳(这取决于命令字符串)。

PHP脚本执行mod_php不会受到影响,即使他们产卵的亚层。

DHCP客户端调用shell脚本来配置系统,从一个潜在的恶意服务器的值。这将允许执行任意命令,通常为根,在DHCP客户机。

各种守护进程和suid /特许的程序可以执行的shell脚本的用户的影响的环境变量设置的值,这将允许任意要运行的命令。

任何其他的应用程序,钩住外壳或运行一个shell脚本使用bash当翻译。shell脚本不出口的变量是不容易受到这个问题,即使他们的过程不受信任的内容并将其存储在(导出)外壳程序变量和开支壳层。

像“真正”的编程语言,bash有功能,虽然在一些有限的实现,并有可能把这些bash功能为环境变量。该漏洞被触发时,额外的代码添加到这些函数定义结束(内部环境变量)

root@slave1 ~]# env x='() { :;}; echo vulnerable' bash -c "echo this is a test"vulnerablethis is a test[root@slave1 ~]# rpm -qa|grep bashbash-4.1.2-8.el6.centos.x86_64[root@slave1 ~]#[root@slave1 ~]# yum update bash -yLoaded plugins: fastestmirror, securityDetermining fastest mirrorsepel/metalink                                                                                                                                             | 3.8 kB     00:00 * epel: mirror.premi.stbase                                                                                                                                                      | 3.7 kB     00:00cdh                                                                                                                                                       |  951 B     00:00cloudera-cdh4                                                                                                                                             |  951 B     00:00epel                                                                                                                                                      | 4.4 kB     00:00epel/primary_db                                                                                                                                           | 6.3 MB     00:26extras                                                                                                                                                    | 3.3 kB     00:00percona                                                                                                                                                   |  951 B     00:00percona/primary                                                                                                                                           |  30 kB     00:00percona                                                                                                                                                                    98/98updates                                                                                                                                                   | 3.4 kB     00:00updates/primary_db                                                                                                                                        | 5.3 MB     00:22Setting up Update ProcessResolving Dependencies--> Running transaction check---> Package bash.x86_64 0:4.1.2-8.el6.centos will be updated---> Package bash.x86_64 0:4.1.2-15.el6_5.1 will be an update--> Finished Dependency ResolutionDependencies Resolved================================================================================================================================================================================= Package                               Arch                                    Version                                            Repository                                Size=================================================================================================================================================================================Updating: bash                                  x86_64                                  4.1.2-15.el6_5.1                                   updates                                  905 kTransaction Summary=================================================================================================================================================================================Upgrade       1 Package(s)Total download size: 905 kDownloading Packages:bash-4.1.2-15.el6_5.1.x86_64.rpm                                                                                                                          | 905 kB     00:02Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning Transaction  Updating   : bash-4.1.2-15.el6_5.1.x86_64                                                                                                                                  1/2  Cleanup    : bash-4.1.2-8.el6.centos.x86_64                                                                                                                                2/2Updated:  bash.x86_64 0:4.1.2-15.el6_5.1Complete![root@slave1 ~]# env x='() { :;}; echo vulnerable' bash -c "echo this is a test"bash: warning: x: ignoring function definition attemptbash: error importing function definition for `x'this is a test[root@slave1 ~]#
关于bash漏洞的事及修复方法

相关文章:

你感兴趣的文章:

标签云: