From the Zero to Malware Discovery

From the Zero to Malware Discovery

Hello people, I was with some time, and I decided to made an analysis using some tools that I commented last post Tools.

I'll start to do a static analysis, so first I start using the command file in Linux, it's really useful to identify the correct format from a file.

File command Linux

Another command I like to use in Linux is exiftool, normally it give me some information about date of the access and modification, type extension, type (You can see that is possible confirmed the first checked I did using command file.

exiftool command Linux

Below using DIE (Detect It Easy) we can find out more information about the sample, like how it was compiled (Microsoft Visual Studio 2022) using language C++, with architecture AMD64, mode 64 bits, the file size is 1.02MB (mega bytes).

DIE (Detect It Easy)

Could I put this in a sandbox and received a report? yes, but the big problem that some malware have features against sandbox, virtual machine or anything like it. That's why, I'm doing everything manually using several tools.

Now let's use the PE-Bear, often executable / binary files are divide in sections .text (executable code) .data (data) .rdata (resources). But the PE-Bear show more sections that can be useful during an investigation


PE-Bear

I like to use PE-bear because we have a lot of information like: Headers, Sections, Disasm (disassembly), Strings, Imports and etc. . We can collect the file hashes MD5, SHA, and SHA256 to use this in security tools and create a eradication / prevention.

PE-Bear

This window displays all strings (sequences of characters) found in the PE file. Strings can include:

  • Error messages
  • URLs
  • File paths
  • License codes
  • Call Libraries
  • Command line

PE-Bear

Identified command line in powershell trough PE-Bear String tab.

PE-Bear

Explaining the command found above.

Get-WmiObject Win32_Shadowcopy: This command retrieves information about shadow copies on the system. Shadow copies are automatic or point-in-time backups of files and folders in Windows, typically used for data recovery.

Remove-WmiObject: This command removes the objects returned by the previous query (Get-WmiObject), meaning it deletes the shadow copies.

So the full command:

powershell.exe -Command "Get-WmiObject Win32_Shadowcopy | Remove-WmiObject"

Will look for all shadow copies (automatic backups of the system) on the computer and delete them, removing those shadow copies from the system.

Continuing the analysis, in the image below we can identify one kind of extension and a message, in other words, we can see precious information that will help to discovery what is possible purpose of the file.

PE-Bear

After found this text I exported all strings in binary.

File > From all loaded > Export strings to.

PE-Bear

I chose a folder to send the TXT file. (In my case I selected Download Folder)

PE-Bear

Here we can see the TXT file was created with all strings identified inside the binary.


Windows Explorer

When I opened this file and I did a research about the same text I found using PE-Bear, I identified the extension (.akira) used by file.After hits I did a simple research about the word akira, there were a lot of article of many vendors talk about this malware (now we confirmed this is a ransomware)

Strings from binary

Above in the text we can find .akira (extension) the message leave by the group when they have succeeded in target someone. The group leave instructions how to make contact to try recover the data encrypted, and etc.

Some articles related to this malware for further reading:

Look for now I just made static analysis, I didn't to run the malware to discovery all this information and details about the sample, that now we can call of malware / ransomware.

PEstudio

Now I'll present PEStudio, another tool very used for many malware researcher, incident responder, threat hunter and forensics analyst. With it I'll present another point of view for the same sample, but with more information about the same.

Note: it's my favorite to make analysis of malware.

Beginning with lateral window of left you'll several topics, and each one have more information when you click it. Someone will be with a different collor like light gray, red, orange, and yellow.

PEStudio

Yellow or orange may indicate alerts about suspicious behaviors, such as the lack of a digital signature or unusual function imports.

Red is often used to highlight critical areas, such as the presence of known malicious behaviors or other indications that the file may be dangerous.

Indicators

PEStudio

Here you'll identified a overview about the file like hashes (sha256, MD5), virustotal check, libraries, type, size, signature, imports, when it was compiled, if is executable or not. the entropy, in the context of malware, entropy refers to the level of randomness or complexity in the binary code of a file. Malware authors often use techniques like obfuscation, encryption, or packing to increase the entropy of a file, making it appear more random and harder to analyze or detect.

Note: High entropy values (typically above 7.5 or 8.0 on a scale from 0 to 8) generally indicate that the file may have been packed, encrypted, or obfuscated.

VirusTotal

PEStudio

In this Tab we can see the report returned by VirusTotal about this sample (malware) from 72 tools 59 identified this binary as malware (Trojan, Ransomware. malicious, unsafe and etc).

Could I stop here? yes, because I confirmed during my static analysis that it's a malicious file. But let's continues a little bit more :).

Libraries

PEStudio

In section libraries you can see the libraries used by malware during the execution.one caught my attention WSTAPI32.dll a tried of use some resource Remote Desktop during the malware execution.

Here you'll find more details about it:

Imports

PEStudio

Conclusion

I didn't need to run the file in a sandbox to discovery that was a malware or had suspicious behavior. I just needed to use some tools, a little bit creativity, patience and do a good investigation. If you work like forensics analyst, incident responder, malware research and etc. This kind of approach can be useful a day.

Sandbox is not an absolute truth! Helps? yes but the malware authors always create a way to bypass this.

About the tools I made a post a month ago Tools.


Samuel Pires

Enthusiast of all kinds of tech, art and creativity

1 天前

Lindasso mano!

回复
Anderson Gomes

Technical Account Manager at Fortinet

2 周

ótimo trabalho meu amigo. Utilizei o exiftool para resolver um problema em um cliente. Muito util para pegar as informa??es do arquivo.

?ngello Cássio

Information Security Specialist | OSEP | OSCP | OSCE | DCPT | eCPPTv2 | eCPTXv2

2 周

arrebenta demais ... ah isso numa talk hein

Reinaldo B.

Threat Intelligence Specialist | OPSEC | Threat Hunting | OSINT | Dark Web Intelligence | Threat Research

2 周

Very interesting and simple analysis, of course, it is necessary to know what the tools return and what to look at, but in a few steps analyzing an artifact and informing that it is ransomware in this way as demonstrated is useful and accurate.

Parabéns pelo artigo Zozi!!!

要查看或添加评论,请登录

Zoziel P.的更多文章

  • Windows Analysis Tips and Tools

    Windows Analysis Tips and Tools

    Hi people, I found some old notes, but useful that I use during an incident, and I decided to share these tools and…

    14 条评论
  • Ransomware is not just a threat, it's a crisis waiting to happen...

    Ransomware is not just a threat, it's a crisis waiting to happen...

    Although I haven't posted anything here, I wanted to share my thoughts on my favorite wicked malware: ransomware. To…

    21 条评论
  • Analyzing Steal Bank Account with Malicious PDF

    Analyzing Steal Bank Account with Malicious PDF

    Hi everyone, as have time I don't post anything, I decided to write one more analysis about stolen bank accounts and…

    11 条评论
  • Analise de arquivos maliciosos - Exemplo 01

    Analise de arquivos maliciosos - Exemplo 01

    English Version O intuito dessa série de artigos é exibir analises de exemplos de arquivos maliciosos que apresentei…

    13 条评论
  • Malicious file analysis - Example 01

    Malicious file analysis - Example 01

    My objective with this series of articles is to show an analysis of examples of malicious files that I presented during…

    3 条评论
  • Analisando ataques de phishing que usam PDFs maliciosos

    Analisando ataques de phishing que usam PDFs maliciosos

    Todos os dias nós recebemos muitos ataques de phishing com documentos(Word, Excel) ou PDFs maliciosos. Resolvi dar uma…

    11 条评论
  • Analyzing Phishing attacks that use malicious PDFs

    Analyzing Phishing attacks that use malicious PDFs

    Portuguese version Every day everybody receives many phishing attacks with malicious docs or PDFs. I decided to take a…

    8 条评论
  • PowerShell Introduction

    PowerShell Introduction

    I wrote this article to show a brief introduction about how to use PowerShell daily. Many professionals work…

    9 条评论
  • Carreira em Cybersecurity

    Carreira em Cybersecurity

    English Version Fala galera sempre escrevo artigos, compartilho posts de alguns sites que acompanho e acho relevante…

    10 条评论
  • Cybersecurity career

    Cybersecurity career

    Hey guys, I always write articles, share posts from some sites that I follow and find relevant. Among these various…

    4 条评论