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

108 lines
5.4 KiB
Markdown
Raw Normal View History

# 23 - Pentesting Telnet
2022-04-28 16:01:33 +00: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
<details>
2022-04-28 16:01:33 +00:00
<summary>Support HackTricks</summary>
* 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>
{% endhint %}
2022-04-28 16:01:33 +00:00
<figure><img src="../.gitbook/assets/image (14) (1).png" alt=""><figcaption></figcaption></figure>
2022-04-28 16:01:33 +00:00
**即时可用的漏洞评估和渗透测试设置**。从任何地方运行完整的渗透测试使用20多个工具和功能从侦察到报告。我们不取代渗透测试人员 - 我们开发自定义工具、检测和利用模块以便让他们有更多时间深入挖掘、获取shell并享受乐趣。
2022-04-28 16:01:33 +00:00
{% embed url="https://pentest-tools.com/" %}
2022-04-28 16:01:33 +00:00
2023-08-03 19:12:22 +00:00
## **基本信息**
Telnet是一种网络协议提供了一种不安全的方式让用户通过网络访问计算机。
**默认端口:** 23
2022-05-01 13:25:53 +00:00
```
23/tcp open telnet
```
## **枚举**
### **横幅抓取**
```bash
nc -vn <IP> 23
```
所有有趣的枚举都可以通过 **nmap** 执行:
```bash
nmap -n -sV -Pn --script "*telnet* and safe" -p 23 <IP>
```
The script `telnet-ntlm-info.nse` 将获取 NTLM 信息Windows 版本)。
来自 [telnet RFC](https://datatracker.ietf.org/doc/html/rfc854):在 TELNET 协议中有各种“**选项**”,可以使用“**DO, DON'T, WILL, WON'T**”结构进行授权,以便用户和服务器同意使用更复杂(或许只是不同)的约定集进行 TELNET 连接。这些选项可能包括更改字符集、回显模式等。
**我知道可以枚举这些选项,但我不知道怎么做,所以如果你知道怎么做,请告诉我。**
2023-08-03 19:12:22 +00:00
### [暴力破解](../generic-methodologies-and-resources/brute-force.md#telnet)
2023-08-03 19:12:22 +00:00
## 配置文件
```bash
/etc/inetd.conf
/etc/xinetd.d/telnet
/etc/xinetd.d/stelnet
```
## HackTricks 自动命令
2022-05-01 13:25:53 +00:00
```
2021-08-12 13:37:00 +00: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 17:54:03 +00:00
Entry_1:
2023-08-03 19:12:22 +00:00
Name: Notes
Description: Notes for t=Telnet
Note: |
wireshark to hear creds being passed
tcp.port == 23 and ip.addr != myip
2021-08-15 17:54:03 +00:00
2023-08-03 19:12:22 +00:00
https://book.hacktricks.xyz/pentesting/pentesting-telnet
2021-08-15 17:54:03 +00:00
Entry_2:
2023-08-03 19:12:22 +00:00
Name: Banner Grab
Description: Grab Telnet Banner
Command: nc -vn {IP} 23
2021-08-15 17:54:03 +00:00
Entry_3:
2023-08-03 19:12:22 +00:00
Name: Nmap with scripts
Description: Run nmap scripts for telnet
Command: nmap -n -sV -Pn --script "*telnet*" -p 23 {IP}
Entry_4:
2023-08-03 19:12:22 +00:00
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'
2023-08-03 19:12:22 +00:00
```
<figure><img src="../.gitbook/assets/image (14) (1).png" alt=""><figcaption></figcaption></figure>
2022-04-28 16:01:33 +00:00
**即时可用的漏洞评估和渗透测试设置**。从任何地方运行完整的渗透测试,使用 20 多种工具和功能,从侦察到报告。我们不替代渗透测试人员 - 我们开发自定义工具、检测和利用模块,以便让他们有更多时间深入挖掘、获取 shell 并享受乐趣。
2022-04-28 16:01:33 +00:00
{% embed url="https://pentest-tools.com/" %}
2022-04-28 16:01:33 +00:00
{% hint style="success" %}
学习和实践 AWS 黑客技术:<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks 培训 AWS 红队专家 (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
学习和实践 GCP 黑客技术:<img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks 培训 GCP 红队专家 (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
<details>
2022-04-28 16:01:33 +00:00
<summary>支持 HackTricks</summary>
* 查看 [**订阅计划**](https://github.com/sponsors/carlospolop)!
* **加入** 💬 [**Discord 群组**](https://discord.gg/hRep4RUj7f) 或 [**Telegram 群组**](https://t.me/peass) 或 **在** **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)** 上关注我们。**
* **通过向** [**HackTricks**](https://github.com/carlospolop/hacktricks) 和 [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) GitHub 仓库提交 PR 来分享黑客技巧。
2022-04-28 16:01:33 +00:00
</details>
{% endhint %}