← Back to Writeups
HTBN/AReversing

Tear Or Dear

XESXOR8/23/20262 min read
#reversing#htb#n/a

Tear Or Dear

Platform: HackTheBox | Category: Reversing | Difficulty: N/A | Author: D3v0o0Nu11 | Date: 2026-02-10

Description

Find the username and password and put them in the flag in the format: REDACTED Warning: It can produce false positives.

Solution Approach

Core idea: Identify the weakness from source review or fingerprinting first. Iterate with incremental payloads instead of guessing.

Steps

  1. First, unzip the .zip file given.

  2. Since it's a PE file, let us decompile the PE using dnSpy. But before that let us run it on windows.

  3. Yep, let us decompile it.

  4. Let us check the main() function.

  5. Now check the LoginForm() function.

  6. Hmm.. let us check the button1_Click

  7. Seems the line 11 shall be our interest, so let us set a breakpoint at that line, then run the program.

RESULT (Enter both username and password as ADMIN)

  1. Because we want to see the this. so let us check that and search for username.

  2. Found it! Now let us run it again but this time enter the pass as test.

  3. Hmm.. Our password input is saved as the username.

  4. Now add watch to that variable to see what will the program do with the variable as the it running.

  5. Now search for o, since the username is compared to o.

  6. Let us watch that as well, not forget to watch the s too.

  7. Set the breakpoint at check1 function at line 528.

  8. Now run the program again. Then modify the value of our username (which is the pass) as the leaked pass we got.

PRESS CONTINUE

PRESS STEP OVER

  1. Got s2, add that to watch,then do the same thing with the check2() function.

  2. The s3 gave us the same value, confused here. let us check the check4().

  3. It still gave us the same value, how about the last check.

  4. Add to watch for .aa value.

  5. Well actually i'm stucked here for a while and tried to input the password as roiw!@# and the username as roiw it says wrong but when i entered the username as piph and pass as roiw!@#. It says correct!

  6. Hence we got the flag!

Flag

REDACTED

Lessons Learned

  1. Identify the weakness from source review or fingerprinting first.
  2. Iterate with incremental payloads instead of guessing.
  3. Reuse the same pattern in future engagements.