Codefest CTF 2018: Typing Master

Challenge

If you think you have it in you, connect now to 34.216.132.109 9093 and prove your mettle.
You will be presented with a simple typing task which is meant to check your typing speed.
For example, Can you type ‘Z’ 10 times followed by ‘u’ 6 times, followed by the sum of their ASCII values?

Solution

I just wrote a simple Python program to solve this challenge:

from pwn import *
import re
context.log_level = 'critical'
host = '34.216.132.109'
port = 9093
s = remote(host, port)
prompt = s.recv()
# print prompt
found = re.findall(r"'(\w)' (\d*)", prompt)
string = []
string.append(found[0][0] * int(found[0][1]))
string.append(found[1][0] * int(found[1][1]))
string.append(str(ord(found[0][0]) +  ord(found[1][0])))
answer = ''.join(string)
s.sendline(answer)
print s.recv().split()[-1]
s.close()

And the flag is:

 CodefestCTF{1_s33_y0u_4r3_a_m4n_0f_sp33d} 

Rispondi

Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo di WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione /  Modifica )

Google photo

Stai commentando usando il tuo account Google. Chiudi sessione /  Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione /  Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione /  Modifica )

Connessione a %s...

Questo sito utilizza Akismet per ridurre lo spam. Scopri come vengono elaborati i dati derivati dai commenti.