Mariusz Bartosik's website

Graphics programming, demoscene and book reviews

CyberSpace CTF 2024 – 3D Obj write-up

Textured cube on gray background

This challenge turned out to be quite frustrating for some contestands. Many were not familiar with handling 3D objects, which isn’t a standard CTF task. It’s one of those situations where either you know how to do it or you won’t be able to learn it quickly. While some people managed to read the flag using just an online 3D object viewer, here’s my take that may be closer to the intended solution.

Category: Forensics
Points: 212 points
Solves: 81 out of 830 teams
Author: aa.crypto
Challenge:

I am sending you my secret cube. I hope you could read my secret from the little colourful squares?

handout_3d_obj.zip

There’s a zip file with chall.obj, cube.mtl and tex.png. The object is in the classic Wavefront OBJ format, which can be loaded in any 3D modeling program or on-line viewer like https://3dviewer.net/.

When rotating the cube, you might notice visible glitches caused by z-fighting. This occurs when two surfaces are rendered at nearly the same depth and precision of z-buffer is too low to correctly represent small differences.

Let’s look at UV map connecting vertices of a polygon with points on a texture:

Indeed, looks like there are two groups of UV coordinates. Some are small and likely placed manually, and there are many bigger rectangles clustered in the lower left corner.

Selecting just the small ones reveals that they belong to polygons forming the text on the four sides of the cube:

Another solution is to select bigger polygons on UV map and delete them.

This leaves just the ones forming the flag: CSCTF{H1d1ng_in_T3x7ur3}. Actually, the texture doesn’t contain any hidden information and can be replaced with any image. The message was hidden in geometry and UV map.

This challenge was fun for me as I could use my 3D-related knowledge to solve it. I’m looking forward to more tasks like this one. Also, check out the official solution for a different approach to uncovering the flag.

Avatar

Written by Mariusz Bartosik

I’m a software engineer interested in 3D graphics programming and the demoscene. I'm also a teacher and a fan of e-learning. I like to read books. In spare time, I secretly work in my lab on the ultimate waffles with whipped cream recipe.

Comments

Leave a Reply

Required fields are marked *. Your email address will not be published. You can use Gravatar to personalize your avatar.

Allowed HTML tags: <blockquote> <a href=""> <strong> <em> <pre> . Use [code lang="cpp"] and [/code] for highlighted code.