$ cat writeup.md…
$ cat writeup.md…
HackTheBox
The task provides a Windows executable file (Bypass.exe) — a .NET assembly requiring authentication bypass.
$ cat /etc/rate-limit
Rate limit reached (20 reads/hour per IP). Showing preview only — full content returns at the next hour roll-over.
"The Client is in full control. Bypass the authentication and read the key to get the Flag."
The task provides a Windows executable file (Bypass.exe) — a .NET assembly requiring authentication bypass.
$ file Bypass.exe Bypass.exe: PE32 executable (console) Intel 80386 Mono/.Net assembly, for MS Windows
The file is a .NET assembly, which means IL code can be disassembled.
Used monodis to obtain the IL code:
monodis --output=bypass.il Bypass.exe
The binary contains two checks:
1. Login Check (Method '0'::'1')
false regardless of inputIL_0043: ldc.i4.0 // push 0 (false) IL_0044: ret // return
2. Secret Key Check (Method '0'::'2')
string::op_Equalitybrfalse.s to jump to "Wrong Key" if comparison failsstring::ConcatUsed Python to patch two locations:
#!/usr/bin/env python3 """ Bypass.exe patcher Patches authentication checks in .NET binary """ with open('Bypass.exe', 'rb') as f: data = bytearray(f.read()) # Patch 1: Bypass Login Check # Location: Offset 0x2bf # Change: ldc.i4.0 (0x16) -> ldc.i4.1 (0x17) # Effect: Login function now always returns true data[0x2bf] = 0x17 # Patch 2: Bypass Key Check # Location: Offset 0x2f5 # Change: brfalse.s (0x2c) -> brtrue.s (0x2d) # Effect: Inverted conditional - shows flag when key is WRONG data[0x2f5] = 0x2d with open('Bypass_patched.exe', 'wb') as f: f.write(data) print("Patched successfully!")
...
$ grep --similar