DeadSec CTF 2024 – Mic check

This is a small write-up of the “Mic check” challenge from DeadSec CTF 2024 (Misc Category). The difficulty was easy and it was a kind of stuff that appears often in CTF challenges.

Description :

mic is it ok?
mic is it ok?

A link is to start a docker container and the command to connect to it are provided.

Solution :

When connecting to the docker with netcat, we receive a letter, we must reply with the same letter, then we receive 2 letters and must reply with the same 2 letters, and so on. We could do that manually but the “difficulty” is that you have to type the increasing amount of letters in less than 1 or 2 seconds.

A very good and easy library to use in Python to solve this challenge is called pwntools. Now we just need to make a small script that reads what we receive, and send the same string.

from pwn import *
p = remote("35.225.65.217",32456)
output=""
while len(output)<100:
p.recvuntil(b">")
input = p.recvuntil(b" [")
p.recvline()
p.recvuntil(b">")
output = input.decode("utf-8")
output = output[:-1]
output = output.replace(" ", "")
log.info("Sending : "+output)
p.sendline(output.encode('utf-8'))
input = p.recvline()
log.info("Received : "+input.decode("utf-8"))
view raw mic.py hosted with ❤ by GitHub

Then run it :

Until you see the flag :

That’s it, the flag was DEAD{mic is working!}

Leave a Comment

Your email address will not be published. Required fields are marked *