SEC: Telnet — Remote Terminal Protocol

Telnet is a text-based network protocol for remote terminal access. Learn how it works, its default port, security risks, and practical uses for testing SMTP, HTTP, and other TCP-based services.

What is Telnet?

Telnet (Teletype Network) is a text-based network protocol developed in 1969, widely used in the early days of the internet. It is designed for remote terminal connection — allowing a user to connect to and interact with a remote system as if they were physically present at its terminal.

The TELNET protocol is a network protocol for remote terminal connection. `telnet`, a TELNET client, allows you to connect to and communicate with a remote system and issue text commands.

Telnet provides a login interface with username and password authentication, enabling users to execute commands on the remote system.

Default port: 23


The Core Problem with Telnet

Telnet transmits all data in plaintext — including usernames, passwords, and all commands entered during a session. Any attacker who can intercept the network traffic between client and server can read the entire session content.

md
Telnet Session (unencrypted):
Client --> "username: admin" --> Network --> Server
Client --> "password: secret123" --> Network --> Server
         ^
[Attacker captures plaintext credentials via sniffing]

For this reason, Telnet has been replaced by SSH (Secure Shell) for all remote administration purposes. Modern security policies should prohibit the use of Telnet for any administrative access.


Basic Usage

bash
# Connect to a remote host and port
telnet <SERVER-IP-ADDRESS> <PORT-NUMBER>

# Example: Connect to a server on default Telnet port
telnet 192.168.1.100 23


Using Telnet to Test Network Services

Even though Telnet is insecure for remote administration, it remains a valuable diagnostic tool for manually testing any TCP-based service — because it can connect to any port and send raw text commands.

Testing SMTP (Email Server) on Port 110

bash
telnet 10.10.149.120 110
AUTH
+OK
PLAIN
.
USER linda
+OK
PASS Pa$$123
+OK Logged in.
STAT
+OK 4 2216
LIST
+OK 4 messages:
1 690
2 589
3 483
4 454
.
RETR 4
+OK 454 octets
Return-path: <user@client.thm>

Testing an HTTP Web Server

bash
# Connect to a web server on port 8008
telnet example.com 8008

# After connecting, manually send an HTTP request:
GET / HTTP/1.1
Host: example.com

bash
# With localhost as the Host header
telnet example.com 8008

GET / HTTP/1.1
Host: localhost

This technique allows manual inspection of HTTP responses, server headers, and error messages — useful for fingerprinting web servers and understanding their behavior.


Common Telnet Use Cases in Security

Use CaseDescription
Banner grabbingConnect to a port and read the service banner to identify software and version
SMTP testingManually send emails to verify server configuration or test for open relay
HTTP debuggingSend raw HTTP requests to inspect server responses
Port availability checkVerify that a specific TCP port is open and accessible
Protocol interactionInteract with any TCP-based service protocol manually

One of the most common security uses of Telnet is banner grabbing — connecting to a service and reading whatever the server sends immediately upon connection:

bash
telnet target.com 22
# Returns: SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.5
# Reveals: SSH version and OS distribution

telnet target.com 25
# Returns: 220 mail.target.com ESMTP Postfix (Ubuntu)
# Reveals: SMTP server software and version

This information helps identify specific software versions that can then be cross-referenced against vulnerability databases.


Telnet vs. SSH

FeatureTelnetSSH
EncryptionNone (plaintext)Full encryption
AuthenticationUsername/password in cleartextKeys + optional passphrase
Port2322
IntegrityNoneHMAC protection
SecurityCritically insecureSecure
Use in productionNeverYes
Diagnostic useUseful for TCP service testingPreferred for remote access

Security Recommendation

Telnet should never be used for remote system administration. All remote access to servers, network devices, and cloud infrastructure should use SSH with key-based authentication.

If Telnet is enabled on any networked device in your environment:

  • Immediately disable the Telnet service
  • Replace with SSH
  • Check for credentials that may have been captured in transit
  • Review logs for any unauthorized access during the period Telnet was active