12. Mr robot 靶機

一個 ctf 類的靶機 https://www.vulnhub.com/entry/mr-robot-1,151/

信息收集

image-20210620185529688

sS sT 都掃了全端口、sU 掃了 top 1k 端口。有效的就這些。

web 端口

第一眼看上去非常驚豔,看起來及其酷炫。

瀏覽網頁功能。跑目錄。跑爬蟲。送到 burp crawl 嘗試爬取一些信息。

image-20210620191033944

發現一個 名爲 fsocity.dic 的字典,長達 80w 行,太多了,嘗試去重,只剩 1w 多行。

發現 wp 網站,果斷上 wpscan

# 先跑插件,主題,小範圍 id 用戶
wpscan --url=http://192.168.200.150 -e vp,vt,u1-50 --api-token PZZl9BlyoGuWqg8OL9DZRs9fsytsCKs7V3mRlnUeaTA
# 沒法現值得注意的。

# 發現 /wp-login.php 登錄頁面存在用戶名枚舉,嘗試用前面獲取到的字典跑用戶
wpscan --url=http://192.168.200.150 -e u --users-list ../../ztest/uniqueusername --detection-mode passive --users-detection mixed
# 發現三個有效用戶名  elliot:Elliot:ELLIOT

# 進一步用這個字典充當密碼,嘗試跑一下
wpscan --url=http://192.168.200.150 -e u -U Elliot,elliot,ELLIOT -P ../../ztest/uniqueusername --detection-mode passive --users-detection mixed 
# 發現三個用戶憑證相同,都是 ER28-0652

成功獲取管理員後臺。

image-20210620192743802

上傳插件即可獲取 webshell 。

此處我選擇使用的是 msf 自帶的 plugin 上傳模塊。但需要修改下檢測模塊。

ll /usr/share/metasploit-framework/modules/exploits/unix/webapp/wp_admin_shell_upload.rb

image-20210628162557360

$ grep "def wordpress_and_online" -r /usr/share/metasploit-framework/*
/usr/share/metasploit-framework/lib/msf/core/exploit/remote/http/wordpress/base.rb:  def wordpress_and_online?

image-20210628163024426

可以看到判斷是否爲wordpress 主要是正則匹配 wordpress 特有的關鍵詞。而主頁的沒有包含這些關鍵詞,故匹配失敗。解決方法註釋即可。

這個解決方法只是臨時解決方法,,

得到 shell 。

提權

查看其它用戶目錄,發現 robot 用戶目錄下的第二個key ,並且其給出了密碼的md5 ,網上搜索即可得到其對應的密碼abcdefghijklmnopqrstuvwxyz。然後以 robot 用戶登錄,獲取到第二個 key。

image-20210623212655415

上傳 linpeas 腳本,收集到以下信息。

Linux version 3.13.0-55-generic (buildd@brownie) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ) #94-Ubuntu SMP 
Description:    Ubuntu 14.04.2 LTS

image-20210623205841684

集成安裝包的點,無太大利用價值

image-20210621234307341

image-20210621234511040

image-20210623210327534

image-20210621234703998

suid 提權

發現 suid 的nmap ,正好可以通過其提權。

image-20210624091901973

image-20210624092033573

image-20210624092046560

第三個 key

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章