Shellshock Attack experiment

Source: Internet
Author: User

Shellshock Attack Experiment

First, the experimental description

In 9 months , A serious vulnerability was found in Bash Shellshock , the vulnerability can be used on many systems and can be triggered either remotely or locally. In this experiment, students need to reproduce the attack to understand the vulnerability and answer some questions.

Second, the preparation of knowledge 1.What isShellshock?

Shellshock, also known as Bashdoor, is a security vulnerability in the extensive use of the Bash Shell in Unix , It is open for the first time in 9 months of the year . Many Internet daemons, such as Web servers, use bash to handle certain commands, allowing an attacker to execute arbitrary code on a vulnerable bash version. This could allow an attacker to access the computer system without authorization. -- excerpt from Wikipedia

2. Preparation required for the experiment

Prompt installation is successful, you can query

Iii. contents of the experiment

In this experiment, we attackSet-uidprogram to getRootpermissions. First, make sure that you have installed a vulnerableBashversion, and let/bin/shPointing/bin/bash.Please compile the code below and set it toSet-uidprogram to ensure that its owner isRoot. We knowSystem ()function calls the"/bin/sh-c"to run the specified command, This also means that/bin/bashwill be invoked, usingShellshockvulnerability to obtain permissions.

#include <stdio.h>

void Main ()

{

Setuid (Geteuid ());

Make real UID = effective UID. System ("/bin/ls-l");

}

If setuid (Geteuid ()) statement is removed, and then try to attack, we can not get access to it?

failed! This means that ifReal UIDand theEffective UIDIn the same way, the content defined in the environment variable is valid within the program, soShellshockthe vulnerability could be exploited. But if two ofUIDIf the environment variable fails, you cannot launch an attack, which can beBashis verified in the source code (VARIABLES.C,in the308to the369between lines) please indicate which line is causing the difference, and indicateBashthe reason for this design.

Third, the experimental experience

This is this semester Linux last experiment, This is the last experiment of Linux this semester, the experiment is very simple , bshellshock loophole, this flaw can be used in many systems, And can be triggered either remotely or locally, in this experiment we personally reproduce the attack to understand the vulnerability. That way the shellshock loophole can be exploited, but if the two uid is different, the environment variable fails and the attack cannot be launched. only by constantly discovering loopholes, the system can continue to improve.

Shellshock Attack experiment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.