In this post, we’ll walk through the solutions for all four dynamic analysis challenges. I followed the official Frida Android tutorial (https://frida.re/docs/android/) to set up Frida before starting the challenge.

Meet with Frida

1 - Description

00 - Description

2 - Obtaining 1st Flag

Obtaining the first flag was straightforward. I created a Frida script to hook the target function and print its return value, which revealed the flag.

01 - Code1

01 - Hook getFlag1

02 - Lesson Learned

3 - Obtaining 2nd Flag

The second flag was more challenging, involving checks on a static member, return value, and class member variables. To bypass this, I developed a Frida script that dynamically modified the return value and member variables at runtime, which allowed me to retrieve the flag.

03 - Code3

03 - Flag2

04 - Lesson Learned

4 - Obtaining 3rd Flag

The third flag involved verifying that the value of UUID.randomUUID().toString() was a specific, non-random UUID. I wrote a script to hook the UUID.toString() method directly, capture its output, and successfully retrieve the flag.

05 - Code3

05 - Flag3

06 - LEsson Learned

Obfuscated Secrets

1 - Description

00 - Description

2 - Obtaining Flag

The obfuscated secrets challenge was trickier due to its heavily obfuscated encryption function. To be honest, I leveraged ChatGPT to analyze and understand the function. Once I had a clear picture, I developed a hook script to capture the IV, key, and the encrypted/decrypted values during runtime.

01 - code

02 - Frida

The code output indicated that the decrypted message was “check IV and key,” which resembled hex values. When I converted those hex values to ASCII, I successfully obtained the flag.

03 - flag

04 - lesson learned

Brute Force

1 - Description

00 - Description

2 - Obtaining Flag

The brute force challenge was straightforward. I wrote a Frida script that instantiates the target class and calls the getFlag method with values from 0000 to 9999 inside a try-catch block. If no error occurred, the input was the correct PIN, and the flag was revealed.

01 - code part

02 - PIN

03 - Lesson Learned

Time Your Attack

1 - Description

00 - Description

2 - Obtaining Flag

The “Time Your Attack” challenge was very difficult. I relied on ChatGPT to help me understand the partially decompiled code, which included a significant amount of assembly instructions that made analysis challenging.

01 - InputProvided

After analyzing the decompiled function, I realized it verifies the 10-digit PIN one digit at a time. If a digit is correct, the function takes longer to respond, allowing a timing attack to deduce the PIN step by step.

I then created a script that exploited this timing behavior to brute force the PIN. Due to noisy output, I collected 200 samples per digit to accurately measure the response time and reliably identify each correct digit.

02 - code

03 - pin

04 - lesson learned


<
Previous Post
Juicy Bar CTF - Tools and APIs
>
Next Post
Juicy Bar CTF - Network Manipulation