September 27, 2023

How to Use Reverse Engineering in Cybersecurity

No items found.
Close-up of a glowing illuminated circuit board schematic with complex wiring and components.
Contributors
Blue geometric shape resembling a stylized tilted square with rounded edges on a black background.
Content Team
Immersive
Share

TL;DR

  • Reverse engineering in cybersecurity is the practice of deconstructing software (including malware) to understand how it works without executing it.
  • It enables defensive teams to identify attack techniques, deobfuscate malicious code, and develop targeted countermeasures before threats escalate.
  • Core disciplines include static analysis, binary exploitation, malware deobfuscation, stack and heap overflow analysis, and return-oriented programming (ROP).

In the intricate landscape of cybersecurity, the ability to dissect and understand the inner workings of software – malicious or otherwise – is paramount. Enter reverse engineering: a disciplined approach that enables professionals to identify vulnerabilities and anticipate potential threats.

Definition

Reverse engineering in cybersecurity is the process of analyzing software — including malware, executables, and compiled code — to understand its behavior, identify vulnerabilities, and uncover attacker techniques. Unlike dynamic analysis, which observes software as it runs, static reverse engineering dissects code without ever executing it.

By mastering the principles of reverse engineering, cybersecurity teams can enhance their proactive defense mechanisms, offering unparalleled insights into the tactics and strategies of adversaries. From an exploitation perspective, teams can ensure safer computer systems for everyone, and improve an organization’s strategic posture in an increasingly complex cyber world.

At Immersive, we believe hands-on experience trumps theoretical knowledge. There’s no better way to sharpen your skills than by diving headfirst into real-world challenges. This blog post explores the significance of reverse engineering and some of the complex labs we’ve created to develop your skills in this highly sought-after area of information security.

Each exercise crafted by Immersive is designed to stimulate your cognitive abilities, inviting you to think, analyze, and hypothesize about how to exploit these vulnerabilities or reverse engineer malware. Whether you’re a seasoned professional or an enthusiastic novice, these scenarios are complex and show you fun ways to exploit Windows and Linux processes.

Malware analysis: Darkside.dll Deobfuscation

On Thursday, May 6, 2021, Colonial Pipeline was struck by a ransomware attack. According to statements made by the FBI, the perpetrators are known as DarkSide.

The Darkside.dll Deobfuscation lab takes you through analyzing a variant of malware used as part of the group's ransomware, which uses a huge array of API calls. In this lab, you’ll gain the skills to deobfuscate the malware – without ever running it.

Deobfuscating API calls in malware represents a sophisticated layer of the cybersecurity cat-and-mouse game. Malware authors often obfuscate API calls to conceal malicious activities and elude signature-based detection systems.

When these API calls are obfuscated, they appear as innocuous or nonsensical code, making it challenging for security tools to flag them as malicious. However, when deobfuscated, the reverse engineer can get a much better idea of what the code is doing.

Below is an image of the obfuscated strings, which just look like some random bytes in sequence.

‍

The deobfuscation process requires a great understanding of assembly code. You’ll use static analysis to examine the malware assembly and decompiled code without executing it to identify patterns or algorithms used in its deobfuscation process. The image below shows the decompiled code and how variables are matched to the data section to be deobfuscated later.

By deobfuscating these calls, cybersecurity analysts can gain a clearer understanding of the malware's functionality, intent, and communication, enabling them to devise more effective countermeasures and defense strategies.

Linux source code Analysis: Stack overflow Ep.5 – NX

Analyzing software in the Linux space, you’re faced with an exploitation puzzle. There’s an up-to-date Linux system and compiler protections, but also some software that’s still holding a stack overflow vulnerability. This Stack overflow ep.5 - NX exercise will redefine your understanding of Linux security for specific processes.

Exploiting a stack overflow on a Linux system, especially when the no-execute (NX) bit is set, introduces an intricate layer of complexity. The NX bit is a security feature that marks certain areas of memory, like the stack, as non-executable.

This means that even if an attacker manages to overflow the buffer and inject malicious shellcode, the system will prevent its execution. However, this doesn't render the system impervious to attacks. In such scenarios, attackers often resort to techniques like return-oriented programming (ROP). Below is an example from the lab of a simple ROP chain used to exploit a process like this.

‍

Instead of injecting and executing their own code, attackers manipulate the program's control flow to execute existing snippets of code (called gadgets) in unintended sequences to achieve their malicious objectives.

Successfully exploiting a stack overflow in the presence of the NX bit necessitates a deep understanding of the system's memory layout, binary exploitation techniques, and the application's control flow, making it slightly more challenging.

Windows source code analysis: Heap Exploitation Ep.2 – heap overflow (practical)

Returning to the Windows domain, but with a twist – this time, you'll analyze and exploit a heap overflow exploit lurking within an up-to-date system. Heap overflows, with their distinct complexities, offer a unique reverse engineering challenge. Dive deep, explore the intricacies of the heap, and unmask a way to exploit and redirect code execution that can lay in specific processes.

Exploiting a heap overflow on Windows systems is a sophisticated endeavor, demanding a nuanced understanding of the platform's memory management. Unlike stack overflows, which typically involve overwriting a return address, heap overflows deal with corrupting data structures within the heap, a dynamically allocated region of memory. In a Windows environment, the heap manager governs the allocation and deallocation of memory blocks.

An attacker exploiting a heap overflow typically targets specific control data used on the heap, like function pointers or linked list pointers. By manipulating these, the attacker could redirect the program's execution flow, leading to arbitrary code execution.

The image below shows processing software copying too much data onto the heap. Knowing which points in the heap get overwritten, you can overwrite function pointers like vtable pointers to redirect control flow when they’re called.

The image below shows the address you have code stored in that you want to execute (shown in the red box) and the amount of data you want to copy from the BMP (shown with the blue boxes).

‍

Hex dump snippet showing bytes with highlighted patterns: two blue boxes at 00 00 and 40 00, red around 13 36 40 00.

As such, understanding and defending against heap overflows remains a priority in Windows-based cybersecurity.

Build Real Reverse Engineering Skills with Immersive

When it comes to reverse engineering, we believe hands-on experience is paramount. And cybersecurity enthusiasts, professionals, and those looking to upskill can get just that with our up-to-date reverse engineering content. In these labs, you can navigate the intricacies of Windows and Linux systems, confront and dissect vulnerabilities that defy the latest mitigations, and pick apart malware to achieve an in-depth understanding of the software.

Ready to evolve? Immersive's Reverse Engineering and Malware Analysis labs give security teams hands-on practice with real threat scenarios — from DarkSide malware deobfuscation to Windows heap exploitation. No passive content. No simulations. Real skills, provably built.

Explore Immersive’s Labs →

‍

FAQ: Reverse Engineering in Cybersecurity

What is reverse engineering in cybersecurity?

Reverse engineering in cybersecurity is the process of analysing compiled software — including malware and binary executables — to understand its behaviour, identify vulnerabilities, and uncover the techniques used by threat actors. It is typically performed without executing the code, using static analysis tools such as Ghidra, IDA Pro, and x64dbg. Security teams use reverse engineering to deconstruct malware, map attacker TTPs, and build targeted defences.

Why is malware reverse engineering important for security teams?

Malware reverse engineering allows security teams to understand precisely how a threat operates — what it targets, how it communicates, and what obfuscation it uses to evade detection. This insight enables analysts to develop signatures, build detection rules, and create countermeasures before a similar variant reaches the organisation's environment. It also supports incident response by helping teams determine the full scope and impact of a breach.

What is static analysis in the context of reverse engineering?

Static analysis is the examination of code or binaries without executing them. In reverse engineering, static analysis involves disassembling or decompiling an executable to inspect its logic, identify function calls, and detect obfuscated behaviour. It is the foundational technique used in malware analysis, as it avoids triggering the malware's payload while still revealing its intent and structure.

What is return-oriented programming (ROP) and how is it used by attackers?

Return-oriented programming (ROP) is an advanced exploitation technique used to bypass security controls such as the NX (no-execute) bit. Rather than injecting new shellcode, attackers chain together small snippets of existing code (gadgets) already present in the binary or its dependencies. By controlling the stack, they manipulate the program's execution flow through these gadgets to achieve their objective without ever executing injected code. ROP is a common technique in real-world exploits targeting hardened Linux and Windows systems.

How does Immersive help security teams develop reverse engineering skills?

Immersive provides hands-on reverse engineering labs within the Immersive One platform, covering malware deobfuscation, binary exploitation, heap and stack overflow analysis, and defensive and offensive reverse engineering across Linux and Windows environments. Each lab is built around real threat actor techniques and real malware variants, allowing security teams to build, measure, and prove their reverse engineering capabilities in a controlled, high-fidelity setting.

“The speed at which Immersive produces technical content is hugely impressive, giving our teams hands-on experience with serious vulnerabilities, in a secure environment, as soon as they emerge.”
TJ Campana
Head of Global Cybersecurity Operations, HSBC
“Realistic simulation of current threats is the only way to test and improve response readiness. Immersive's platform provides the closest thing to replication of a real incident — all within a safe virtual environment.”
Paul Jackson
Regional Managing Director, APAC Cyber Risk, Kroll
“Immersive has made the journey so much easier over the past five years. This practical, interactive approach hasn't just improved my technical abilities — it's given me a real sense of confidence.”
Paul Blance
Position, Specsavers
"I recently got the chance to try out Immersive, and it was an enlightening experience! The gamified learning made absorbing new information quite enjoyable. Overall, a solid platform!"
Atakan Bal
Mercedes Benz

Ready to Get Started?
Get a Live Demo.

Simply complete the form to schedule time with an expert that works best for your calendar.