0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【TryHackMe】Investigating Windows 2.0:Walkthrough

0
Posted at

概要

TryHackMe「Investigating Windows 2.0」のWalkthroughです。

Task1

Q1.What registry key contains the same command that is executed within a scheduled task?

タスクスケジューラーを確認します。
GameOverという名前のスケジュールがあります。

image.png

mim.exeを定期的に実行しています。

image.png

Autorunsを起動し、Logonタブを確認します。
レジストリキーがHKCU\Environment\UserInitMprLogonScriptだと分かりました。

image.png

A.HKCU\Environment\UserInitMprLogonScript

Q2.What analysis tool will immediately close if/when you attempt to launch it?

Lokiを実行し、ログを収集します。
スクリプトでprocexp64.exeが起動したキルするようになっていることが分かりました。

loki.log
Warning: MODULE: WMIScan MESSAGE: CLASS: __eventFilter MD5: e927bbd0b8f2b60275ed1d8e821696cc NAME: ProcessStartTrigger QUERY: SELECT * FROM Win32_ProcessStartTrace WHERE ProcessName = 'procexp64.exe'

(中略)

Warning: MODULE: WMIScan MESSAGE: CLASS: __FilterToConsumerBinding MD5: 05d517b0ad20ae5119703c8f100b768e CONSUMER: ActiveScriptEventConsumer.Name="KillProcess" FILTER: __EventFilter.Name="ProcessStartTrigger"

(中略)

Set oProcessList = oServices.ExecQuery("SELECT * FROM Win32_Process WHERE ProcessID = " & TargetEvent.ProcessID)
For Each oProcess in oProcessList
    oProcess.Terminate()
Next

A.procexp64.exe

Q3.What is the full WQL Query associated with this script?

クエリはLokiのログから判明しました。

A.SELECT * FROM Win32_ProcessStartTrace WHERE ProcessName = 'procexp64.exe'

Q4.What is the script language?

プロセスキルの検知付近のログを確認します。
ScriptingEngine = "VBScript"とあり、VBScriptで書かれていることが分かります。

image.png

A.VBScript

Q5.What is the name of the other script?

LokiのログにName = "LaunchBeaconingBackdoor"とあり、名前が分かりました。

image.png

A.LaunchBeaconingBackdoor

Q6.What is the name of the software company visible within the script?

VBScriptのコメントアウトから、Motobit Softwareであることが確認できました。

' Decodes a base-64 encoded string (BSTR type).
' 1999 - 2004 Antonin Foller, http://www.motobit.com
' 1.01 - solves problem with Access And 'Compare Database' (InStr)
Function Base64Decode(ByVal base64String)
    'rfc1521
    '1999 Antonin Foller, Motobit Software, http://Motobit.cz

image.png

A.Motobit Software

Q7.What 2 websites are associated with this software company? (answer, answer)

同様にVBScriptのコメントアウトから、URLを確認できました。

http://www.motobit.com
http://Motobit.cz

A.http://www.motobit.com, http://motobit.cz

Q8.Search online for the name of the script from Q5 and one of the websites from the previous answer. What attack script comes up in your search?

"LaunchBeaconingBackdoor" "Motobit"などで検索すると、PowerShellのスクリプトを発見しました。

A.WMIBackdoor.ps1

Q9.What is the location of this file within the local machine?

ファイル検索でWMIBackdoor.ps1を探すと、TMPフォルダにあるファイルがヒットしました。

image.png

A.C:\TMP

Q10.Which 2 processes open and close very quickly every few minutes? (answer, answer)

タスクスケジューラーを確認します。
falshupdate22では、powershell.exeを実行しています。

image.png

GameOverではmim.exeを実行しています。

image.png

A.mim.exe, powershell.exe

Q11.What is the parent process for these 2 processes?

プロセスモニターで、一定時間プロセスを確認します。
powershellなどは親プロセスがsvchost.exeになっていると分かります。

image.png

A.svchost.exe

Q12.What is the first operation for the first of the 2 processes?

mim.exeのプロセスを確認すると、OperationがProcess Startになっています。

image.png

A.Process Start

Q13.Inspect the properties for the 1st occurrence of this process. In the Event tab what are the 4 pieces of information displayed? (answer, answer, answer, answer)

プロセスプロパティのイベントタブを確認します。

image.png

A.Parent PID, Command line, Current directory, Environment

Q14.Inspect the disk operations, what is the name of the unusual process?

異常なディスク操作を探しましたが、特にありませんでした。

A.no process

Q15.Run Loki. Inspect the output. What is the name of the module after Init?

Initモジュールのあとのログを確認します。
WMIScanモジュールのログがあります。

image.png

A.WMIScan

Q16.Regarding the 2nd warning, what is the name of the eventFilter?

2つ目のWarningログを確認します。
CLASS: __eventFilterになっていることを確認できます。
NAME: ProcessStartTriggerとあり、イベントフィルターの名前を確認できました。

image.png

A.ProcessStartTrigger

Q17.For the 4th warning, what is the class name?

4つ目のWarningログを確認します。
クラス名を確認します。

image.png

A.__FilterToConsumerBinding

Q18.What binary alert has the following 4d5a90000300000004000000ffff0000b8000000 as FIRST_BYTES?

4d5a90000300000004000000ffff0000b8000000で検索をします。
FILE: C:\TMP\nbtscan.exeを確認できました。

image.png

A.nbtscan.exe

Q19.According to the results, what is the description listed for reason 1?

DESC: Known Bad / Dual use classicsからdescriptionを確認できました。

image.png

A.Known Bad / Dual use classics

Q20.Which binary alert is marked as APT Cloaked?

APT Cloakedに関する検知を検索します。
FILE: C:\TMP\p.exeを確認できました。

image.png

A.p.exe

Q21.What are the matches? (str1, str2)

MATCHES: Str1: psexesvc.exe Str2: Sysinternals PsExecのログから、内容を確認できました。

image.png

A.psexesvc.exe, Sysinternals PsExec

Q22.Which binary alert is associated with somethingwindows.dmp found in C:\TMP?

somethingwindows.dmpで検索します。
FILE: C:\TMP\schtasks-backdoor.ps1を発見しました。

image.png

A.schtasks-backdoor.ps1

Q23.Which binary is encrypted that is similar to a trojan?

Trojanで検索します。
FILE: C:\TMP\xCmd.exeを発見しました。

image.png

A.xCmd.exe

Q24.There is a binary that can masquerade itself as a legitimate core Windows process/image. What is the full path of this binary?

svchost.exeで検索します。
FILE: C:\Users\Public\svchost.exeを発見しました。
svchost.exeはsystem32にあるはずのものなので、これが怪しいです。

image.png

A.C:\Users\Public\svchost.exe

Q25.What is the full path location for the legitimate version?

本来svchost.exeは、C:\Windows\System32にあります。

A.C:\Windows\System32

Q26.What is the description listed for reason 1?

DESC項目を確認します。
DESC: Stuff running where it normally shouldn't

image.png

A.Stuff running where it normally shouldn't

Q27.There is a file in the same folder location that is labeled as a hacktool. What is the name of the file?

hacktoolで検索します。
FILE: C:\Users\Public\en-US.jsを確認できます。

image.png

A.en-US.js

Q28.What is the name of the Yara Rule MATCH?

REASON_1: Yara Rule MATCH: CACTUSTORCHを確認できます。

A.CACTUSTORCH

Q29.Which binary didn't show in the Loki results?

mim.exeがヒットしないことを確認できます。

A.mim.exe

Q30.Complete the yar rule file located within the Tools folder on the Desktop. What are 3 strings to complete the rule in order to detect the binary Loki didn't hit on? (answer, answer, answer)

mim.exe内の文字列を確認します。
実行ファイルで検索を絞ると、mk.exeが見つかりました。

C:\Users\Administrator\Desktop\Tools\SysinternalsSuite>strings.exe C:\TMP\mim.exe | findstr .exe
CThis file is a protected executable and requires a password to run.
Service.exe.manifest
mk.exe
mk.exe
mk.exe

バージョン情報で絞るとv2.0.50727がヒットしました。

C:\Users\Administrator\Desktop\Tools\SysinternalsSuite>strings.exe C:\TMP\mim.exe | findstr ver
<?xml version="1.0" encoding="utf-8" ?>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
<supportedRuntime version="v2.0.50727" />
Converters
-version
/version
_version
<?xml version="1.0" encoding="utf-8" ?>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
<supportedRuntime version="v2.0.50727" />
-version
/version
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

PowerShellのファイルで絞ると、mk.ps1がヒットしました。

C:\Users\Administrator\Desktop\Tools\SysinternalsSuite>strings.exe C:\TMP\mim.exe | findstr ps
mk.ps1
mk.ps1
Dps
mk.ps1

A.mk.ps1,mk.exe,v2.0.50727

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?