- Challenge Name: recursive_hell.png
- Category: Steganography
- Initial File: recursive_hell.png (17 MB PNG image)
- Flag:
EOF{its_a_damn_loop} - Difficulty: Expert (68 nested ZIPs + 48 Base64 layers)
- Challenge Information
- Solution Phases
- Technical Summary
- Tools Used
- Key Insights
- Files Created During Solution
- Complete Command Sequence
file /home/uttam/Downloads/recursive_hell.png
# Output: PNG image data, 680 x 512, 16-bit/color RGB, non-interlaced
# Observation: File size 17 MB - suspiciously large for a simple PNGexiftool /home/uttam/Downloads/recursive_hell.pngKey Finding:
- Warning: "Text/EXIF chunk(s) found after PNG IDAT"
- This indicated additional data appended after the image data
strings /home/uttam/Downloads/recursive_hell.png | grep -E "EOF\{.*\}"Result: No readable flag found (flag was deeply embedded)
binwalk /home/uttam/Downloads/recursive_hell.pngOutput:
DECIMAL HEXADECIMAL DESCRIPTION
--------------------------------------------------------------------------------
0 0x0 PNG image, 680 x 512, 16-bit/color RGB
296306 0x48572 Zip archive data
Key Discovery: ZIP archive embedded at byte offset 296306 (0x48572)
dd if=recursive_hell.png of=extracted.zip bs=1 skip=296306Parameters:
if= input file (PNG)of= output file (ZIP)bs=1= block size 1 byte (for precise extraction)skip=296306= skip PNG data, start at ZIP offset
unzip -q extracted.zip
ls -lhResult: Extracted file named temp_68.txt
file temp_68.txt
# Output: Zip archive data, at least v2.0 to extractRealization: The .txt file is actually another ZIP! This is a recursive nesting challenge.
Created: extract_recursive.sh
#!/bin/bash
# Script to extract 68 nested ZIP files
for i in {67..1}; do
if [ -f "temp_$i.txt" ]; then
file_type=$(file temp_$i.txt)
if echo "$file_type" | grep -q "Zip archive"; then
echo "Extracting temp_$i.txt..."
mv temp_$i.txt temp_$i.zip
unzip -q temp_$i.zip
else
echo "Found non-ZIP file: temp_$i.txt"
file temp_$i.txt
break
fi
fi
done
echo "Extraction complete. Final file:"
ls -lh temp_0.txtchmod +x extract_recursive.sh
./extract_recursive.shOutput:
Extracting temp_67.txt...
Extracting temp_66.txt...
Extracting temp_65.txt...
... (continues through all 68 levels) ...
Extracting temp_1.txt...
Extraction complete. Final file:
-rw-r--r-- 1 uttam uttam 1.2K Oct 30 19:45 temp_0.txt
Result: Successfully extracted 68 nested ZIP archives, reaching temp_0.txt
head temp_0.txtObservation: File contains Base64-encoded data (alphanumeric + / + =)
base64 -d temp_0.txt > decoded_1.txt
head decoded_1.txtResult: Still Base64! Multiple layers of encoding detected.
Created: recursive_decode.sh
#!/bin/bash
# Script to decode multiple layers of Base64 encoding
input="temp_0.txt"
counter=0
while true; do
output="decoded_$counter.txt"
# Attempt Base64 decoding
base64 -d "$input" > "$output" 2>/dev/null
if [ $? -ne 0 ]; then
echo "Decoding failed at iteration $counter"
break
fi
# Check if output is different from input
if cmp -s "$input" "$output"; then
echo "No change at iteration $counter"
break
fi
# Check if output is still Base64
if head -c 100 "$output" | grep -qE '^[A-Za-z0-9+/=]+$'; then
echo "Iteration $counter: Still Base64"
input="$output"
counter=$((counter + 1))
else
echo "Iteration $counter: Not Base64 anymore!"
file "$output"
echo "Searching for flag..."
grep -o "EOF{[^}]*}" "$output"
break
fi
donechmod +x recursive_decode.sh
./recursive_decode.shOutput:
Iteration 0: Still Base64
Iteration 1: Still Base64
Iteration 2: Still Base64
Iteration 3: Still Base64
...
Iteration 46: Still Base64
Iteration 47: Still Base64
Iteration 48: Not Base64 anymore!
decoded_48.txt: ASCII text, with no line terminators
Searching for flag...
EOF{its_a_damn_loop}
cat decoded_48.txt
# Output: EOF{its_a_damn_loop}β SUCCESS! Flag captured after 68 ZIP extractions + 48 Base64 decodings = 116 total iterations!
| Metric | Value | Details |
|---|---|---|
| Initial File Size | 17 MB | Unusually large PNG |
| ZIP Archive Offset | 296306 bytes | Found via binwalk |
| Nested ZIP Levels | 68 | temp_68.txt β temp_0.txt |
| Base64 Encoding Layers | 48 | Decoded iteratively |
| Total Iterations | 116 | 68 + 48 |
| Final Flag Location | decoded_48.txt | ASCII text file |
| Flag | EOF{its_a_damn_loop} | β Captured |
file- File type identificationexiftool- EXIF metadata examinationbinwalk- Critical: Detected embedded ZIPstrings- String extraction attempts
dd- Binary data extraction at specific offsetunzip- ZIP archive extractionbase64- Base64 decoding
bash- Shell scripting for automationgrep- Pattern matching for Base64 and flagcmp- File comparison
- 68 nested ZIPs - Each ZIP contains another ZIP (classic recursion)
- 48 Base64 layers - Each decode reveals another encoded layer
- Total 116 iterations - Manual extraction would be impractical
- Flag name confirms it: "its_a_damn_loop" acknowledges the recursive nature
- Binwalk detection - Without finding the ZIP offset, challenge couldn't be solved
- Automation - Manual extraction of 116 layers would take hours
- Pattern recognition - Recognizing the recursive structure early
- Scripting skills - Creating robust extraction/decoding loops
/home/uttam/Downloads/
βββ recursive_hell.png # Original challenge file
βββ extracted.zip # Extracted from PNG offset
βββ extract_recursive.sh # ZIP extraction script
βββ recursive_decode.sh # Base64 decoder script
βββ temp_68.txt β temp_0.txt # 68 extracted ZIP files
βββ decoded_0.txt β decoded_48.txt # 48 Base64 decode iterations
# 1. Analyze PNG
binwalk recursive_hell.png
# 2. Extract embedded ZIP
dd if=recursive_hell.png of=extracted.zip bs=1 skip=296306
# 3. Initial extraction
unzip extracted.zip
# 4. Run recursive ZIP extractor
bash extract_recursive.sh
# 5. Run recursive Base64 decoder
bash recursive_decode.sh
# 6. Verify flag
cat decoded_48.txt
# Output: EOF{its_a_damn_loop}This was an excellent steganography challenge testing:
- Binary analysis skills (
binwalk,dd) - Pattern recognition (identifying recursion)
- Automation abilities (bash scripting)
- Persistence (116 iterations!)
The flag "its_a_damn_loop" perfectly captures the frustration and eventual triumph of solving this recursive nightmare! π―