← Back to Writeups
HTBEasyMisc

Eternal Loop

D3v0o0Nu119/2/20261 min read
#misc#htb#easy

Eternal Loop

Platform: HackTheBox | Category: Misc | Difficulty: Easy | Author: D3v0o0Nu11 | Date: 2026-02-10

Description

Can you find a way out of this loop?

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. Hmm.. Let's unzip it again.

  3. It seems we can't enter the same password as before.

  4. Let's use fcrackzip then.

  5. Got no result, so i tried to unzip it using it's own name as the password. Turns out got it right!

  6. Let's keep going.

  7. Seems we need to automate this. So i did a small outsource on the internet for a script to automate this unzipping. Found this bash script.

sh
#!/bin/bash

ZIPFILE=$1
RESULT=0

while [ $RESULT -eq 0 ]
do
PASSWORD=$( unzip -l $ZIPFILE | grep -E "^\s+[0-9]+" | grep -Eo "[0-9]+\.zip" | grep -Eo "[0-9]+" )
unzip -P "$PASSWORD" "$ZIPFILE"
RESULT=$?
ZIPFILE="$PASSWORD.zip"
done
  1. Stopped at 6969.
  2. Let's use fcrackzip for it.

USE THE PASS, THEN STRINGS THE FILE WE GOT - RESULT

  1. 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.