hacktricks/network-services-pentesting/pentesting-telnet.md

122 lines
5.7 KiB
Markdown
Raw Normal View History

2022-05-01 13:25:53 +00:00
# 23 - Pentesting Telnet
2022-04-28 16:01:33 +00:00
2024-07-19 11:08:05 +02:00
{% hint style="success" %}
Learn & practice AWS Hacking:<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
Learn & practice GCP Hacking: <img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="/.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
2022-04-28 16:01:33 +00:00
2024-07-19 11:08:05 +02:00
<details>
2022-04-28 16:01:33 +00:00
2024-07-19 11:08:05 +02:00
<summary>Support HackTricks</summary>
2024-01-02 19:28:27 +01:00
2024-07-19 11:08:05 +02:00
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
2022-04-28 16:01:33 +00:00
</details>
2024-07-19 11:08:05 +02:00
{% endhint %}
2022-04-28 16:01:33 +00:00
2024-08-04 17:08:37 +02:00
<figure><img src="/.gitbook/assets/pentest-tools.svg" alt=""><figcaption></figcaption></figure>
2022-04-28 16:01:33 +00:00
2024-11-09 13:59:32 +01:00
**Get a hacker's perspective on your web apps, network, and cloud**
2024-11-09 13:50:14 +01:00
**Find and report critical, exploitable vulnerabilities with real business impact.** Use our 20+ custom tools to map the attack surface, find security issues that let you escalate privileges, and use automated exploits to collect essential evidence, turning your hard work into persuasive reports.
2022-04-28 16:01:33 +00:00
2024-07-29 11:13:14 +02:00
{% embed url="https://pentest-tools.com/?utm_term=jul2024&utm_medium=link&utm_source=hacktricks&utm_campaign=spons" %}
2022-04-28 16:01:33 +00:00
2022-05-01 13:25:53 +00:00
## **Basic Information**
Telnet is a network protocol that gives users a UNsecure way to access a computer over a network.
**Default port:** 23
2022-05-01 13:25:53 +00:00
```
23/tcp open telnet
```
2022-05-01 13:25:53 +00:00
## **Enumeration**
2022-05-01 13:25:53 +00:00
### **Banner Grabbing**
```bash
nc -vn <IP> 23
```
All the interesting enumeration can be performed by **nmap**:
```bash
nmap -n -sV -Pn --script "*telnet* and safe" -p 23 <IP>
```
2022-05-01 13:25:53 +00:00
The script `telnet-ntlm-info.nse` will obtain NTLM info (Windows versions).
2024-02-08 04:08:28 +01:00
From the [telnet RFC](https://datatracker.ietf.org/doc/html/rfc854): In the TELNET Protocol are various "**options**" that will be sanctioned and may be used with the "**DO, DON'T, WILL, WON'T**" structure to allow a user and server to agree to use a more elaborate (or perhaps just different) set of conventions for their TELNET connection. Such options could include changing the character set, the echo mode, etc.
**I know it is possible to enumerate this options but I don't know how, so let me know if know how.**
2022-05-01 13:25:53 +00:00
### [Brute force](../generic-methodologies-and-resources/brute-force.md#telnet)
2022-05-01 13:25:53 +00:00
## Config file
```bash
/etc/inetd.conf
/etc/xinetd.d/telnet
/etc/xinetd.d/stelnet
```
2022-05-01 13:25:53 +00:00
## HackTricks Automatic Commands
2022-05-01 13:25:53 +00:00
```
2021-08-12 09:37:00 -04:00
Protocol_Name: Telnet #Protocol Abbreviation if there is one.
Port_Number: 23 #Comma separated if there is more than one.
Protocol_Description: Telnet #Protocol Abbreviation Spelled out
2021-08-15 13:54:03 -04:00
Entry_1:
Name: Notes
Description: Notes for t=Telnet
Note: |
wireshark to hear creds being passed
tcp.port == 23 and ip.addr != myip
https://book.hacktricks.xyz/pentesting/pentesting-telnet
Entry_2:
Name: Banner Grab
Description: Grab Telnet Banner
Command: nc -vn {IP} 23
Entry_3:
Name: Nmap with scripts
Description: Run nmap scripts for telnet
Command: nmap -n -sV -Pn --script "*telnet*" -p 23 {IP}
Entry_4:
Name: consoleless mfs enumeration
Description: Telnet enumeration without the need to run msfconsole
Note: sourced from https://github.com/carlospolop/legion
Command: msfconsole -q -x 'use auxiliary/scanner/telnet/telnet_version; set RHOSTS {IP}; set RPORT 23; run; exit' && msfconsole -q -x 'use auxiliary/scanner/telnet/brocade_enable_login; set RHOSTS {IP}; set RPORT 23; run; exit' && msfconsole -q -x 'use auxiliary/scanner/telnet/telnet_encrypt_overflow; set RHOSTS {IP}; set RPORT 23; run; exit' && msfconsole -q -x 'use auxiliary/scanner/telnet/telnet_ruggedcom; set RHOSTS {IP}; set RPORT 23; run; exit'
2021-08-12 09:37:00 -04:00
```
2024-08-04 17:08:37 +02:00
<figure><img src="/.gitbook/assets/pentest-tools.svg" alt=""><figcaption></figcaption></figure>
2022-04-28 16:01:33 +00:00
2024-11-09 13:59:32 +01:00
**Get a hacker's perspective on your web apps, network, and cloud**
2024-11-09 13:50:14 +01:00
**Find and report critical, exploitable vulnerabilities with real business impact.** Use our 20+ custom tools to map the attack surface, find security issues that let you escalate privileges, and use automated exploits to collect essential evidence, turning your hard work into persuasive reports.
2022-04-28 16:01:33 +00:00
2024-07-29 11:13:14 +02:00
{% embed url="https://pentest-tools.com/?utm_term=jul2024&utm_medium=link&utm_source=hacktricks&utm_campaign=spons" %}
2022-04-28 16:01:33 +00:00
2024-07-19 11:08:05 +02:00
{% hint style="success" %}
Learn & practice AWS Hacking:<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
Learn & practice GCP Hacking: <img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="/.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
2022-04-28 16:01:33 +00:00
2024-07-19 11:08:05 +02:00
<details>
2022-04-28 16:01:33 +00:00
2024-07-19 11:08:05 +02:00
<summary>Support HackTricks</summary>
2024-01-02 19:28:27 +01:00
2024-07-19 11:08:05 +02:00
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
2022-04-28 16:01:33 +00:00
</details>
2024-07-19 11:08:05 +02:00
{% endhint %}