Showing posts with label blackhole. Show all posts
Showing posts with label blackhole. Show all posts

Monday, August 26, 2013

Expack continues exploiting Java vulnerability

Exploit kits available in the wild tend to follow a trend by exploiting vulnerabilities reported in various browser components which are commonly deployed. Recently, we have seen an increase in exploitation of a year old vulnerability reported in the JRE component of JAVA (CVE-2012-1723). Exploitation of this vulnerability in JRE allows a attacker to download malware onto a victim's machine and execute it. Let's looks at an analysis of such an exploit kit recently found in the wild.

Exploit Kit URL:
hxxp://174.142.240.91/577ac477f62d4873cf41dc834d107b7c/influences-portal.php

When accessed, the above exploit URL executes obfuscated JavaScript and loads an applet into the browser as shown below:


Obfuscated source code:


Let's analyze the above obfuscated JavaScript code by de-obfuscating it. While de-obfuscating the JavaScript code, we noticed that the code has multiple layers of obfuscation. For the scope of this article, lets skip ahead to the end of the de-obfuscation process. 

As usual, the exploit kit request loads content based on the version of the browser and versions of different plugins installed in a browser by running browser/plugin detection logic embedded in obfuscated JavaScript. The exploit kit targets vulnerabilities in JRE (Java) and Adobe components of the browsers.

Let's take a look at following de-obfuscated code which loads malicious applet into browser:


The following code calls the relevant functions above, depending upon the JRE version found on the victim's machine:


The applet is executed by the browser, which then downloads a malicious .jar file from following URL,

hxxp://174.142.240.91/577ac477f62d4873cf41dc834d107b7c/influences-portal.php?gKoRO=UfhqAFb&gCTEVgSTdQbZjI=wUkSXV 

The de-complied code of the downloaded .jar file is also heavily obfuscated. 


VT Result: 13 / 45
MD5:  361b0e1eab5e647315e6873ea16ca720

This .jar files exploits the vulnerability in the JRE, which allows the attacker to download additional malware and execute it the browser context.

 
 VT Result: 13 / 46 
MD5: a151fdce265ba4fcab1b36bd624d330f

A Trojan then connects to the CnC server by sending POST data and in response, the CnC server replies with 'STATUS-IMPORT-OK'.


After receiving command 'STATUS-IMPORT-OK' from the CnC server, The Trojan then downloads another malware file (6.exe) from the same domain which looks to be a variant of ZerooAccess rootkit. The detection rate for the '6.exe' is also fairly low on VT.
 
VT-Result: 6 / 46  
MD5: b152b3d170dc089b057fbbe3d6393764

Exploitation of browser components such as Java and Adobe plugins by exploit kits are now a very common reason for enterprise PCs to become compromised. My colleague Krishanan ise in Red Kit Exploit Kit Activity, which also addressed the same vulnerability in Java.It is vital that enterprises ensure that browser plugins are always patched and up to date, something enterprises regularly fail to do. In the case Java, given the now regular stream of 0days that it has inspired, you may want to seriously consider disabling Java altogether, at least at the browser level, something that you can read about in a previous blog post entitled: Are you vulnerable to yet another Java 0Day exploit?

Pradeep

Tuesday, May 21, 2013

Darkleech attack continues to grow

The Apache Darkleech attack has been in the news for quite some time now. The first compromise that we identified in our transactions dates back to mid-March. This Darkleech exploit (aka Linux.Cdorked)  injects malicious redirections into a website that leads to a Blackhole exploit kit (BEK) landing page. Sucuri published up a great write up about the Darkleech infection mechanism on the server side.

We are currently observing a considerable rise in websites being compromised due to this attack. The infected websites redirect to a version of the Blackhole Exploit Kit v2. We identified the following sites being compromised in the past week within observed Zscaler traffic:

202.218.253.214
bazzillbasics.com
bigfishermanseafood.com
clasificados.zocalo.com.mx
colima.vendidoalas3.com.mx
embarque.com
kimindschool.com
mapas.guiaroji.com.mx
mediagazer.com
middleschoolbook.com
mpsrail.co.uk
new.schoolnotes.com
newsofthepast.com
norwalkmedicalgroup.com
reports.valeopartners.com
studioartsdallas.com
unit2.euro2day.gr
v2.wallpaperzip.com
www.264thegrill.com
www.acadianabusiness.com
www.alancristea.com
www.aqua-medic.com
www.aquapurawater.ca
www.backroads.org
www.beachcamsusa.com
www.bsgco.com
www.chicagohomeestates.com
www.compactpowercenter.com
www.companyrescue.co.uk
www.eastpak.com
www.euro2day.gr
www.flowersandservices.com
www.fortworthzoocoupons.net
www.freedieting.com
www.gite-mer.com
www.grandlifehotels.com
www.jackshainman.com
www.momentumtraining.biz
www.nevadasecuritylicense.com
www.qualityenvironmental.co.uk
www.ranabroadband.net
www.rentalsource.com
www.servo2go.com
www.superiorvalves.com
www.theacme.com
www.trulia.com
www.vbbound.com
www.visit-montenegro.com
www.volpifoods.com

The following list shows the list of IPs and websites observed serving the Blackhole Exploit kit landing page.

129.121.101.227
129.121.104.90
129.121.108.220
129.121.113.217
129.121.120.211
129.121.168.226
129.121.194.244
129.121.199.90
129.121.201.230
129.121.45.181
129.121.55.185
129.121.61.189
129.121.65.124
129.121.85.166
143.95.13.5
143.95.1.6
143.95.17.5
143.95.1.8
143.95.2.6
143.95.7.6
149.47.113.128
149.47.149.225
149.47.154.201
149.47.205.179
149.47.21.162
149.47.218.128
149.47.22.176
149.47.225.171
149.47.245.128
173.233.133.30
173.233.133.43
173.233.134.138
173.244.221.89
174.37.210.122
174.37.210.127
208.166.50.27
208.43.236.169
208.69.183.138
208.69.183.205
209.126.248.63
216.154.208.125
64.247.176.220
64.247.180.106
65.75.145.203
65.75.168.252
65.75.174.197
65.75.176.120
65.75.184.70
65.75.185.243
65.75.188.211
65.75.190.59
67.213.213.23
69.89.4.92
69.89.5.224
69.89.9.47
adanakenthaber.com
aftabcurrency.eu
akmusik.org
alzagh.com
aminexchange.net
austriawanderer.com
basquet-atletico.lendanearlongisland.com
boomchoon.co.uk
budgettyremaintenance.co.uk
cariparker.co.uk
cinselmarket.org
countryandleisureclothing.co.uk
egyptwanderer.com
elkadytrans.com
firstbytemicro.com
foryouroccasions.co.uk
georgemediahouse.co.uk
gheep.co.uk
gshcontracts.co.uk
hcxmy.com
hungarywanderer.com
lcwceramics.co.uk
leventerkekkuaforu.com
lovehost.co.uk
moneystopltd.co.uk
mpsrail.co.uk
mtlssc.org.uk
ondervreemdevlag.nl
partitioningsoutheast.co.uk
platjadarovirtual.com
rika.100pixels.co.uk
sms.nozom.com.eg
teddyrepair.co.uk
upminstercontainers.com
wallpapers.animalz.gr
wcwr.co.uk

The following pattern in the URL was observed:

\/[a-z0-9]{16,32}\/q.php

We also identified the following user-agent strings when the redirection was made:

Java/1.6.0_26
JNLP/1.7.0 javaws/10.21.2.11 () Java/1.7.0_21
JNLP/6.0 javaws/1.6.0_03 (b05) Java/1.6.0_03
JNLP/6.0 javaws/1.6.0_26 (b03) Java/1.6.0_26

The user agents found while visiting these infected sites were mainly: MSIE_7_X, MSIE_8_X and MSIE_9_X.

Upon visiting an infected website, it redirects to a standard BEK v2 landing page as shown below.


The exploit code targets vulnerabilities in multiple plugins including Adobe PDF and Java when run on IE, causing the attacker to load malicious code in the context of the application. When deobfuscating the PDF exploit, we can see the final URL used for redirection, as shown in the image below. However, this URL was not accessible (404 error response), at the time of writing, hence it was not possible to retrieve the malicious binary file.


Upon revisiting some of these compromised websites, it was found that the page was no longer serving the injected code. This provides a clue. The attackers probably choose random sites running the Apache Webservers that are vulnerable to the dark leech exploit and infect them only for a brief period of time and then clean them up. Hence tracking Darkleech infections is can be a challenging task. For further details on the vulnerability and how the server can be patched, please refer to CVE-2012-1557.

Monday, April 9, 2012

PDF exploits targeted through Blackhole exploit kits.

PDF exploits have been targeted by Blackhole exploit kits for some time now. The Blackhole exploit kit will deliver various malicious PDF files to a user if the victim is running a potentially vulnerable version of Adobe Reader. When these PDFs are opened through Adobe Reader, a known vulnerability is exploited which will then compromise the user’s machine.

Let’s look at the de-obfuscated portion of the Blackhole exploit kit. The exploit kit for this sample was delivered from “flightpub.net/l/src.php?case=46677c190b37f2d6”.

The de-obfuscated code above shows how an iFrame of 1x1 pixels is created to load a malicious PDF file residing at “./content/ap1.php?f=97d19::182b5” or “./content/ap1.php?f=97d19::182b5”, depending upon the version of Adobe reader installed. These two files are hosted on same the domain - “flightpub.net”.

The absolute paths of the malicious files are,

hxxp://flightpub.net/l/content/ap1.php?f=97d19::182b5 and
hxxp://flightpub.net/l/content/ap2.php?f=97d19::182b5

For analysis purposes, we can manually downloaded the aforementioned PDF files. The PDF files contain a JavaScript object, which contains obfuscated JavaScript, as shown below:

The JavaScript code loops through array ‘ar’ and converts each element of the array with logic included in function ‘test2()’. The de-obfuscated code targets a three year old vulnerability in Adobe Acrobat reader.

Let’s take a look at the some of the de-obfuscated code,

A stack based buffer overflow vulnerability exists in the ‘getIcon()’ method, which is detailed in CVE-2009-0927.

This vulnerability is widely targeted by various versions of the Blackhole exploit kit. I have seen different variants of the payload URL used to host these PDF exploits. The URL pattern changes with different variants of the exploit kit. The different URL path patterns seen so far are:

/content/ap1.php?f=97d19::182b5
/content/ap2.php?f=97d19::182b5
/content/fdp1.php?f=63
/content/fdp2.php?f=63
/content/adfp2.php?f=193
/content/adfp1.php?f=193

The common pattern in the above URL paths are ‘/content/’ and ‘.php?f=’. By identifying these common patterns one can write a network signature on URL strings to catch these malicious URLs.

Let’s take a look at couple of snort signatures for detecting these malicious URL’s.

alert tcp $HOME_NET any -> $EXTERNAL_NET $HTTP_PORTS (msg:"ET CURRENT_EVENTS Blackhole Acrobat 1-7 PDF exploit download request 3"; flow:established,to_server; content:"/fdp1.php?f="; http_uri; reference:md5,8a33d1d36d097ca13136832aa10ae5ca; reference:cve,CVE-2011-0611; classtype:trojan-activity; sid:2014052; rev:2;)

alert tcp $HOME_NET any -> $EXTERNAL_NET $HTTP_PORTS (msg:"ET CURRENT_EVENTS DRIVEBY Blackhole PDF Exploit Request /fdp2.php"; flow:established,to_server; content:"/fdp2.php?f="; http_uri; reference:md5,8a33d1d36d097ca13136832aa10ae5ca; reference:cve,CVE-2011-0611; classtype:trojan-activity; sid:2014035; rev:2;)

Most of the vulnerabilities targeted by various exploit kits are public. Making sure all of your applications are updated regularly with the latest security updates will go a long way in helping to keep your computer secure.

Pradeep

Monday, January 16, 2012

Popularity of Exploit kits leading to an increase in compromised websites

The dominance of exploit kits like Blackhole, Incognito and others, continues to be seen in the wild. Attackers continue to use these exploit kits to generate malicious webpages and host them on various domains. These exploit kits usually targets browser and browser plugin vulnerabilities.

To increase the likelihood of a successful attack, exploit kits are commonly used to infect legitimate sites that already have significant traffic. Attackers achieve this by crafting scripts designed to identify sites with injection vulnerabilities, which allow for hidden iFrames to be written, which then point to the exploit kit URL. When users visit the infected sites and are redirected to the browser exploit kits, a known browser or plugin vulnerability is typically used to download and execute malicious content without user knowledge. You can visit this related blog for more information about iFrame injection in detail.

Recently, I’ve seen a spike in such compromised sites, which lead to exploit kit URLs. In most cases, the JavaScript code containing the hidden iFrame is heavily obfuscated. Different exploit kits have their own techniques to obfuscate malicious code. Let’s take look at a couple of examples and their respective de-obfuscated code.

iFrame leading to Incognito exploit kit
URL:
hxxp://www.snapstudios.net/kitchen-set-hidden-behind-the-cupboard.html

Obfuscated code:

The aforementioned obfuscated code was injected at the start of the webpage. Let’s deobfuscate the code to make sense of it.

De-obfuscated code:

You can see that the deobfuscated code generates a hidden iFrame with the ‘src’ attribute being assigned the exploit kit URL. Generally, the visibility of the iFrame is kept hidden and dimensions are kept to a minimum, which ensures that the iFrames don’t alter the look and feel of the page.

Exploit kit URL: hxxp://racingengines.osa.pl/showthread.php?t=63942072

After observing patterns in the exploit URL, one can determine that this URL belongs to the Incognito Exploit kit.

Suspicious URL Pattern: “/showthread.php?t=”

Search results for the above pattern at www.malwaresomainlist.com confirms that URL belongs to the well known Incognito exploit kit. The exploit kit URL is still active but currently not delivering the malicious code. Visit this blog on Incognito exploit kit for more details.

iFrame leading to Blackhole exploit kit
URL:
hxxp://steelrode.com/

Obfuscated code:

De-obfuscated code:

Exploit kit URL: hxxp://brighttz.com/main.php?page=dac9bd89165e2708

Suspicious URL pattern : /main.php?page=”

Search results for the suspicious pattern at www.malwaredomainlist.com can be found here. The exploit kit URL is not currently active. We have been writing about the Blackhole exploit kit for some time. At present, this seems to be the favored exploit kit amongst attackers. You can find more information about the Blackhole exploit kit here.

Fortunately, the aforementioned exploit kit URLs have been blocked by Google Safe Browsing. A sample Google diagnostic report of the Incognito exploit kit URL can be found here. While conducting research I came across a number of such compromised websites on a daily basis. Attackers continually alter obfuscated code to ensure that it is not yet detected by popular AV/IPS/IDS vendors. This keeps them one step ahead in this ongoing game of cat and mouse.

To conclude, I would like to say,

The growth in compromised websites is directly proportional to the growth in popularity of different exploit kits”.

Pradeep