Basic virus analysis

BadB

Professional
Messages
2,415
Reaction score
2,368
Points
113
Hello young hacker, in this article we will look at such a sub-area of hacking as malware analysis.

In this article, you will find out:
  • How to intercept and analyze the traffic of a virus
  • How to analyze the system for changes.
  • How to study the malware code. Reverse engineering.

Traffic analysis.
Perhaps one of the most important things when analyzing a virus. And so, to analyze outgoing traffic, special programs are used - sniffers. The most popular ones are:
Consider what we can learn about the virus, according to its requests.
Open our sniffer, in my case it's Fiddler:
fb0bbd20-2f4f-4391-9e3c-1aade974e604.png

Program interface.

We launch the virus, then see what requests were sent:
db44c3c2-e155-40e9-964a-34666f5b27d1.png


Let's analyze them. The first request flew to this site: http://ip.42.pl/raw
When you go to it, your external IP will appear, the malware uses this site to parse your IP user.

The second request went to the domain, and the following was shown when navigating to it:
0f1deb50-9b54-4a8a-880b-38bb1da2526f.png


All these numbers are needed to parse software functions. Let me give you an example. When the software made a request and copied the numbers, a check occurs: If the first digit == 1, then the software needs to steal the logs; passwords, as an example in pseudocode, but I think you understand.
When you received the domain of the panel, you can also analyze the panel itself for vulnerabilities, throw brute force, spizd the logs. For malware-hunters, the panel is a very important clue, because if the panel is on a non-bulletproof hosting, they can send a request to the administration, asking them to provide all the information about the owner of this domain. Well, there is increasing.
Of course, malware developers should understand that sooner or later, their brainchild will begin to be studied, but if you thought that there was no protection from traffic analysis, you are grossly mistaken. For example, I made Anti-Analysis in my software, and in one of the methods I simply checked the running processes, and if there was a sniffer process among them, the software self-destructed, something like that.

System behavior.
To track the creation of files, folders, register operations, the Process Monitor program is most often used.

6a384f4b-b49a-45e2-9874-354bce7c7a59.png

Program interface.
But before you start analyzing the system, you should set up the filters.
Go to the "Filter => Filter ..."

01d980e0-61b8-4885-ac37-776affa3e6d4.png


Add the required filter - Process Name, begins with, process_name, Include:
e2d598f8-1a91-456b-ad60-35f43d4d66a9.png


Instead of who is the name of your process.
We also add a filter to the Windows folder, this is necessary so that when the malware accesses any DLL, we do not have unnecessary entries.
9b8a72c7-8642-4070-9d9b-5f7e573a0f66.png


Now, in the main window, select what to track: Register activity, File system, Network traffic, Streams
59941340-70d6-45b0-ba15-1b801deb7c6c.png


Now everything is ready, let's start the analysis of the system with the keyboard shortcut: CTRL + E.

Next, we launch our virus and see the output
09112b48-b79e-4307-86a2-0c833aef9b4a.png


Let's analyze some of the actions. The first thing the software does is create a folder in the Temp directory with the username and hide it:
309cf2c0-9e35-4a56-a6d7-f7340cc45d9b.png


Creature
83121bba-713b-480a-99dd-8f51b4050074.png

Hiding

Then it receives the paths to the database of files of the browser's chromium - Login Data, which contain logins and passwords, and also copies this file to a temporary directory
50ebb55e-b737-47a4-8e1d-723bc9ca4716.png


After that, it pulls out passwords, cookies, browser history from all databases and writes down files
59ea0602-9094-4e4e-9389-56f9e94fa51f.png


Well, further, it acts in the same way as other viruses of this type, collects files from the desktop, steam, telegram. Then it archives the folder and sends it to the domain that was in the traffic analysis.
e9579477-26b8-423b-bd95-4a07a9b430b8.png


This completes the analysis of the system, and the files created, move on to the next item.

Reverse engineering.
Reverse engineering is a study of some finished device or program, as well as documentation for it in order to understand the principle of its operation; for example, to discover undocumented features (including software bookmarks), to modify or reproduce a device, program, or other object with similar functionality, but without direct copying.
Reversing is akin to cracking, however, reversing is more often understood as restoring the source code of a program from an executable code, often code reversing may not even be associated with the program protection algorithm.

In this article, I will only touch the very basics of reverse .Net applications.

Tools.

For reverse, we need programs:
  1. ExeInfoPE / RDG Packer Detector
  2. dnSpy
ExeInfoPE and RDG Packer Detector perform one (of) an important function for reverse - Find out the programming language in which the program is written.

a1d9c539-d5dd-42ac-a3ae-c6a12c8de602.png


dnSpy - Disassembly tool, in simple terms, this utility will allow us to get all the code from the exe file.

DnSpy includes a decompiler, debugger and assembly editor. It can be easily extended by writing your own extension.

Let's get down to business, open dnSpy, and put our file there
17a7975c-3e67-4aaf-93aa-578f0632c92f.png


And if the result turned out to be something like this, then you are lucky the virus is not obfuscated.

Obfuscation - bringing the source text or executable code of a program to a form that preserves its functionality, but complicates analysis, understanding of work algorithms and modification during decompilation

f9962454-1a4c-4554-95b2-bb0691c9f61c.png


Well, method calls
685d9def-de41-462d-8a5d-59578a0b02b5.png


Conclusion.

That's all, in this article we have only scratched the surface of malware analysis. If you are interested in this topic, then first I advise you to learn at least a couple of programming languages, so that afterwards you can understand what is happening in the code. Then master the reverse, practice deobfuscation, work with IDA Pro. That's all.
 
RAT virus

What does this mean?
The abbreviation RAT itself stands for Remote Assess Trojan[/B] , which means a Trojan for remote access. RAT is also translated from English as a rat, which also describes this thing very well, now you will understand why, after I describe the capabilities of this virus)

This is one of the most dangerous malware programs because it gives the person who infected the computer the ability to gain full access to it.
So, here are the possibilities of the rat:
1. Monitor and record actions online
2. Run any files and install programs
3. Launch a webcam and record information from it (video, photo)
4. Edit system files
5. Open and close ports
6. Steal files from a computer, such as cookies (browser files that allow you to access accounts from different sites)
7. Install other viruses

How does the RAT Trojan get infected? Yes, just like any other virus. Through left links, files, through infected flash drives. The only thing that can be said is that RAT is more likely than other viruses to be thrown on purpose, since it is your computer / personality that is interesting, but not always. Sometimes they are massively infected.
Precautions - do not go to the left sites, use an antivirus, or even better a firewall (a program that allows you to block and allow connections).
How to understand that you have a rat? If your account has been spoiled, you observe how the programs open and close, you notice that the webcam turns on randomly.
If you notice such bullshit, clean your computer as soon as possible.

Be careful bro, and may such a rat never settle in your computer)
 
Top