Trusted Design

T1060 - Registry Run Keys / Startup Folder

概要

Adversaries may achieve persistence by adding a program to a startup folder or referencing it with a Registry run key. Adding an entry to the "run keys" in the Registry or startup folder will cause the program referenced to be executed when a user logs in. (Citation: Microsoft Run Key) These programs will be executed under the context of the user and will have the account's associated permissions level.

Placing a program within a startup folder will cause that program to execute when a user logs in. There is a startup folder location for individual user accounts as well as a system-wide startup folder that will be checked regardless of which user account logs in.

The startup folder path for the current user is: * C:\Users[Username]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup The startup folder path for all users is: * C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp

The following run keys are created by default on Windows systems: * HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run * HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce * HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run * HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce

The HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnceEx is also available but is not created by default on Windows Vista and newer. Registry run key entries can reference programs directly or list them as a dependency. (Citation: Microsoft RunOnceEx APR 2018) For example, it is possible to load a DLL at logon using a "Depend" key with RunOnceEx: reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\0001\Depend /v 1 /d "C:\temp\evil[.]dll" (Citation: Oddvar Moe RunOnceEx Mar 2018)

The following Registry keys can be used to set startup folder items for persistence: * HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders * HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders * HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders * HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

The following Registry keys can control automatic startup of services during boot: * HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce * HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce * HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices * HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunServices

Using policy settings to specify startup programs creates corresponding values in either of two Registry keys: * HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run * HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run

The Winlogon key controls actions that occur when a user logs on to a computer running Windows 7. Most of these actions are under the control of the operating system, but you can also add custom actions here. The HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit and HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell subkeys can automatically launch programs.

Programs listed in the load value of the registry key HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows run when any user logs on.

By default, the multistring BootExecute value of the registry key HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager is set to autocheck autochk *. This value causes Windows, at startup, to check the file-system integrity of the hard disks if the system has been shut down abnormally. Adversaries can add other programs or processes to this registry value which will automatically launch at boot.

Adversaries can use these configuration locations to execute malware, such as remote access tools, to maintain persistence through system reboots. Adversaries may also use Masquerading to make the Registry entries look as if they are associated with legitimate programs.

管理者によるコメント

T1060は、Windowsが起動またはユーザーがログインした際にプログラムを自動実行する「Runレジストリキー」や「スタートアップフォルダ」にマルウェアを登録し、「永続化(Persistence)」を達成します。

1. 概要

この手法で攻撃者は、「PCの起動やユーザーのログインという日常動作をトリガーにした、マルウェアの確実な自動再実行」を実現します。

何を実現できるのか

2. 攻撃の流れ

攻撃者は、OSの標準的な自動起動の仕組みにマルウェアのパスを滑り込ませます。主に「レジストリ」と「フォルダ」の2つのルートがあります。

ルートA:Runレジストリキーの改ざん

  1. Windowsには、ログイン時に指定されたプログラムを動かすレジストリキーが存在します。

    • ユーザー権限で可能:
      HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run (または RunOnce

    • 管理者権限が必要:
      HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run (または RunOnce

  2. 攻撃者はここに新しい値(例:UpdateCheck などの無害を装った名前)を作成し、データ部分にマルウェア(.exe や スクリプト)のパスを書き込みます。

ルートB:スタートアップフォルダへの配置

  1. ログイン時にフォルダ内のファイルを全実行する「スタートアップフォルダ」を狙います。

    • ユーザー権限:
      C:\Users\<ユーザー名>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

    • 管理者権限:
      C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup

  2. 攻撃者はこのフォルダ内に、マルウェア本体、またはマルウェアを呼び出すショートカットファイル(.lnk)を配置します。

実行

ユーザーが次回システムにログインした瞬間、OSがこれらの場所を順番に読み込み、マルウェアが自動的に起動します。

3. 防御・対策

「書き込みの監視」と「可視化」が最も効果的です。

4. 重要ポイント

5. 関連する主なCWE

6. 関連する代表的な事例

特定の脆弱性を突くものではなく、OSの標準仕様の悪用であるため、数え切れないほどのマルウェアが利用しています。

実務上のアドバイス

セキュリティ運用の現場では、「不審なプロセスが Run レジストリを書き換えた」 という検知は高確率で黒(インシデント)と判断できます。特に、Office製品(Word, Excel)やPowerShellからこのレジストリへの書き込みが発生した場合は、マクロなどを起点とした攻撃が進行中である可能性が極めて高いです。

分析

この攻撃手法を利用する脅威アクター

この攻撃手法を利用する脅威アクターは登録されていません。

関連する CVE

攻撃手法 – 脅威アクター Graph


← Technique一覧に戻る ← Tactics一覧に戻る