Semtex Level 0
Semtex Level 0 — receive a stream from a network port, discard every second byte, and run the executable that reveals the password.
Table of Contents
Source: This content is aggregated from overthewire (MIT). Visit the original repository for the latest version.
Get a shell
semtex.labs.overthewire.org
| x86/elf: | Connect to port 24000 |
| amd64/elf: | Connect to port 24001 |
| ppc/mach-O: | Connect to port 24002 |
Receive data until the port is closed.
Every second byte you receive is trash, ignore it. The other bytes are an executable that shows you the password.
Then login to semtex1@semtex.labs.overthewire.org on port 2229
Thanks to mrx for the amd64 and ppc binaries!
Reading Material
Study guide
Level map: this level gives you the login for semtex1, used on port 2229.
What this level teaches
Raw network reading and handling unusual file formats.
Key ideas
- Choose your platform. The page lists three ports for three platforms: x86 ELF, amd64 ELF and PowerPC Mach-O. Pick the one you can run.
- Read until the port closes, then process the data.
- Cleaning the stream. Every second byte is garbage to ignore; the others form an executable.
- Run it. The program shows the password. Check its type with
filefirst. - Reading. Beej’s guide to network programming is linked.
How to approach it
- Write a small client that connects, reads everything and saves it.
- Remove the unwanted bytes with a script.
- Mark the result executable and run it in a safe environment.
Why it matters
Receiving untrusted executables is risky; analyse them in a virtual machine.