Skip navigation.

evilcry's blog

Basical Trojan Banker Win32.Banz.a Anatomy - Reverse Engineering


Today we are going to inspect a Rootkit Technology based Banker, called Win32.Banz.a or RKIT/Banker.9088.
This rootkit presents some interesting aspects from a reverse engineering point of view because has two
layers of protection:
* DalKrypt[/b]

Before starting the direct analysis let's study the general structure, with a PE inspection.

MD5: 58A567A59A6B713B3B2638BC76C100DC
SHA-1: 0C18FF28DF6941541CDA89FF8006025E0E07E83D

[b]Section Headers:

* UPX0
* UPX1
* .rsrc
* .DalKiT[/b]

Backdoor.IRC.Zapchast - mIRC used as Zombie - Reversing Malicious Network-IRC Activity

In this blog post we are going to Investigate the malicious network activity of a still-alive Backdoor-Zombie called Backdoor.IRC.Zapchast, here a little summary of its functionalities:

* Changes security settings of Internet Explorer
* Survives to System Restart
* Creates various copies of itself into Windows directory
* Produces other Processess
* Join to IRC Network, This is the most interesting functionality

Win32.Parite.B Unpacking and Anatomy Reversing and Network Analysis


Long time not blogging due to real life issues. Today we are going to inspect Win32.Parite.B a trojan that modifies System Files and Enstablishes a Network Activity with an Irc Server and Downloads other potential threats. We can consider Parite.B an IrcBot Client.

Let's perform a first basilar inspection of the malicious binary. The executable is delivered under the name of Protesto_Serasa.exe

MD5: 475D456FA0062BB5323F1F002AC143DA

Application presents an interesting Section Directory

* UPX0
* UPX1
* .rsrc
* .wtq

Apparently appears to be a classical UPX packed application, but if we go to inspect deeply the .wtq section we can suddenly see that the EntryPoint is located at 00096000 that belogs exactly to .wtq. This means that
at loading time, UPX presence is quite useless because the first code that will be execute comes out from .wtq that as we will see contains layer of decryption for the rest of the code.

Pay attention that exists also a TLS Directory, so in debugging phase we have to set TLS Awareness (Break on TLS) to be sure that we are able to follow the potentially hidden to debugger code.

Rootkit Agent.adah Anatomy and Executables Carving via Cryptoanalytical Approach

Today I'm going to expose how to perform the preliminar analysis of a Rootkit Application both via the classical Reverse Engineering approach and Crytpanalysis one.

We will inspect a recent threat commonly detected as Rootkit Agent.adah, this rootkit is delivered in the usual form of executable (.exe) via Compromised or Malicious Websites.

Usually the main executable is delivered in packed/compressed form and presents other executables embedded as resources, in other cases we can have blocks of encrypted data that will be decrypted on fly by the main executable.

In the first step we are going to see how is structured the executable. CFF reveals us that the application is packed with UPX v3.0;

Due to the nature of UPX, that is essentially a compressor, we will see a pattern almost constant, stabilized at high levels of entropy. Here a graph plot

As should be evident, the internal structure and presence of embedded data is protected cause the constancy of the Entropy along the executable. In other words in this case the contribution from knowledge of entropy does not help us to have additional information. We have to perform more specific inspections, this time by using Floating Frequency Analysis.

Let's spend some word about what mean Floating Frequency..

The floating frequency of a document is a characteristic of its local information content at individual points in the document. The floating frequency specifies how many different characters are to be found in any given 64-character long segment of the document. The function considers sequences of text in the active window that are 64 characters long and counts how many different characters are to be found in this "window". The "window" is then shifted one character to the right and the calculation is repeated. This procedure results in a summary of the document in which it is possible to identify the places with high and low information density. A document of length n > 64 bytes has n-63 such index numbers in its characteristics.

This is how work, implicitly should be clear enough how to interpret a Floating Frequency Graph,
high values which deviate markedly from the background in an executable suggest that encrypted data or even cryptographic keys will be found in those places.

Let's inspect the first graph:

As you can see, with floating frequency we are now able to distinguish the PE Header that presents a low Differences Ratio, suddenly after the PE Header we can see UPX at work, plot is constant and uniform, near the end happens an interesting thing, a marked decrease of frequency that remains stable and uniform for a certain offset range, at the end of this isolated behaviour we register another abrupt decrease, this is the end of PE and obviously of the file.

The isolated behaviour is truly interesting, the offset of this 'object' is placed in .rsrc section and presents a strong entropy due the evident density of Floating Freq. plot. A good compression algo introduces a significative increase of entropy, but if the block has already an high entropy this increase obviously cannot happen.We may think that the resource is compressed/encrypted. For example we could have another packed exectable.

After this preliminary inspection we unpack the main malicious executable and inspect in the same way the unpacked one.

Here the Entropy Plot of unpacked sample:

As you can the, now the situation is different, emerges the evidence of PE Header, after a normal ammount of entropy, globally lower that the previous graph, a central drop caused by Zero Padding for PE Alignment, sucessively an increase long a defined amount of bytes (a block) and suddenly after an evident increase of entropy that reaches the RED Level. This mean that our previous observations on floating frequency plot was correct, here the 'object' that certainly is packed/compressed. Finally we have a classical slow down caused by the intrinsic structure of PE Format.

Again let's perform the Floating Frequency inspection of the unpacked executable, here how changes the graph:

Again Floating Frequency reveals us more details, or better (in this case) highlights better the structure of the whole executable plus the conformations of the two objects. If you pay attention to the first one, you can see that this corpse is truly similar to the global look of the unpacked executable, in other words we can state that the first object is effectively another merged executable!
The second one is certainly a compressed object, the reason is clear just lookup the previous explaintions.

Now let's see practically the whole body of our unpacked executable, from a classical Reverse Engineering point of view. We said that the two objects are placed into .rsrc section, let's look with Great CFF (I love this Tool :) ) if this is true.

Bang! correct, the two merged resources are definitely two executables!
The first one is a clean .sys, this is clear due to the presence of INIT in the PE Header.
Also the second resource corresponds to our predictions, we have an UPX packed executable.

Now should be trivial to carve these two executables, just locate the starting offset and by delimiting with Block Start/End function of CFF we obtain the executable size that added to the starting offset give us the final offset where to cut.

The Block End corresponds obviously with the end of first/second resource.

The .sys is the core file of our rootkit, I'll reverse it in a future post, the second executable, when unpacked become clear that is a DLL, if we take a look to some function name for exampe this:

_NF_STATUS __cdecl nf_addRule(struct _NF_RULE *)

became clear that this DLL acts as Network Filter by using NetFilterSDK ( )

But this is matter of future blog post.

Hope you enjoyed this little paper :)

Giuseppe 'Evilcry' Bonfa'

PHP/Spy.Bull Cryptanalysis of Encryption used and Threat Analysis

Today we're going to locate a PHP/Spy.Bull infected target, Cryptoanalyze the
encoded blocks involved in and finally analyze the deriving thread.

It's clear that cryptanalysis part is is superabundant for the study of the actual threat, what I want to show here is a different, more pragmatic and general approach to the problem.

This procedure can be used in much more complex contexts, where encryption is stronger that our case and there is an important lack of informations.

This malicious PHP malware affects compromised Websites, with an encrypted page, the classical anatomy of an infected URL is

Let's now see this page.


As you can see we have two blocks of encrypted data:

1. The first one that does not help us in this moment because we don't have any explicit information about the encryption algorithm used, but we can pragmatically how complex is this cipher text.
2. We can decode the second block, its easly Base64 Encoded.

At a first look it's obvious that the first code block presents an encryption that should be not so hard. But this is only a supposition, we have to demonstrate:

1. It's really easy how appears?
2. We can have a misure of how many complex is?

Could happen that an apparently easy block it's the result of complex operations.

DNAScan Malicious Network Activity Reverse Engineering


This is a paper split into two episodes, the first two can be read here


In this blog post we will investigate deeply the effective functionalities of DNAScan,
that can be seen as a set of Threads that accomplish different networking functionalities like:

* Server Functionalities
* Client Functionalities
* Malicious File Exchange
* Generic Backdoor

Let's start from the beginning of network functionalities setup, initially from the main thread is called WSAStartup used to initiate the Winsock DLL, successively is called a classical socket() and immediately after WSAIoctl

[Crimeware] Researches and Reversing about Eleonore Exploit Pack


Today we will see how works Eleonore Exploit Pack directly from an infected website.

Essentially Eleonore Exploit Pack is a collection of Exploits and Data Statistics Collectors, this is the 'marketing' presentation of the exploit pack:

I present new actual russian exploits pack "Eleonore Exp v1.2"

Exploits on pack:
> MS009-02
> Telnet - Opera
> Font tags - FireFox
> PDF collab.getIcon
> PDF Util.Printf
> PDF collab.collectEmailInfo
> DirectX DirectShow
> Spreadsheet

PHP pBot Dissection

Today I'll dissect a website infected with PHP:Pbot-A according to Avast naming convenction.

Be careful link reported is still alive!

From a malicious domains DB emerged this infected URL

As you can see it seems a classical .txt file, but this is a classical evidence of RFI Infection.

MD5 : da67134fc6953201d3556f5fedbcd50d

* #crew@corp. since 2003
* edited by: devil__ and MEIAFASE
* Friend: LP
* .user //login to the bot
* .logout //logout of the bot
* .die //kill the bot
* .restart //restart the bot

Swimming into Trojan and Rootkit GameThief Win32 Magania Hostile Code


Here my last paper.


Trojan-GameThief.Win32.Magania, according to Kaspersky naming convention, monitors the user activities trying to obtain valuable information from the affected user, especially about gaming login accounts. This long tutorial analyze this malware but is also a general document which explains how to analyze a modern nested-dolls malware.

Giuseppe 'Evilcry' Bonfa'

Backdoor UltimateDefender Reverse Engineering


Here the reverse engineering of Backdoor UltimateDefender
a malware that presents also Rootkit Functionalities.

Giuseppe 'Evilcry' Bonfa'

Syndicate content