Honeyclient Evasion Techniques, Bible.org Case

Hot on the heels of the NBC.com hack last week, Websense® Security Labs™ researchers were alerted by SANS to another high profile website compromise on Friday: bible.org. It appears that the offending code has now been removed from the bible.org website.  

 

At first glance, this seemed to be a run-of-the-mill “compromise, redirect, exploit” chain; however, closer analysis revealed the use of an interesting Honeyclient evasion technique. Honeyclients allow the profiling of websites in a heuristic and automated way; more often, testing a website with a Honeyclient takes longer than signature-based solutions but the results are much more accurate, especially when new zero-day code or a new emerging threat needs to be flagged up and requires scrutiny. Usually, Honeyclients run on top of virtual machine sandboxes: evasion techniques allow malicious code to become more aware of its running environment and to check if it’s in a virtual environment or likely to be an ‘analysis’ environment before actually running malicious code. 

 

 

 

This snippet of code is the entirety of the Honeyclient evasion attempt – as the method name suggests, the function ‘jsstatic’ will only be called once the eventhandler registers the movement of the user’s mouse over the document (page) – obviously, a primitive Honeyclient will have no mouse movement emulation, therefore the offending function that leads to exploit code will never be called and alerted on by the Honeyclient.

 

Let’s take a closer look at the jsstatic function (click to enlarge):

 

 

The first part of this function definition is simply a sentry variable, to stop the function being executed indefinitely with each new onmousemove event – the global variable astatf is defined as 0 in an earlier part of the script. The next part simply creates the iFrame, which is then executed as if it had just been injected into the page, as per a normal compromise.

 

This technique is quite primitive and showcases the infancy of this type of Honeyclient evasion technique. The plethora of event handling methods available means this technique is not going to go away anytime soon, and is likely only going to get more complex and inventive. 

 

In summary: the use of such techniques ultimately aids malicious code in remaining undetected for longer periods of time and thus increases its chances of bypassing security products undetected. The technique described in this blog is simple and allows redirection to exploits only if a mouse movement is detected, an action that is often associated with an actual person interacting with a website and often not used by primitive Honeyclients. Why are the attackers using this technique instead of the normal drive-by type technique we usually see? probably because they wanted to make the attack more stealthy, as attacks like this wouldn’t be picked up by automated behavioral analysis systems. That’s why multiple layers of defense are needed for web-based attacks.

 

This discovery ties in to Websense Security Labs predictions that Cybercriminals will become more ‘virtually aware’ and find modern bypass methods to avoid security detection – see our Websense 2013  Security Predictions.

 

Author: Darrel Rendell 

NBC.com Compromised

Earlier today the main website of NBC and some of their show websites (such as www.jaylenosgarage.com) were compromised and served malicious content to users. The malicious content was inserted as a one-line iframe tag on one of the JavaScripts that gets loaded every time a user visits the page:

 

 

 

This one line of code forces the web browser of every visiting user to download content from the walterjeffers site, which, in turn, redirects the user to two other sites that eventually use an exploit kit to automatically install a malicious file onto the computer. During the few hours the attack was active, we saw several different URLs being used by the attackers. See the screenshot below for the sequence of events as recorded by our replay system that we have in Websense Security Labs.

 

 

 

 

Two vulnerabilities were used to compromise the user’s computer. In the above example, we can see a PDF file, but the exploit will also try Java vulnerabilities. If either is successful, a malicious binary from the Citadel family is installed on the machine. This family of malware is a so-called banking Trojan, which is designed to help the cyber criminals steal money from online banking accounts. While the file has very bad coverage from antivirus solutions according to VirusTotal, our Websense ThreatScope technology was able to see it as suspicious and provide a lot of additional details about the behavior of the file. See here for the full report.

 

Websense customers were proactively protected against the exploit code attack by our real-time analytics specifically designed to prevent exploit kits.

 

 

 

NBC has since confirmed that their site has been cleaned up, and it’s again safe to visit.

APT1: A Prevention Perspective

There’s been increased interest in targeted attacks and advanced persistent threats in the news lately, from the intrusions on large media outlets and hacks on social networking sites to a recent detailed report of the tactics behind the infiltration of a sophisticated attack family dubbed “APT1”.  Much of the controversy swirling around these reports stems from the attempt to identify the perpetrators behind the attacks — a decidedly difficult enterprise.  While the balance of evidence presented for APT1 does appear to point toward authorship in China (after exhaustive analysis), sophisticated attacks are faceless at the moment of attempted compromise.  

 

 

Here are a few data points we’ve already put together from our own analysis of the ThreatSeeker Network:

  • We have observed more than 2,000 unique cases of APT1 attacks since 2011 against all major industry segments.
  • China has a disproportionately large share of web-based attack traffic in the United States.  
    • For example, in February 0.49 percent of all web requests from US manufacturing companies land on servers in China.  11.21 percent of all malicious web requests from US manufacturing companies land on servers in China.  If you’re looking at traffic patterns, that’s more than a 20X traffic disparity toward malware.
    • US news & media companies are also disproportionately driven to malware located in China:   legitimate requests to China make up 7.47 percent of overall traffic, whereas China’s portion of all malicious traffic goes up to 21.21 percent.

  • As the APT1 report suggests, China currently has much less web-based attack traffic originating from the rest of the world at 0.76 percent.  That may change.

 

A more interesting question than authorship for us is: “How can you proactively stop targeted attacks like APT1?”  Signatures are obviously not the answer.  Here are some of the ways that we block APT1 along the kill chain without the need for signature updates:

 

  • Full content scanning within SSL, including preventing rogue certificates and criminal encryption (as we blogged about previously) 
  • File sandboxing (find two examples of APT1’s telltale behavior in ThreatScope reports here and here)
  • URL sandboxing in e-mails to prevent spear phishing
  • Data loss prevention technology to fingerprint and identify legitimate data as it exits
  • Dynamic DNS request interception
  • Web reputation /  destination awareness. Many domains, hosts, IP addresses, and even ASNs used by APT1 have been classified for years. Block known compromised hosts for the hops and the outbound C&C traffic.

 

 

One trend that you can confidently predict: the attackers will continue to adapt and get smarter, and the techniques to thwart them will need to do the same.

 

 

APT1: a prevention perspective

There’s been increased interest in targeted attacks and advanced persistent threats in the news lately, from the intrusions on large media outlets and hacks on social networking sites to a recent detailed report of the tactics behind the infiltration of a sophisticated attack family dubbed “APT1”.  Much of the controversy swirling around these reports stems from the attempt to identify the perpetrators behind the attacks — a decidedly difficult enterprise.  While the balance of evidence presented for APT1 does appear to point toward authorship in China (after exhaustive analysis), sophisticated attacks are faceless at the moment of attempted compromise.  

 

 

Here are a few data points we’ve already put together from our own analysis of the ThreatSeeker Network:

  • We have observed more than 2,000 unique cases of APT1 attacks since 2011 against all major industry segments.
  • China has a disproportionately large share of web-based attack traffic in the United States.  
    • For example, in February 0.49 percent of all web requests from US manufacturing companies land on servers in China.  11.21 percent of all malicious web requests from US manufacturing companies land on servers in China.  If you’re looking at traffic patterns, that’s more than a 20X traffic disparity toward malware.
    • US news & media companies are also disproportionately driven to malware located in China:   legitimate requests to China make up 7.47 percent of overall traffic, whereas China’s portion of all malicious traffic goes up to 21.21 percent.

  • As the APT1 report suggests, China currently has much less web-based attack traffic originating from the rest of the world at 0.76 percent.  That may change.

 

A more interesting question than authorship for us is: “How can you proactively stop targeted attacks like APT1?”  Signatures are obviously not the answer.  Here are some of the ways that we block APT1 along the kill chain without the need for signature updates:

 

  • Full content scanning within SSL, including preventing rogue certificates and criminal encryption (as we blogged about previously) 
  • File sandboxing (find two examples of APT1’s telltale behavior in ThreatScope reports here and here)
  • URL sandboxing in e-mails to prevent spear phishing
  • Data loss prevention technology to fingerprint and identify legitimate data as it exits
  • Dynamic DNS request interception
  • Web reputation /  destination awareness. Many domains, hosts, IP addresses, and even ASNs used by APT1 have been classified for years. Block known compromised hosts for the hops and the outbound C&C traffic.

 

 

One trend that you can confidently predict: the attackers will continue to adapt and get smarter, and the techniques to thwart them will need to do the same.

 

 

Microsoft loses yet another fanboy

Another one bytes the dust as Microsoft (and its ugly licensing practices) pushes a long-time fan away. Jack Wallen looks at what’s in store for Microsoft.

Categories Uncategorized