レジストリの操作
システム上の特定のプロセスへのダイナミックリンクライブラリ(DLL)の自動読み込みを可能にするレジストリ値AppInit_DLLsに加えられた変更を監視する必要があります。同様の機能を持つ関連レジストリ値はAppCertDllsです。レジストリ値全体のパスは次のとおりです。
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\AppInit_DLLs
HKLM\SYSTEM\CurrentControlSet\Control\SESSION MANAGER\ AppCertDlls
ルール
<?xml version='1.0' encoding='UTF-8'?> <rule> <description> <name>AppInit DLL Registry Creation [A0101]</name> <category>Persistence</category> <os>Windows</os> <severity>80</severity> <mitreattackid>T1218.011</mitreattackid> <explanation>AppInit DLL is a mechanism that allows an arbitrary list of DLLs to be loaded into each user-mode process on the system. DLLs that are specified in the `AppInit_DLLs` value in the Registry key `HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Windows` are loaded by user32.dll into (almost) every process that loads user32.dll. The AppInit DLL functionality is disabled in Windows 8 and later versions when secure boot is enabled.</explanation> <benignCauses>AppInit_DLLs are rarely used by specific software, such as graphic card support dlls or virtual machine software.</benignCauses> <maliciousCauses>AppInit_DLLs are sometimes used by malware to achieve persistence on the target machine.</maliciousCauses> <recommendedActions>1. Evaluate if the change to the Applnit_DLLs correlates with known software, a software update, patch cycles, etc. 2. Evaluate the process/module that made the change. 3. Check for presence of new/non-standard DLLs on the computer. 4. If a suspicious process/module or DLL is detected, start the incident response process (for example, disconnect the computer from the internet, update your antivirus product and scan the computer for malware, send samples for analysis, block modules, etc.).</recommendedActions> </description> <definition> <operations> <operation type="RegSetValue"> <operator type="OR"> <operator type="AND"> <operator type="OR"> <condition component="RegistryItem" property="Key" condition="starts" value="HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows"/> <condition component="RegistryItem" property="Key" condition="starts" value="HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Windows"/> </operator> <condition component="RegistryItem" property="Key" condition="ends" value="Appinit_Dlls"/> </operator> <operator type="AND"> <condition component="RegistryItem" property="Key" condition="starts" value="HKLM\SYSTEM\ControlSet"/> <condition component="RegistryItem" property="Key" condition="ends" value="Control\SESSION MANAGER\AppCertDlls"/> </operator> </operator> </operation> </operations> </definition> <maliciousTarget name="current"/> <actions> <action name="TriggerDetection"/> <action name="StoreEvent"/> </actions> </rule> |
上記のルールの例で注意すべき点:
1.完全なHKEY値は照合されないため、完全な値ではなく短縮されたHKEY値を使用します。
2.AppInit_DLLsのWow6432Nodeを含みます。この値と他の多くの値は、x64システムでx86をサポートするため、このレジストリキーで重複します。この値も監視する必要があります。
3.ends条件でレジストリ値を照合します。まず、レジストリ値の名前"AppInit_DLLs"を照合し、レジストリ値へのパスが必要なパスであるかどうかを確認することにしました。このアプローチは、理論上、条件の短絡評価によりサーバーのワークロードを軽減できるはずです。照合にレジストリ値パス全体を("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\AppInit_DLLs")を使用することもできます。
4.CurrentControlSetレジストリ値は、オペレーティングシステムによって動的に評価され、ControlSet%number%を指す代替シンボリックリンクです。Enterprise InspectorはControlSet%number%値を持つレジストリパスを受け取るので、レジストリ値のパスを2つのコンポーネントに分割します。