guard_shells
Guard shells for connection limiting and robot detection.
When running a telnet server on a public IPv4 address, or even on large private networks, various network scanners, scrapers, worms, bots, and other automatons will connect.
The robot_check function detects whether the remote end is a real terminal emulator
by requesting a cursor position report (CPR) after writing a single space character.
Real terminals respond to CPR, while bots typically timeout.
These shells are used when normal shell access is denied due to connection limits or failed robot checks.
- async robot_check(reader, writer, timeout=5.0)[source]
Check if client responds to cursor position report.
- Return type:
- Returns:
True if client passes (responds to CPR with expected width).
- async robot_shell(reader, writer)[source]
Shell for failed robot checks.
Asks philosophical questions, logs responses, and disconnects.
- Return type:
- async busy_shell(reader, writer)[source]
Shell for when connection limit is reached.
Displays busy message, logs any input, and disconnects.
- Return type: