Challenge: DDR

All the cool robots are playing Digital Dance Robots, a new rythmn game that… has absolutely no sound! Robots are just that good at these games… until they crash because they can’t count to 256. Can you beat the high score and earn a prize? nc chal.2023.sunshinectf.games 23200

Solve

1. Task: Robot will give a 50 arrow string & you have to reply with WASD form.

  • W for up arrow
  • A for left arrow
  • S for down arrow
  • D for right arrow

2. When you enter a correct answer, it will increase score by 1 & give you a new string. 3. We have to complete 256 challenges in order to get the flag. 4. Use pwntools

Solution

1. Code:

from pwn import *

io = remote("chal.2023.sunshinectf.games", 23200)
io.recvuntil(b"   -- Press ENTER To Start --   \r\n")
io.sendline(b"\n")
io.recvuntil(b"\r\n")
io.recvuntil(b"\r\n")

count = 0

while True:
    arrows = str(io.recvline(), encoding="utf-8")

    ans = ""
    up = "W".encode("utf-8")
    left = "A".encode("utf-8")
    down = "S".encode("utf-8")
    right = "D".encode("utf-8")

    for ar in arrows:
        if ar == "⇧":
            ans += "W"
            # io.sendline(up)
        elif ar == "⇦":
            ans += "A"
            # io.sendline(left)
        elif ar == "⇩":
            ans += "S"
            # io.sendline(down)
        elif ar == "⇨":
            ans += "D"
            # io.sendline(right)

    io.sendline(ans.encode("utf-8"))
    io.recvuntil(b"\r")
    count += 1
    print(count)

2. Run:

python solve.py DEBUG

3. After the last challenge, robot will send the flag. Use DEBUG mode to see the flag.

[DEBUG] Received 0x3d bytes:
    b'\r'
    b'YOU WIN!!!\r\n'
    b'Your prize is sun{d0_r0b0t5_kn0w_h0w_t0_d4nc3}\r\n'

Flag

sun{d0_r0b0t5_kn0w_h0w_t0_d4nc3}