Bash漏洞修复解决方案
CVE-2014-6271 and CVE-2014-7169
一、漏洞描述
开源软件Linux中一个频繁使用的片段“Bash”,最近发现存在安全漏洞,其对计算机用户造成的威胁可能要超过今年4月爆出的“心脏出血”(Heartbleed)漏洞。Bash是用于控制Linux计算机命令提示符的软件。网络安全专家表示,黑客可以利用Bash中的一个安全漏洞,对目标计算机系统进行完全控制。
网络安全公司Rapid7的工程经理托德·比尔兹利(Tod Beardsley)则警告称,Bash漏洞的严重程度被评为10级,意味着它具有最大的影响力,而其利用的难度被评为“低”级,意味着黑客比较容易地利用其发动网络攻击。
二、 漏洞编号
CVE-2014-6271 and CVE-2014-7169
三、 检测方式
CVE-2014-6271检测方法:
[root@localhost Desktop]# env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
vulnerable
this is a test
如上表示 出现vulnerable表示不安全
把命令中的bash替换成其他类型的shell,可以检查机器上其他shell是否中。
出现以下内容表示漏洞已修复(但其实漏洞还留了一半)
[root@localhost Desktop]# env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
bash: warning: x: ignoring function definition attempt
bash: error importing function definition for `x'
this is a test
CVE-2014-7169检测方法:
影响 redhat 5 、redhat 6 、redhat 7
这个漏洞是由于之前的CVE-2014-6271修复不完全,依然存在其他方式注入,可以创建读取文件。
可使用以下命令检测,如下为存在漏洞,同时会在当前目录下创建 echo 文件。
[root@localhost Desktop]# env X='() { (a)=>\' sh -c "echo date"; cat echo
sh: X: line 1: syntax error near unexpected token `='
sh: X: line 1: `'
sh: error importing function definition for `X'
Fri Sep 26 01:48:37 PDT 2014
出现下面的两种状态之一说明漏洞已经修复。
[root@localhost Desktop]# env X='() { (a)=>\' sh -c "echo date"; cat echo
date
cat: echo: No such file or directory
也可能出现下面的情况,这是由于已经存在 echo 文件
[root@localhost Desktop]# env X='() { (a)=>\' sh -c "echo date"; cat echo
date
Fri Sep 26 01:50:28 PDT 2014
四、 修复方式
下载官方的rpm包,通过rpm –U 的方式来升级bash,即可解决此漏洞。
五、注意事项
红帽官方版本解决CVE-2014-7169漏洞后,使用env x='() { :;}; echo vulnerable' bash -c "echo this is a test"命令检测结果会发生变化。
[root@localhost Desktop]# env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
this is a test
不会再出现之前的报错信息,直接反馈后面的结果。
六、 演示操作步骤
[root@localhost Desktop]# env X='() { (a)=>\' sh -c "echo date"; cat echo
sh: X: line 1: syntax error near unexpected token `='
sh: X: line 1: `'
sh: error importing function definition for `X'
Fri Sep 26 01:48:37 PDT 2014
[root@localhost Desktop]# env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
vulnerable
this is a test
[root@localhost Desktop]# rpm -Uvh bash-4.1.2-15.el6_5.1.x86_64.rpm
cve漏洞库warning: bash-4.1.2-15.el6_5.1.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
>>>>>>>>### [100%]
1:bash >>>>>>>>### [100%]
[root@localhost Desktop]# env X='() { (a)=>\' sh -c "echo date"; cat echo
sh: X: line 1: syntax error near unexpected token `='
sh: X: line 1: `'
sh: error importing function definition for `X'
Fri Sep 26 01:50:28 PDT 2014
[root@localhost Desktop]# env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
bash: warning: x: ignoring function definition attempt
bash: error importing function definition for `x'
this is a test
[root@localhost Desktop]# rpm -Uvh bash-4.1.2-15.el6_5.2.x86_64.rpm
warning: bash-4.1.2-15.el6_5.2.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
>>>>>>>>### [100%]
1:bash >>>>>>>>### [100%]
[root@localhost Desktop]# env X='() { (a)=>\' sh -c "echo date"; cat echo
date
Fri Sep 26 01:50:28 PDT 2014
[root@localhost Desktop]#rm –rf echo
[root@localhost Desktop]# env X='() { (a)=>\' sh -c "echo date"; cat echo
date
cat: echo: No such file or directory
[root@localhost Desktop]# env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
this is a test
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
热门文章
-
利用正则表达式实现文本数据提取与处理
2025-02-08 -
正则表达式零宽断言详解
2025-02-08 -
文本匹配规则
2025-02-08 -
excel中使用正则
2025-02-08 -
1-31正则表达式
2025-02-08 -
anki之高级筛选
2025-02-08 -
BUAA_OO_2021_第一单元总结
2025-02-08 -
insert语句递增写法
2025-02-08 -
sublime text 3在行前插入递增数字序号的方法
2025-02-08 -
字符串只允许数字和英文的正则
2025-02-08 -
powerbuilder 正则表达式
2025-02-08 -
Shell脚本编写的高级技巧利用正则表达式进行字符串匹配
2025-02-08 -
JAVA正则表达式的三种模式:贪婪,勉强和占有的讨论
2025-02-08 -
go regexp匹配规则
2025-02-08 -
oracle regexp_substr 实现原理
2025-02-08 -
基本的元字符 回溯引用和前后查 匹配模式
2025-02-08 -
elasticsearch query dsl正则
2025-02-08 -
oracle sql正则表达式
2025-02-08 -
GA-设置目标
2025-02-08 -
仅匹配全角片假名的正则表达式
2025-02-08
最新文章
-
java正则表达式 选择题
2025-02-12 -
工龄小数点提取
2025-02-08 -
非零金额 正则表达式
2025-02-08 -
提取文本中数字的函数
2025-02-08 -
vue数字相加小数点变长-概述说明以及解释
2025-02-08 -
vue validate 正则验证小数长度
2025-02-08
发表评论