misc

Challenges

Snake Tongue

I've seen parentheses you people wouldn't believe.

ncat --ssl snake-tongue.challs.snakectf.org 1337

This challenge implements a custom Lisp-like DSL called "Snake lang" with several evaluation forms. Now question: Where is the Flag?

  • The flag is stored in a global Common Lisp variable called *flag*, which is initialized in the main function:

The flag is loaded from the environment variable FLAG and stored as a global parameter accessible throughout the Common Lisp runtime.

How to get there? The DSL (Domain Specific Language) only exposes the format function from Common Lisp's standard library through the *dealwithit* list:

We need to find a way to break out of this restricted environment and access the *flag* variable directly from the underlying Common Lisp system.

Now is the vulnerability, it lies in the ! form handler within the please function:

The ! form compiles and executes real Common Lisp code using eval, completely bypassing the DSL's restrictions. While the dhc macro has a check to prevent redefinition of existing functions:

It allows defining entirely new functions with arbitrary Common Lisp code in their bodies, giving us full access to the underlying runtime environment.

circle-info

Solution

  • Use the ! form to define a new Common Lisp function that returns the *flag* variable

  • Immediately call that function to retrieve the flag

  • ! triggers the vulnerable form handler

  • get-flag becomes the function name (passed to dhc)

  • (x) defines the parameter list

  • *flag* becomes the function body - directly accessing the global flag variable

  • The outer parentheses (... 0) immediately call the newly defined function with argument 0

  • snakeCTF{pr0duct10n_re4dy_l4nguAge_63dceb8e91c1c77d}

GeoGuessitFVG (OSINT)

circle-info

My teammate solved this one (my brain is too rotted for osint), but ultimately was use the Satellite mode, followed the white line which is electric poles. And check each road it cross.

  • snakeCTF{Ov3r_9000_v0lts_9c036a37136f5c6c}

NCPunk'd

Who the hell uses IPX and NCP in 2025? This guy. Can you help me find the flag?

TL;DR: So da network forensics challenge using legacy IPX/NCP protocol. Would need to extract flag.enc and encrypt.pyc from packet capture, decompile Python bytecode, reverse multi-stage encryption to get flag.

What are IPX and NCP?

  • IPX (Internetwork Packet Exchange): Legacy network protocol developed by Novell, predecessor to modern TCP/IP. Used primarily in 1980s-1990s for local area networks.

  • NCP (NetWare Core Protocol): File and print sharing protocol that runs over IPX. Handles file operations, directory services, and remote commands on Novell NetWare systems.

Where is the Flag?

  • The flag is encrypted and stored as flag.enc in frame #6732 of the packet capture. The base64 content is (from strings command):

How to Get There?

  1. Extract the encrypted flag file from NCP traffic

  2. Find and extract the encryption program (encrypt.pyc) from frames #9563, #9565, #9567

  3. Decompile the Python bytecode to understand the encryption algorithm

  4. Reverse the multi-stage encryption process

  • snakeCTF{NCP_5lurp1ng_w1th_b3p1_cef2b24f993d1855}

Last updated