← Back to Writeups
CUSTOMEasyReversing

129 (Утка)

XESXOR9/10/20261 min read
#reversing#custom#easy#apk-decompilation#contrast-enhancement#image-manipulation#linux

129 (Утка)

Platform: duckerz | Category: Reversing | Type: Challenge | Difficulty: Easy | OS: Linux | Author: XESXOR | Date: 2026-01-09 | Status: Solved Techniques: apk-decompilation, contrast-enhancement, image-manipulation

Summary

Task: Find the hidden flag in an Android APK file. Solution: Decompile the APK with jadx, locate a suspicious image in resources, and use ImageMagick to enhance low-contrast hidden text.

129 (Утка) — duckerz

Description

The task provided an Android APK file (duck.apk). The goal was to find the hidden flag within the application.

Analysis

  1. Decompilation: Initial analysis started with decompiling the duck.apk using jadx. While the code didn't immediately reveal the flag, a review of the application's resources was performed.
  2. Resource Exploration: In the res/drawable/ directory, a file named duck_flag.png was discovered.
  3. Image Inspection: At first glance, the image appeared to be mostly white or empty. However, using exiftool and basic image viewers suggested the presence of data. Detailed pixel analysis revealed a very narrow (11px high) horizontal strip that contained subtle variations in color. ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

Solution

Step 1: Resource Extraction

Decompile the APK to access the image files:

bash
jadx -d duck_out duck.apk
cd duck_out/resources/res/drawable/

Step 2: Image Processing

The flag was hidden in a specific region: 157x11 at offset +122+101. To make it readable, we use ImageMagick (magick) to crop, scale, and enhance the contrast.

bash
# Crop the suspicious area, scale it up for readability, and apply thresholding
magick duck_flag.png -crop 157x11+122+101 -scale 1000% -negate -threshold 10% flag_readable.png

‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

Step 3: Reading the Flag

The resulting image flag_readable.png clearly showed the text: DUCKERZ{REDACTED}. The flag uses leetspeak substitutions like ! for l and @ for a. ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍