retr0chat telnet server
Go to file
ed cbc3d95c6b v1.3.2 2022-09-01 23:55:49 +02:00
.vscode v1.3.2 2022-09-01 23:55:49 +02:00
bin support ironpython + jython 2020-01-20 04:16:26 +00:00
clients workaround powershell quirks 2020-12-22 17:20:28 +01:00
docs ctrl-L is screen redraw, fixes #3 2022-07-04 00:06:54 +02:00
r0c v1.3.2 2022-09-01 23:55:49 +02:00
scripts v1.3.2 2022-09-01 23:55:49 +02:00
test add telnet.exe to configurator 2021-09-22 21:25:37 +02:00
.editorconfig this thing broke stuff 2018-01-08 23:21:30 +01:00
.gitattributes workaround powershell quirks 2020-12-22 17:20:28 +01:00
.gitignore ironpython support (sufficiently cursed) 2020-12-22 23:15:50 +01:00
LICENSE Initial commit 2018-01-07 06:53:56 +01:00
README.md add TLS support 2022-04-03 07:11:04 +02:00
setup.py v1.3.1 2022-07-04 00:08:12 +02:00
start-r0c.bat windows fixes 2020-01-20 01:42:02 +00:00
start-r0c.ps1 windows fixes 2020-01-20 01:42:02 +00:00
start-r0c.sh replace shebangs with python3 2021-09-19 17:22:48 +02:00

README.md

r0c telnet server

screenshot of telnet connected to a r0c server

  • download the latest release (standalone): r0c.py

summary

imagine being stuck on ancient gear, in the middle of nowhere, on a slow connection between machines that are even more archaic than the toaster you're trying to keep from falling apart

retr0chat is the lightweight, no-dependencies, runs-anywhere solution for when life gives you lemons

  • tries to be irssi
  • zero dependencies on python 2.6, 2.7, 3.x
  • supports telnet, netcat, /dev/tcp, TLS clients
  • fallbacks for inhumane conditions
    • linemode
    • no vt100 / ansi escape codes

endorsements

features

irc-like:

  • public channels with persistent history (pgup/pgdn)
  • private messages (/msg acidburn hey)
  • nick completion with Tab ↹
  • notifications (bell/visual) on hilights and PMs
  • command subset (/nick, /join, /part, /names, /topic, /me)
  • inline message coloring, see /help

technical:

  • client behavior detection (echo, colors, charset, newline)
  • message input with readline-like editing (arrow-left/right, home/end, backspace)
    • history of sent messages (arrow-up/down)
  • bandwidth-conservative (push/pop lines instead of full redraws; scroll-regions)

windows clients

  • use putty in telnet mode
  • or the powershell client
  • or enable Telnet Client in control panel -> programs -> programs and features -> turn windows features on or off, then press WIN+R and run telnet r0c.int

putty is the best option;

  • the powershell client is OK and no longer spammy as of windows 10.0.15063 (win10 1703 / LTSC)
  • windows-telnet has a bug (since win7) where non-ascii letters occasionally render but usually dont
    • this is due to a buffer overflow in telnet.exe, so r0c will apply a rate-limit to avoid it
    • looks like messages larger than 512 bytes end up messing with the unicode glyphs area? or something

linux clients

most to least recommended

client example
telnet telnet r0c.int
socat socat -,raw,echo=0 tcp:r0c.int:531
bash mostly internals
netcat nc r0c.int 531

you can even exec 147<>/dev/tcp/r0c.int/531;cat<&147&while IFS= read -rn1 x;do [ -z "$x" ]&&x=$'\n';printf %s "$x">&147;done (disconnect using exec 147<&-; killall cat #sorry)

tls clients

if you enable TLS with -tpt 2424 (telnet) and/or -tpn 1515 (netcat) you can connect to r0c with TLS encryption using any of the following:

  • telnet-ssl -zssl -zsecure -zcacert=r0c.crt r0c.int 2424
  • socat -,raw,echo=0 openssl:r0c.int:1515,cafile=cert.crt
  • stty -icanon; ncat --ssl --ssl-trustfile r0c.crt -v r0c.int 1515
  • stty -icanon; openssl s_client -CAfile ~/.r0c/cert.crt -connect r0c.int:1515

firewall rules

telnet uses port 23 by default, so on the server you'll want to port-forward 23 to 2323 (and 531 to 1531 for plaintext):

iptables -A INPUT -p tcp --dport 23 -m state --state NEW -j ACCEPT
iptables -A INPUT -p tcp --dport 531 -m state --state NEW -j ACCEPT
iptables -A INPUT -p tcp --dport 2323 -m state --state NEW -j ACCEPT
iptables -A INPUT -p tcp --dport 1531 -m state --state NEW -j ACCEPT
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 23 -j REDIRECT --to-port 2323
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 531 -j REDIRECT --to-port 1531

documentation

not really but there is a list of commands and a list of hotkeys