RU2649794C1 - System and method for log forming in virtual machine for anti-virus file checking - Google Patents

System and method for log forming in virtual machine for anti-virus file checking Download PDF

Info

Publication number
RU2649794C1
RU2649794C1 RU2017115048A RU2017115048A RU2649794C1 RU 2649794 C1 RU2649794 C1 RU 2649794C1 RU 2017115048 A RU2017115048 A RU 2017115048A RU 2017115048 A RU2017115048 A RU 2017115048A RU 2649794 C1 RU2649794 C1 RU 2649794C1
Authority
RU
Russia
Prior art keywords
file
created
opened
thread
page
Prior art date
Application number
RU2017115048A
Other languages
Russian (ru)
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 RU2017115048A priority Critical patent/RU2649794C1/en
Application granted granted Critical
Publication of RU2649794C1 publication Critical patent/RU2649794C1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/52Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow
    • G06F21/53Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow by executing in a restricted environment, e.g. sandbox or secure virtual machine
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/554Detecting local intrusion or implementing counter-measures involving event detection and direct action
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/56Computer malware detection or handling, e.g. anti-virus arrangements
    • G06F21/566Dynamic detection, i.e. detection performed at run-time, e.g. emulation, suspicious activities

Abstract

FIELD: information technology.
SUBSTANCE: invention relates to solutions for detecting malicious files. Method for deciding to recognize malicious file opened in virtual machine as environment for safe execution of files is disclosed, at that method comprises steps, when: a) during process flow created when file is opened, occurrence of event that is associated with change in at least one page of virtual memory is detected; b) during execution of process flow created when opening file, control transfer to at least one modified virtual memory page is detected; c) log to which following events are saved is created: events that occur during process stream, created when file is opened in modified memory page, and context of processor on which process flow, created when file is opened, is read when logged event occurs; d) saved events in created log are compared with processor context with at least one template; e) it is decided whether to recognize file as malicious, based on comparison results.
EFFECT: technical result is to increase security of computer system, which is achieved by deciding whether to recognize malicious file opened in virtual machine.
8 cl, 4 dwg

Description

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

Изобретение относится к решениям для выявления вредоносных файлов, а более конкретно к системам и способам формирования журнала для проведения антивирусной проверки файла.The invention relates to solutions for detecting malicious files, and more particularly to systems and methods for generating a log for anti-virus scanning of a file.

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

В настоящее время растет количество вредоносного программного обеспечения (например, компьютерные вирусы, трояны, сетевые черви), направленного на причинение ущерба как данным пользователя, так и самому пользователю электронного устройства, зараженного вредоносным программным обеспечением. Ущерб может быть причинен повреждением или удалением файлов пользователя, использованием ресурсов вычислительного устройства пользователя для "добычи" (англ. mining) криптовалют, кражей электронных и конфиденциальных данных пользователя (переписки, изображений, логинов, паролей, данных банковских карт) и прочими действиями. Кроме того, вредоносное программное обеспечение постоянно изменяется, так как его авторы прибегают к все более новым механизмам атак и защиты от приложений безопасности. Используются различные механизмы, например, обфускация (другими словами приведение исходного текста или исполняемого кода программы к виду, сохраняющему ее функциональность, но затрудняющему анализ, понимание алгоритмов работы и модификацию при декомпиляции, например) вредоносного кода или использование механизмов противодействия эмуляции (например, вредоносное программное обеспечение наделено функциями распознавания того, что оно исполняется в эмуляторе, и не проявляет свою вредоносную активность).Currently, an increasing number of malicious software (for example, computer viruses, trojans, network worms), aimed at causing damage to both user data and the user of an electronic device infected with malware. Damage can be caused by damage or deletion of the user's files, using the resources of the user's computing device for the “mining” of cryptocurrencies, the theft of electronic and confidential user data (correspondence, images, logins, passwords, bank card data) and other actions. In addition, malicious software is constantly changing, as its authors resort to increasingly new attack mechanisms and protection from security applications. Various mechanisms are used, for example, obfuscation (in other words, bringing the source code or executable code of a program to a form that preserves its functionality, but makes it difficult to analyze, understand the operation algorithms and modify when decompiling, for example) malicious code or using anti-emulation mechanisms (for example, malicious software the software is endowed with the functions of recognizing that it is executed in the emulator and does not show its malicious activity).

Кроме того, зачастую вредоносное программное обеспечение не проявляет свою вредоносную активность сразу, вместо этого производит множество (порядка миллионов вызовов) вызовов API-функций, огромные циклы (порядка миллиардов итераций), приостанавливает свою работу на некоторое время сразу после запуска (например, на 1 час использованием функции «Sleep()»). Вычислительные устройства пользователя в настоящее время имеют высокую производительность, многоядерные процессоры (есть и многопроцессорные системы), поэтому пользователь может не увидеть или не придать значения загруженности одного из ядер. Кроме того, обычно пользователь пользуется устройством после включения более одного часа. Поэтому вредоносному программному обеспечению, если оно запустилось, нет необходимости сразу проявлять свою активность.In addition, often malicious software does not show its malicious activity immediately, instead, it makes many (about millions of calls) calls to API functions, huge cycles (about billions of iterations), pauses for some time immediately after launch (for example, 1 hour using the Sleep () function). The user's computing devices currently have high performance, multi-core processors (there are also multi-processor systems), so the user may not see or attach importance to the load on one of the cores. In addition, the user usually uses the device after turning it on for more than one hour. Therefore, malicious software, if it starts, there is no need to immediately show their activity.

Для борьбы с упомянутыми подходами производителями приложений безопасности (например, антивирусных приложений) используются подходы с использованием виртуальных машин в виде изолированной среды для безопасного исполнения файлов. Зачастую такие виртуальные машины называются песочницами (от англ. sandbox). Гипервизоры, под управлением которых работают такие виртуальные машины, содержат механизмы перехвата функций, вызываемых исполняемыми в них приложениями.To combat the mentioned approaches, manufacturers of security applications (for example, anti-virus applications) use approaches using virtual machines as an isolated environment for the safe execution of files. Often such virtual machines are called sandboxes (from the English sandbox). Hypervisors under the control of which such virtual machines operate contain mechanisms for intercepting functions caused by applications executed in them.

Стоит отметить, что приложения безопасности используют различные методы определения вредоносного программного обеспечения, например, такие технологии, как сигнатурный и/или эвристический анализ. Если в процессе анализа вредоносность файла не была определена, он может быть передан приложением безопасности на анализ поведения в упомянутую виртуальную машину (например, если не имеет цифровой подписи доверенного производителя программного обеспечения). Затем переданный файл исполняется в виртуальной машине, в процессе исполнения происходит перехват его действий и событий, исполняемых вызовами различных функций, перехваченные события и действия сохраняются в журнал и в дальнейшем анализируются приложением безопасности или экспертом по информационной безопасности.It is worth noting that security applications use various methods for detecting malicious software, for example, technologies such as signature and / or heuristic analysis. If the maliciousness of the file was not determined during the analysis, it can be sent by the security application for analysis of the behavior to the mentioned virtual machine (for example, if it does not have a digital signature of a trusted software manufacturer). Then the transferred file is executed in a virtual machine, in the process of execution, its actions and events are intercepted, executed by calls of various functions, intercepted events and actions are stored in a log and further analyzed by a security application or information security expert.

Таким образом, известные системы перехвата и агрегации событий и действий, работают в два шага. На первом шаге информация собирается, на втором она анализируется.Thus, the well-known systems for intercepting and aggregating events and actions work in two steps. At the first step, information is collected, at the second it is analyzed.

Так, публикация US 8479286 B2 описывает систему и способ, в которых файл до исполнения в виртуальной машине подвергается анализу, и для исполнения файла по результатам анализа выбирается окружение, наиболее подходящее для раскрытия поведения файла. Далее файл исполняется, если по результатам исполнения принимается решение об изменении окружения, окружение изменяется, и файл исполняется повторно.So, publication US 8479286 B2 describes a system and method in which a file is analyzed before being executed in a virtual machine, and the environment that is most suitable for revealing the file’s behavior is selected based on the analysis results to execute the file. Next, the file is executed, if according to the results of the decision to change the environment, the environment is changed, and the file is executed again.

Публикация US 7779472 B1 описывает классический способ исполнения файла в виртуальной машине. В процессе исполнения происходит перехват вызовов API-функций и их параметров. Набор вызванных API-функций сравнивается с наборами вызовов, соответствующих вредоносному поведению. В случае соответствия выносится решение о вредоносности файла.Publication US 7779472 B1 describes a classic way to execute a file in a virtual machine. During execution, calls to API functions and their parameters are intercepted. The set of called API functions is compared with sets of calls that correspond to malicious behavior. In case of compliance, a decision is made on the harmfulness of the file.

Недостатком известных систем и способов является то, что в процессе исполнения файла они не влияют на процесс исполнения. Например, если процесс, запущенный из анализируемого файла (или из приложения, которым анализируемый файл был открыт), приостановил свое исполнение на час или атакует какой-либо почтовый клиент или мессенджер (программу для обмена сообщениями), обращаясь к файлу с сохраненными паролями, но в виртуальной машине атакуемая программа отсутствует, то вредоносность поведения файла выявлена не будет (так как, не обнаружив требуемого файла с паролями, вредоносный файл закончит свое исполнение сам и не проявит вредоносной активности).A disadvantage of the known systems and methods is that during the execution of the file they do not affect the execution process. For example, if a process started from the analyzed file (or from the application with which the analyzed file was opened) has suspended for an hour or is attacked by any mail client or messenger (messaging program), accessing the file with saved passwords, but the attacked program is absent in the virtual machine, the malicious behavior of the file will not be detected (since, if the required file with passwords is not detected, the malicious file will finish its execution itself and will not show malicious activity).

Настоящее изобретение позволяет влиять на процесс исполнения файла в виртуальной машине при анализе файла на вредоносность.The present invention allows you to influence the process of executing a file in a virtual machine when analyzing a file for malware.

Сущность изобретенияSUMMARY OF THE INVENTION

Технический результат настоящего изобретения заключается в повышении безопасности компьютерной системы, которое достигается путем принятия решения о признании вредоносным файла, открываемого в виртуальной машине.The technical result of the present invention is to improve the security of a computer system, which is achieved by deciding whether to recognize a file opened in a virtual machine as malicious.

Согласно одному из вариантов реализации предоставляется способ принятия решения о признании вредоносным файла, открываемого в виртуальной машине в виде среды для безопасного исполнения файлов, при этом способ содержит этапы, на которых: выявляют во время исполнения потока процесса, созданного при открытии упомянутого файла, возникновение события, которое связано с изменением по меньшей мере одной страницы виртуальной памяти; выявляют во время исполнения потока процесса, созданного при открытии упомянутого файла, передачу управления по меньшей мере в одну измененную страницу виртуальной памяти; формируют журнал, в который сохраняют: события, возникающие во время исполнения потока процесса, созданного при открытии упомянутого файла, в измененной странице памяти, и считываемый при возникновении сохраняемого в журнал события контекст процессора, на котором исполняется поток процесса, созданного при открытии упомянутого файла; сравнивают сохраненные в сформированном журнале события и контекст процессора с по меньшей мере одним шаблоном; принимают решение о признании файла вредоносным на основании результатов сравнения.According to one embodiment, a method is provided for deciding whether a file is opened in a virtual machine as an environment for the safe execution of files as malicious, the method comprising the steps of: identifying, during execution of a process thread created when the file was opened, the occurrence of an event which is associated with changing at least one page of virtual memory; during execution of a process thread created when opening said file is detected, control transfer to at least one modified page of virtual memory; form a log in which they save: events that occur during the execution of the process thread created when the mentioned file was opened in the modified memory page, and the processor context read on the event log stored in the event occurs, on which the thread of the process created when the mentioned file was opened is executed; comparing the events stored in the generated log and the processor context with at least one template; make a decision to recognize the file as malicious based on the results of the comparison.

Согласно другому частному варианту реализации предлагается способ, в котором событие, связанное с изменением страницы памяти, представляет собой вызов API-функции во время исполнения потока процесса.According to another particular embodiment, a method is proposed in which an event associated with a change in a memory page is a call to an API function during execution of a process thread.

Согласно еще одному частному варианту реализации предлагается способ, в котором при определении измененной страницы памяти выявляют идентификатор измененной страницы.According to yet another particular embodiment, a method is provided in which, when determining a changed memory page, an identifier of the changed page is detected.

Согласно еще одному частному варианту реализации предлагается способ, в котором выявление передачи управления измененной странице памяти осуществляется в случае, если поток, исполняющий код с измененной страницы, запущен из того же процесса, что и поток, изменивший страницу памяти.According to another particular embodiment, a method is proposed in which a control transfer to a changed memory page is detected if the thread executing the code from the changed page is launched from the same process as the thread that changed the memory page.

Согласно еще одному частному варианту реализации предлагается способ, в котором выявление передачи управления измененной странице памяти осуществляется в случае, если поток, исполняющий код с измененной страницы, запущен из процесса, отличного от процесса, поток которого изменил страницу памяти.According to another particular embodiment, a method is proposed in which a control transfer to a changed memory page is detected if the thread executing the code from the modified page is started from a process other than the process whose thread changed the memory page.

Согласно еще одному частному варианту реализации предлагается способ, в котором шаблон содержит по меньшей мере одно правило.According to yet another particular embodiment, a method is provided in which the template contains at least one rule.

Согласно еще одному частному варианту реализации предлагается способ, в котором правило содержит по меньшей мере одно событие.According to yet another particular embodiment, a method is provided in which the rule comprises at least one event.

Согласно еще одному частному варианту реализации предлагается способ, в котором правило содержит по меньшей мере один контекст процессора.According to yet another particular embodiment, a method is provided in which the rule comprises at least one processor context.

Краткое описание чертежей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. 1 shows an example of a malware file analysis in a virtual machine.

Фиг. 2 показывает пример реализации предлагаемой системы формирования журнала для проведения антивирусной проверки файла.FIG. 2 shows an example of the implementation of the proposed log generation system for anti-virus file scanning.

Фиг. 3 показывает пример реализации предлагаемого способа формирования журнала для проведения антивирусной проверки файла.FIG. 3 shows an example implementation of the proposed method for generating a log for anti-virus scanning of a file.

Фиг. 4 показывает пример компьютерной системы общего назначения, которая позволяет реализовать настоящее изобретение.FIG. 4 shows an example of a general purpose computer system that enables the implementation of the present invention.

Описание вариантов осуществления изобретения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 provided to assist the specialist in the field of technology in a comprehensive understanding of the invention, and the present invention is defined only in the scope of the attached claims.

Введем ряд определений и понятий, которые будут использоваться при описании вариантов осуществления изобретения.We introduce a number of definitions and concepts that will be used in the description of embodiments of the invention.

Виртуальная машина в виде среды для безопасного исполнения файла - это набор (комплекс) программно-аппаратных средств, который предоставляет ресурсы хостовой операционной системы (ГОСТ 56938-2016) для гостевой операционной системы, при этом гостевая операционная система не имеет связи с хостовой операционной системой.A virtual machine in the form of an environment for safe file execution is a set (complex) of hardware and software that provides the resources of the host operating system (GOST 56938-2016) for the guest operating system, while the guest operating system does not have a connection with the host operating system.

Под средствами системы анализа файла на вредоносность в виртуальной машине в настоящем изобретении понимаются реальные устройства, системы, компоненты, группы компонентов, реализованные с использованием аппаратных средств, таких как интегральные микросхемы (англ. application-specific integrated circuit, ASIC) или программируемые вентильные матрицы (англ. field-programmable gate array, FPGA) или, например, в виде комбинации программных и аппаратных средств, таких как микропроцессорная система и набор программных инструкций, а также на нейроморфных чипах (англ. neurosynaptic chips) Функциональность указанных средств системы может быть реализована исключительно аппаратными средствами, а также в виде комбинации, где часть функциональности средств системы реализована программными средствами, а часть аппаратными. В некоторых вариантах реализации часть средств, или все средства, могут быть исполнены на процессоре компьютера общего назначения (например, который изображен на Фиг. 4). При этом компоненты (каждое из средств) системы могут быть реализованы в рамках как одного вычислительного устройства, так и разнесены между несколькими, связанными между собой вычислительными устройствами.By the means of a malware analysis system file in a virtual machine, the present invention refers to real devices, systems, components, groups of components implemented using hardware such as integrated circuits (application-specific integrated circuit, ASIC) or programmable gate arrays ( field-programmable gate array (FPGA) or, for example, as a combination of software and hardware, such as a microprocessor system and a set of software instructions, as well as on neuromorphic chips (English neurosynaptic chips) Fu The functionality of the indicated system tools can be implemented exclusively by hardware, as well as in the form of a combination, where part of the functionality of the system tools is implemented by software, and part by hardware. In some embodiments, part of the means, or all means, may be executed on a general-purpose computer processor (for example, which is depicted in Fig. 4). In this case, the components (each of the means) of the system can be implemented within the framework of a single computing device, or distributed between several connected computing devices.

Фиг. 1 показывает пример анализа файла на вредоносность в виртуальной машине.FIG. 1 shows an example of a malware file analysis in a virtual machine.

В общем случае для анализа на вредоносность файл 100 открывается в виртуальной машине 120 в виде изолированной среды для исполнения файлов. Средство безопасности 110 передает виртуальной машине 120 файл 100. В одном из вариантов реализации виртуальная машина 120 создается средством безопасности 110. В другом варианте реализации виртуальная машина 120 выбирается средством безопасности 110 из ранее созданных виртуальных машин.In general, for malware analysis, file 100 is opened in virtual machine 120 as an isolated environment for executing files. Security tool 110 transmits file 100 to virtual machine 120. In one embodiment, virtual machine 120 is created by security tool 110. In another embodiment, virtual machine 120 is selected by security tool 110 from previously created virtual machines.

Стоит отметить, что в рамках настоящего изобретения файлом 100 является:It is worth noting that in the framework of the present invention, file 100 is:

- исполняемый файл;- executable file;

- динамическая библиотека;- dynamic library;

- сценарий, исполняемый каким-либо интерпретатором (например, файлы Microsoft PowerShell);- a script executed by an interpreter (for example, Microsoft PowerShell files);

- файлы, содержащие сценарии исполнения (например, файлы форматов Microsoft Office или Adobe Acrobat);- files containing execution scripts (for example, Microsoft Office or Adobe Acrobat file formats);

- веб-страница;- webpage;

- изображение;- image;

- прочие известные из уровня техники файлы, которые могут при использовании (например, при исполнении или открытии другими приложениями) нанести вред данным пользователя вычислительного устройства.- other files known from the prior art that, when used (for example, when executed or opened by other applications), can harm the user data of the computing device.

В одном из вариантов реализации под файлом 100 понимается ссылка (например, URL).In one embodiment, a file 100 is a link (for example, a URL).

В общем случае анализ файла 100 осуществляется после его открытия в операционной системе виртуальной машины 120. Под открытием файла 100 понимается одно из:In the General case, the analysis of the file 100 is carried out after it is opened in the operating system of the virtual machine 120. By opening the file 100 is meant one of:

- исполнение файла 100, если файл 100 исполняемый;- execution of file 100, if file 100 is executable;

- открытие файла 100 приложением, если файл 100 не исполняемый.- opening the file 100 by the application if the file 100 is not executable.

Результатом открытия файла 100 является создание и запуск на исполнение процесса (англ. process) в виртуальной машине 120. При этом создается по меньшей мере один поток (англ. thread).The result of opening the file 100 is the creation and execution of a process (Eng. Process) in the virtual machine 120. This creates at least one thread (Eng. Thread).

В одном из вариантов реализации средство безопасности 110 и монитор виртуальных машин 115 (далее по тексту - гипервизор), под управлением которого работает виртуальная машина 120, исполняются на вычислительном устройстве пользователя. В данном случае средство безопасности 110 является приложением безопасности (например, антивирусным приложением). В другом случае средство безопасности 110 и гипервизор 115 исполняются на удаленном сервере (или на разных серверах) или в качестве облачного сервиса. Средство безопасности 110 в этом случае получает файл 100 от сторонних источников (например, от средств безопасности 110, работающих на вычислительных устройствах пользователя), и передает его виртуальной машине 120, где происходит открытие файла 100.In one embodiment, the security tool 110 and the virtual machine monitor 115 (hereinafter referred to as the hypervisor), under the control of which the virtual machine 120 is running, are executed on the user's computing device. In this case, security tool 110 is a security application (e.g., an anti-virus application). In another case, the security tool 110 and the hypervisor 115 are executed on a remote server (or on different servers) or as a cloud service. In this case, the security tool 110 receives the file 100 from third-party sources (for example, from the security tools 110 operating on the user's computing devices) and transfers it to the virtual machine 120, where the file 100 is opened.

В общем случае гипервизор 115 содержит средство перехвата 130 (средство перехвата 130 является модулем, компонентом или функциональной частью гипервизора 115). Средство перехвата 130 перехватывает вызовы API-функций потоками процесса, созданного при открытии файла 100 в виртуальной машине 120, считывает контекст процессора, на котором исполняется поток, вызывавший API-функцию. Стоит отметить, что контекст процессора содержит по меньшей мере значения регистров процессора. В одном из вариантов реализации средство 130 перехвата также считывает стек, используя ранее считанные данные, содержащиеся в регистрах процессора, соответствующих стеку (например, память по адресу из регистров ESP и ЕВР). Кроме того, средство перехвата 130 агрегирует упомянутые данные, сохраняет их (например, в базе данных или в журнале 150) и передает их средству безопасности 110 после исполнения процесса, созданного при открытии файла 100. Средство безопасности 110 в свою очередь выносит на основании данных от средства перехвата 130 вердикт о вредоносности файла 100. В общем случае вердикт выносится после анализа сохраненных данных, например, в зависимости от того, в какой последовательности и с какими параметрами производился вызов API-функций потоками процесса, созданного при открытии файла 100. В одном из вариантов реализации, если вердикт не был вынесен, данные, сохраненные средством перехвата 130, передаются средством безопасности 110 специалисту по информационной безопасности (не отображен на Фиг. 1) на анализ.In general, the hypervisor 115 comprises interception means 130 (the interception means 130 is a module, component, or functional part of the hypervisor 115). The interceptor 130 intercepts the calls to the API functions by the threads of the process created when the file 100 was opened in the virtual machine 120, reads the context of the processor on which the thread that called the API function is executed. It is worth noting that the processor context contains at least the values of the processor registers. In one embodiment, the interceptor 130 also reads the stack using previously read data contained in processor registers corresponding to the stack (for example, memory at an address from ESP and EBP registers). In addition, the interception tool 130 aggregates the mentioned data, saves it (for example, in the database or in the log 150) and transfers it to the security tool 110 after executing the process created when the file 100 was opened. The security tool 110, in turn, makes based on data means of interception 130 verdict on the harmfulness of the file 100. In general, a verdict is issued after analyzing the stored data, for example, depending on in what sequence and with what parameters the API functions were called by process threads, created this when opening the file 100. In one embodiment, if the verdict has not been issued, the data stored by the interceptor 130 is transmitted by the security tool 110 to the information security specialist (not shown in Fig. 1) for analysis.

Фиг. 2 показывает пример реализации предлагаемой системы формирования журнала для проведения антивирусной проверки файла.FIG. 2 shows an example of the implementation of the proposed log generation system for anti-virus file scanning.

Настоящее изобретение отличается тем, что предлагаемая система наряду со средством перехвата 130 содержит также средство анализа 140. В одном из вариантов реализации гипервизор 115 содержит средство анализа 140. В другом варианте реализации средство анализа 140 является компонентом (модулем, функциональной частью) средства безопасности 110.The present invention is characterized in that the proposed system along with interception means 130 also contains analysis means 140. In one embodiment, the hypervisor 115 contains analysis means 140. In another embodiment, the analysis means 140 is a component (module, functional part) of the security means 110.

В общем случае средство перехвата 130 перехватывает события в потоках процесса, созданного при открытии файла 100.In general, the interceptor 130 intercepts events in the threads of the process created when the file 100 was opened.

Событиями являются по меньшей мере:Events are at least:

- вызов API-функции потоком;- call the API function by the thread;

- возврат из API-функции;- return from the API function;

- системный вызов или, другими словами, обращение потока к ядру операционной системы для исполнения какой-либо операции (англ. system call);- a system call or, in other words, a thread accessing the kernel of the operating system to perform an operation (English system call);

- возврат из системного вызова;- return from a system call;

- оповещение (уведомление, нотификация) от операционной системы (например, создание потока, создание процесса, загрузка модуля).- notification (notification, notification) from the operating system (for example, creating a thread, creating a process, loading a module).

В случае перехвата события исполнение потока приостанавливается средством перехвата 130. Стоит отметить, что перехват возможен на разных кольцах защиты операционной системы виртуальной машины 120, реализующих аппаратное разделение системного и пользовательского уровня привилегий, что обеспечивает перехват событий на:In the event of an event interception, the execution of the stream is suspended by the interception means 130. It should be noted that interception is possible on different protection rings of the operating system of the virtual machine 120, which implement hardware separation of the system and user privilege levels, which ensures interception of events on:

- уровне ядра (англ. kernel mode),- kernel level (English kernel mode),

- уровне приложений (англ. user mode).- application level (English user mode).

Исполнение потока приостанавливается путем остановки исполнения инструкций потока.Stream execution is paused by stopping the execution of stream instructions.

Стоит отметить, что в общем случае реализации во время исполнения потоков процесса, созданного при открытии файла 100, средство перехвата 130 определяет стандарт кодирования (англ. coding convention) вызываемых потоками API-функций. Это позволяет однозначно определить использование регистров процессора для передачи параметров в вызываемые API-функции. Так, например, параметры вызовов будут находиться в регистрах ЕСХ (первый параметр), EDX (второй параметр), остальные параметры будут в стеке (регистр ESP). Кроме того, стандарт кодирования позволяет однозначно определить возвращаемые значения. Например, если API-функция возвращает значение «0», то делает это в регистре ЕАХ.It is worth noting that in the general case of the implementation, during the execution of the threads of the process created when the file 100 was opened, the interception tool 130 defines the coding standard (called coding convention) of the API functions called by the threads. This allows you to uniquely determine the use of processor registers for passing parameters to the called API functions. So, for example, the call parameters will be in the ECX registers (first parameter), EDX (second parameter), the remaining parameters will be on the stack (ESP register). In addition, the coding standard allows you to uniquely determine the return value. For example, if the API function returns the value “0”, it does so in the EAX register.

Перехваченное событие и контекст процессора средство перехвата сохраняет в журнал 150. После сохранения журнал 150 передается средством перехвата 130 средству анализа 140.The intercepted event and the processor context are captured by the interceptor in the log 150. After being saved, the log 150 is transmitted by the interceptor 130 to the analyzer 140.

Средство анализа 140 использует набор шаблонов. В одном из вариантов реализации шаблоны хранятся в структуре данных (например, в дереве). В структуру данных шаблоны могут быть добавлены средством анализа 140 во время запуска виртуальной машины 120. В другом варианте реализации, шаблоны выбираются средством анализа 140 из базы данных.Analysis Tool 140 uses a set of patterns. In one embodiment, the templates are stored in a data structure (for example, in a tree). Templates can be added to the data structure by analysis tool 140 during startup of virtual machine 120. In another implementation, templates are selected by analysis tool 140 from the database.

В общем случае шаблон содержит одно или несколько правил. В одном из вариантов реализации каждому правилу назначается приоритет. В другом случае правила добавляются в шаблон упорядоченно.In general, a template contains one or more rules. In one embodiment, each rule is assigned a priority. Otherwise, the rules are added to the template in an orderly manner.

Правило представляет собой логическое условие, основанное на использовании логических операндов (например, «если» или «логическое или»). Кроме того, правила могут быть связаны с друг с другом. В одном из вариантов реализации правило использует сохраненный контекст процессора. В другом варианте реализации правило содержит логику изменения контекста процессора и данные для изменения контекста процессора. В еще одном вариантов реализации правило содержит логику, с помощью которой средство анализа 140 признает открытый файл 100 вредоносным.A rule is a logical condition based on the use of logical operands (for example, “if” or “logical or”). In addition, the rules may be related to each other. In one implementation, the rule uses the stored processor context. In another embodiment, the rule contains logic for changing the context of the processor and data for changing the context of the processor. In yet another implementation, the rule contains logic by which the analysis tool 140 recognizes the open file 100 as malicious.

Примерами вышеописанных правил являются:Examples of the above rules are:

Правило 1: «если» вызвана FileOpen(«$SytemDrive:\<случайное имя>»), «то» продолжить исполнение.Rule 1: “if” is called by FileOpen (“$ SytemDrive: \ <random name>”), “then” continue execution.

Правило 2: «если» Правило 1 и FileWrite(«$SytemDrive:\<случайное имя>», текстовая строка), «то» продолжить исполнение.Rule 2: “if” Rule 1 and FileWrite (“$ SytemDrive: \ <random name>”, text string), “then” continue execution.

В вышеописанном примере поток процесса, созданного при открытии файла 100, обращается к случайному (требуемому) файлу в корне системного диска. Само по себе событие создания (или чтения) требуемого файла не является вредоносным, но оно зачастую является началом вредоносного функционала. Поэтому средством анализа 140 на основании правил принимается решение продолжить исполнение упомянутого потока. Далее, в требуемый файл производится запись. В зависимости от типа требуемого файла и записанной в него информации требуемый файл может иметь вредоносный функционал.In the above example, the thread of the process created when opening the file 100 accesses a random (required) file in the root of the system disk. The event of creating (or reading) the required file in itself is not malicious, but it is often the beginning of malicious functionality. Therefore, analysis tool 140, based on the rules, makes a decision to continue execution of said stream. Next, the required file is recorded. Depending on the type of the required file and the information recorded in it, the required file may have malicious functionality.

Более подробным примером работы системы и правил является следующий набор:A more detailed example of how the system and rules work is the following set:

Правило 10: «если» файл 100 не подписан, то продолжить исполнение.Rule 10: “if” file 100 is not signed, then continue execution.

Правило 11: «если» правило 10, «и» файл 100 вызвал FileOpen(«$SytemDrive:\<случайное имя>»), «то» подменить возвращаемое значение на «Успех» «и» продолжить исполнение.Rule 11: “if” rule 10, “and” file 100 called FileOpen (“$ SytemDrive: \ <random name>”), “then” replace the return value with “Success” “and” continue execution.

Правило 12: «если» правило 11, «и» файл 100 вызвал FileWrite(«$SytemDrive:\<случайное имя>», буфер памяти, используемый процессом, созданным при открытии файла 100), «то» признать файл 100 вредоносным «и» закончить исполнение.Rule 12: “if” rule 11, “and” file 100 caused FileWrite (“$ SytemDrive: \ <random name>”, the memory buffer used by the process created when opening file 100), “then” recognize file 100 as malicious “and »Finish the execution.

Стоит отметить, что в приведенном примере правил «файл 100» используется для более наглядного и понятного представления правил. В общем случае в правиле используются потоки процесса, созданного при открытии файла 100.It should be noted that in the above example of the rules, “file 100” is used for a more visual and understandable presentation of the rules. In the general case, the rule uses the threads of the process created when the file 100 was opened.

В вышеописанном примере файл 100 не подписан, то есть поставщик (создатель) файла 100 неизвестен. Далее поток процесса, созданного при открытии файла 100, в процессе исполнения также обращается к случайному файлу в корне системного диска. Однако, обычно операционная система запрещает создание файла в корне системного диска (вредоносные файлы могут проверять другие пути, пока файл не создастся). Поэтому средством анализа 140 на основании правил принимается решение подменить возвращаемый результат на «успех», с помощью средства перехвата 130 результат подменяется, затем исполнение потока процесса, созданного при открытии файла 100, продолжается. Далее, в созданный файл производится запись. Если в созданный файл записан буфер памяти, файл может быть вредоносным (иметь вредоносный функционал). Имеет смысл прекратить анализ файла 100, затем провести анализ созданного файла, а по результатам анализа созданного файла вынести вердикт о вредоносности файла 100.In the above example, the file 100 is not signed, that is, the provider (creator) of the file 100 is unknown. Further, the flow of the process created when opening the file 100, in the process of execution also refers to a random file in the root of the system drive. However, usually the operating system prohibits the creation of a file in the root of the system drive (malicious files may check other paths until the file is created). Therefore, the analysis tool 140, based on the rules, makes the decision to replace the returned result with “success”, using the interception tool 130, the result is changed, then the execution of the process flow created when the file 100 is opened continues. Next, a record is created in the created file. If a memory buffer is written to the created file, the file may be malicious (have malicious functionality). It makes sense to stop analyzing file 100, then analyze the created file, and, based on the analysis of the created file, render a verdict on the harmfulness of file 100.

Стоит отметить, что выше описаны лишь примеры правил. В общем случае правила могут быть более емкими, например, отслеживать создание файла по разным путям, отслеживать расширение создаваемого файла, анализировать тип созданного файла, разрешать создание файла и отслеживать дальнейшее поведение потоков процесса, созданного при открытии файла 100 (например, не будет ли попыток добавить созданный файл в список автозапуска операционной системы каким-либо известным образом), отслеживать изменение атрибутов потоками как файла 100, так и других файлов, отслеживать доступ потоков в сеть Интернет.It is worth noting that the above are only examples of rules. In general, the rules can be more capacious, for example, monitor the creation of a file in different ways, monitor the extension of the created file, analyze the type of the created file, allow the creation of the file and monitor the further behavior of the threads of the process created when the file was opened 100 (for example, will there be any attempts add the created file to the startup list of the operating system in any known way), track the change of attributes by the streams of both file 100 and other files, track the access of streams to the Internet.

В одном из вариантов реализации средство анализа 140 также оперирует экспертными данными (экспертизой), которые хранятся в отдельной базе данных. Эти данные могут также использоваться в правилах шаблонов.In one embodiment, the analysis tool 140 also operates with expert data (expertise) that is stored in a separate database. This data can also be used in template rules.

Примером такого правила может являться:An example of such a rule may be:

Правило 21: «если» файл 100 обращается к веб-ресурсу, «и» веб-ресурсу присвоена вредоносная категория, «то» признать файл 100 вредоносным.Rule 21: “if” file 100 refers to the web resource, “and” the web resource is assigned a malicious category, “then” recognize file 100 as malicious.

Стоит отметить, что в вышеописанном примере категория веб-ресурса, к которому обращается поток процесса, созданного при открытии файла 100 в виртуальной машине, ранее определена (присвоена) известным из уровня способом и сохранена в отдельной базе данных.It is worth noting that in the above example, the category of the web resource accessed by the flow of the process created when the file 100 was opened in the virtual machine was previously defined (assigned) in a manner known from the level and stored in a separate database.

В одном из вариантов реализации правило содержит условие для глубины анализа или глубины агрегации события. Например,In one embodiment, the rule contains a condition for the depth of analysis or the depth of event aggregation. For example,

Правило 31: «если» файл 100 исполняет цикл, «и» контекст событий вызова API-функций не меняется, «то» не перехватывать события возврата из API-функций.Rule 31: “if” the file 100 executes a loop, “and” the context of the events of invoking API functions does not change, “then” do not intercept return events from API functions.

Упомянутый пример правила позволяет ускорить исполнение файла 100 путем уменьшения количества перехватов событий и чтения контекста. Если потоком процесса, созданного при открытии файла 100, был вызван цикл длительностью порядка одного миллиарда итераций, состоящий из вызовов «CreateWindow()», «CloseWindow()», не имеет смысла перехватывать и сохранять контекст каждого события. Очевидно, что средство перехвата 130 в соответствии с вышеописанным отработает по меньшей мере четыре миллиарда раз (в цикле вызываются две API-функции, событием является вызов и возврат из API-функции), и столько же раз прочитает контекст процессора.This example rule allows you to speed up the execution of file 100 by reducing the number of event hooks and reading context. If a thread of the order of one billion iterations consisting of calls “CreateWindow ()”, “CloseWindow ()” was called by the flow of the process created when opening file 100, it makes no sense to intercept and save the context of each event. Obviously, the interceptor 130, in accordance with the above, will work at least four billion times (two API functions are called in a loop, the event is a call and return from the API function), and it will read the processor context the same number of times.

В одном из вариантов реализации правило содержит условие увеличения переменной цикла. Например,In one embodiment, the rule contains a condition for increasing the loop variable. For example,

Правило 41: «если» файл 100 исполняет цикл, «и» контекст событий вызова API-функций не меняется, «то» увеличивать значение переменной цикла в 5 раз спустя каждые 10 итераций.Rule 41: “if” file 100 executes a loop, “and” the context of events for invoking API functions does not change, “then” increase the value of the loop variable 5 times every 10 iterations.

Вышеописанный пример применим для ускорения исполнения циклов потоком процесса, созданного при открытии в виртуальной машине 120 файла 100. Средство анализа 140 определяет, что исполняемый поток циклически вызывает некоторые события. При этом ничего не происходит, что является одним из известных сценариев антиэмуляции. Чтобы поток процесса, созданного при открытии файла 100, наиболее полно проявил свой функционал, необходимо как можно быстрее завершить цикл и продолжить исполнение. Благодаря вышеописанному правилу цикл будет завершен в несколько раз быстрее.The above example is applicable to speed up the execution of cycles by a process thread created when file 100 was opened in virtual machine 120. Analysis tool 140 determines that an executable thread cyclically triggers some events. However, nothing happens, which is one of the well-known anti-emulation scenarios. In order for the flow of the process created when opening the file 100 to show its full functionality, it is necessary to complete the cycle as soon as possible and continue execution. Thanks to the above rule, the cycle will be completed several times faster.

В одном из вариантов реализации средство перехвата 130 выявляет при исполнении потока процесса, созданного при открытии файла 100, возникновение события, которое связано с изменением страницы виртуальной памяти (далее по тексту страница памяти). В общем случае событие, связанное с изменением страницы памяти, представляет собой вызов API-функции потоком. Изменение данных в странице памяти может происходить как напрямую, например, вызовом WriteProcessMemory(), так и скрыто, например посредством записи данных с использованием SetWindowLong(). При этом можно выявить, например, описатель (англ. handle) окна. Стоит отметить, что запись в память другого процесса вполне легальная операция с точки зрения операционной системы. Но вредоносные программы также очень часто используют подобные механизмы для внедрения вредоносного кода. События, связанные с изменением страниц памяти, и контекст процессора средство перехвата 130 сохраняет в журнал 150.In one embodiment, the interception tool 130 detects when the process thread created when opening the file 100 is executed, the occurrence of an event that is associated with a change in the virtual memory page (hereinafter referred to as the memory page). In the general case, the event associated with a change in the memory page is a call to an API function by a thread. Changing data in a memory page can occur either directly, for example, by calling WriteProcessMemory (), or hidden, for example, by writing data using SetWindowLong (). In this case, you can identify, for example, the handle (English handle) of the window. It is worth noting that writing to the memory of another process is a completely legal operation from the point of view of the operating system. But malware also very often uses similar mechanisms to inject malicious code. The events associated with the change of the pages of memory, and the processor context, the interceptor 130 stores in the log 150.

Средство анализа 140 определяет измененные страницы памяти. По анализу журнала 150, в котором сохранены события, связанные с изменением страниц памяти, и контекст процессора, средством анализа 140 могут быть выявлены идентификаторы (например, адреса или номера) измененных страниц памяти.An analysis tool 140 determines modified pages of memory. According to the analysis of the log 150, in which the events associated with the change of the memory pages and the processor context are stored, by means of the analysis 140 identifiers (for example, addresses or numbers) of the modified memory pages can be detected.

В одном из вариантов реализации средство анализа 140 передает идентификаторы измененных страниц средству перехвата 130.In one embodiment, the analyzer 140 passes the identifiers of the modified pages to the interceptor 130.

Средство перехвата 130 также выявляет передачу управления на какую-либо из измененных страниц, идентификаторы которых получены от средства анализа 140. Передача управления на страницу памяти в общем случае означает, что поток выполняет код по виртуальному адресу, который содержится на этой странице памяти. В одном из вариантов реализации выявление передачи управления осуществляется в случае, если поток, исполняющий код с измененной страницы, запущен из того же процесса, что и поток, изменивший страницу памяти. В другом варианте реализации выявление передачи управления осуществляется в случае, если поток, исполняющий код с измененной страницы, запущен из процесса, отличного от процесса, поток которого изменил страницу памяти. Таким образом, если потоком процесса, созданного при открытии файла 100, была изменена страница памяти, и она принадлежит этому же (изменение своих собственных страниц памяти используется вредоносными приложениями как защита от сигнатурного анализа или противодействие статическому анализу исполняемого кода) или другому процессу (например, explorer.exe), то необходимо перехватывать события процесса, когда будет передано управление измененной странице памяти.The interceptor 130 also detects the transfer of control to any of the modified pages, the identifiers of which are obtained from the analysis tool 140. Transfer of control to a memory page generally means that the thread executes code at the virtual address that is contained on this memory page. In one embodiment, control transfer is detected if the thread executing the code from the modified page is launched from the same process as the thread that changed the memory page. In another embodiment, the control transfer is detected if the thread executing the code from the modified page is started from a process other than the process whose thread changed the memory page. Thus, if the memory page was changed by the thread of the process created when the file 100 was opened, and it belongs to the same (changing its own memory pages is used by malicious applications as protection against signature analysis or preventing static analysis of executable code) or another process (for example, explorer.exe), it is necessary to intercept process events when control is transferred to the modified memory page.

В общем случае после выполнения передачи управления на измененную страницу памяти средство перехвата 130 и средство анализа 140 выполняют описанные выше действия.In the General case, after the transfer of control to the modified memory page, the interception tool 130 and the analysis tool 140 perform the above operations.

Примером вышеописанного являетсяAn example of the above is

Правило 51: «если» процесс, созданный при открытии файла 100, изменяет данные по меньшей мере в одной странице памяти, «то» перехватывать события при передаче управления по меньшей мере одной из страниц, на которой были изменены данные.Rule 51: “if” the process created when opening the file 100 changes data in at least one memory page, “then” intercept events when transferring control to at least one of the pages on which the data was changed.

Подобный подход позволяет экономить ресурсы системы при анализе приложений, изменяющих страницы памяти других приложений. Например, не анализируются упомянутые выше сценарии анти-эмуляции (множество вызовов API-функций, которые не несут вреда данным пользователя), средство анализа 130 не сохраняет каждый вызов в журнале 150. В данном случае анализируется лишь то, будет ли передано управление измененным страницам памяти, и является ли код в упомянутых измененных страницах виртуальной памяти вредоносным. В сформированный таким образом средством перехвата 130 журнал 150 попадают лишь события, изменяющие страницы памяти, и события, которые возникают при исполнении кода с измененных страниц памяти.This approach saves system resources when analyzing applications that change the memory pages of other applications. For example, the anti-emulation scenarios mentioned above are not analyzed (many calls to API functions that are not harmful to user data), the analysis tool 130 does not save every call in the log 150. In this case, it analyzes only whether control will be transferred to the modified memory pages and whether the code in said modified virtual memory pages is malicious. Only the events that change the pages of memory and the events that occur when the code is executed from the modified pages of the memory get into the journal 150 formed in this way by the interception 130.

Таким образом, средство анализа 140 после получения журнала 150 от средства перехвата 130 анализирует произошедшие события, то есть события (текущее и предыдущие), сохраненные в журнале 150, и данные произошедших событий (например, контекст процессора, соответствующий какому-либо событию). Анализ заключается в сравнении произошедших событий с шаблоном. При этом событие сравнивается последовательно с каждым правилом, сохраненными в шаблоне (в зависимости от порядка правил в шаблоне или их приоритета). На основании сравнения средство анализа 140 принимает по меньшей мере одно из решений:Thus, the analysis tool 140 after receiving the log 150 from the interception tool 130 analyzes the events that have occurred, that is, the events (current and previous) stored in the log 150, and the data of the events that have occurred (for example, the processor context corresponding to any event). The analysis consists in comparing the events that have occurred with the template. In this case, the event is compared sequentially with each rule stored in the template (depending on the order of the rules in the template or their priority). Based on the comparison, the analysis tool 140 makes at least one of the decisions:

- решение о признании файла 100 вредоносным;- decision to recognize the file 100 as malicious;

- решение об остановке исполнения процесса, созданного при открытии файла 100;- the decision to stop the execution of the process created when opening the file 100;

- решение об изменении контекста процессора;- a decision to change the context of the processor;

- решение об ожидании следующего события.- The decision to wait for the next event.

Стоит отметить, что средство анализа 140 может комбинировать упомянутые выше решения. Например, если файл 100 был признан вредоносным, в одном из вариантов реализации можно остановить исполнение процесса, созданного при открытии файла 100. В другом варианте реализации можно продолжить исполнение процесса, созданного при открытии файла 100, то есть ожидать следующего события, для дальнейшего анализа поведения потоков процесса и создания журнала 150. В одном из вариантов реализации признают файл 100 вредоносным, но изменяют контекст процессора и ожидают следующего события. Такая последовательность действий нужна для более полного раскрытия функционала файла 100. Например, файл 100 был признан вредоносным после того, как в процессе анализа был создан еще один файл, содержащий вредоносный код. Однако, в некоторых случаях (например, поток пытается скачать что-то с вредоносного веб-ресурса) имеет смысл продолжить перехват событий и наполнение журнала 150 для анализа дальнейшего поведения потоков процесса, созданного при открытии файла 100. В еще одном из вариантов реализации, даже если файл 100 не был признан вредоносным (например, в процессе исполнения открылось окно, которое ожидает ввод пользователя), принимают решение об остановке исполнения процесса, созданного при открытии файла 100.It is worth noting that the analysis tool 140 can combine the above solutions. For example, if the file 100 was found to be malicious, in one implementation it is possible to stop the execution of the process created when the file 100 is opened. In another embodiment, the execution of the process created when the file 100 was opened, that is, to wait for the next event to further analyze the behavior process threads and log creation 150. In one embodiment, the file 100 is recognized as malicious, but they change the processor context and wait for the next event. Such a sequence of actions is needed to more fully disclose the functionality of file 100. For example, file 100 was found to be malicious after another file containing malicious code was created in the analysis process. However, in some cases (for example, a thread is trying to download something from a maliciously crafted web resource), it makes sense to continue intercepting events and filling log 150 to analyze the further behavior of the process threads created when opening file 100. In another embodiment, even if the file 100 was not recognized as malicious (for example, a window was opened during execution that was waiting for user input), they decide to stop the execution of the process created when the file 100 was opened.

Принятые решения средство анализа 140 передает средству перехвата 130. Средство перехвата 130 исполняет действия, соответствующие принятым решениям. В случае принятия средством анализа 140 решения об ожидании следующего события возобновляется исполнение потока, которое было приостановлено средством перехвата 130.The analysis means 140 passes the decisions to the interceptor 130. The interceptor 130 performs the actions corresponding to the decisions made. If the analysis tool 140 makes a decision to wait for the next event, the execution of the thread that has been suspended by the interception tool 130 resumes.

В одном из вариантов реализации средство анализа 140 инициирует перезагрузку виртуальной машины 120. Например, если в процессе анализа файла 100 был создан новый файл, путь к которому был добавлен в автозагрузку операционной системы виртуальной машины 120, средство анализа 140 инициирует перезагрузку, чтобы проверить функционал созданного файла на вредоносность.In one embodiment, the analysis tool 140 initiates a reboot of the virtual machine 120. For example, if a new file was created during the analysis of the file 100, the path to which was added to the startup of the operating system of the virtual machine 120, the analysis tool 140 initiates a reboot to verify the functionality of the created file for malware.

В общем случае после завершения анализа файла 100 в виртуальной машине 120 средство перехвата 130 передает журнал 150 средству безопасности 110. Анализ файл 100 может быть завершен как естественным путем (потоки процесса, созданного при открытии файла 100, сами закончили исполнение), так и по решению средства анализа 140 (средством анализа 140 вынесено решение об остановке процесса, созданного при открытии файла 100).In the general case, after the analysis of the file 100 in the virtual machine 120 is completed, the interception tool 130 transfers the log 150 to the security tool 110. The analysis of the file 100 can be completed both naturally (the threads of the process created when opening the file 100 completed the execution themselves), and by decision analysis tools 140 (analysis tool 140 made a decision to stop the process created when opening the file 100).

Таким образом, упомянутая система позволяет выявить вредоносность файла 100 на основании решений от средства анализа 140, а именно на основании того, было ли вынесено решение о признании файла 100 вредоносным.Thus, the said system makes it possible to detect the harmfulness of the file 100 based on the decisions from the analysis tool 140, namely, based on whether a decision was made to recognize the file 100 as malicious.

Фиг. 3 показывает пример реализации предлагаемого способа формирования журнала для проведения антивирусной проверки файла.FIG. 3 shows an example implementation of the proposed method for generating a log for anti-virus scanning of a file.

В общем случае формирования журнала для проведения антивирусной проверки файла средство безопасности 110 передает файл 100 виртуальной машине 120.In the general case of generating a log for anti-virus scanning of a file, security tool 110 transmits file 100 to virtual machine 120.

В общем случае анализ файла 100 осуществляется после его открытия в операционной системе виртуальной машины 120. Под открытием файла 100 понимается одно из:In the General case, the analysis of the file 100 is carried out after it is opened in the operating system of the virtual machine 120. By opening the file 100 is meant one of:

- исполнение файла, если файл исполняемый;- file execution, if the file is executable;

- открытие файла приложением, если файл не исполняемый.- opening the file by the application if the file is not executable.

На начальном этапе 310 выявляют с помощью средства перехвата 130 во время исполнения потока процесса, созданного при открытии упомянутого файла, возникновение события, которое связано с изменением по меньшей мере одной страницы памяти. В общем случае событие, связанное с изменением страницы памяти, представляет собой вызов API-функции потоком. Упомянутое событие и контекст процессора сохраняются средством перехвата 130 в журнал 150.At the initial step 310, an interception 130 is detected during the execution of the process thread created when the said file was opened, the occurrence of an event that is associated with a change in at least one memory page. In the general case, the event associated with a change in the memory page is a call to an API function by a thread. Said event and processor context are stored by interceptor 130 to log 150.

На этапе 320 определяют с помощью средства анализа 140 по меньшей мере одну измененную страницу памяти путем анализа сохраненных в журнале 150 данных. В одном из вариантов реализации при определении измененных страниц памяти выявляют идентификаторы измененных страниц. Идентификаторы измененных страниц средство анализа 140 передает средству перехвата 130.At 320, at least one modified memory page is determined by analysis tool 140 by analyzing data stored in log 150. In one embodiment, identifiers of modified pages are identified when defining modified memory pages. The identifiers of the changed pages, the analysis tool 140 passes to the interception tool 130.

На этапе 330 выявляют с помощью средства перехвата 130 во время исполнения потока процесса, созданного при открытии файла, передачу управления по меньшей мере одной измененной странице памяти. Передача управления на страницу памяти в общем случае означает, что поток выполняет код по виртуальному адресу, который содержится на этой странице памяти. В одном из вариантов реализации выявление передачи управления осуществляется в случае, если поток, исполняющий код с измененной страницы, запущен из того же процесса, что и поток, изменивший страницу памяти. В другом варианте реализации выявление передачи управления осуществляется в случае, если поток, исполняющий код с измененной страницы, запущен из процесса, отличного от процесса, поток которого изменил страницу памяти, и.At 330, the control transfer of at least one modified memory page is detected by interception 130, during execution of the process flow created when the file was opened. Transferring control to a memory page generally means that the thread executes the code at the virtual address that is contained on this memory page. In one embodiment, control transfer is detected if the thread executing the code from the modified page is launched from the same process as the thread that changed the memory page. In another embodiment, the control transfer is detected if the thread executing the code from the modified page is launched from a process other than the process whose thread changed the memory page, and.

На этапе 340 с помощью средства анализа 140 формируют журнал 150, в который сохраняют:At step 340 using the analysis tool 140 form a journal 150, which stores:

- события, возникающие во время исполнения потока процесса, созданного при открытии упомянутого файла, в измененной странице памяти;- events that occur during execution of a process thread created when the mentioned file is opened in the modified memory page;

- считываемый при возникновении сохраняемого в журнал события контекст процессора, на котором исполняется поток процесса, созданного при открытии упомянутого файла.- the context of the processor that is read when the event is stored in the event log, on which the thread of the process created when the mentioned file was opened is executed.

В одном из вариантов реализации на этапе 350 после формирования журнала 150 на этапе 340 производят его анализ с помощью средства анализа 140 для определения вредоносности файла, открываемого в виртуальной машине.In one embodiment, at step 350, after generating log 150, at step 340, it is analyzed using analysis tool 140 to determine the harmfulness of the file opened in the virtual machine.

Фиг. 4 представляет пример компьютерной системы общего назначения, персональный компьютер или сервер 20, содержащий центральный процессор 21, системную память 22 и системную шину 23, которая содержит разные системные компоненты, в том числе память, связанную с центральным процессором 21. Системная шина 23 реализована, как любая известная из уровня техники шинная структура, содержащая в свою очередь память шины или контроллер памяти шины, периферийную шину и локальную шину, которая способна взаимодействовать с любой другой шинной архитектурой. Системная память содержит постоянное запоминающее устройство (ПЗУ) 24, память с произвольным доступом (ОЗУ) 25. Основная система ввода/вывода (BIOS) 26, содержит основные процедуры, которые обеспечивают передачу информации между элементами персонального компьютера 20, например, в момент загрузки операционной системы с использованием ПЗУ 24.FIG. 4 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 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 ROM systems 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. Similar input devices are, as usual, connected to computer system 20 via 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 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, представленного на Фиг. 4. В вычислительной сети могут присутствовать также и другие устройства, например, маршрутизаторы, сетевые станции, пиринговые устройства или иные сетевые узлы.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 are the same personal computers or servers that have most or all of the elements mentioned earlier in the description of the creature the personal computer 20 of FIG. 4. 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. One skilled in the art will recognize that there may be other embodiments of the present invention consistent with the spirit and scope of the present invention.

Claims (15)

1. Способ принятия решения о признании вредоносным файла, открываемого в виртуальной машине в виде среды для безопасного исполнения файлов, при этом способ содержит этапы, на которых:1. A method for deciding whether to recognize a file opened in a virtual machine as an environment for the safe execution of files, the method comprises the steps of: а) выявляют во время исполнения потока процесса, созданного при открытии упомянутого файла, возникновение события, которое связано с изменением по меньшей мере одной страницы виртуальной памяти;a) during the execution of the thread of the process created when the mentioned file is opened, the occurrence of an event that is associated with a change in at least one page of virtual memory is detected; б) выявляют во время исполнения потока процесса, созданного при открытии упомянутого файла, передачу управления по меньшей мере в одну измененную страницу виртуальной памяти;b) identify during execution of the process thread created when opening the file, the transfer of control to at least one modified page of virtual memory; в) формируют журнал, в который сохраняют:c) form a journal in which they save: - события, возникающие во время исполнения потока процесса, созданного при открытии упомянутого файла, в измененной странице памяти, и- events that occur during execution of the process thread created when the mentioned file is opened in the modified memory page, and - считываемый при возникновении сохраняемого в журнал события контекст процессора, на котором исполняется поток процесса, созданного при открытии упомянутого файла;- the context of the processor that is read when the event is stored in the event log, on which the thread of the process created when the mentioned file was opened is executed; г) сравнивают сохраненные в сформированном журнале события и контекст процессора с по меньшей мере одним шаблоном;d) compare the events stored in the generated log and the processor context with at least one template; д) принимают решение о признании файла вредоносным на основании результатов сравнения.e) make a decision to recognize the file as malicious based on the results of the comparison. 2. Способ по п. 1, в котором событие, связанное с изменением страницы памяти, представляет собой вызов API-функции во время исполнения потока процесса.2. The method according to claim 1, in which the event associated with a change in the memory page is a call to an API function during execution of a process thread. 3. Способ по п. 1, в котором при определении измененной страницы памяти выявляют идентификатор измененной страницы.3. The method according to p. 1, in which when determining the changed memory page identifies the identifier of the modified page. 4. Способ по п. 1, в котором выявление передачи управления измененной странице памяти осуществляется в случае, если поток, исполняющий код с измененной страницы, запущен из того же процесса, что и поток, изменивший страницу памяти.4. The method according to claim 1, wherein the control transfer to the changed memory page is detected if the thread executing the code from the modified page is launched from the same process as the thread that changed the memory page. 5. Способ по п. 1, в котором выявление передачи управления измененной странице памяти осуществляется в случае, если поток, исполняющий код с измененной страницы, запущен из процесса, отличного от процесса, поток которого изменил страницу памяти.5. The method according to claim 1, wherein the control transfer to the changed memory page is detected if the thread executing the code from the modified page is launched from a process other than the process whose thread changed the memory page. 6. Способ по п. 1, в котором шаблон содержит по меньшей мере одно правило.6. The method according to claim 1, in which the template contains at least one rule. 7. Способ по п. 6, в котором правило содержит по меньшей мере одно событие.7. The method of claim 6, wherein the rule comprises at least one event. 8. Способ по п. 6, в котором правило содержит по меньшей мере один контекст процессора.8. The method of claim 6, wherein the rule comprises at least one processor context.
RU2017115048A 2017-04-28 2017-04-28 System and method for log forming in virtual machine for anti-virus file checking RU2649794C1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
RU2017115048A RU2649794C1 (en) 2017-04-28 2017-04-28 System and method for log forming in virtual machine for anti-virus file checking

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
RU2017115048A RU2649794C1 (en) 2017-04-28 2017-04-28 System and method for log forming in virtual machine for anti-virus file checking

Publications (1)

Publication Number Publication Date
RU2649794C1 true RU2649794C1 (en) 2018-04-04

Family

ID=61867410

Family Applications (1)

Application Number Title Priority Date Filing Date
RU2017115048A RU2649794C1 (en) 2017-04-28 2017-04-28 System and method for log forming in virtual machine for anti-virus file checking

Country Status (1)

Country Link
RU (1) RU2649794C1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2708355C1 (en) * 2018-06-29 2019-12-05 Акционерное общество "Лаборатория Касперского" Method of detecting malicious files that counteract analysis in isolated environment
EP3588346A1 (en) * 2018-06-29 2020-01-01 AO Kaspersky Lab Method of detecting malicious files resisting analysis in an isolated environment
RU2724790C1 (en) * 2018-12-28 2020-06-25 Акционерное общество "Лаборатория Касперского" System and method of generating log when executing file with vulnerabilities in virtual machine
CN114598747A (en) * 2022-03-15 2022-06-07 国网安徽省电力有限公司信息通信分公司 Data acquisition method and system of virtualization cloud platform

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080320594A1 (en) * 2007-03-19 2008-12-25 Xuxian Jiang Malware Detector
US7779472B1 (en) * 2005-10-11 2010-08-17 Trend Micro, Inc. Application behavior based malware detection
US8479286B2 (en) * 2009-12-15 2013-07-02 Mcafee, Inc. Systems and methods for behavioral sandboxing
RU2568282C2 (en) * 2014-04-18 2015-11-20 Закрытое акционерное общество "Лаборатория Касперского" System and method for ensuring fault tolerance of antivirus protection realised in virtual environment
US20170068815A1 (en) * 2014-07-14 2017-03-09 Palo Alto Networks, Inc. Detection of malware using an instrumented virtual machine environment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7779472B1 (en) * 2005-10-11 2010-08-17 Trend Micro, Inc. Application behavior based malware detection
US20080320594A1 (en) * 2007-03-19 2008-12-25 Xuxian Jiang Malware Detector
US8479286B2 (en) * 2009-12-15 2013-07-02 Mcafee, Inc. Systems and methods for behavioral sandboxing
RU2568282C2 (en) * 2014-04-18 2015-11-20 Закрытое акционерное общество "Лаборатория Касперского" System and method for ensuring fault tolerance of antivirus protection realised in virtual environment
US20170068815A1 (en) * 2014-07-14 2017-03-09 Palo Alto Networks, Inc. Detection of malware using an instrumented virtual machine environment

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2708355C1 (en) * 2018-06-29 2019-12-05 Акционерное общество "Лаборатория Касперского" Method of detecting malicious files that counteract analysis in isolated environment
EP3588346A1 (en) * 2018-06-29 2020-01-01 AO Kaspersky Lab Method of detecting malicious files resisting analysis in an isolated environment
CN110659478A (en) * 2018-06-29 2020-01-07 卡巴斯基实验室股份制公司 Method for detecting malicious files that prevent analysis in an isolated environment
US11170103B2 (en) 2018-06-29 2021-11-09 AO Kaspersky Lab Method of detecting malicious files resisting analysis in an isolated environment
CN110659478B (en) * 2018-06-29 2023-08-15 卡巴斯基实验室股份制公司 Method for detecting malicious files preventing analysis in isolated environment
RU2724790C1 (en) * 2018-12-28 2020-06-25 Акционерное общество "Лаборатория Касперского" System and method of generating log when executing file with vulnerabilities in virtual machine
CN114598747A (en) * 2022-03-15 2022-06-07 国网安徽省电力有限公司信息通信分公司 Data acquisition method and system of virtualization cloud platform
CN114598747B (en) * 2022-03-15 2023-09-29 国网安徽省电力有限公司信息通信分公司 Data acquisition method and system of virtualized cloud platform

Similar Documents

Publication Publication Date Title
RU2665911C2 (en) System and method of file analysis for maliciousness in virtual machine
US10803180B2 (en) Deterministic method for detecting and blocking of exploits on interpreted code
US11048795B2 (en) System and method for analyzing a log in a virtual machine based on a template
KR102206115B1 (en) Behavioral malware detection using interpreter virtual machine
RU2589862C1 (en) Method of detecting malicious code in random-access memory
RU2514141C1 (en) Method of emulating system function calls for evading emulation countermeasures
JP6346632B2 (en) System and method for detecting malicious files on mobile devices
JP6700351B2 (en) System and method for detection of malicious code in a process&#39;s address space
US20170090929A1 (en) Hardware-assisted software verification and secure execution
RU2724790C1 (en) System and method of generating log when executing file with vulnerabilities in virtual machine
JP2018041438A (en) System and method for detecting malicious codes in file
RU2649794C1 (en) System and method for log forming in virtual machine for anti-virus file checking
CN110659478B (en) Method for detecting malicious files preventing analysis in isolated environment
EP3361406A1 (en) System and method of analysis of files for maliciousness in a virtual machine
US11914711B2 (en) Systems and methods for automatically generating malware countermeasures
RU2592383C1 (en) Method of creating antivirus record when detecting malicious code in random-access memory
Nguyen et al. Pushdown model generation of malware
EP4312401A1 (en) Methods and systems for analyzing environment-sensitive malware with coverage-guided fuzzing
Gupta et al. Pattern based malware detection technique in cloud architecture
EP3588346A1 (en) Method of detecting malicious files resisting analysis in an isolated environment
EP3674940A1 (en) System and method of forming a log when executing a file with vulnerabilities in a virtual machine