2024-07-19 11:24:45 +00:00
|
|
|
|
# 23 - Pentesting Telnet
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
2024-07-19 11:24:45 +00:00
|
|
|
|
{% hint style="success" %}
|
2024-08-04 15:17:39 +00:00
|
|
|
|
学习与实践 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
|
|
|
|
|
2024-07-19 11:24:45 +00:00
|
|
|
|
<details>
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
2024-07-29 09:26:26 +00:00
|
|
|
|
<summary>支持 HackTricks</summary>
|
2024-01-02 22:21:01 +00:00
|
|
|
|
|
2024-07-29 09:26:26 +00:00
|
|
|
|
* 查看 [**订阅计划**](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
|
|
|
|
|
2023-04-30 21:54:03 +00:00
|
|
|
|
</details>
|
2024-07-19 11:24:45 +00:00
|
|
|
|
{% endhint %}
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
2024-08-04 15:17:39 +00:00
|
|
|
|
<figure><img src="/.gitbook/assets/pentest-tools.svg" alt=""><figcaption></figcaption></figure>
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
2024-08-04 15:17:39 +00:00
|
|
|
|
**即时可用的漏洞评估与渗透测试设置**。从任何地方运行完整的渗透测试,使用 20 多种工具和功能,从侦察到报告。我们不替代渗透测试人员 - 我们开发自定义工具、检测和利用模块,以便让他们有更多时间深入挖掘、获取 shell 并享受乐趣。
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
2024-07-29 09:26:26 +00: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
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
## **基本信息**
|
2020-07-15 15:43:14 +00:00
|
|
|
|
|
2024-08-04 15:17:39 +00:00
|
|
|
|
Telnet 是一种网络协议,允许用户以不安全的方式通过网络访问计算机。
|
2020-07-15 15:43:14 +00:00
|
|
|
|
|
2024-03-29 21:06:45 +00:00
|
|
|
|
**默认端口:** 23
|
2022-05-01 13:25:53 +00:00
|
|
|
|
```
|
2020-07-15 15:43:14 +00:00
|
|
|
|
23/tcp open telnet
|
|
|
|
|
```
|
2024-01-02 22:21:01 +00:00
|
|
|
|
## **枚举**
|
2020-07-15 15:43:14 +00:00
|
|
|
|
|
2024-01-02 22:21:01 +00:00
|
|
|
|
### **横幅抓取**
|
2020-07-15 15:43:14 +00:00
|
|
|
|
```bash
|
|
|
|
|
nc -vn <IP> 23
|
|
|
|
|
```
|
2024-07-19 11:24:45 +00:00
|
|
|
|
所有有趣的枚举都可以通过 **nmap** 执行:
|
2020-07-15 15:43:14 +00:00
|
|
|
|
```bash
|
|
|
|
|
nmap -n -sV -Pn --script "*telnet* and safe" -p 23 <IP>
|
|
|
|
|
```
|
2024-07-19 11:24:45 +00:00
|
|
|
|
The script `telnet-ntlm-info.nse` 将获取 NTLM 信息(Windows 版本)。
|
2024-02-08 04:42:06 +00:00
|
|
|
|
|
2024-08-04 15:17:39 +00:00
|
|
|
|
来自 [telnet RFC](https://datatracker.ietf.org/doc/html/rfc854):在 TELNET 协议中有各种“**选项**”,可以使用“**DO, DON'T, WILL, WON'T**”结构进行授权,以便用户和服务器同意使用更复杂(或可能只是不同)的约定集进行 TELNET 连接。这些选项可能包括更改字符集、回显模式等。
|
2020-07-15 15:43:14 +00:00
|
|
|
|
|
2024-07-19 11:24:45 +00:00
|
|
|
|
**我知道可以枚举这些选项,但我不知道怎么做,所以如果你知道怎么做,请告诉我。**
|
2020-07-15 15:43:14 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
### [暴力破解](../generic-methodologies-and-resources/brute-force.md#telnet)
|
2020-07-15 15:43:14 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
## 配置文件
|
2020-07-15 15:43:14 +00:00
|
|
|
|
```bash
|
|
|
|
|
/etc/inetd.conf
|
|
|
|
|
/etc/xinetd.d/telnet
|
|
|
|
|
/etc/xinetd.d/stelnet
|
|
|
|
|
```
|
2024-07-19 11:24:45 +00:00
|
|
|
|
## 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}
|
|
|
|
|
|
2022-07-01 13:10:24 +00:00
|
|
|
|
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'
|
2021-08-14 09:02:12 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
```
|
2024-08-04 15:17:39 +00:00
|
|
|
|
<figure><img src="/.gitbook/assets/pentest-tools.svg" alt=""><figcaption></figcaption></figure>
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
2024-08-04 15:17:39 +00:00
|
|
|
|
**即时可用的漏洞评估和渗透测试设置**。从任何地方运行完整的渗透测试,提供20多种工具和功能,从侦察到报告。我们不替代渗透测试人员 - 我们开发自定义工具、检测和利用模块,以便让他们有更多时间深入挖掘、获取shell并享受乐趣。
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
2024-07-29 09:26:26 +00: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:24:45 +00:00
|
|
|
|
{% hint style="success" %}
|
2024-08-04 15:17:39 +00:00
|
|
|
|
学习和实践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
|
|
|
|
|
2024-07-19 11:24:45 +00:00
|
|
|
|
<details>
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
2024-08-04 15:17:39 +00:00
|
|
|
|
<summary>支持HackTricks</summary>
|
2024-01-02 22:21:01 +00:00
|
|
|
|
|
2024-08-04 15:17:39 +00:00
|
|
|
|
* 查看[**订阅计划**](https://github.com/sponsors/carlospolop)!
|
|
|
|
|
* **加入** 💬 [**Discord群组**](https://discord.gg/hRep4RUj7f)或[**电报群组**](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>
|
2024-07-19 11:24:45 +00:00
|
|
|
|
{% endhint %}
|