On October 1, 2016 – Krebs on Security reported that the source code for the Internet of Things (IoT) botnet malware Mirai had been posted online and was freely available for download. Mirai reportedly spreads through Telnet brute-forcing, indicating that this a current, on-going issue. But what is Telnet and what are the implications of its use?
How The Mirai Malware Uses The Telnet Protocol
As a user, the Internet appears to consist predominately of websites and the servers that support them. It is easy to miss the enormous range of systems that are beneath the surface. In this article, we will plumb the depths of the Internet a little to see what goes on behind the scenes.
While there are almost 14 million devices on the current Internet using the Secure Shell (SSH) protocol to encrypt remote machine access, there are still over 15 million devices using the Telnet protocol.
Telnet was deprecated in favour of SSH as Telnet sends credentials (username/password) in clear-text and any attacker on that network path can intercept the credentials. Additionally, Telnet rarely has brute-force protection enabled so attackers can take their time sending well-known username/password combinations to a device in order to attempt to gain access.
Telnet, however, has other interesting angles to it for security research. As it has been deprecated, it is typically still visible on legacy equipment, in particular network infrastructure equipment. In short, Telnet typically appears on older network equipment. This is very helpful shorthand for an attacker.
The equipment in question falls into a number of basic categories:
- Routers, Firewalls and VPNs for organizations
- Home Routers
- (Industrial) Control Systems
- Miscellaneous devices
One major issue for older network equipment running telnet, is that they typically do not have the same security engineering practices as modern devices. For example, default credentials. Whilst many devices unfortunately still ship with default credentials, some devices even advertise that they are currently configured to use them!
The routers of one well-known manufacturer have default administrator credentials detailed in the telnet banner. Our research has yielded over 20,000 of these devices currently connected to the Internet, some of which were from within government departments.
Home routers are an attractive target for people attempting to make DDoS botnets as vulnerabilities that these devices have are frequently wormable. That is, a piece of code can be deployed which autonomously seeks out vulnerable devices, compromises them and uses these freshly compromised devices as launching pads for the next wave of attacks.
In a twist of events, one worm infecting Linux home routers, called Wifatch or REINCARNA, actually displays a warning message on the Telnet banner that the device has been infected and provides instructions for how the user can protect him or herself. Our research indicated over 82,000 infected devices that were infected by REINCARNA. The banner is displayed below:
“Telnet and other backdoors have been closed to avoid further infection of this device. Please disable telnet, change root/admin passwords, and/or update the firmware.”
The Telnet banner is also often used to issue legal threats, for example, “PRIVATE ELECTRONIC DEVICE” yields 139 results. The threat of “imprisonment” is also wielded by 3048 devices. Military systems have their own kinds of banners informing the user that information on its usage is collected “or purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct, law enforcement, and counterintelligence investigations.”
Other more esoteric devices such as Automatic Number Plate Recognition (64 devices), 3G backup routers (31 devices), GPRS modems (33 devices) and cable set-top boxes (213 devices). The full numbers are naturally much higher, but we simply want to demonstrate the diversity of devices connected to the public Internet.
Our research shows that legacy network protocols can still endanger us today. The combination of cleartext passwords – such as no encryption, default or weak credentials – and ease of brute-forcing make Telnet an attractive target. Coupled to that is the fact that Telnet is still often enabled on network devices. The perfect storm? It remains to be seen.