Vortex Level 0
Vortex Level 0 — write a small TCP client that reads four unsigned integers in host byte order, adds them, and sends back the result.
Table of Contents
Source: This content is aggregated from overthewire (MIT). Visit the original repository for the latest version.
Level Goal
Your goal is to connect to port 5842 on vortex.labs.overthewire.org and read in 4 unsigned integers in host byte order. Add these integers together and send back the results to get a username and password for vortex1. This information can be used to log in using SSH.
Note: vortex is on an 32bit x86 machine (meaning, a little endian architecture)
Helpful Reading Material
Study guide
Level map: connect to port 5842 on vortex.labs.overthewire.org to obtain the credentials for the next account.
What this level teaches
Basic network programming and the realities of 32-bit little-endian data.
Key ideas
- Sockets. Create a TCP socket, connect, read and write. The page links Beej’s network programming guide.
- Byte order. The server sends four 32-bit unsigned integers in host byte order. The page notes the machine is 32-bit x86, so little-endian.
- Fixed-width arithmetic. Think about what a 32-bit unsigned integer can hold and what happens when a sum is too big; the value you send must fit the same format.
- Parsing binary data. In Python, the
structmodule reads and writes binary integers.
How to approach it
- Connect with a small script and read exactly the bytes you expect.
- Convert them to numbers, add them correctly for the width involved, and send the result in the same format.
Why it matters
Binary protocols and integer width mistakes are the foundation of countless exploits.