Select your language

Analysis of a Trojan in JAVA

These days it has begun to reproduce a Trojan that reaches the user through an email in Portuguese (very common in South America to receive news of this type from Brazil). This is the email you may receive:

Igual eu te falei aquele dia e voce nao quis acreditar. Friend to people counts not finger!
Veja só o que seu amiguinho andou aprontando nessas fotos.
DSC02421.jpg (568.3 KB)
DSC02521.jpg (603.4 KB)

Obviously those "images" with links to the corresponding executables... Qu... These days it has begun to reproduce a Trojan that reaches the user through an email in Portuguese (very common in South America to receive news of this type from Brazil). This is the email you may receive:

Igual eu te falei aquele dia e voce nao quis acreditar. Friend to people counts not finger!
Veja só o que seu amiguinho andou aprontando nessas fotos.
DSC02421.jpg (568.3 KB)
DSC02521.jpg (603.4 KB)

Obviously those "images" with links to the corresponding executables... that they are the same, although it seems that they are of different size, they are to mislead. Executables point in this direction: http://ads.sapo.[ REMOVED]/event.ng/Type=click&FlightID=90951&AdID=169189&TargetID=6167&ASeg=&AMod=&Segments=8,69,154,526,527,688,1343,2130,2884,3325,3747,4552,4663,4778,4932,4963,4971,5065,5081,5088,5117,5152,5165,5169,5200,5295,5301,5508,5549,5557&Targets=246,5389,704,6167&Values= 31,43,51,60,72,84,90,91,100,110,150,193,204,209,376,978,1036,1097,1100,1399,1436,1459,1478,1488,1489,1733,1754,1819,1863,1922,1941,2020,2174,2230,2863,2869,2956,2993,3322,3533,3576&RawValues=&Redirect=http://www.givinbeauty.com/UserFiles/File/photos.php?0.19325211365355321

That link leads to an executable file: http://www.givin[DELETED].com/UserFiles/File/photos.php?0.19325211365355321.

Análisis de un troyano en JAVAWe will see below that this site has a login option and if they hacked it, it was there, they uploaded the executable and forwarded it by mail. In addition, as we will see, they used another website to redirect in this case to http://ads.sapo.[ REMOVED]/event.ng/.

When you download the Trojan and observe it with Peid you will find that it is packaged with UPX. If we open the EXE we will see a string like this:

.rdata:00414BA8 0000000B C WINRAR. SFX
.rdata:00414BCC 00000039 C d:\\Projects\\WinRAR\\SFX\\build\\sfxrar32\\Release\\sfxrar.pdb

These lines mean that they are self-extracting executables of WinRAR. Do we need to decompress them with Olly? No, with WinRAR we can unzip it in a folder and it will leave a file called: loader.jar, a JAVA application and we have already taken some layers out of the onion.
Análisis de un troyano en JAVA
We can make use of WinRAR once again to decompress the JAVA JAR, as these are compressed with ZIP. So we right-click and extract to a folder. It will return the folders that you see in the image.
- Publicidad -

Now let's go to the best, decompile the . CLASS, the compiled JAVA files (the famous . OBJ). These files are interpreted by the JAVA classloader and are executed as one more application. There are many JAVA CLASS file decompilers and one of the best known is the JAVA Decompiler DJ.

We will see the Imports, some interesting and others not so much.

import b.d;
import by.squareroot.injector.lib.MyKernel32;
import by.squareroot.injector.struct.Context;
import by.squareroot.injector.struct.MemoryBasicInformation;
import by.squareroot.injector.struct.ProcessInformation;
import by.squareroot.injector.struct.StartupInfoA;
import by.squareroot.injector.struct.TotalProcInfo;
import by.squareroot.injector.struct.WoW64Context;
import by.squareroot.injector.struct.pe.MZHeader;
import by.squareroot.injector.struct.pe.PEInfo;
import by.squareroot.injector.struct.pe.PE_ExtHeader;
import by.squareroot.injector.struct.pe.PE_Header;
import by.squareroot.injector.struct.pe.SectionHeader;
import com.sun.jna.Platform;
import com.sun.jna.Pointer;
import com.sun.jna.platform.win32.Advapi32Util;
import com.sun.jna.platform.win32.WinReg;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.nio.ByteBuffer;
import java.util.Properties;
The first are the most interesting obviously, we will see that they are classes made with the help of a friend of our creator called squareroot. If we look a little for the name of the class, the nickname of the creator and the word Class, we find a Russian site that offered to download: build___00002469.jar that apparently contained this same content.

We must not give up there (we must learn to look as the great Fravia, QEPD taught us) we will look a little further we will find a reference in this stitio that seems to be from another reverser analyzing jaZEUS.

If we read that article a little and then continue with it we can conclude two things:

  1. The creator of this virus used the same technique and resources as the jaZEUS virus to infect its victims.
  2. It is a variant of JAZeus or the original version.
I opt for the first option since the dropper (executable that decompresses and leaves the virus in one place to run it later) is different from the jaZEUS version analyzed by our friend Donato Ferrante (ratsoul). The structure of our variant is very similar to that of jaZEUS, we can see it in the image of the article:
Análisis de un troyano en JAVA
We will see that the Launcher class is not found in our Injectorpackage and neither is the crypt package. But if we will find the same thing in the data package.

In JAZeus apparently the two .EXE are encrypted, in our variant, only app.exe is encrypted and dummy.exe not, we can see it simply by opening the EXE and seeing its header. If we debug dummy.exe we will see that it is another dropper made in C++ that will seek to decrypt app.exe, looking for the encryption method in the method file and then using that parameter to decrypt and execute it.

Apparently the method of unpacking this virus is the same as JAZeus does, with the variant that the launcher does not have. From what I see the launcher is unified in a.class since it runs app.exe after decrypting it from there inside. The injector package takes care of the assembly and in-memory injection of the executable for the execution of the actual virus. In the method "a" of the class "a", we will see that it is put at the beginning to start when our OS starts:

s = a("data/app.exe");
b.a a1 = a();
try
{
ifnull)
{
String s1;
if((s1 = ((Properties) (obj)).getProperty("hklmnull)
{
String s2 = a();
Advapi32Util.registrySetStringValue(WinReg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\", s1, s2);
}
String s3;
if((s3 = ((Properties) (obj)).getProperty("hklunull)
{
obj = a();
Advapi32Util.registrySetStringValue(WinReg.HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Run\\", s3, ((String) (obj)));
}
}
}
As we can see we will find other interesting pieces of code, to find our virus we will have to decrypt app.exe. Not having the launcher becomes a little difficult but the most important thing is that we find how it works, to stop it at least we must take out that registration key.

If it becomes a JAZeus we will have some more security problems, we can also find the 3DES encryption method as a string in the others. CLASS, in addition to a possible key, phrase widely used as a demo of blog post, etc.

- Publicidad -

Spark by Disidents

See original.

No comments

• If you're already registered, please log in first. Your email will not be published.

Comments are closed

The comments for this content are closed.

The Challenge of Global Instability: Towards a Comprehensive Security and Defense Response

The Challenge of Global Instability: Towards a Comprehensive Security and Defense Response

The growing convergence between physical and digital threats is forcing organizations to rethink their security strategies. Faced with this scenario, there is a need for comprehensive approaches...

AI applied to medical security

AI applied to medical security

The Directorate of the Medical Emergency System (SEM), attached to the Ministry of Health of El Salvador, strengthened its technological infrastructure with the modernization of its video...

Eight Red Dot Awards Highlight Innovation in Technology Design

Eight Red Dot Awards Highlight Innovation in Technology Design

International. The technology company Ajax Systems announced that it has won eight awards in the Red Dot Design Award, one of the most prestigious global awards in the field of industrial design....

Villa María del Triunfo reinforces its security with intelligent video surveillance

Villa María del Triunfo reinforces its security with intelligent video surveillance

Peru. The district of Villa María del Triunfo has launched an intelligent video surveillance system that already shows results in terms of citizen security and that will be expanded in a second...

Milestone Systems grows 10% by 2025 and reinforces its commitment to artificial intelligence and intelligent video

Milestone Systems grows 10% by 2025 and reinforces its commitment to artificial intelligence and intelligent video

Denmark. The company reported net income of $340 million in 2025, representing a 10% growth from the previous year. The company spent about a third of this revenue on innovation, with an emphasis on...

Micro Key Solutions Reinforces Latin America Strategy with New Key Appointments

Micro Key Solutions Reinforces Latin America Strategy with New Key Appointments

United States. In response to the growth in demand for monitoring and management software solutions in the security industry, Micro Key Solutions announced the expansion of its operations in Latin...

Grupo Multisistemas strengthens its presence in Mexico with a new office in Morelia

Grupo Multisistemas strengthens its presence in Mexico with a new office in Morelia

Mexico. Grupo Multisistemas de Seguridad Industrial (GMSI) advances in its national growth strategy with the inauguration of new offices in Morelia, Michoacán, with the aim of expanding its coverage...

Case study: Security system modernization with artificial intelligence and centralized monitoring

Case study: Security system modernization with artificial intelligence and centralized monitoring

Mexico City. The Superior Audit Office of the Federation (ASF) implemented an ambitious technological renovation project in its five headquarters located in Mexico City, with the aim of...

Automated key and equipment management strengthens security in mining operations

Automated key and equipment management strengthens security in mining operations

International. Access and equipment management in the mining industry is evolving towards increasingly automated models, in response to operational complexity and occupational safety demands.

Security becomes a technological platform

Security becomes a technological platform

Mexico. Security is moving from a set of standalone systems to an integrated technology platform that combines artificial intelligence, video analytics, sensors, access control, and data platforms....

Suscribase Gratis
Remember Me
SUBSCRIBE TO OUR ENGLISH NEWSLETTER
DO YOU NEED A SERVICE OR PRODUCT QUOTE?
LATEST INTERVIEWS
SITE SPONSORS










LATEST NEWSLETTER
Latest Newsletter