Blogs & Stories

SpiderLabs Blog

Attracting more than a half-million annual readers, this is the security community's go-to destination for technical breakdowns of the latest threats, critical vulnerability disclosures and cutting-edge research.

[Honeypot Alert] New Bot Malware (BoSSaBoTv2) Attacking Web Servers Discovered

Our web honeypots picked up some interesting attack traffic. The initial web application attack vector (PHP-CGI vulnerability) is not new, the malware payload is. We wanted to get this information out to the community quickly due to the following combined threat elements -

  • Active exploit attempts to upload/install the malware
  • The overall low detection rates among AV vendors
  • The malware is actively being sold in underground forums

Update - Another security researcher has also seen similar activity in his ModSecurity honeypots back on August 26. Some of the tactics have changed but the core of the attack seems the same.

We have already discussed the initial PHP-CGI vuln attack/exploit vector in a previous blog post. What is interesting in these attacks are the actual tools installed if the attack is successful. Here is the initial screen shot of the attack payloads taken from the ModSecurity audit log file on the honeypot:

Screen Shot 2014-09-11 at 12.20.12 PM

We cross referenced this attack with our own IDS alerts from Trustwave MSS team and have seen a definite increase in scanning activity for the inital web application attack vector (PHP-CGI) within the last month:

IDS Alerts by Week

Keep in mind that exploit vectors and payloads are separate ecosystems. They are often interchanged with each other. For example, we often see new PHP command injection vectors used within botnet code that execute or install the same backend malware code. The initial URL encoded data in the QUERY_STRING decodes to:

Screen Shot 2014-09-11 at 12.23.55 PM

The final "auto_prepend_file=php://input -a" data tells php to take the info from the POST payload and append it to any existing code and execute it. If we look at the complete PHP code in the request body, we see that there are actually 2 different variables that contain base64 encoded data.

Screen Shot 2014-09-11 at 12.27.51 PM

This data is then later decoded and places into temp files and then executed.

Screen Shot 2014-09-11 at 12.29.08 PM

What are these files? If we base64 decode the variable data, we can see that they are in fact ELF binaries that are packed with UPX -

Screen Shot 2014-09-11 at 12.32.08 PM

Here is some quick static analysis -

Screen Shot 2014-09-11 at 12.38.23 PM

The files are essentially the same, however one is 32-bit and one is 64-bit. The attacker isn't even bothering with checking the web server OS version... they are just trying to execute both to see which one might work. Checking this file over on VirusTotal shows that only 4 AV vendor currently detects this file as malicious:

Screen Shot 2014-09-12 at 11.54.09 AM
Note - We have internally verified that Trustwave AV does detect this file as malicious.

The file contains many clear text URLs that have been associated with Botnet C&C activity:

  • srv5050.co

  • ka3ek.com

  • ircqfrum.com

  • 8rb.su

Once we see the IRC botnet code, we get a clearer idea of what we are dealing with here:

Screen Shot 2014-09-11 at 1.06.34 PM

There are many IRC commands here. IRC botnet code installs are nothing earth-shatteringly new however most of the variants we capture are written in Perl, PHP, etc... This one is binary C code. One interesting tactical note - the destination IRC port on these C&C servers is 53. This is a smart move from the attacker's perspective as DMZ network firewalls may allow web servers to initiate outbound DNS queries.

Additionally, we see the highlighted section of code which seems to identify this code as: BoSSaBoTv2. After some searching, we were able to find that this code is actively being sold on underground forums. Here are some example screenshots:

Screen Shot 2014-09-11 at 1.14.54 PM

Screen Shot 2014-09-11 at 1.15.51 PM

Notice some of these features including bundling a Bitcoin Miner program. This is interesting as this shows another aspect how an attacker is looking to abuse their access to a compromised web server. They can siphon off local system resources such as CPU and RAM in attempts to create Bitcoins. Here are some of the commands for downloading and running the Bitcoin miner -

Screen Shot 2014-09-11 at 1.18.39 PM

We also see on the hacker forum that this malware is for sale at affordable prices:

Screen Shot 2014-09-11 at 1.19.50 PM


We wanted to get this information out to the community quickly due to the following combined threat elements -

  • Active exploit attempts to upload/install the malware
  • The overall low detection rates among AV vendors
  • The malware is actively being sold in underground forums

Here are a few defensive steps:

Update Network Firewall Egress Rules

All too often, we see weak or non-existent egress firewall rules. As an example of why you need them - during our research, we saw the IRC botnet master send down commands to have the malware update itself by downloading a new version -

Screen Shot 2014-09-15 at 9.49.27 AM

If you can block outbound connections from your web servers to 3rd party hosts, you can significantly help to reduce an attacker's ability to expand their breach.

Deploy a WAF

Our honeypots picked this up due to alerts from our ModSecurity WAF rules. The Trustwave WAF also detects these attacks. Not only will this give you some base protections, but it also provides better logging vs. standard web server log files. Speaking of web server log files....

Check Your Logs

Review your web server log files to see if you have been receiving these initial PHP-CCI attacks.

Screen Shot 2014-09-11 at 1.28.45 PM

Pay close attention to the HTTP Response Status Codes. Anything other than a 404 - Not Found could indicate trouble.