How to install and use telnet on Kali Linux

The telnet utility, a once common protocol that graced the terminal of every system administrator and power user, was a precursor for SSH. These days, it’s a forgotten relic that isn’t installed by default on most Linux distros.

Despite the other protocols that have come to replace it, telnet remains an ideal utility to test the connection to a certain port of a device. In this guide, we’ll see how to install telnet on Kali Linux, along with some usage examples.

In this tutorial you will learn:

  • How to install telnet
  • Command usage examples for telnet

telnet command on Kali Linux

telnet command on Kali Linux

Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Kali Linux
Software telnet
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

Install telnet on Kali

telnet is easily installed from the system’s apt package manger. Open a terminal and execute the following commands to install it.

$ sudo apt update
$ sudo apt install telnet

Command usage examples for telnet

You can specify a target device via hostname, domain name, or IP address. Try connecting to a specific port by specifying the number after the host. The following example checks to see if example.com is open on port 80.

$ telnet example.com 80
Trying 93.184.216.34...
Connected to example.com.

The third line confirms that we’ve established a successful connection, meaning the port is open and vulnerable to attack.

telnet to a website on port 80

telnet to a website on port 80

You can also interact with the connection. For example, to retrieve html from the site, we can paste the following snippet after a connection is established.

GET /index.html HTTP/1.0
Host: example.com




Take note of the two extra line breaks, as these are also necessary.

Receiving HTML data from a website over telnet connection

Receiving HTML data from a website over telnet connection

There are other interesting things we can do with telnet, such as sending an email. This is the purpose of telnet, to connect to a port and allow the user to interact with any protocol that accepts clear text communication. In the context of Kali, it’s most handy as a tool to quickly see if a port is open or closed.

You can see the rest of telnet’s options by looking at the man page.

$ man telnet

Closing Thoughts

In this guide, we saw how to install and use telnet on Kali Linux. Although telnet has fallen out of widespread use, it still has its niche as a tool to check for open ports and send clear text communication. It can be used as a reconnaissance tool on Kali, or to send requests to a particular port as an attempt to reveal sensitive information or other vulnerabilities.