Skip to content
Business logic Write-up Intermediate

Reverse Engineering & Hacking a License Checker

The binary checks a hardcoded password and then validates a license file with specific character constraints. An attacker could bypass the password check by patching a conditional jump to an unconditional jump, or by crafting a license file that meets the length and character requirements.

medium.com

Published on medium.com

Hi, I’m Spandan, a web pentester & a bug bounty hunter, currently in my first year of undergrad. I’m just super new to this “Reverse Engineering” thing (been hardly 4–5 days since I started with the basics syntax of x86–64 binaries).

Spandan Pokhrel, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker could bypass the password check by patching the binary or by crafting a valid license file, potentially gaining unauthorised access to the application's functionality.

What the attacker needed

Access to the binary; ability to run the binary; ability to create a license.txt file

The fix

The password should not be hardcoded, and the license validation should use stronger, non-predictable checks; the binary should also be protected against patching.

How it was found

  1. Run the binary and observe it asks for a password.
  2. Open the binary in Binary Ninja and locate the strcmp call comparing user input to a hardcoded password.
  3. Find the hardcoded password in the .data section.
  4. Enter the correct password, but see that a license file is required.
  5. Create a license.txt file with a 32-character string that satisfies the character checks (first character 'N', fifth 'L', ninth greater than 'Y', eleventh greater than 'Y').
  6. Run the binary again with the crafted license file to successfully pass validation.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

This is a reverse engineering exercise on a small program. The program asks for a password and then checks a license file. By examining the compiled code, the author found the correct password and the rules for the license file, and also showed how to skip the password check by modifying the program's instructions.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.