当前位置: 首页 > 工具软件 > bash-fun > 使用案例 >

linux的漏洞怎样修复工具,Linux Bash 严重漏洞检测及修复方法-Fun言

益绯辞
2023-12-01

日前Linux官方内置Bash中新发现一个非常严重安全为了避免您Linux服务器受影响,建议您尽快完成漏洞修补,修复方法如下:

【已确认被成功利用的软件及系统】

所有安装GNUbash版本小于或者等于4.3的Linux操作系统。

【漏洞描述】

该漏洞源于你调用的bash shell之前创建的特殊的环境变量,这些变量可以包含代码,同时会被bash执行。

【漏洞检测方法】

可以使用如下命令来检查系统存在此漏洞:

env x='() { :;}; echo vulnerable' bash -c "echo this is a test"

修复前

输出:

vulnerable

this is a test

使用修补方案修复后

bash: warning: x: ignoring function definition attempt

bash: error importing function definition for `x'

this is a test

特别提示:该修复不会有任何影响,如果您的脚本使用以上方式定义环境变量,修复后您的脚本执行会报错。

【建议修补方案 】

请您根据Linux版本选择您需要修复的命令, 为了防止意外情况发生,建议您执行命令前先对Linux服务器系统盘打个快照,如果万一出现升级影响您服务器使用情况,可以通过回滚系统盘快照解决。

CentOS:

yum -y update bash

Ubuntu(管理员权限安装更新):

14.04 64bit

14.04 32bit

12.04 64bit

12.04 32bit

10.10 64bit

10.10 32bit

Debian:

7.5 64bit && 32bit

apt-get -y install --only-upgrade bash

6.0.x 64bit

6.0.x 32bit

OpenSuse:

13.1 64bit

13.1 32bit

Aliyun Linux:

5.x 64bit

5.x 32bit

RedHat红帽系可通过更新 bash 并重启系统来解决这个问题:

# yum update bash

或者:

# yum update bash-4.1.2-15.el6_5.1

此举只是更新了 bash 包,还需要重启系统才能生效。

Ubuntu 用户可以通过如下命令打补丁,无需重启:

apt-get update

apt-get install bash

RedHat/CentOS 修复后查看版本:

[root@localhost]#which bash

/bin/bash

[root@localhost]#/bin/bash --version

GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)

Copyright (C) 2009 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later

This is free software; you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.

[root@localhost ]#rpm -q bash

bash-4.1.2-15.el6_5.1.x86_64

 类似资料: