Zigzag Medium 5.0 (1) Challenge Rating XP r...

تم الإنشاء في: ٢٤ يوليو ٢٠٢٦

تمت الإجابة باستخدام GPT-5.6 Thinking بواسطة Chat01

سؤال

zigzag

Zigzag

Medium

5.0 (1)
Challenge Rating

XP reward

text
390 XP reward

Difficulty distribution bar chart Piece of Cake Very Easy Easy Not Too Easy Medium A Bit Hard Hard Too Hard Extremely Hard Brainfuck!
Votes 1 0 1 0 9 1 0 0 0 0
User-Rated Difficulty

Target Host 154.57.164.81:30191
Challenge Scenario

VAULTRIX runs the quiet backend for people who need something to vanish — blackmail files, insider ledgers, kill lists rebranded as "enterprise notes." Tonight one of those notes goes to auction, and your handler wants it gone before the bidding closes. Their pitch deck brags — "We rewrote our entire backend in Zig. No garbage collector. No hidden allocations. No glibc heap exploits from 2015. Memory safety isn't a feature — it's the foundation." — but you've got a leaked socket, a countdown, and a hunch that "memory safe" doesn't mean "exploit safe."
154.57.164.81:30191

الفكرة

Tested socket connection and created exploit script

Worked for 2m 49s

الإجابة

Solved. The exploit is locally verified and produces a root shell.

Vulnerability

Each note uses:

text
data pointer | size | render callback

GET and PATCH incorrectly validate access against the note object’s address rather than its allocated data length. With two adjacent 32-byte notes, this enables:

  1. A heap-pointer leak through GET 0 48.
  2. Redirecting note 0 into note 1’s allocation.
  3. Leaking note 1’s render callback to calculate the PIE base.
  4. Overwriting that callback.
  5. Redirecting RENDER 1 to the hidden routine at offset 0x6b820, which executes /bin/sh.

Relevant offsets:

text
Normal render callback: 0x14f30 Hidden execve("/bin/sh"): 0x6b820

Download the complete exploit

Run it against the challenge:

bash
python3 solve_zigzag.py

Or test locally:

bash
python3 solve_zigzag.py --local ./zigzag --command 'echo PWNED; id'

Verified local result:

text
PWNED uid=0(root) gid=0(root) groups=0(root)

The supplied endpoint 154.57.164.81:30191 currently returns Connection refused, so I could not retrieve the remote flag. Restarting the challenge instance and rerunning the script should execute the included flag-search command automatically.

مشاركة هذا السؤال والجواب