Semtex Level 5
Semtex Level 5 — connect from ten different IP addresses, answer a challenge on each, and receive the password on a randomly chosen connection.
Table of Contents
Source: This content is aggregated from overthewire (MIT). Visit the original repository for the latest version.
Random Networking
Make 10 connections to port 24027 from different IP’s. On each connection you will receive a string of 10 ASCII characters. XOR this string with the Semtex5 password, character by character. Then send back the 10 characters followed by another string of exactly 10 characters which identifies you (can be anything within A-Z, a-z, 0-9). The first 10 characters that you send, are different on every connection, the last 10 have to be the same. If you do not send the correct string back within 5 seconds you are disconnected. Once connected with at least 10 different IP’s You will receive the password on one connection, chosen randomly.
**Note: Your connections time out in 2 minutes and you cannot connect from an IP that is still connected. May the sockets be with you. **
Reading Material
Study guide
Level map: the challenge service is on port 24027.
What this level teaches
Working with multiple source addresses and a challenge-response protocol.
Key ideas
- Challenge-response. Each connection sends ten ASCII characters that you must combine, character by character, with the Semtex 5 password using XOR, then send back along with your own identifier.
- Timing. You have five seconds to answer, and connections time out after two minutes.
- Different IPs. You cannot reuse an address that is still connected, so you need several exits, such as proxies.
- Reading. The SOCKS5 RFC is linked, as a way of routing connections through other hosts.
How to approach it
- Write and test the challenge-response handling on a single connection.
- Route ten connections through different addresses, using SOCKS or SSH tunnels.
- Keep them open until the password arrives.
Why it matters
It shows how defences based on source IP can be circumvented with proxies.