The Count
Challenge:
Apparently DEADFACE is recruiting programmers, but spookyboi is a little apprehensive about recruiting amateurs. He's placed a password hash in the form of a flag for those able to solve his challenge. Solve the challenge and submit the flag as
flag{SHA256_hash}
.code.deadface.io:50000
Solution:
Connecting to the provided service produces a programming challenge:
$ nc code.deadface.io 50000
DEADFACE gatekeeper: Let us see how good your programming skills are.
If a = 0, b = 1, c = 2, etc.. Tell me what the sum of this word is:
You have 5 seconds to give me an answer.
Your word is: wobble
This is essentially a A1Z26 Cipher, but A=0 instead of 1 (e.g BASE-26). It appeared that the provided "word" was always lowercase so we took a very simple approach of subtracting 97 from the ASCII decimal value of each character in the word (ex. ASCII character "b" = 98 decimal).
from pwn import *
context.log_level = 'critical'
r = remote('code.deadface.io', 50000)
r.recvuntil(b"\n\n")
r.recvuntil(b"\n\n")
r.recvuntil(b": ")
output = r.recvuntil(b"\n").strip(b'\n')
print(output)
numbers = [ord(letter) - 97 for letter in list(output.decode("utf-8"))]
print(numbers)
answr = sum(numbers)
print(answr)
r.sendline(str(answr))
print(r.recv().decode())
r.close()
$ python3 solve_count.py
b'ethereal'
[4, 19, 7, 4, 17, 4, 0, 11]
66
flag{d1c037808d23acd0dc0e3b897f344571ddce4b294e742b434888b3d9f69d9944}
Leave a comment