ESPILON-CTF-2026-Writeups/IoT/Lets_All_Love_UART
2026-03-22 19:18:58 +01:00
..
README.md ESPILON CTF 2026 — Write-ups édition 1 (33 challenges) 2026-03-22 19:18:58 +01:00

Let's All Love UART — Solution

Difficulty: Easy | Category: IoT | Flag: ESPILON{LAIN_TrUsT_U4RT}

Overview

The challenge emulates a split UART interface on a Lain router:

  • TX (port 1111): Read only — device output
  • RX (port 2222): Write only — send commands

Steps

  1. Open two terminals:
# Terminal 1 — read device output
nc <host> 1111

# Terminal 2 — send commands
nc <host> 2222
  1. On the RX terminal, send the flag command:
flag
  1. The flag prints on the TX terminal:
ESPILON{LAIN_TrUsT_U4RT}

Solver Script

#!/usr/bin/env python3
import socket
import threading

HOST = "<host>"
TX_PORT = 1111
RX_PORT = 2222

def reader():
    with socket.create_connection((HOST, TX_PORT)) as s:
        while True:
            data = s.recv(4096)
            if not data:
                break
            out = data.decode(errors="replace")
            print(out, end="")
            if "ESPILON{" in out:
                break

tx_thread = threading.Thread(target=reader, daemon=True)
tx_thread.start()

with socket.create_connection((HOST, RX_PORT)) as s:
    s.sendall(b"flag\n")

tx_thread.join()

Flag

ESPILON{LAIN_TrUsT_U4RT}

Author

Eun0us