1.2 KiB
Executable File
1.2 KiB
Executable File
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
- Open two terminals:
# Terminal 1 — read device output
nc <host> 1111
# Terminal 2 — send commands
nc <host> 2222
- On the RX terminal, send the
flagcommand:
flag
- 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