Kuboid
Open Luck·Kuboid.in
Security BSides2025
Open in YouTube ↗

THICC Clients - No Admin, No Permissions, No Problem! Reverse Engineering Your Way to Application Admin

Security BSides London395 views41:23about 1 month ago

This talk demonstrates techniques for reverse engineering and patching thick client applications to bypass administrative restrictions and gain unauthorized access. The speaker focuses on manipulating Common Intermediate Language (CIL) instructions in .NET/C# binaries to alter application logic, such as modifying authentication checks. The presentation highlights the importance of identifying and exploiting hardcoded credentials, insecure data handling, and custom SQL query execution within thick clients. Practical methodologies for using decompilation tools to identify and modify application behavior are provided.

Bypassing Thick Client Authentication via CIL Manipulation

TLDR: Thick client applications often rely on client-side logic for security, making them prime targets for reverse engineering. By decompiling .NET binaries and manipulating Common Intermediate Language (CIL) instructions, researchers can bypass authentication checks and escalate privileges without needing administrative access. This post breaks down how to identify these logic flaws and patch binaries to force application-level admin access.

Security professionals often overlook thick client applications, assuming they are either too complex to reverse or too secure to bother with. This is a mistake. Many enterprise applications, ranging from time-tracking software to internal logistics tools, are built on .NET or Java and rely on client-side logic to enforce security boundaries. When a developer assumes the client is a trusted environment, they leave the door wide open for anyone with a decompiler and a bit of patience.

The Vulnerability in the Logic

Thick clients frequently perform "security" checks on the client side before communicating with a backend. If the application checks if a user is an administrator by calling a local function like IsAdmin(), that function is just code waiting to be read. If you can modify that code to always return true, you have effectively bypassed the check.

The core of this technique involves working with Common Intermediate Language (CIL), the low-level assembly language that .NET code is compiled into before the Just-In-Time (JIT) compiler turns it into machine code. Tools like dnSpy allow you to decompile these binaries, view the CIL, and modify the instructions directly.

Patching the Binary

When you load a target binary into a tool like dnSpy, you are looking for the decision points. In a typical authentication flow, you might find a block of code that looks like this:

IL_0008: ldarg.0
IL_0009: ldc.i4.0
IL_000a: beq.s IL_0021

In this snippet, the application is loading an argument and comparing it to zero. If they are equal, it jumps to a failure state at IL_0021. To bypass this, you don't need to rewrite the entire application. You simply need to change the jump condition. By replacing the beq.s (branch if equal) with a br.s (unconditional branch) or simply inverting the logic, you can force the application to follow the "success" path regardless of the actual input.

This is not just about authentication bypass. Once you have forced the application to treat you as an administrator, you often unlock hidden UI elements or, more importantly, the ability to execute custom SQL queries. Many of these applications are essentially SQL-as-a-Service wrappers. If the client allows an admin to run a query, and you have patched the client to think you are an admin, you have just gained a direct line to the backend database.

Real-World Engagement Strategy

During a penetration test, your first step should be reconnaissance of the binary itself. Don't just run a scanner. Use Ghidra or dnSpy to map out the classes. Look for strings related to "admin," "login," "permissions," or "dashboard." These are your entry points.

If you find a function that checks for administrative status, look at the CIL instructions. If the application is not obfuscated, you will find the logic clear as day. Even if it is obfuscated, the logic must exist for the application to function. You are looking for the if statement that decides whether to show the "Admin Dashboard" or the "Access Denied" message.

Once you have identified the target function, modify the CIL to force the desired outcome. Save the modified binary as a new file. If the application crashes, you likely broke a dependency or messed up the stack. This is where the "trial and error" part of the job comes in. You are learning the application's internal state machine. Every crash is a data point that tells you what the application expects to see on the stack.

Defensive Considerations

Defenders need to stop treating the thick client as a secure perimeter. If your application logic relies on the client to verify permissions, you have already lost. All sensitive authorization decisions must happen on the server side. The client should only be a display layer.

Furthermore, if you are shipping .NET applications, consider using obfuscation tools to make the CIL harder to read. While this is not a silver bullet—a determined researcher will eventually find the logic—it raises the bar significantly for casual attackers. Finally, ensure that your backend APIs validate every request. Never trust the client to tell the server who the user is or what they are allowed to do.

Reverse engineering is a skill that pays dividends. By understanding how the application is built, you can find flaws that automated scanners will never touch. Stop looking for the same old vulnerabilities and start looking at the logic that holds the application together. You might be surprised at how easily it falls apart.

Talk Type
talk
Difficulty
intermediate
Has Demo Has Code Tool Released


BSides London 2025 Track 3

8 talks · 2025
Browse conference →
Premium Security Audit

We break your app before they do.

Professional penetration testing and vulnerability assessments by the Kuboid Secure Layer team. Securing your infrastructure at every layer.

Get in Touch
Official Security Partner
kuboid.in