Книга: Practical Malware Analysis: The Hands-On Guide to Dissecting Malicious Software
Назад: Persistence Mechanisms
Дальше: Covering Its Tracks—User-Mode Rootkits

). DLL load-order hijacking can even be used for a privilege escalation. If the directory where the shows how malware enables its SeDebugPrivilege.

The access token is obtained using a call to OpenProcessToken at and passing in its process handle (obtained with the call to GetCurrentProcess), and the desired access (in this case, to query and adjust privileges) are passed in. Next, the malware calls LookupPrivilegeValueA. which retrieves the locally unique identifier (LUID). The LUID is a structure that represents the specified privilege (in this case, SeDebugPrivilege).

The information obtained from OpenProcessToken and LookupPrivilegeValueA is used in the call to AdjustTokenPrivileges at . A key structure, PTOKEN_PRIVILEGES, is also passed to AdjustTokenPrivileges and labeled as NewState by IDA Pro. Notice that this structure sets the low and high bits of the LUID using the result from LookupPrivilegeValueA in a two-step process seen at and . The Attributes section of the NewState structure is set to SE_PRIVILEGE_ENABLED at , in order to enable SeDebugPrivilege.

This combination of calls often happens before system process manipulation code. When you see a function containing this code, label it and move on. It’s typically not necessary to analyze the intricate details of the escalation method that malware uses.

sss
sss

© RuTLib.com 2015-2018