SeDebugPrivilegeを悪用した権限昇格

SeDebugPrivilege特権は、本来はシステムのデバッグ目的で利用される権限レベルだが、マルウェアが権限昇格のために悪用することもある。
マルウェアはAdjustTokenPrivileges関数を利用してSeDebugPrivilege特権を取得することができる。

access tokenとは
access tokenとはプロセスやスレッドのセキュリティに関する様々な情報を含んでいるオブジェクトであり、その中にはプロセスの権限レベルの情報も含まれている。
access token内の情報はAdjustTokenPrivileges関数によって変更することができる。

SeDebugPrivilege特権取得の大まかな流れ
1. OpenProcessToken関数によってaccess tokenを取得。
2. LookupPrivilegeValueA関数によってSeDebugPrivilegeのLUID (Locally Unique Identifier)を取得。
3. 1と2で取得した値をAdjustTokenPrivileges関数に渡して権限レベルを変更し、SeDebugPrivilege特権を取得する。

上記のような流れでOpenProcessToken、LookupPrivilegeValueA、AdjustTokenPrivilegesの3つの関数がマルウェア内で呼び出されている場合は、何らかの権限昇格を試みている可能性が高い。

ちなみにカレント・ユーザーに割り当てられている権限レベルの一覧はwhoami /priv コマンドで確認できる。


C:\Users\user>whoami /priv

PRIVILEGES INFORMATION
----------------------

Privilege Name                Description                          State
============================= ==================================== ========
SeShutdownPrivilege           Shut down the system                 Disabled
SeChangeNotifyPrivilege       Bypass traverse checking             Enabled
SeUndockPrivilege             Remove computer from docking station Disabled
SeIncreaseWorkingSetPrivilege Increase a process working set       Disabled
SeTimeZonePrivilege           Change the time zone                 Disabled

以上。

Leave a Reply

Your email address will not be published. Required fields are marked *