Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

A tutorial on how to detect and repair the shell-breaking vulnerability ​​ in bash on Linux systems

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains the "detection and repair of bash under the Linux system shell vulnerabilities in the method tutorial", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in-depth, together to study and learn "detection and repair of bash shell vulnerabilities under the Linux system in the method tutorial" it!

On September 24, 2014, a security researcher named Stefan Shazera discovered a bash vulnerability called "Shellshock" (also known as "bash gate" or "Bash vulnerability"). If this vulnerability is compromised, a remote attacker can execute any program code by outputting function definitions in a specially crafted environment before calling shell. The code within these functions can then be executed immediately when bash is called.

Note that the shell-breaking vulnerability affects bash versions 1.14 through 4.3 (current version). Although there is no authoritative and complete fix for this vulnerability at the time of writing, although major Linux distributions (Debian,Red Hat,CentOS,Ubuntu and Novell/Suse) have released patches (CVE-2014-6271 and CVE-2014-7169) that partially address this vulnerability, it is recommended that bash be updated as soon as possible and check for updates in the next few days. There is already a perfect solution).

Detect shell vulnerabilities

To check if there is a shell vulnerability in your Linux system, enter the following command in the terminal.

$env Your bash version is vulnerable'() {:;}; echo "Your bash version is vulnerable" 'bash-c "echo This is a test"

If your Linux system has been exposed to shell penetration, the command output will look like this:

Your bash version is vulnerableThis is a test

In the above command, an environment variable named x has been set to be available to the user environment. As we know, it is not assigned (it is a virtual function definition), followed by an arbitrary command (red), which will be executed before the bash call.

Apply repair for shell-breaking vulnerabilities

You can install the newly released bash patch as follows.

On Debian and its derivatives:

# aptitude update & & aptitude safe-upgrade bash

On Red Hat-based distributions:

# yum update bash

Before patching:

Debian:

CentOS:

After patching:

Debian:

CentOS:

Note that the bash version in each release has not changed before and after the patch is installed-but you can see from the update command that the patch has been installed (probably requires your confirmation before installation).

Thank you for your reading, the above is the content of the "method tutorial to detect and repair shell vulnerabilities in bash under the Linux system". After the study of this article, I believe you have a deeper understanding of the method tutorial to detect and repair shell vulnerabilities in bash under the Linux system, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report