Skip to content

MalDev - Introduction to Malware Development

An introductory guide to the fundamentals of Malware Development, the programming languages used, and the development life cycle.

MalDev: Introduction to Malware Development ​

Malware is software specifically designed to perform malicious actions, such as gaining unauthorized access to a system or stealing sensitive data. While often associated with criminal activity, malware development (MalDev) is a critical skill for ethical hackers, such as penetration testers and red teamers, to conduct authorized security assessments.

Why Learn Malware Development? ​

Offensive security professionals often need to perform tasks against a client's environment where standard tools may fail. There are three main options for tools:

  1. Open-Source Tools (OSTs): Frequently signatured and easily detected by security vendors.
  2. Purchasing Tools: Often closed-source and expensive, but better at evading security.
  3. Developing Custom Tools: These provide a significant advantage because they have not been analyzed or signatured by vendors, making malware development knowledge paramount for successful assessments.

Choosing a Programming Language ​

Technically, any language (Python, PowerShell, C#, C, C++, Go, Rust) can be used, but the choice usually depends on three factors: difficulty of reverse engineering, prerequisites on the target system (like needing an interpreter), and the resulting file size.

Languages are generally classified into two groups:

  • High-level (e.g., Python): More abstracted from the OS, less memory efficient, and provides less control.
  • Low-level (e.g., C): Provides an intimate level of interaction with the system and more freedom, making it the preferred choice for targeting Windows machines.

Windows Malware Development and the MDLC ​

Modern Windows MalDev is heavily focused on evading host-based security solutions like Antivirus (AV) and Endpoint Detection and Response (EDR). To build effective, evasive malware, developers follow the Malware Development Life Cycle (MDLC):

  1. Development: Refining the functionality within the malware.
  2. Testing: Performing tests to uncover hidden bugs.
  3. Offline AV/EDR Testing: Running the malware against security products without internet connectivity to prevent sample submission to vendors.
  4. Online AV/EDR Testing: Testing against cloud-delivered protection engines for more accurate results.
  5. IoC Analysis: Acting as a threat hunter to pull out Indicators of Compromise (IoCs) that could be used to signature the malware, then returning to the development stage.

Essential Tools for the Journey ​

To begin developing and analyzing malware, several tools are required:

  • Visual Studio: The primary environment for coding and compiling C/C++.
  • x64dbg: A debugger used to get an internal understanding of developed malware.
  • PE-Bear: A tool for reversing PE files and looking for suspicious indicators.
  • Process Hacker/ System Informer: Used to monitor system resources and detect malware behavior.
  • C2: The communication infrastructure that allows attackers to remotely control compromised devices inside a target network(Msfvenom/Havoc/Cobalt Strike).

References ​

For further study on the foundations of malware and the tools required for development:

Released under the MIT License. Sitemap | RSS