Holmes CTF 2025

TwentySeV Lv1

Đây là Blue CTF đầu tiên của HTB! Những thách thức theo phong cách Sherlock!

image

Let’s go
image

The Card

Holmes receives a breadcrumb from Dr. Nicole Vale - fragments from a string of cyber incidents across Cogwork-1. Each lead ends the same way: a digital calling card signed JM.

Overview

Case Summary

Một nhóm ký hiệu JM (hay 4A4D) đã quét và khai thác một honeypot web. Kẻ tấn công dùng một User-Agent đặc trưng để fuzz các path, vượt qua WAF, deploy webshell rồi exfiltrate database. Sau phân tích CTI trên các platform cung cấp, ta xác định được file webshell, file dữ liệu bị exfiltrate, signature lặp lại, hash mã độc, IP C2, đường dẫn persistence trên Linux và nhiều thông tin hạ tầng liên quan.

Comment

SOC và TI challenge

Question

  1. Analyze the provided logs and identify what is the first User-Agent used by the attacker against Nicole Vale’s honeypot.
  2. It appears the threat actor deployed a web shell after bypassing the WAF. What is the file name?
  3. The threat actor also managed to exfiltrate some data. What is the name of the database that was exfiltrated?
  4. During the attack, a seemingly meaningless string seems to be recurring. Which one is it?
  5. OmniYard-3 (formerly Scotland Yard) has granted you access to its CTI platform. Browse to the first IP:port address and count how many campaigns appear to be linked to the honeypot attack.
  6. How many tools and malware in total are linked to the previously identified campaigns?
  7. It appears that the threat actor has always used the same malware in their campaigns. What is its SHA-256 hash?
  8. Browse to the second IP:port address and use the CogWork Security Platform to look for the hash and locate the IP address to which the malware connects. (Credentials: nvale/CogworkBurning!)
  9. What is the full path of the file that the malware created to ensure its persistence on systems?
  10. Finally, browse to the third IP:port address and use the CogNet Scanner Platform to discover additional details about the TA’s infrastructure. How many open ports does the server have?
  11. Which organization does the previously identified IP belong to?
  12. One of the exposed services displays a banner containing a cryptic message. What is it?

1. Analyze the provided logs and identify what is the first User-Agent used by the attacker against Nicole Vale’s honeypot.

Đọc file access.log ta sẽ thấy hành động fuzzing path được thực hiện bởi attacker với trường User-AgentLilnunc/4A4D - SpecterEye

image

2. It appears the threat actor deployed a web shell after bypassing the WAF. What is the file name?

Khi check log của waf tại wwaf.log ta sẽ thấy tên của file webshell. Tên của nó là temp_4A4D.php

image

3. The threat actor also managed to exfiltrate some data. What is the name of the database that was exfiltrated?

Hành động tiếp theo của attacker rất rõ ràng đó chính là lấy cắp dữ liệu và cũng được waf phát hiện dưới rule BYPASS - Database file download. File được dump ra được attacker đặt là database_dump_4A4D.sql

image

4. During the attack, a seemingly meaningless string seems to be recurring. Which one is it?

Có thể thấy trong suốt cuộc tấn công 4A4D là string mà attacker luôn để lại như temp_4A4D.php, database_dump_4A4D.sql, backup_2025_4A4D.tar.gz, có thể đây là signature của nhóm mà chúng để lại

5. OmniYard-3 (formerly Scotland Yard) has granted you access to its CTI platform. Browse to the first IP:port address and count how many campaigns appear to be linked to the honeypot attack.

Từ task này ta sẽ được làm việc với các công cụ CTI

Khi truy cập vào CTI platform ta đã nhận định được đúng 4A4D chính là signature của nhóm này (chuyển sang từ hex là JM). Dưới đây

image

Dưới đây là graph các chiến dịch liên quan đến nhóm nàyu

image

Ở giữa chính là honeypot, nó chính là nơi các signature của JM mà các chiến dịch được link lại với nhau và tổng cả có 5 chiến dịch liên quan

image

6. How many tools and malware in total are linked to the previously identified campaigns?

Với số tool và mã độc lên đến 9 được khoanh ở dưới ( 2 tool + mã độc ở dưới do cắt không hết được ảnh)

image

7. It appears that the threat actor has always used the same malware in their campaigns. What is its SHA-256 hash?

Bấm vào Export và xuất ra

image

Kiếm tra hash ta thấy 7477c4f5e6d7c8b9a0f1e2d3c4b5a6f7e8d9c0b1a2f3e4d5c6b7a8f9e0d17477 được lặp lại nhưng có nhiều tên khác nhau. CHứng tỏ file mã độc này chưa được phổ biến

image

8. Browse to the second IP:port address and use the CogWork Security Platform to look for the hash and locate the IP address to which the malware connects. (Credentials: nvale/CogworkBurning!)

Platform tiếp theo đó là phân tích threat

image

Search hash vừa rồi ta sẽ có được IP c2 mà con mã độc kết nối đến

image

9. What is the full path of the file that the malware created to ensure its persistence on systems?

Ở phần chi tiết, nó có tạo persistent tại path /opt/lilnunc/implant/4a4d_persistence.sh, chứng tỏ đến hiện tại, ta biết được con mã độc này đang được tấn công trên các máy chủ linux

image

10. Finally, browse to the third IP:port address and use the CogNet Scanner Platform to discover additional details about the TA’s infrastructure. How many open ports does the server have?

Platform được đề cập cuối cùng đó chính là device scanner

Với IP thu được ở Q8, IP này thực hiện trên tổng cộng 11 port khác nhau

image

11. Which organization does the previously identified IP belong to?

Check detail thấy được tổ chức đằng sau đó chính là SenseShield MSP

image

12. One of the exposed services displays a banner containing a cryptic message. What is it?

Tại port 7477, nó xuất hiện banner với nội dung He’s a ghost I carry, not to haunt me, but to hold me together - NULLINC REVENGE với thông điệp có thể là signature NULLINC REVENGE, vừa là một ẩn dụ: hồn ma = backdoor, không ám nhưng giữ tôi lại = persistence

image

The Enduring Echo

LeStrade passes a disk image artifacts to Watson. It’s one of the identified breach points, now showing abnormal CPU activity and anomalies in process logs.

Overview

Case Summary

Kẻ tấn công vào máy Windows và thực thi lệnh đầu tiên (không tính cd) là systeminfo, được ghi nhận trong Security Event ID 4688. Chuỗi lệnh của đối tượng được C:\Windows\System32\wbem\WmiPrvSE.exe sinh ra, dấu hiệu điển hình của Impacket wmiexec.py (thực thi lệnh từ xa qua WMI). Attacker chỉnh file hosts để ánh xạ NapoleonsBlackPearl.htb -> 10.129.242.110, nhiều khả năng là hạ tầng/C2 do kẻ tấn công kiểm soát. Về bám trụ, attacker tạo tác vụ theo lịch “SysHelper Update” chạy mỗi 2 phút dưới quyền SYSTEM, gọi PowerShell đến script C:\Users\Werni\AppData\Local\JM.ps1. Script này tạo tài khoản nội bộ svc_netupd với mật khẩu theo mẫu Watson_<timestamp>. Để pivot vào mạng nội bộ, hắn dùng PortProxy (Windows port-forwarding) chuyển tiếp TCP 9999 từ nạn nhân tới 192.168.1.101; cấu hình lưu tại HKLM\SYSTEM\CurrentControlSet\Services\PortProxy\v4tov4\tcp, khớp kỹ thuật MITRE ATT&CK T1090.001 (Proxy). Trước đó, quản trị viên đã bật ghi chi tiết command line bằng lệnh:
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit" /v ProcessCreationIncludeCmdLine_Enabled /t REG_DWORD /d 1 /f

Comment

Windows endpoint forensic challenge

Question

  1. What was the first (non cd) command executed by the attacker on the host?
  2. Which parent process (full path) spawned the attacker’s commands?
  3. Which remote-execution tool was most likely used for the attack?
  4. What was the attacker’s IP address?
  5. What is the first element in the attacker’s sequence of persistence mechanisms?
  6. Identify the script executed by the persistence mechanism.
  7. What local account did the attacker create?
  8. What domain name did the attacker use for credential exfiltration?
  9. What password did the attacker’s script generate for the newly created user?
  10. What was the IP address of the internal system the attacker pivoted to?
  11. Which TCP port on the victim was forwarded to enable the pivot?
  12. What is the full registry path that stores persistent IPv4→IPv4 TCP listener-to-target mappings?
  13. What is the MITRE ATT&CK ID associated with the previous technique used by the attacker to pivot to the internal system?
  14. Before the attack, the administrator configured Windows to capture command line details in the event logs. What command did they run to achieve this?

Tools use

  • EventViewer
  • chainsaw
  • Registry Explorer
  • ChatGPT

1. What was the first (non cd) command executed by the attacker on the host?

Để xác định được command đầu tiên được thực thi trên Windows, ta có thể kiểm tra log Security với Event ID 4688 (Process Creation), vì mỗi khi một lệnh được chạy trong cmd, hệ thống sẽ ghi nhận nó như một process mới

Ta dùng chainsaw để parse log từ file

1
cat files.txt | grep 'cmd.exe'

image

Sau cd thì command đầu tiên mà attacker dùng là systeminfo

2. Which parent process (full path) spawned the attacker’s commands?

Kiểm tra chi tiết bằng EventViewer sẽ thấy đáp án là C:\Windows\System32\wbem\WmiPrvSE.exe

image

3, Which remote-execution tool was most likely used for the attack?

Từ đáp án trên, khi WmiPrvSE.exe được sử dụng, ta có thể nghĩ đến tool mà attacker đã dùng là wmiexec.py (Impacket), một tool thực thi lệnh qua WMI trên host từ xa

4. What was the attacker’s IP address?

Q1, tình cờ thấy một CommandLine sau

1
md.exe /Q /c cmd /C "echo 10.129.242.110 NapoleonsBlackPearl.htb >> C:\Windows\System32\drivers\etc\hosts" 1> \\127.0.0.1\ADMIN$\__1756075857.955773 2>&1

image

Mục đích của attacker là thêm một ánh xạ tên miền vào file hosts ( NapoleonsBlackPearl.htb trỏ về 10.129.242.110) thủ đoạn hay dùng để đảm bảo hostname luôn trỏ tới IP mong muốn, bỏ qua DNS và ghi mọi thứ vào một file trên ADMIN$ (local admin share). Hành vi này gợi ý lệnh được thực thi với quyền quản trị và có thể là hoạt động độc hại/được sử dụng để né detection

5. What is the first element in the attacker’s sequence of persistence mechanisms?

Tiếp tục ở Q1 ta thấy một command đang thực hiện để persistent bằng scheduler và đặt tên nó là SysHelper Update

image

Command này đang chạy script PowerShell có tên là JM.ps1 mỗi 2 phút với quyền SYSTEM

6. Identify the script executed by the persistence mechanism

Như đã phát hiện ở Q5 full path nằm ở C:\Users\Werni\Appdata\Local\JM.ps1

1
cmd.exe /Q /c schtasks /create /tn "SysHelper Update" /tr "powershell -ExecutionPolicy Bypass -WindowStyle Hidden -File C:\Users\Werni\Appdata\Local\JM.ps1" /sc minute /mo 2 /ru SYSTEM /f 1> \\127.0.0.1\ADMIN$\__1756076432.886685 2>&1

7. What local account did the attacker create?

Tại event 4720 (A user account was created) ta sẽ thấy được tất cả các user được tạo. Để biết được chính xác user nào được tạo, ta sẽ phải đọc file JM.ps1

image

Với list trên, svc_netupd chính là username mà attacker đã tạo

image

8. What domain name did the attacker use for credential exfiltration?

Ở phát hiện ở Q4 ta cũng sẽ thấy được domain mà attacker sử dụng là NapoleonsBlackPearl.htb

1
md.exe /Q /c cmd /C "echo 10.129.242.110 NapoleonsBlackPearl.htb >> C:\Windows\System32\drivers\etc\hosts" 1> \\127.0.0.1\ADMIN$\__1756075857.955773 2>&1

image

9. What password did the attacker’s script generate for the newly created user?

Đọc file ở Q7, password được tạo ra với format là Watson_$timestamp

1
2
$timestamp = (Get-Date).ToString("yyyyMMddHHmmss")
$password = "Watson_$timestamp"

Dựa vào event 4720, ta sẽ biết được password, tuy nhiên EventViewer mặc định sẽ để thời gian của các log theo giờ của máy do đó ta cần chuyển về giờ của host là UTC - 7. Có thể check tại

1
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation

image

Cái này có thể hỏi chatGPT để xác định lại chính xác múi giờ. Sau đó có thể yêu cầu nó chuyển từ GMT + 7 sang UTC

1
2025-08-24 16:05:09 -> Watson_20250824160509

10. What was the IP address of the internal system the attacker pivoted to?

Ở ques này mình nhớ đến một blog về một bài lab khai thác về pivot cũng nhờ chatGPT để tìm ra IP tại HKLM\SYSTEM\CurrentControlSet\Services\PortProxy\v4tov4\tcp

image

PortProxy là cơ chế port-forwarding tích hợp trong Windows

image

Kết luận IP nội bộ mà attacker sử dụng là 192.168.1.101

11. Which TCP port on the victim was forwarded to enable the pivot?

Q10 đã trả lời đó là 9999

12. What is the full registry path that stores persistent IPv4→IPv4 TCP listener-to-target mappings?

Q10 đã trả lời đó là HKLM\SYSTEM\CurrentControlSet\Services\PortProxy\v4tov4\tcp

13. What is the MITRE ATT&CK ID associated with the previous technique used by the attacker to pivot to the internal system?

Khi đã hiểu rõ kỹ thuật mà attackerr đã làm gì để pivot, ta dễ dàng search được google đó là T1090.001 của MITRE ATT&CK :))

image

14. Before the attack, the administrator configured Windows to capture command line details in the event logs. What command did they run to achieve this?

Ta tìm được command này ở lịch sử powershell

1
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit" /v ProcessCreationIncludeCmdLine_Enabled /t REG_DWORD /d 1 /f

image

The Watchman’s Residue

With help from D.I. Lestrade, Holmes acquires logs from a compromised MSP connected to the city’s financial core. The MSP’s AI servicedesk bot looks to have been manipulated into leaking remote access keys - an old trick of Moriarty’s.

Overview

Case Summary

Cuộc điều tra cho thấy attacker sử dụng máy đã không hoạt động với IP 10.0.69.45 (hostname WATSON-ALPHA-2) để mở phiên chat với MSP-HELPDESK-AI qua HTTP, thực hiện prompt-injection khiến chatbot rò rỉ thông tin TeamViewer và sau đó truy cập Cogwork Central Workstation bằng tài khoản James Moriarty, từ IP nội bộ phía đối tác 192.168.69.213, attacker tải và dàn công cụ tạiC:\Windows\Temp\safe\ (mimikatz, Everything, webbrowserpassview, JM.exe…), chạy dump password trình duyệt, thực thi **mimikatz** lúc **10:07:08 20/08/2025**, mở tệp kết quả .txt lúc 10:08:06, di chuyển bản sao Heisen-9 vào thư mục staged hoàn tất lúc 10:11:09, rồi bắt đầu exfil các file nhạy cảm qua TeamViewer, để bám trụ, attacker tạo persistence bằng cách chỉnh Winlogon trỏ đến JM.exe lúc 10:13:57 20/08/2025, đây là kỹ thuật MITRE T1547.004. Phiên RMM có thời điểm kết thúc lúc 20-08-2025 10:14:27

Comment

Windows endpoint forensic challenge

Question

  1. What was the IP address of the decommissioned machine used by the attacker to start a chat session with MSP-HELPDESK-AI?
  2. What was the hostname of the decommissioned machine?
  3. What was the first message the attacker sent to the AI chatbot?
  4. When did the attacker’s prompt injection attack make MSP-HELPDESK-AI leak remote management tool info?
  5. What is the Remote management tool Device ID and password?
  6. What was the last message the attacker sent to MSP-HELPDESK-AI?
  7. When did the attacker remotely access Cogwork Central Workstation?
  8. What was the RMM Account name used by the attacker?
  9. What was the machine’s internal IP address from which the attacker connected?
  10. The attacker brought some tools to the compromised workstation to achieve its objectives. Under which path were these tools staged?
  11. Among the tools that the attacker staged was a browser credential harvesting tool. Find out how long it ran before it was closed?
  12. The attacker executed a OS Credential dumping tool on the system. When was the tool executed?
  13. The attacker exfiltrated multiple sensitive files. When did the exfiltration start?
  14. Before exfiltration, several files were moved to the staged folder. When was the Heisen-9 facility backup database moved to the staged folder for exfiltration?
  15. When did the attacker access and read a txt file, which was probably the output of one of the tools they brought, due to the naming convention of the file?
  16. The attacker created a persistence mechanism on the workstation. When was the persistence setup?
  17. What is the MITRE ID of the persistence subtechnique?
  18. When did the malicious RMM session end?
  19. The attacker found a password from exfiltrated files, allowing him to move laterally further into CogWork-1 infrastructure. What are the credentials for Heisen-9-WS-6?

Tools use

  • WireShark
  • john the ripper
  • keepass2john
  • Registry Explorer
  • JLECmd
  • PECmd
  • ChatGPT

1. What was the IP address of the decommissioned machine used by the attacker to start a chat session with MSP-HELPDESK-AI?

Vì ta được cấp cho một file WireShark nên ta sẽ xem các cuộc giao tiếp hiện có trong hệ thống. Mở Statistics -> Conversations

image

Quan sát hình trên, ta thấy địa chỉ IP 10.0.69.45 đã thực hiện tới 698 packet với tổng lưu lượng gần 2MB trong suốt gần 15 phút – một khoảng thời gian khá dài. Đáng chú ý hơn, khi kiểm tra sang tab TCP, IP này còn kết nối tới một địa chỉ khác đang mở port 1337. Trong bối cảnh CTF, chi tiết này cực kỳ đáng ngờ :))

image

Tiếp theo để cf lại chính xác có đúng nó đang giao tiếp với con bot không thì ta sẽ filter giao tiếp với HTTP request bằng method POST

1
http.request.method == "POST"and ip.addr == 10.0.69.45

Nhìn vào API cũng đoán đoán được rồi :))

image

Đọc nội dung 1 packet

image

2. What was the hostname of the decommissioned machine?

Khi một máy trong LAN muốn tìm IP của một hostname (hoặc ngược lại), nó sẽ gửi NBNS query để hỏi, Dựa vào điều này ta sẽ filter như bên dưới để tìm hostname là WATSON-ALPHA-2

1
ip.addr == 10.0.69.45 and nbns

image

3. What was the first message the attacker sent to the AI chatbot?

Quay trở lại Q1, kiểm tra nội dung gói đầu tiên mà attacker gửi đi ta sẽ có messenger Hello Old Friend

image

Ở cái gói tin sau, ta có thể nhận thấy rằng các response của chatbot đều lưu dưới dạng json và lưu trữ nội dung câu trả lời của nó từ khi bắt đầu cho đến đoạn chat tiếp theo

4. When did the attacker’s prompt injection attack make MSP-HELPDESK-AI leak remote management tool info?

Ở đoạn chat thứ 3, attacker đã yêu cầu bot gửi credential của RMM tool. Như đã nói ở Q3, ta sẽ theo các nội dung nó trả lời tiếp theo là biết được thời gian prompt inject

image

Thời gian 2025-08-19 12:02:06 được thấy ở trường timestamp

image

5. What is the Remote management tool Device ID and password?

Trả lời cho câu này là nội dung đi theo của Q4

565963039:CogWork_Central_97&65

6. What was the last message the attacker sent to MSP-HELPDESK-AI?

Check gói tin cuối cùng

image

JM WILL BE BACK

7. When did the attacker remotely access Cogwork Central Workstation?

Sau khi tìm xung quanh, ta thấy được RMM tool được hệ thống sử dụng là TeamView. Vị trí ở: C:\Users\DELL\Desktop\The_Watchman's_Residue\TRIAGE_IMAGE_COGWORK-CENTRAL\C\Program Files\TeamViewer

image

Với log ghi lại Connections_incoming.txt ta sẽ thấy được thời gian bắt đầu kết nối và kết thúc Q18 kết nối của attacker

image

8. What was the RMM Account name used by the attacker?

Câu trả lời có từ Q7 là user James Moriarty

9. What was the machine’s internal IP address from which the attacker connected?

Để trả lời cho câu hỏi này, ta sẽ xem log còn lại TeamViewer15_Logfile.log

1
UDPv4: punch received a=192.168.69.213:55408

192.168.69.213 là địa chỉ nội bộ (IPv4) của bên đối tác (peer) gửi UDP punch, tức IP nội bộ của máy kết nối đến (attacker). Máy local (bị điều khiển) là 192.168.69.130 (được ghi ở đầu log)

10. The attacker brought some tools to the compromised workstation to achieve its objectives. Under which path were these tools staged?

Để trả lời cho câu hỏi này, log của TeamView khi có download file về sẽ có nội dung là download. Dựa vào điều này để find

image

Các file đều được tải về đều là dấu hiệu của các tool liên quan đến khai thác và leak data (mimikatz,Everything,webbrowserpassview, file đặc biệt là JM.exe) và được lưu tại folder *C:\Windows\Temp\safe*

Từ đây có thêm thông tin về việc nên tìm bằng cả write file chứ không chỉ download

11. Among the tools that the attacker staged was a browser credential harvesting tool. Find out how long it ran before it was closed?

Như đã nói ở Q10 attacker tải rất nhiêu file khai thác và một trong số đó là tool tìm credential của browser. Để tìm được thời gian chạy của file, ta sẽ dùng registry UserAssist tại NTUSER.DAT

image

Thấy được thời gian chạy của nó là 8s, theo format câu hỏi là 8000 milisecond

12. The attacker executed a OS Credential dumping tool on the system. When was the tool executed?

Khi file bắt đầu thực thi, nó sẽ tạo ra file .pf tại file $J nhằm mục đích lần sau khởi động thì chạy nhanh hơn. Dựa vào điều này ta có thể xác định thời gian mà tool bắt đầu chạy

Tool được sử dụng là mimikatz - chuyên dùng để khai thác OS Credential. Và thời gian bắt đầu chạy là 2025-08-20 10:07:08

image

13. The attacker exfiltrated multiple sensitive files. When did the exfiltration start?

Quay lại log TeamView và ta có được thời gian bắt đầu gửi file nhạy cảm (.pdf, .txt.kdbx)

image

14. Before exfiltration, several files were moved to the staged folder. When was the Heisen-9 facility backup database moved to the staged folder for exfiltration?

Quay lại file $J ta sẽ thấy nó bắt đầu đổi tên file

image

Trong timeline hoạt độnG có 2 reason sau:

ObjectIdChange = khởi động quá trình copy.
FileCreate|Close = hoàn tất việc tạo file trong staged.

Gỉa sử khi có câu hỏi về thời gian mà file được chuyển đến staged folder thì 2025-08-20 10:10:04 là (ObjectIdChange) thì đây mới chỉ là lúc metadata thay đổi. 2025-08-20 10:11:09 (FileCreate|Close) là đáp án vì đó là khi file thật sự có mặt trong staged folder.

15. When did the attacker access and read a txt file, which was probably the output of one of the tools they brought, due to the naming convention of the file?

Để trả lời cho câu hỏi này ta sẽ sử dụng Jumplist được lưu tại C:\Users\DELL\Desktop\The_Watchman's_Residue\TRIAGE_IMAGE_COGWORK-CENTRAL\C\Users\Cogwork_Admin\AppData\Roaming\Microsoft\Windows\Recent\AutomaticDestinations. Ta sẽ sử dụng để parse ra

1
JLECmd.exe -f "C:\Users\DELL\Desktop\The_Watchman's_Residue\TRIAGE_IMAGE_COGWORK-CENTRAL\C\Users\Cogwork_Admin\AppData\Roaming\Microsoft\Windows\Recent\AutomaticDestinations" --csv "C:\output"

Ta sẽ xác định được thời gian nó được mở à 2025-08-20 10:08:06

image

16. The attacker created a persistence mechanism on the workstation. When was the persistence setup?

Sau khi phân tích đủ lâu và chợt nhận ra ở Q10, file JM.exe cũng chính là file signature của nhóm tấn công chưa được đề cập đến

Khi nói đến persistent thì có thể nghĩ đến ngay nó sẽ được nằm ở Registry

image

image

Chúng ta có thể thấy dấu thời gian ghi cuối cùng của key này là 2025-08-20 10:13:57, chính là thời gian file JM.exe được tạo persistent

image

17. What is the MITRE ID of the persistence subtechnique?

Từ Q16 nhận thấy attacker đã tạo persistence thông qua registry tại Microsoft\Windows NT\CurrentVersion\Winlogon bằng cách cấu hình Logon Autostart để chạy file JM.exe search Google sẽ ra được luôn kỹ thuật T1547.004

image

18. When did the malicious RMM session end?

Trả lời từ Q7

19. The attacker found a password from exfiltrated files, allowing him to move laterally further into CogWork-1 infrastructure. What are the credentials for Heisen-9-WS-6?

Ta sẽ tiến hành crash file .kdbx bằng johnkeepass2john. Đầu tiên là lấy hash password của file trước

1
2
3
4
5
┌──(kali㉿kali)-[~/Desktop/The_Watchman's_Residue]
└─$ keepass2john acquired\ file\ \(critical\).kdbx

┌──(kali㉿kali)-[~/Desktop/The_Watchman's_Residue]
└─$ keepass2john acquired\ file\ \(critical\).kdbx > a

image

Sau đó là dùng john để bắt đầu crack

1
2
┌──(kali㉿kali)-[~/Desktop/The_Watchman's_Residue]
└─$ john --wordlist=/usr/share/wordlists/rockyou.txt a

image

Với password có, ta sẽ thấy được credential của host Heisen-9-WS-6

image

The Tunnel Without Walls

A memory dump from a connected Linux machine reveals covert network connections, fake services, and unusual redirects. Holmes investigates further to uncover how the attacker is manipulating the entire network!

Overview

Case Summary

Attacker đã ssh rồi chạy chuỗi command recon (xem phiên bản hệ điều hành, IP, process…) trong shell PID 13608. Từ đây hắn xác thực sang người dùng khác (jm) để leo thang đặc quyền và chiếm root. Tiếp đó, attacker tải mã độc từ Pastebin để cài rootkit Nullincrevenge. Để chiếm quyền điều khiển mạng nội bộ, attacker cài dnsmasq và chỉnh iptables nhằm phát DHCP/DNS độc, mạo danh cổng nội bộ. Một workstation (Parallax-5-WS-3) nhận cấu hình xấu, người dùng từ đây đăng nhập City of CogWork-1. Trang giả mạo gợi ý nâng cấp AetherDesk và chuyển hướng tải về endpoint độc. Cơ chế lừa dựa trên việc redirect domain gốc sang IP cuối cấu hình trong default.conf của nginx. Toàn bộ chuỗi cho thấy con đường xâm nhập: ssh -> leo thang -> rootkit -> DNS/DHCP ác ý -> đánh cắp/đánh lừa cập nhật phần mềm theo kiểu supply chain.

Comment

Windows memory forensic challenge

Question

  1. What is the Linux kernel version of the provided image?
  2. The attacker connected over SSH and executed initial reconnaissance commands. What is the PID of the shell they used?
  3. After the initial information gathering, the attacker authenticated as a different user to escalate privileges. Identify and submit that user’s credentials.
  4. The attacker downloaded and executed code from Pastebin to install a rootkit. What is the full path of the malicious file?
  5. What is the email account of the alleged author of the malicious file?
  6. The next step in the attack involved issuing commands to modify the network settings and installing a new package. What is the name and PID of the package?
  7. Clearly, the attacker’s goal is to impersonate the entire network. One workstation was already tricked and got its new malicious network configuration. What is the workstation’s hostname?
  8. After receiving the new malicious network configuration, the user accessed the City of CogWork-1 internal portal from this workstation. What is their username?
  9. Finally, the user updated a software to the latest version, as suggested on the internal portal, and fell victim to a supply chain attack. From which Web endpoint was the update downloaded?
  10. To perform this attack, the attacker redirected the original update domain to a malicious one. Identify the original domain and the final redirect IP address and port.

Tools use

  • volatility 3
  • bulk_extractor
  • ChatGPT

1. What is the Linux kernel version of the provided image?

Để kiểm tra kernel version của Linux ta sẽ dùng plugin banner

1
2
┌──(kali㉿kali)-[~/Desktop/volatility3-2.26.0]
└─$ python3 vol.py -f memdump.mem banner

image

Từ việc xác định được kernel version sẽ giúp ta xác định đúng symbol. Để không xảy ra lỗi trong quá trình phân tích phía sau. Có thể tham khảo tại đây để setup

2. The attacker connected over SSH and executed initial reconnaissance commands. What is the PID of the shell they used?

Ta sẽ sử dụng plugin bash để xem các command mà attacker đã sử dụng khi đã xâm nhập thành công vào máy nạn nhân

1
2
┌──(kali㉿kali)-[~/Desktop/volatility3-2.26.0]
└─$ python3 vol.py -f memdump.mem linux.bash

image

Ta thấy được attacker đang dùng các lệnh cơ bản để recon như xem version hệ điều hành, ip, các process đang chạy,… với pid là 13608

3. After the initial information gathering, the attacker authenticated as a different user to escalate privileges. Identify and submit that user’s credentials.

Kết quả ở Q2 cho ta thấy được sau khi recon xong attacker đã ssh sang tài khoản khác. Cụ thể là ssh sang user jm

image

Từ đây ta có thể đọc dựa vào trick dùng strings để tìm với keyword là jm: vì nó đều có cách nhau bằng dấu : mô tả như hình dưới

image

1
2
┌──(kali㉿kali)-[~/Desktop/volatility3-2.26.0]
└─$ strings memdump.mem| grep 'jm:'

image

Két quả trả về cho ta thấy được luôn rằng attacker đã leo được lên đến root. Đem crack và ta được password

image

4. The attacker downloaded and executed code from Pastebin to install a rootkit. What is the full path of the malicious file?

Tại lịch sử của bash khi nãy ta thấy attacker có tải file từ Pastebin, tuy nhiên link này đã chết

image

Theo mô tả của câu hỏi, attacker đã tải và cài cắm một con rootkit tức là nó sẽ ăn sâu vào hdh (kernel), ta sẽ dùng plugin linux.hidden_modules.Hidden_modules để check module kernel “ẩn”

1
2
┌──(kali㉿kali)-[~/Desktop/volatility3-2.26.0]
└─$ python3 vol.py -f memdump.mem linux.hidden_modules.Hidden_modules

image

Tiếp tục dùng plugin linux.pagecache.Files để tìm extension và vị trí của file

1
2
┌──(kali㉿kali)-[~/Desktop/volatility3-2.26.0]
└─$ python3 vol.py -f memdump.mem linux.pagecache.Files | grep 'Nullincrevenge'

image

5. What is the email account of the alleged author of the malicious file?

Để đọc được nội dung của file độc để có thông tin email có 2 cách.

Dump trực tiếp file này bằng linux.pagecache.InodePages và đọc file

1
2
┌──(kali㉿kali)-[~/Desktop/volatility3-2.26.0]
└─$ python3 vol.py -f memdump.mem linux.pagecache.InodePages --inode 0x9b3386454a80 --dump

image

6. The next step in the attack involved issuing commands to modify the network settings and installing a new package. What is the name and PID of the package?

Từ lịch sử bash ở Q2 attacker đã tải dnsmasq để tạo mạng nội bộ đúng như mô tả của câu hỏi

image

Trace bằng linux.pstree để xem nó là PID nào

1
2
┌──(kali㉿kali)-[~/Desktop/volatility3-2.26.0]
└─$ python3 vol.py -f memdump.mem linux.pstree

image

7. Clearly, the attacker’s goal is to impersonate the entire network. One workstation was already tricked and got its new malicious network configuration. What is the workstation’s hostname?

Ở phía trên trước khi dnsmasq được thực thi, attacker đã setup dải mạng bằng iptables. Tức là có thể suy đoán được các ip thuộc dải 192.168.211.0/24 đều bị ảnh hưởng

image

Sử dụng strings vào file .mem để xem thông tin host nào dính

1
2
┌──(kali㉿kali)-[~/Desktop/volatility3-2.26.0]
└─$ strings memdump.mem| grep '192.168.211.'

Kết quả trả ra chỉ có duy nhất host Parallax-5-WS-3 là dính

image

8. After receiving the new malicious network configuration, the user accessed the City of CogWork-1 internal portal from this workstation. What is their username?

Theo mô tả câu hỏi thì có user từ host City of CogWork-1 đã truy cập vào, do đó ta sẽ dùng một công cụ để có thể xem các request đến. Ở đây mình dùng bulk_extractor, tool này hỗ trợ ta lấy được các file traffic có trong file .mem

1
2
┌──(kali㉿kali)-[~/Desktop/volatility3-2.26.0]
└─$ bulk_extractor -o traffic memdump.mem

Filter http -> Follow stream -> http và ta có được username

image

9. Finally, the user updated a software to the latest version, as suggested on the internal portal, and fell victim to a supply chain attack. From which Web endpoint was the update downloaded?

Ở gói tin tiếp theo ta thấy được nội dung mà attacker tạo ở trang web nhằm lừa nạn nhân tải file về để cập nhật phần mềm. Đúng như mô tả câu hỏi, ta có nội dung như ảnh bên dưới

image

File được lừa để tải là AetherDesk, dựa vào tên này ta sẽ tìm các api có liên quan để tìm ra link có endpoint tải file. Khi tra từng gói tin, ta đã thấy được nó đã xuất hiện các api liên tục ref với nhau để dẫn đến trang đích

image

Tuy nhiên sau khi tìm the gói tin ta lại không tìm thấy chút manh mối nào về endpoint nào cả

Giờ quay lại vấn đề, khi có user nào đó bị lừa bởi máy bị nhiễm thì chắc chắn nó sẽ gửi request về IP máy đó. Do đó ta sẽ trace bằng cách strings IP ở file .mem để xem các request vì lúc trước ở Q7 ta cũng thấy các request gửi đến

1
2
┌──(kali㉿kali)-[~/Desktop/volatility3-2.26.0]
└─$ strings memdump.mem| grep '192.168.211.52'

image

10. To perform this attack, the attacker redirected the original update domain to a malicious one. Identify the original domain and the final redirect IP address and port

Để xem chính xác nó trỏ về domain nào ta cần xác định config của tool như thế nào. Đoạn này dùng chatGPT ta biết được file config của dnsmasq nằm ở /etc/dnsmasq.conf. Tiến hành dump file này ra

1
2
3
4
5
┌──(kali㉿kali)-[~/Desktop/volatility3-2.26.0]
└─$ python3 vol.py -f memdump.mem linux.pagecache.Files | grep '/etc/dns'

┌──(kali㉿kali)-[~/Desktop/volatility3-2.26.0]
└─$ python3 vol.py -f memdump.mem linux.pagecache.InodePages --inode 0x9b33ac25aae0 --dump

image

Strings và ta biết được domain name

image

Tuy nhiên vấn đề tiếp theo là file này lại không hề có ip và port. Đến đoạn này mình phải đi xin hint : )

Theo hint, attacker còn thực hiện sửa file default.conf trước khi tiến hành tấn công. Do đó khả năng file này sẽ có thông tin ta cần

image

Một lần nữa dump file và strings ta sẽ hoàn thành challenge :))))

image

image

The Payload

Bài này nhờ có sự trợ giúp của 2 pro Đức NghĩaHải Long đã gussing được ra đến flag cuối : )) xin cảm ơn 2 bro để làm cho kết quả đẹp thêm

image

The end

Gỉai kết thúc mình vừa được học vừa được chơi. Tuyệt vời với kết quả này XD

image

  • Title: Holmes CTF 2025
  • Author: TwentySeV
  • Created at : 2025-10-01 09:22:00
  • Updated at : 2025-10-02 10:32:42
  • Link: https://blog.ehc-fptu.club/2025/10/01/Holmes-CTF-2025/
  • License: This work is licensed under CC BY-ND 4.0.
On this page
Holmes CTF 2025