23 - Pentesting Telnet

Reading time: 3 minutes

tip

学习和实践 AWS 黑客技术:HackTricks Training AWS Red Team Expert (ARTE)
学习和实践 GCP 黑客技术:HackTricks Training GCP Red Team Expert (GRTE)

支持 HackTricks

基本信息

Telnet 是一种网络协议,允许用户以不安全的方式通过网络访问计算机。

默认端口: 23

23/tcp open  telnet

枚举

横幅抓取

bash
nc -vn <IP> 23

所有有趣的枚举都可以通过 nmap 执行:

bash
nmap -n -sV -Pn --script "*telnet* and safe" -p 23 <IP>

脚本 telnet-ntlm-info.nse 将获取 NTLM 信息(Windows 版本)。

来自 telnet RFC:在 TELNET 协议中有各种 "options",可以使用 "DO, DON'T, WILL, WON'T" 结构进行授权,以便用户和服务器同意使用更复杂(或可能只是不同)的约定集进行 TELNET 连接。这些选项可能包括更改字符集、回显模式等。

我知道可以枚举这些选项,但我不知道怎么做,所以如果你知道怎么做,请告诉我。

Brute force

Config file

bash
/etc/inetd.conf
/etc/xinetd.d/telnet
/etc/xinetd.d/stelnet

HackTricks 自动命令

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

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.wiki/en/network-services-pentesting/pentesting-telnet.html

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'

tip

学习和实践 AWS 黑客技术:HackTricks Training AWS Red Team Expert (ARTE)
学习和实践 GCP 黑客技术:HackTricks Training GCP Red Team Expert (GRTE)

支持 HackTricks