Thursday, June 20, 2024

How Malware Analysis Helps You Detect Reused Malware code

The fight against malware has taken another angle. Cybersecurity experts found a way to detect reused malware, improving malware analysis. In this post, we will explore how new malware analysis techniques help you detect reused malware.

Why Do Hackers Reuse Code? 

Cybercriminals aim to cause the most impact and the minimal possible effort. Like any other developer, they like to reuse code. When conducting malware analysis, security analysts think of malware regarding families and different strains. But, in reality, hackers are not unlike other developers. As such, most current malware recycles pieces of software from other malware. The hackers can add to it and change it a little (the modifications are probably also taken from public repositories).

Malware creators aim to work efficiently. Instead of creating a new piece of software with thousands of lines of code, they look for working segments and apply them to their software. While this can be counterintuitive for attackers, it creates a way to track the malware, but it doesn’t stop them from trying. Because, more often than not, it saves them time to do social engineering and phishing practices and create a more deadly product.

Examples of hackers’ code reuse

Shadow Brokers

This hacktivist group released exploit source code stolen from the National Security Association. The code included several zero-day vulnerabilities of the MS file sharing service. This code was repurposed by attackers into the famous ransomware attacks WannaCry and NotPetya.

EDA2 and Hidden Tear

In another case, a security researcher from Turkey published two ransomware variants, Eda2 and Hidden Tear, for educational purposes. Attackers quickly grabbed this opportunity and used this source code to create their ransomware variants.

They reuse attack methods too.

Hackers not only reuse code. They reuse attack techniques, methods, and practices. After all, if a specific attack line has worked in the past, why shouldn’t they use it again? This is most common among “script kiddies”—beginner hackers—. They will reuse attack methods to fill the gaps in their skills. Beginner hackers use the same tools used by pen testers.

Seasoned hackers also reuse methods when they are effective—for example, using malicious office macros. Criminals will also reuse social engineering tactics and spear phishing. Attackers build on the success of others to infringe more damage or exploit reused code.

How Genetic Malware Analysis detects reused code

Malware analysis is a critical method to respond to security incidents effectively. There is an innovative approach to automated malware analysis called Genetic Malware Analysis. This technology aims to provide detailed insights into any file suspicious of malware. Let’s dive into it.

What is genetic malware analysis?

Software is in constant evolution. Developers reuse code written by others. Searching for reused pieces of code that they can recognize is one of the tactics security researchers use. Looking for similarities is a tactic that has proven successful for threat analysis. For example, the WannaCry ransomware mentioned above contains code pieces related to the Lazarus threat actor group.

The problem with this approach is that doing it manually is time-consuming and requires a high level of expertise. As a result, it can only be applied to a limited number of files.

Genetic malware analysis solves these issues by automating and scaling the process. It compares the files against a database of trusted and malicious software. Since the process is automated, it only takes seconds.

How it works

At first, the system parses and disassembles files, then transforms the code into searchable tokens—the “genes”—. Like the tokenization used in search engines, the algorithm breaks the code into smaller fragments, ignoring variable names and non-essential. 

After the genes are extracted, the tool compares them against a code database to detect reused code among them. The code genome database is constantly updated with cataloged malware. Once a new malware enters the code database, it is flagged to prevent attackers from reusing the code. Security teams can also use genetic malware analysis to explore the similarities in other suspicious software, like metadata, strings, resources, and more.

The capabilities of genetic malware analysis are not limited to detection. Once the system detects the malware, it creates YARA signatures based on the code. These signatures can increase the protection by identifying future variants of the malware. This feature makes genetic malware analysis signatures more effective than hash-based signatures.


Detecting malware has become a more difficult task because of the increasing complexity of malware tactics. The approach of detecting reuse code to identify malware, although clever, was very time-consuming and ultimately lacked effectiveness. By automating this process and enhancing it, new technologies like genetic malware analysis give an improved approach to malware analysis.


Latest articles

1inch partners with Blockaid to enhance Web3 security through the 1inch Shield

1inch, a leading DeFi aggregator that provides advanced security solutions to users across the...

Hackers Exploit Progressive Web Apps to Steal Passwords

In a concerning development for cybersecurity, hackers are increasingly leveraging Progressive Web Apps (PWAs)...

INE Security: Optimizing Teams for AI and Cybersecurity

2024 is rapidly shaping up to be a defining year in generative AI. While...

Threat Actor Claims Breach of Jollibee Fast-Food Gaint

A threat actor has claimed responsibility for breaching the systems of Jollibee Foods Corporation,...

Threat Actors Claiming Breach of Accenture Employee Data

Threat actors have claimed responsibility for a significant data breach involving Accenture, one of...

Diamorphine Rootkit Exploiting Linux Systems In The Wild

Threat actors exploit Linux systems because they are prevalent in organizations that host servers,...

Amtrak Data Breach: Hackers Accessed User’s Email Address

Amtrak notified its customers regarding a significant security breach involving its Amtrak Guest Rewards...

Free Webinar

API Vulnerability Scanning

71% of the internet traffic comes from APIs so APIs have become soft targets for hackers.Securing APIs is a simple workflow provided you find API specific vulnerabilities and protect them.In the upcoming webinar, join Vivek Gopalan, VP of Products at Indusface as he takes you through the fundamentals of API vulnerability scanning..
Key takeaways include:

  • Scan API endpoints for OWASP API Top 10 vulnerabilities
  • Perform API penetration testing for business logic vulnerabilities
  • Prioritize the most critical vulnerabilities with AcuRisQ
  • Workflow automation for this entire process

Related Articles