Home / malwarePDF  

TrojanDownloader:Java/OpenConnection


First posted on 28 February 2012.
Source: Microsoft

Aliases :

There are no other names known for TrojanDownloader:Java/OpenConnection.

Explanation :

TrojanDownloader:Java/OpenConnection is the detection for a Java based malware family that exploits a vulnerability discussed in CVE-2010-0094. The vulnerability affects Java Runtime Environment (JRE) up to and including version 6 release 18, and makes it possible for untrusted code to gain browser security privileges under the user's account.

A user may encounter threat from this family when visiting a compromised website. If the user is using a vulnerable version of Java, successful exploitation resulting in infection can occur. Threats such as this can often be avoided by ensuring the most up to date software is installed on the computer. To prevent reinfection and avoid similar exploits, make sure up to date security patches are applied to the Java Runtime Environment.

Update vulnerable Java applications

This threat exploits a known vulnerability in Java Runtime Environment. After removing this threat, make sure that you install the updates available from the vendor. You can read more about this vulnerability in Java, as well as where to download the software update from the following links:

  • CVE-2010-0094
  • Java Download


It may be necessary to remove older versions of Java that are still present. Keeping old and unsupported versions of Java on your system presents a serious security risk. To read more about why you should remove older versions of Java, see the following information.

  • Remove older versions of Java

Top

TrojanDownloader:Java/OpenConnection is the detection for a Java based malware family that exploits a vulnerability discussed in CVE-2010-0094. The vulnerability affects Java Runtime Environment (JRE) up to and including version 6 release 18, and makes it possible for untrusted code to gain browser security privileges under the user's account.

A user may encounter a threat from this family when visiting a compromised website. If the user is using a vulnerable version of Java, successful exploitation resulting in infection can occur. To prevent reinfection, and avoid similar exploits, make sure up to date security patches are applied to the Java Runtime Environment. You can read more about this in the Recovery section below.

A number of legitimate websites could be compromised or unwillingly host a malicious applet through advertising frames which could redirect to or host a malicious Java applet. It is common for this detection to trigger in your Internet cache. When using Internet Explorer, the Internet cache is known as the Temporary Internet Files folder and is commonly located at C:\Users\<user name>\AppData\Local\Microsoft\Windows\Temporary Internet Files\. The Temporary Internet Files (or cache) folder contains webpage content that is stored on your hard disk for quick viewing. This cache permits Internet Explorer to download only the content that has changed since you last viewed a webpage, instead of downloading all the content for a page every time it is displayed.

When antivirus software to detects malicious Java applets in a web browser's cache, it doesn't necessarily mean that the computer has been compromised. Most of the time it reflects the fact that, at some stage, a webpage with a malicious applet had been visited and cached internally. To thwart such a notification it is often enough to purge the cache using a web browser's configurable security options.

The vulnerability makes use of the "get" method of "java.rmi.MarshalledObject", which de-serializes an object from an internal byte array. At the same time, the byte array can contain a previously serialized "ClassLoader" which, after its full de-serialization by the "get" method of "java.rmi.MarshalledObject", becomes fully trusted and can load other classes and methods at the user's security context level outside the sandbox.



Installation

TrojanDownloader:Java/OpenConnection is a collection of Java classes which exploit the CVE-2010-0094 vulnerability. The collection resides inside a JAR file and is referenced by a Java applet. The applet class will normally have some obscure class names and will be located inside a JAR package. Some examples of names we have seen used in the wild are:

  • "aefe.class"
  • "wrsvwwfsfwhazilh.class"


Regardless of the name it goes by, the applet class name is unlikely to make much sense most of the time.

The JAR package size normally ranges between 10 to 30 kilobytes in size. The JAR package might contain a number of legitimate Java classes with a purpose to obscure its malicious classes intent. The presence of any number of arbitrary class files can significantly affect the size, name, and content of the JAR file.

Once loaded, commonly from within a browser, the malicious applet creates an RMIConnectionImpl object with an obfuscated connection ID string. The string can be encrypted or can be a plain text. Some examples of the strings we've seen are:

  • "okokokokhg"
  • "metasploit"


The applet reads a parameter which it expects to be specified in referencing the applet HTML file, and uses it as a location for a file to be downloaded and executed later. The parameter string name in most of the variants aims to hide the real intention of the applet and could be quite inconspicuous, for instance "url", "data", "game_id". The parameter string can be plain text or encrypted. This information is passed to a separate class, contained within the JRE package - where it is decrypted if necessary - and is used in attempt to download and execute a file from a remote location and execute it locally.

In most of the malware's variants, the file is saved in the Internet Explorer cache folder. The file name would be either changed to the mimic Internet Explorer cache or changed to a name of a legitimate executable such as "mstsc.exe". The file is executed with elevated privileges.

Additional information

Malware from this family is distributed in the form of a Java archive (.JAR) package. The JAR file consists of number of Java class files with obfuscated names. For instance:

  • "a2ea.class"
  • "a3c1.class"
  • "ab5a.class"


It is not uncommon for such a JAR file to have a number of legitimate class files with "human readable" names, such as for instance:

  • "WhatTheJava.class"
  • "JavaBeans.class"
  • "Server.class"


Note: In order to hinder detection, the class files may be obfuscated with string variables which are never used in the code flow.



Analysis by Oleg Petrovsky

Last update 28 February 2012

 

TOP