Joker
Enumeration
Nmap
扫描发现对外开放了22,3128两个端口,使用nmap扫描端口详细信息
┌──(kali㉿kali)-[~/vegetable/HTB/Linux/Joker]
└─$ nmap -sC -sV -p 22,3128 -oA nmap 10.10.10.21 -Pn
Starting Nmap 7.93 ( https://nmap.org ) at 2024-01-09 05:37 EST
Nmap scan report for 10.10.10.21
Host is up (0.35s latency).PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.3p1 Ubuntu 1ubuntu0.1 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 8824e357109f1b173d7af3263db6334e (RSA)
| 256 76b6f60800bd68ce97cb08e777693d8a (ECDSA)
|_ 256 dc91e48dd016cecf3d91820923a7dc86 (ED25519)
3128/tcp open http-proxy Squid http proxy 3.5.12
|_http-title: ERROR: The requested URL could not be retrieved
|_http-server-header: squid/3.5.12
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernelService detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 29.92 seconds
22端口运行着ssh服务,而3128端口只是一个squid代理,在foxy proxy中配置 ip 和端口,但是依然无法访问
考虑到刚开始设置了 -sT 参数只扫描了TCP端口,所以尝试扫描UDP端口,然后发现了69端口也对外开放
┌──(kali㉿kali)-[~/vegetable/HTB/Linux/Joker]
└─$ sudo nmap -sC -sV -sU -p 69 10.10.10.21 -Pn
[sudo] password for kali:
Starting Nmap 7.93 ( https://nmap.org ) at 2024-01-09 05:44 EST
Nmap scan report for 10.10.10.21
Host is up.PORT STATE SERVICE VERSION
69/udp open|filtered tftpService detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 118.69 seconds
可以看到69端口运行的是tftp服务,这还是比较有用处的
TFTP代表Trivial File Transfer Protocol(简单文件传输协议),是一种用于在计算机网络上进行文件传输的协议。TFTP设计得非常简单,用于在客户端和服务器之间传输小文件,通常用于引导(bootstrapping)和配置设备,例如路由器、交换机和其他网络设备。
TFTP
连接tftp协议,尝试获取/etc/passwd文件,却被告知Access violation
┌──(kali㉿kali)-[~/vegetable/HTB/Linux/Joker]
└─$ tftp 10.10.10.21
tftp> get /etc/passwd
Error code 2: Access violation
使用get下载任意文件失败,又想到刚才的squid代理,考虑回到3128端口进行进一步枚举,搜索发现squid的配置文件默认路径为 /etc/squid/squid.conf ,尝试利用tftp协议下载该文件,成功下载该文件后,可以看到squid的版本信息为 3.5.12,其中引用了 /etc/squid/passwords ,尝试下载该文件
┌──(kali㉿kali)-[~/vegetable/HTB/Linux/Joker]
└─$ cat passwords
kalamari:$apr1$zyzBxQYW$pL360IoLQ5Yum5SLTph.l0
直接使用 john 破解 hash 时显示“No password hashes left to crack (see FAQ)”,但是使用 root 权限(sudo)运行时没有报错,结果如下所示,获得用户名密码 kalamari : ihateseafood
┌──(kali㉿kali)-[~/vegetable/HTB/Linux/Joker]
└─$ sudo john passwords --wordlist=/usr/share/wordlists/rockyou.txt
[sudo] password for kali:
Created directory: /root/.john
Warning: detected hash type "md5crypt", but the string is also recognized as "md5crypt-long"
Use the &