RU2585978C2 - Method of invoking system functions in conditions of use of agents for protecting operating system kernel - Google Patents

Method of invoking system functions in conditions of use of agents for protecting operating system kernel Download PDF

Info

Publication number
RU2585978C2
RU2585978C2 RU2014139202/08A RU2014139202A RU2585978C2 RU 2585978 C2 RU2585978 C2 RU 2585978C2 RU 2014139202/08 A RU2014139202/08 A RU 2014139202/08A RU 2014139202 A RU2014139202 A RU 2014139202A RU 2585978 C2 RU2585978 C2 RU 2585978C2
Authority
RU
Russia
Prior art keywords
call
function
address
handler
hypervisor
Prior art date
Application number
RU2014139202/08A
Other languages
Russian (ru)
Other versions
RU2014139202A (en
Inventor
Максим Витальевич Юдин
Александр Сергеевич Тарасенко
Вячеслав Иванович Левченко
Игорь Юрьевич Кумагин
Original Assignee
Закрытое акционерное общество "Лаборатория Касперского"
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Закрытое акционерное общество "Лаборатория Касперского" filed Critical Закрытое акционерное общество "Лаборатория Касперского"
Priority to RU2014139202/08A priority Critical patent/RU2585978C2/en
Publication of RU2014139202A publication Critical patent/RU2014139202A/en
Application granted granted Critical
Publication of RU2585978C2 publication Critical patent/RU2585978C2/en

Links

Images

Landscapes

  • Storage Device Security (AREA)
  • Stored Programmes (AREA)

Abstract

FIELD: information security.
SUBSTANCE: invention relates to antivirus technologies, and more specifically to a method of creating handler system calls. According to one version, method of system function call, during which following steps are performed: loading hypervisor for interception of handler system calls. Modifying structure of operating system kernel, connected to system function call, said structure operating system kernel includes at least: a) a system call; b) system call table in which address of call is replaced with at least one system function call address on other function with maintaining original address system function call; intercepting system call handler call by hypervisor; calling another function at any replacement address in system call; calling system function on stored original address.
EFFECT: technical result consists in a system function call in conditions of use of operating system kernel protection means.
1 cl, 7 dwg

Description

Область техникиTechnical field

Изобретение относится к антивирусным технологиям, а более конкретно к способу вызова системных функций в условиях использования средств защиты ядра операционной системы.The invention relates to antivirus technologies, and more particularly to a method for invoking system functions under the conditions of using kernel protection means of the operating system.

Уровень техникиState of the art

В настоящее время современные антивирусные продукты используют перехват системных вызовов для того, чтобы можно обнаруживать вредоносные программы, например, уже на стадии их выполнения. Например, на использовании подобных перехватов построена технология System Watcher (http://support.kaspersky.eom/us/8057#block1). Перехватывая системные вызовы, которые ведут к подозрительным действиям (например, запись исполняемого файла в папку Windows), можно блокировать даже пока еще неизвестные вредоносные программы, что является одним из ключевых достоинств современных антивирусов.Currently, modern anti-virus products use interception of system calls in order to detect malware, for example, already at the stage of their execution. For example, using such interceptions, the System Watcher technology was built (http: //support.kaspersky.eom/us/8057#block1). Intercepting system calls that lead to suspicious actions (for example, writing an executable file to the Windows folder), you can block even unknown malware, which is one of the key advantages of modern antiviruses.

Однако возможность перехвата вызовов системных сервисов в 64-х разрядных версиях операционной системы (ОС) Windows ограничивается реализованной Microsoft системой защиты Patch Guard (http://msdn.microsoft.com/en-us/library/windows/hardware/dn613955 (v=vs.85).aspx), препятствующей применению классических методов перехвата. Patch Guard отслеживает изменения в ряде важных объектов ядра ОС (как вредоносных изменений в следствии работы руткитов или же из-за модификаций сторонним программным обеспечением, таким как антивирусы), например таблицу системных вызовов или таблицу векторов прерываний (англ. Interrupt Descriptor Table, IDT), и при обнаружении изменений в них вызывает крах системы.However, the ability to intercept system service calls in 64-bit versions of the Windows operating system (OS) is limited by the Microsoft-implemented Patch Guard security system (http://msdn.microsoft.com/en-us/library/windows/hardware/dn613955 (v = vs.85) .aspx), which prevents the use of classical interception methods. Patch Guard tracks changes in a number of important objects of the OS kernel (as malicious changes resulting from the operation of rootkits or due to modifications by third-party software such as antiviruses), for example, a system call table or an interrupt vector table (Eng Interrupt Descriptor Table, IDT) , and upon detection of changes in them causes a system crash.

В настоящий момент описаны технологии, которые позволяют обойти защиту, аналогичную PatchGuard. Например, патент US7996836 описывает подход к использованию гипервизора для обхода Patchguard. При использовании гипервизора появляется возможность создания перехватчиков упомянутых объектов ядра без краха системы.Currently, technologies are described that circumvent protection similar to PatchGuard. For example, US7996836 describes an approach for using a hypervisor to bypass Patchguard. When using a hypervisor, it becomes possible to create interceptors of the mentioned kernel objects without crashing the system.

Таким образом, обход защиты PatchGuard возможен при помощи аппаратной виртуализации. Однако создание перехватчиков для объектов ядра (например, для контроля SSDT) требует знания их внутренней структуры, которая меняется в зависимости от версии ОС Windows, что требует выпуска адаптированной версии перехватчика для поддержки очередной версии ОС.Thus, bypassing PatchGuard protection is possible using hardware virtualization. However, the creation of interceptors for kernel objects (for example, to control SSDT) requires knowledge of their internal structure, which varies depending on the version of Windows, which requires the release of an adapted version of the interceptor to support the next version of the OS.

Анализ предшествующего уровня техники позволяет сделать вывод о неэффективности и в некоторых случаях о невозможности применения предшествующих технологий, недостатки которых решаются настоящим изобретением, а именно способом вызова системных функций в условиях использования средств защиты ядра операционной системы.An analysis of the prior art allows us to conclude about the inefficiency and, in some cases, the impossibility of applying the previous technologies, the disadvantages of which are solved by the present invention, namely, by calling system functions in the conditions of using the operating system kernel protection means.

Раскрытие изобретенияDisclosure of invention

Технический результат настоящего изобретения заключается в обеспечении вызова системных функций в условиях использования средств защиты ядра операционной системы.The technical result of the present invention is to provide a call to system functions in terms of using means of protection of the kernel of the operating system.

Согласно одному из вариантов реализации, предлагается способ вызова системных функций, во время которых выполняют следующие этапы: загружают гипервизор для перехвата обработчика системных вызовов; модифицируют структуры ядра операционной системы, связанные с вызовами системных функций, при этом указанные структуры ядра операционной системы включают, по меньшей мере: а) обработчик системных вызовов; б) таблицу системных вызовов, в которой заменяют адрес вызова, по меньшей мере, одной системной функции, на адрес вызова другой функции, сохраняя при этом оригинальный адрес вызова системной функции; перехватывают вызов обработчика системных вызовов с помощью гипервизора; вызывают другую функцию по замененному адресу в таблице системных вызовов; вызывают системную функцию по сохраненному оригинальному адресу.According to one implementation option, a method for calling system functions is proposed, during which the following steps are performed: loading a hypervisor to intercept a system call handler; modify the structure of the kernel of the operating system associated with calls to system functions, while these structures of the kernel of the operating system include at least: a) a processor of system calls; b) a system call table, in which the call address of at least one system function is replaced by the call address of another function, while maintaining the original call address of the system function; intercept a call to the system call handler using a hypervisor; call another function at the replaced address in the system call table; call the system function at the stored original address.

Краткое описание чертежейBrief Description of the Drawings

Дополнительные цели, признаки и преимущества настоящего изобретения будут очевидными из прочтения последующего описания осуществления изобретения со ссылкой на прилагаемые чертежи, на которых:Additional objectives, features and advantages of the present invention will be apparent from reading the following description of an embodiment of the invention with reference to the accompanying drawings, in which:

Фиг. 1а приводит пример модификации системного вызова.FIG. 1a provides an example of a modification to a system call.

Фиг. 2 иллюстрирует пример загрузки обработчика.FIG. 2 illustrates an example of loading a handler.

Фиг. 3 приводит способ использования гипервизора для обхода Patch Guard.FIG. 3 provides a way to use the hypervisor to bypass the Patch Guard.

Фиг. 4 иллюстрирует способ обработки системных вызовов.FIG. 4 illustrates a method for handling system calls.

Фиг. 5 иллюстрирует пример реализации компьютерной системы, на которой может быть реализовано настоящее изобретение.FIG. 5 illustrates an example implementation of a computer system on which the present invention may be implemented.

Фиг. 6 показывает пример выполнения API-функции в операционной системе Windows.FIG. 6 shows an example of executing an API function in a Windows operating system.

Фиг. 7 приводит пример вызова системной службы.FIG. 7 provides an example of a system service call.

Описание вариантов осуществления изобретенияDescription of Embodiments

Объекты и признаки настоящего изобретения, способы для достижения этих объектов и признаков станут очевидными посредством отсылки к примерным вариантам осуществления. Однако настоящее изобретение не ограничивается примерными вариантами осуществления, раскрытыми ниже, оно может воплощаться в различных видах. Сущность, приведенная в описании, является ничем иным, как конкретными деталями, необходимыми для помощи специалисту в области техники в исчерпывающем понимании изобретения, и настоящее изобретение определяется в объеме приложенной формулы.The objects and features of the present invention, methods for achieving these objects and features will become apparent by reference to exemplary embodiments. However, the present invention is not limited to the exemplary embodiments disclosed below, it can be embodied in various forms. The essence described in the description is nothing more than the specific details necessary to assist the specialist in the field of technology in a comprehensive understanding of the invention, and the present invention is defined in the scope of the attached claims.

Для лучшего понимания настоящего изобретения, в первую очередь будет приведено описание работы механизмов вызова системных функций в ОС Windows.For a better understanding of the present invention, first of all, a description will be given of the operation of the mechanisms for invoking system functions in Windows.

Фиг. 6 показывает пример выполнения API-функции в операционной системе Windows. В качестве примера API-функции была выбрана WriteFile. На этапе 610 Windows приложение (например, Microsoft Word или Notepad) пытается записать данные в файл путем вызова соответствующей Win32 API функции WriteFile в Kernel32.dll. Затем на этапе 620 происходит вызов NtWriteFile в Ntdll.dll (т.е. происходит последовательный вызов всех связанных системных функций), что в свою очередь приводит к вызову системного прерывания на этапе 630 и поиску соответствующего обработчика (что делает функция KiSystemService в Ntoskrnl.exe) при вызове NtWriteFile. Отметим, что данный процесс происходит в режиме пользователя, а после вызова прерывания происходит переход в режим ядра. На этапе 640 происходит вызов NtWriteFile уже непосредственно в Ntoskrnl.exe и непосредственно выполнение записи в файл на этапе 650 (здесь также скрыты детали, связанные с работой драйвера файловой системы).FIG. 6 shows an example of executing an API function in a Windows operating system. WriteFile was chosen as an example of an API function. At step 610, the Windows application (for example, Microsoft Word or Notepad) attempts to write data to the file by calling the corresponding Win32 API function WriteFile in Kernel32.dll. Then, at step 620, the NtWriteFile is called in Ntdll.dll (i.e., all related system functions are called sequentially), which in turn leads to a system interrupt at step 630 and the search for the corresponding handler (which is done by the KiSystemService function in Ntoskrnl.exe ) when calling NtWriteFile. Note that this process occurs in user mode, and after the interrupt is called, it switches to kernel mode. At 640, NtWriteFile is called directly in Ntoskrnl.exe and directly writes to the file at 650 (details related to the operation of the file system driver are also hidden here).

Разберем более подробно этап 630, связанный с вызовом инструкции SYSCALL. В настоящий момент в современных процессорах архитектуры х86 для перехода из режима пользователя (англ. user mode) в режим ядра (англ. kernel mode) требуется вызвать инструкцию SYSCALL/SYSENTER (далее будем использовать только SYSCALL). На архитектуре х64 адрес данного обработчика хранится в регистре LSTAR (Long System Target-Address Register), который относится к регистрам MSR (Machine Specific Registers).Let us examine in more detail step 630 associated with calling the SYSCALL instruction. Currently, in modern x86 architecture processors, to switch from user mode (English user mode) to kernel mode (English kernel mode), you need to call the SYSCALL / SYSENTER instruction (hereinafter we will use only SYSCALL). On the x64 architecture, the address of this processor is stored in the LSTAR (Long System Target-Address Register) register, which refers to the MSR (Machine Specific Registers) registers.

На Фиг.7 приведен пример вызова системной службы. При переходе в режим ядра диспетчер системных служб 710 (в ОС Windows это KiSystemService) копирует аргументы системного вызова из стека потока пользовательского режима в свой стек режима ядра (чтобы пользователь не смог изменить аргументы при обращении к ним ядра), а затем выполняет системную службу 720 из таблицы системных служб 730 (в ОС Windows это System Service Dispatch Table, SSDT).7 is an example of a system service call. When switching to kernel mode, the 710 System Services Manager (on Windows, it is KiSystemService) copies the system call arguments from the user-mode thread stack to its kernel-mode stack (so that the user cannot change the arguments when the kernel accesses them), and then executes the 720 system service from the system services table 730 (on Windows, this is the System Service Dispatch Table, SSDT).

Таким образом, в рамках работающих таких методов защиты, как Patch Guard, для модификации системной службы 720 потребуется модифицировать саму таблицу 730, что приведет к краху системы. Для того чтобы можно было обойти подобное ограничение, требуется создать собственную копию таблицы 730, но, кроме того, использовать собственный обработчик вызова SYSCALL (далее для упрощения будем использовать сокращение обработчик) с целью использования собственной таблицы системных служб (будем считать это структурами операционной системы, связанными с вызовами системных функций). Далее на Фиг. 2 и 3 будет рассмотрен пример создания и использования обработчика вызова SYSCALL.Thus, within the framework of working protection methods such as Patch Guard, to modify the system service 720, it will be necessary to modify table 730 itself, which will lead to the system crash. In order to circumvent this limitation, you need to create your own copy of table 730, but in addition, use your own SYSCALL call handler (hereinafter we will use the abbreviation handler for simplification) in order to use your own system services table (we will consider this an operating system structure, associated with calls to system functions). Further in FIG. 2 and 3, an example of creating and using a SYSCALL call handler will be considered.

На Фиг. 1а приведен пример модификации системного вызова (например, обработчика определенной файловой операции). В адресном пространстве ядра 100 по определенному адресу загружен оригинальный обработчик 110, который необходимо модифицировать под свои нужды. Модификация кода может быть основана на использования ряда таких приемов, как подмена адреса (например, с помощью модификации SSDT/IDT таблиц), непосредственное изменение обработчика (например, с помощью сплайсинга) или модификация тела самой системной функции. Подменив адрес обработчика 110 на адрес другого обработчика 120 можно реализовать необходимый функционал, например, включив антивирусную проверку ряда файловых или реестровых операций. Однако отметим, что, так как Patch Guard проверяет значения регистра MSR, то подменить значение данного регистра (более подробно про этот регистр описано ниже) с использованием вышеописанных техник невозможно.In FIG. Figure 1a shows an example of modifying a system call (for example, a handler for a specific file operation). In the address space of the kernel 100 at a specific address the original handler 110 is loaded, which must be modified to suit your needs. Modification of the code can be based on the use of a number of such techniques as address spoofing (for example, by modifying SSDT / IDT tables), directly changing the handler (for example, using splicing), or modifying the body of the system function itself. By changing the address of the processor 110 to the address of another processor 120, it is possible to implement the necessary functionality, for example, by turning on anti-virus scanning of a number of file or registry operations. However, note that, since Patch Guard checks the values of the MSR register, it is impossible to change the value of this register (more about this register below) using the techniques described above.

Для обхода Patch Guard можно использовать виртуализацию, используя гипервизор. На Фиг. 3 приведен пример использования гипервизора для обхода Patch Guard. Гипервизор 300 имеет более высокую привилегию для выполнения (уровень - 1, в то время как у ядра 0, а уровень пользовательских приложений 3), может быть загружен в любой момент, как при старте ОС, так и во время ее работы. При инициализации гипервизора 300 задается список инструкций, который можно перехватывать с его помощью. Для перехвата инструкции SYSCALL достаточно указать перехват инструкций RDMSR (чтение MSR) и WRMSR (запись в MSR).You can use virtualization to bypass the Patch Guard using a hypervisor. In FIG. Figure 3 shows an example of using a hypervisor to bypass Patch Guard. Hypervisor 300 has a higher privilege to execute (level 1, while the kernel has 0, and user application level 3), it can be loaded at any time, both at the OS startup and during its operation. Upon initialization of the hypervisor 300, a list of instructions is set that can be intercepted using it. To intercept the SYSCALL instruction, just specify the interception of the RDMSR (read MSR) and WRMSR (write to MSR) instructions.

Таким образом, используя гипервизор 300 можно контролировать регистр MSR (в частности, LSTAR, далее для обобщения будем использовать лишь MSR), записывая необходимое значение 320а и сохраняя оригинальное значение 3206. Это дает возможность подставлять оригинальное значение 3206 для считывания такими средствами защиты как Patch Guard (и не вызывая краха системы), но в то же время использовать необходимый адрес 320а для использования измененного обработчика.Thus, using the hypervisor 300, it is possible to control the MSR register (in particular, LSTAR, we will use only MSR for summarization), writing down the necessary value 320a and preserving the original value 3206. This makes it possible to substitute the original value 3206 for reading by such protection tools as Patch Guard (and without causing a system crash), but at the same time use the necessary address 320a to use the modified handler.

Пример загрузки обработчика приведен на Фиг. 2. На этапе 210 происходит определение адреса в памяти кода оригинального обработчика 110 - определяется размер и положение в памяти загруженного образа. Затем на этапе 220 создается копия обработчика 110 в виде образа 120. Размер памяти под копию должен быть выделен с учетом возможных изменений. Предпочтительным вариантом является выделение памяти в памяти уже загруженного драйвера 130, что облегчит модификацию кода обработчика. Подобными изменениями являются - модификация относительных ссылок на этапе 230, замена в коде обработчика 120 адресов сервисных таблиц (например, SSDT) на этапе 240 и инициализация таблицы исключений на этапе 250. Последнее необходимо для того, что корректно обрабатывать исключения, связанные с выполнением кода обработчика 120. Все вышеперечисленные изменения возможно сделать с применением дизассемблера, которые необходим для разбора команд обработчика 110 и их последующей модификации (этапы 230 - 250). Данные изменения являются необходимыми для того, чтобы можно корректно заменить обработчик 110. Другие изменения могут относится к различным областям компьютерной безопасности, связанной с анализом перехваченных вызовов.An example of handler loading is shown in FIG. 2. At step 210, the address in the code memory of the original handler 110 is determined — the size and position in the memory of the downloaded image are determined. Then, at step 220, a copy of the handler 110 is created in the form of an image 120. The size of the memory for the copy should be allocated taking into account possible changes. The preferred option is to allocate memory in the memory of the already loaded driver 130, which will facilitate the modification of the processor code. Such changes are the modification of relative links at step 230, the replacement in the handler code 120 of the addresses of service tables (for example, SSDT) at step 240, and the initialization of the exception table at step 250. The latter is necessary in order to correctly handle exceptions associated with the execution of the handler code 120. All of the above changes can be made using the disassembler, which is necessary for parsing the processor 110 instructions and their subsequent modification (steps 230 - 250). These changes are necessary in order to correctly replace the handler 110. Other changes may relate to various areas of computer security related to the analysis of intercepted calls.

После того, как обработчик 120 был инициализирован, его можно использовать для перехвата системных вызовов. В качестве интересующих вызовов можно рассматривать файловые и реестровые операции, операции, связанные со снятием снимков экрана. Можно отметить, что в последних версиях ОС Windows можно использовать перехваты файловых и реестровых операций, используя сам API ОС.After the handler 120 has been initialized, it can be used to intercept system calls. As calls of interest, you can consider file and registry operations, operations related to taking screenshots. It can be noted that in the latest versions of Windows, you can use the interception of file and registry operations using the OS API itself.

В рамках ОС Windows для борьбы с определенным классом вредоносных программ, которые делают снимки экрана (скриншоты, англ. screenshots) с целью выделения в них важной пользовательской информации (например, пароли), требуется обеспечить контроль перехватов функций, связанных с снятием снимков экрана. Существует ряд техник, которые позволяют получить описатель (дескриптор) окна необходимого приложения и скопировать растр (англ. bitmap) с него или же использовать поверхности Direct3D (Direct3D surface) для их преобразования в растр прямо в памяти и последующим сохранением на диск для анализа. Для того, чтобы можно было отследить вредоносные приложения, которые используют подобные техники, требуется не только обеспечить перехват вызова SYSCALL, но также модифицировать SSDT таблицу для перехвата необходимых вызовов.Within the Windows operating system, in order to combat a certain class of malicious programs that take screenshots (screenshots, English screenshots) in order to highlight important user information (for example, passwords), it is necessary to provide control over intercepts of functions related to taking screenshots. There are a number of techniques that allow you to get the window descriptor (descriptor) of the desired application and copy the raster (English bitmap) from it or use Direct3D surfaces (Direct3D surface) to convert them into a raster directly in memory and then save them to disk for analysis. In order to be able to track down malicious applications that use similar techniques, it is necessary not only to provide SYSCALL call interception, but also to modify the SSDT table to intercept the necessary calls.

Надо отметить, что гипервизор 300 не обязательно загружать всегда и держать его в памяти во время работы ОС. Гипервизор 300 может быть загружен и во время работы ОС при выполнения одного из следующих условий:It should be noted that the hypervisor 300 does not have to always be loaded and kept in memory while the OS is running. Hypervisor 300 can also be loaded while the OS is running when one of the following conditions is true:

- Загрузка критичного приложения (например, банковского приложения), для которого необходимо обеспечить защиту от снятия снимков экрана.- Downloading a critical application (for example, a banking application), for which it is necessary to provide protection against taking screenshots.

- Пользователь зашел на сайт банка или платежной системы (например, PayPal), в рамках которого также требуется обеспечить защиту от снятия снимков экрана.- The user went to the website of the bank or payment system (for example, PayPal), which also requires protection from taking screenshots.

- Антивирусное приложение требует наличия самозащиты (т.е. защита от попыток закончить процесс антивирусного приложения или остановить работу антивирусного драйвера), что приводит к необходимости отслеживания соответствующих системных вызовов.- The anti-virus application requires self-protection (i.e. protection against attempts to terminate the anti-virus application process or stop the anti-virus driver), which leads to the need to track the corresponding system calls.

- Более гибкое управление системой контроля приложений (англ. application control) с помощью подмены системных вызовов, реализация изолированной среды (англ. sandbox).- More flexible management of the application control system (English application control) by replacing system calls, implementation of an isolated environment (English sandbox).

- Осуществление глубокой проверки подозрительного приложения в рамках эмуляции его поведения. В этом случае вызываются не настоящие обработчики сервисных функций ядра, а вызываются специальные функции эмулятора поведения ОС. При этом никаких изменений в настоящей ОС не проводится, однако приложение считает, что выполняется на реальной системе. На основе протоколов эмулятора определяется степень опасности приложения. Данная проверка может осуществляться как на машине пользователя, так и на выделенном облачном сервисе.- Implementation of deep verification of a suspicious application as part of emulating its behavior. In this case, not real kernel service function handlers are called, but special functions of the OS behavior emulator are called. At the same time, no changes are made in this OS, however, the application considers that it is running on a real system. Based on the emulator protocols, the degree of danger of the application is determined. This check can be carried out both on the user's machine and on a dedicated cloud service.

При выполнении одного из подобных условий на этапе 410 на Фиг. 4 (которая иллюстрирует способ обработки системных вызовов) будет загружен гипервизор. Таблица SSDT будет модифицирована на этапе 420. Обработчик функции SYSCALL будет загружен на этапе 430 (загрузка проиллюстрирована на Фиг. 2). На этапе 440 происходит перехват вызова, с помощью модифицированной таблицы SSDT контекст вызова (например, какой процесс произвел вызов) передается на этапе 450 на антивирусный анализ (т.е. произошел вызов другой функции), в рамках которого, например, может быть определено, является ли вредоносным процесс, который осуществил вызов. Так как после вызова другой функции (например, для антивирусной проверки) по замененному адресу в таблице системных вызовов требуется обеспечить корректное выполнение кода системного вызова, то после этого вызывают системную функцию по сохраненному оригинальному адресу.When one of these conditions is met, at step 410 of FIG. 4 (which illustrates how to handle system calls) a hypervisor will be loaded. The SSDT table will be modified in step 420. The SYSCALL function handler will be loaded in step 430 (the download is illustrated in FIG. 2). At step 440, the call is intercepted, using the modified SSDT table, the call context (for example, which process made the call) is transmitted at step 450 for antivirus analysis (i.e., another function was called), within which, for example, it can be determined Is the process that made the call malicious? Since, after calling another function (for example, for anti-virus scanning) at the replaced address in the system call table, it is necessary to ensure the correct execution of the system call code, then the system function is called at the stored original address.

Также стоит отметить, что в ряде случаев может потребоваться синхронизация оригинальной и модифицированной таблицы SSDT. Оригинальная таблица SSDT может быть обновлена в рамках процедуры hot patching.It is also worth noting that in some cases, it may be necessary to synchronize the original and modified SSDT tables. The original SSDT table can be updated as part of the hot patching procedure.

Кроме того, предложенная схема перехвата с использованием гипервизора может быть реализована таким образом, что бы не снижать уровень защиты ОС обеспечиваемого технологией PatchGuard, так как все загружаемые модули на х64 системах проходят проверку подписи и с помощью гипервизора может быть реализована защита копии перехватчика и копии сервисных таблиц от изменения, обеспечивая даже более надежный эквивалент защиты PatchGuard.In addition, the proposed interception scheme using a hypervisor can be implemented in such a way as not to reduce the level of OS protection provided by PatchGuard technology, since all loadable modules on x64 systems undergo signature verification and protection of a copy of an interceptor and a copy of service can be implemented using a hypervisor tables against modification, providing an even more robust equivalent of PatchGuard protection.

Фиг. 5 представляет пример компьютерной системы общего назначения, персональный компьютер или сервер 20, содержащий центральный процессор 21, системную память 22 и системную шину 23, которая содержит разные системные компоненты, в том числе память, связанную с центральным процессором 21. Системная шина 23 реализована, как любая известная из уровня техники шинная структура, содержащая в свою очередь память шины или контроллер памяти шины, периферийную шину и локальную шину, которая способна взаимодействовать с любой другой шинной архитектурой. Системная память содержит постоянное запоминающее устройство (ПЗУ) 24, память с произвольным доступом (ОЗУ) 25. Основная система ввода/вывода (BIOS) 26 содержит основные процедуры, которые обеспечивают передачу информации между элементами персонального компьютера 20, например, в момент загрузки операционной системы с использованием ПЗУ 24.FIG. 5 is an example of a general purpose computer system, a personal computer or server 20 comprising a central processor 21, a system memory 22, and a system bus 23 that contains various system components, including memory associated with the central processor 21. The system bus 23 is implemented as any prior art bus structure comprising, in turn, a bus memory or a bus memory controller, a peripheral bus and a local bus that is capable of interacting with any other bus architecture. The system memory contains read-only memory (ROM) 24, random access memory (RAM) 25. The main input / output system (BIOS) 26 contains the basic procedures that ensure the transfer of information between the elements of the personal computer 20, for example, at the time of loading the operating system using ROM 24.

Персональный компьютер 20 в свою очередь содержит жесткий диск 27 для чтения и записи данных, привод магнитных дисков 28 для чтения и записи на сменные магнитные диски 29 и оптический привод 30 для чтения и записи на сменные оптические диски 31, такие как CD-ROM, DVD-ROM и иные оптические носители информации. Жесткий диск 27, привод магнитных дисков 28, оптический привод 30 соединены с системной шиной 23 через интерфейс жесткого диска 32, интерфейс магнитных дисков 33 и интерфейс оптического привода 34 соответственно. Приводы и соответствующие компьютерные носители информации представляют собой энергонезависимые средства хранения компьютерных инструкций, структур данных, программных модулей и прочих данных персонального компьютера 20.The personal computer 20 in turn contains a hard disk 27 for reading and writing data, a magnetic disk drive 28 for reading and writing to removable magnetic disks 29, and an optical drive 30 for reading and writing to removable optical disks 31, such as a CD-ROM, DVD -ROM and other optical information carriers. The hard disk 27, the magnetic disk drive 28, the optical drive 30 are connected to the system bus 23 through the interface of the hard disk 32, the interface of the magnetic disks 33 and the interface of the optical drive 34, respectively. Drives and associated computer storage media are non-volatile means of storing computer instructions, data structures, software modules and other data of a personal computer 20.

Настоящее описание раскрывает реализацию системы, которая использует жесткий диск 27, сменный магнитный диск 29 и сменный оптический диск 31, но следует понимать, что возможно применение иных типов компьютерных носителей информации 56, которые способны хранить данные в доступной для чтения компьютером форме (твердотельные накопители, флеш карты памяти, цифровые диски, память с произвольным доступом (ОЗУ) и т.п.), которые подключены к системной шине 23 через контроллер 55.The present description discloses an implementation of a system that uses a hard disk 27, a removable magnetic disk 29, and a removable optical disk 31, but it should be understood that other types of computer storage media 56 that can store data in a form readable by a computer (solid state drives, flash memory cards, digital disks, random access memory (RAM), etc.) that are connected to the system bus 23 through the controller 55.

Компьютер 20 имеет файловую систему 36, где хранится записанная операционная система 35, а также дополнительные программные приложения 37, другие программные модули 38 и данные программ 39. Пользователь имеет возможность вводить команды и информацию в персональный компьютер 20 посредством устройств ввода (клавиатуры 40, манипулятора «мышь» 42). Могут использоваться другие устройства ввода (не отображены): микрофон, джойстик, игровая консоль, сканнер и т.п. Подобные устройства ввода по своему обычаю подключают к компьютерной системе 20 через последовательный порт 46, который в свою очередь подсоединен к системной шине, но могут быть подключены иным способом, например, при помощи параллельного порта, игрового порта или универсальной последовательной шины (USB). Монитор 47 или иной тип устройства отображения также подсоединен к системной шине 23 через интерфейс, такой как видеоадаптер 48. В дополнение к монитору 47, персональный компьютер может быть оснащен другими периферийными устройствами вывода (не отображены), например, колонками, принтером и т.п.Computer 20 has a file system 36 where the recorded operating system 35 is stored, as well as additional software applications 37, other program modules 38, and program data 39. The user is able to enter commands and information into personal computer 20 via input devices (keyboard 40, keypad “ the mouse "42). Other input devices (not displayed) can be used: microphone, joystick, game console, scanner, etc. Such input devices are, as usual, connected to the computer system 20 via a serial port 46, which in turn is connected to the system bus, but can be connected in another way, for example, using a parallel port, a game port, or a universal serial bus (USB). A monitor 47 or other type of display device is also connected to the system bus 23 via an interface such as a video adapter 48. In addition to the monitor 47, the personal computer can be equipped with other peripheral output devices (not displayed), for example, speakers, a printer, etc. .

Персональный компьютер 20 способен работать в сетевом окружении, при этом используется сетевое соединение с другим или несколькими удаленными компьютерами 49. Удаленный компьютер (или компьютеры) 49 является таким же персональным компьютером или сервером, которые имеют большинство или все упомянутые элементы, отмеченные ранее при описании существа персонального компьютера 20, представленного на Фиг. 5. В вычислительной сети могут присутствовать также и другие устройства, например маршрутизаторы, сетевые станции, пиринговые устройства или иные сетевые узлы.The personal computer 20 is capable of operating in a networked environment, using a network connection with another or more remote computers 49. The remote computer (or computers) 49 is the same personal computer or server that has most or all of the elements mentioned earlier in the description of the creature the personal computer 20 of FIG. 5. Other devices, such as routers, network stations, peer-to-peer devices, or other network nodes may also be present on the computer network.

Сетевые соединения могут образовывать локальную вычислительную сеть (LAN) 50 и глобальную вычислительную сеть (WAN). Такие сети применяются в корпоративных компьютерных сетях, внутренних сетях компаний и, как правило, имеют доступ к сети Интернет. В LAN- или WAN-сетях персональный компьютер 20 подключен к локальной сети 50 через сетевой адаптер или сетевой интерфейс 51. При использовании сетей персональный компьютер 20 может использовать модем 54 или иные средства обеспечения связи с глобальной вычислительной сетью, такой как Интернет. Модем 54, который является внутренним или внешним устройством, подключен к системной шине 23 посредством последовательного порта 46. Следует уточнить, что сетевые соединения являются лишь примерными и не обязаны отображать точную конфигурацию сети, т.е. в действительности существуют иные способы установления соединения техническими средствами связи одного компьютера с другим.Network connections can form a local area network (LAN) 50 and a wide area network (WAN). Such networks are used in corporate computer networks, internal networks of companies and, as a rule, have access to the Internet. In LAN or WAN networks, the personal computer 20 is connected to the local area network 50 via a network adapter or network interface 51. When using the networks, the personal computer 20 may use a modem 54 or other means of providing communication with a global computer network such as the Internet. The modem 54, which is an internal or external device, is connected to the system bus 23 via the serial port 46. It should be clarified that the network connections are only exemplary and are not required to display the exact network configuration, i.e. in reality, there are other ways to establish a technical connection between one computer and another.

В заключение следует отметить, что приведенные в описании сведения являются примерами, которые не ограничивают объем настоящего изобретения, определенного формулой.In conclusion, it should be noted that the information provided in the description are examples that do not limit the scope of the present invention defined by the claims.

Claims (1)

1. Способ вызова системных функций, во время которых выполняют следующие этапы:
• загружают гипервизор для перехвата обработчика системных вызовов (функция SYSCALL) с целью обхода Patch Guard, при этом гипервизор загружается во время работы операционной системы при выполнении, по крайней мере, одного из следующих условий:
- загрузка банковского приложения, для которого необходимо обеспечить защиту от снятия снимков экрана;
- требование защиты антивирусного приложения от попыток закончить процесс антивирусного приложения или остановить работу антивирусного драйвера;
- осуществление проверки подозрительного приложения в рамках эмуляции его поведения;
• модифицируют структуры ядра операционной системы, связанные с вызовами системных функций, при этом указанные структуры ядра операционной системы включают:
а) обработчик системных вызовов;
б) таблицу системных вызовов, в которой заменяют адрес вызова системной функции, на адрес вызова другой функции, сохраняя при этом оригинальный адрес вызова системной функции;
• перехватывают вызов обработчика системных вызовов с помощью гипервизора, используя перехват инструкций RDMSR и WRMSR;
• вызывают функцию для антивирусной проверки по замененному адресу в таблице системных вызовов;
• вызывают системную функцию по сохраненному оригинальному адресу.
1. A method of calling system functions during which the following steps are performed:
• load the hypervisor to intercept the system call handler (SYSCALL function) in order to bypass the Patch Guard, while the hypervisor is loaded while the operating system is running when at least one of the following conditions is met:
- downloading a banking application, for which it is necessary to provide protection against taking screenshots;
- the requirement to protect the anti-virus application from attempts to terminate the anti-virus application process or stop the anti-virus driver;
- verification of a suspicious application as part of emulating its behavior;
• modify the kernel structure of the operating system associated with calls to system functions, while the specified kernel structure of the operating system includes:
a) system call handler;
b) a table of system calls, in which the address of the call to the system function is replaced by the address of the call of another function, while maintaining the original address of the call to the system function;
• intercept the call of the system call handler using the hypervisor, using the interception of the RDMSR and WRMSR instructions;
• call the function for anti-virus scanning at the replaced address in the system call table;
• call the system function at the stored original address.
RU2014139202/08A 2014-09-30 2014-09-30 Method of invoking system functions in conditions of use of agents for protecting operating system kernel RU2585978C2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
RU2014139202/08A RU2585978C2 (en) 2014-09-30 2014-09-30 Method of invoking system functions in conditions of use of agents for protecting operating system kernel

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
RU2014139202/08A RU2585978C2 (en) 2014-09-30 2014-09-30 Method of invoking system functions in conditions of use of agents for protecting operating system kernel

Publications (2)

Publication Number Publication Date
RU2014139202A RU2014139202A (en) 2016-04-20
RU2585978C2 true RU2585978C2 (en) 2016-06-10

Family

ID=55789216

Family Applications (1)

Application Number Title Priority Date Filing Date
RU2014139202/08A RU2585978C2 (en) 2014-09-30 2014-09-30 Method of invoking system functions in conditions of use of agents for protecting operating system kernel

Country Status (1)

Country Link
RU (1) RU2585978C2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2634176C1 (en) * 2016-07-29 2017-10-24 Акционерное общество "Лаборатория Касперского" System and method for detecting malware by intercepting access to information displayed to user
RU2634168C1 (en) * 2016-07-29 2017-10-24 Акционерное общество "Лаборатория Касперского" System and method for blocking access to protected applications

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7703081B1 (en) * 2005-09-22 2010-04-20 Symantec Corporation Fast system call hooking on x86-64 bit windows XP platforms
US7996836B1 (en) * 2006-12-29 2011-08-09 Symantec Corporation Using a hypervisor to provide computer security
RU2462747C2 (en) * 2007-01-25 2012-09-27 Майкрософт Корпорейшн Protection of operating system resources
RU2468418C2 (en) * 2007-01-25 2012-11-27 Майкрософт Корпорейшн Security agents and privileged modes
US8484734B1 (en) * 2006-08-22 2013-07-09 Trend Micro Incorporated Application programming interface for antivirus applications

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7703081B1 (en) * 2005-09-22 2010-04-20 Symantec Corporation Fast system call hooking on x86-64 bit windows XP platforms
US8484734B1 (en) * 2006-08-22 2013-07-09 Trend Micro Incorporated Application programming interface for antivirus applications
US7996836B1 (en) * 2006-12-29 2011-08-09 Symantec Corporation Using a hypervisor to provide computer security
RU2462747C2 (en) * 2007-01-25 2012-09-27 Майкрософт Корпорейшн Protection of operating system resources
RU2468418C2 (en) * 2007-01-25 2012-11-27 Майкрософт Корпорейшн Security agents and privileged modes

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2634176C1 (en) * 2016-07-29 2017-10-24 Акционерное общество "Лаборатория Касперского" System and method for detecting malware by intercepting access to information displayed to user
RU2634168C1 (en) * 2016-07-29 2017-10-24 Акционерное общество "Лаборатория Касперского" System and method for blocking access to protected applications
US10210348B2 (en) 2016-07-29 2019-02-19 AO Kaspersky Lab System and method of blocking access to protected applications

Also Published As

Publication number Publication date
RU2014139202A (en) 2016-04-20

Similar Documents

Publication Publication Date Title
RU2637997C1 (en) System and method of detecting malicious code in file
US11106792B2 (en) Methods and systems for performing a dynamic analysis of applications for protecting devices from malwares
US9946562B2 (en) System and method for kernel rootkit protection in a hypervisor environment
US9202046B2 (en) Systems and methods for executing arbitrary applications in secure environments
RU2510074C2 (en) System and method of checking executable code before execution thereof
US9639698B2 (en) Systems and methods for active operating system kernel protection
US8973144B2 (en) System and method for kernel rootkit protection in a hypervisor environment
EP2981925B1 (en) Systems, methods and apparatuses for protection of antivirus software
US20080016314A1 (en) Diversity-based security system and method
Leon et al. Hypervisor-assisted dynamic malware analysis
Zhao et al. Breaking Turtles All the Way Down: An Exploitation Chain to Break out of {VMware}{ESXi}
Grill et al. “Nice Boots!”-A Large-Scale Analysis of Bootkits and New Ways to Stop Them
RU2585978C2 (en) Method of invoking system functions in conditions of use of agents for protecting operating system kernel
Rauchberger et al. Longkit-A Universal Framework for BIOS/UEFI Rootkits in System Management Mode.
Zhong et al. A virtualization based monitoring system for mini-intrusive live forensics
Lamps et al. WinWizard: Expanding Xen with a LibVMI intrusion detection tool
US9342694B2 (en) Security method and apparatus
Grimm et al. Automatic mitigation of kernel rootkits in cloud environments
RU2596577C2 (en) Method of creating a system call handler
EP2720170B1 (en) Automated protection against computer exploits
Suzaki et al. Kernel memory protection by an insertable hypervisor which has VM introspection and stealth breakpoints
Pereberina et al. An approach to dynamic malware analysis based on system and application code split
RU2592383C1 (en) Method of creating antivirus record when detecting malicious code in random-access memory
Vetter et al. Uncloaking rootkits on mobile devices with a hypervisor-based detector
Grill Bootkits revisited: detecting, analysing and mitigating bootkit threats