+

JP2018195155A - Program, information processing apparatus, and information processing method - Google Patents

Program, information processing apparatus, and information processing method Download PDF

Info

Publication number
JP2018195155A
JP2018195155A JP2017099584A JP2017099584A JP2018195155A JP 2018195155 A JP2018195155 A JP 2018195155A JP 2017099584 A JP2017099584 A JP 2017099584A JP 2017099584 A JP2017099584 A JP 2017099584A JP 2018195155 A JP2018195155 A JP 2018195155A
Authority
JP
Japan
Prior art keywords
file
condition
program
ransomware
predetermined process
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
JP2017099584A
Other languages
Japanese (ja)
Other versions
JP6219550B1 (en
Inventor
孝志 吉川
Takashi Yoshikawa
孝志 吉川
圭 菅原
Kei Sugawara
圭 菅原
優 関原
Yu Sekihara
優 関原
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsui Bussan Secure Directions Inc
Original Assignee
Mitsui Bussan Secure Directions Inc
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 Mitsui Bussan Secure Directions Inc filed Critical Mitsui Bussan Secure Directions Inc
Priority to JP2017099584A priority Critical patent/JP6219550B1/en
Priority to US15/645,270 priority patent/US10264002B2/en
Application granted granted Critical
Publication of JP6219550B1 publication Critical patent/JP6219550B1/en
Priority to US16/144,606 priority patent/US11159541B2/en
Publication of JP2018195155A publication Critical patent/JP2018195155A/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

To provide a program for effectively preventing an attack of malware, an information processing apparatus, and an information processing method.SOLUTION: A predetermined process is determined as ransomware when the following conditions are satisfied: an actual file on a disc is mapped on a memory as a virtual file corresponding to the actual file by a predetermined process (first condition); the virtual file is unmapped by the predetermined process (second condition); and file structure of the actual file or the virtual file at the time of unmapping is changed to be inappropriate (third condition).SELECTED DRAWING: Figure 71

Description

本発明は、プログラム、情報処理装置、及び情報処理方法に関する。   The present invention relates to a program, an information processing apparatus, and an information processing method.

近年、ランサムウェアと呼ばれる種類のマルウェアが世界的に流行している。   In recent years, a type of malware called ransomware has become popular worldwide.

ランサムウェアは、他の一般的なマルウェアと同じくインターネットやメール経由で端末に感染する。   Ransomware, like other common malware, infects devices via the Internet and email.

ランサムウェアは一度感染すると、端末上の一部のファイルまたは全体を暗号化(ロック)し、ファイルの使用または端末の使用を不可能にした上で、身代金(ランサム:ransom)を支払うよう要求する。暗号化されたファイルを復元することの見返りに金銭を要求する脅迫型のマルウェアである。   Once the ransomware is infected, it encrypts (locks) some or all of the files on the device, makes it impossible to use the file or the device, and asks to pay a ransom. . It is a threatening malware that demands money in return for restoring encrypted files.

ランサムウェアの場合、感染すると直ちにファイルの暗号化が開始される。このため、そのランサムウェアがセキュリティ製品にとって未知の検体である場合、パターンファイルによる検知等の通常の検知では間に合わず、ファイルの暗号化を阻止することは困難である。仮にランサムウェアの感染に早期に気付き、直ちに端末の電源を切る等の処置をとったとしても、ランサムウェアによりいくらかのファイルが暗号化されることは免れず、被害を完全に阻止することは非常に困難である。   In the case of ransomware, file encryption starts immediately after infection. For this reason, when the ransomware is an unknown sample for a security product, it is difficult to prevent file encryption because normal detection such as detection by a pattern file is not in time. Even if you notice ransomware infection at an early stage and immediately take measures such as turning off the power of the terminal, it is inevitable that some files will be encrypted by ransomware, and it is very difficult to completely prevent damage It is difficult to.

ランサムウェアを検出するための方法として、ランサムウェアがユーザーによる操作や入力状態に関係なく、突然ウィンドウを表示する等の特徴的動作をすることを利用して、キーボード、マウス等の入力インターフェースの操作状態と、ディスプレイデバイスの変更状態とを監視してランサムウェアを検出する方法が知られている(特許文献1参照)   As a method for detecting ransomware, operation of input interfaces such as a keyboard and a mouse is performed by utilizing a characteristic operation such as suddenly displaying a window regardless of a user's operation or an input state. A method for detecting a ransomware by monitoring a state and a change state of a display device is known (see Patent Document 1).

米国特許出願公開第2014/0181971号明細書US Patent Application Publication No. 2014/0181971

従来の方法ではランサムウェアのようなマルウェアによるファイルの暗号化等の攻撃を有効に阻止することが困難であった。   In the conventional method, it has been difficult to effectively prevent attacks such as file encryption by malware such as ransomware.

本発明の目的は、マルウェアによる攻撃を有効に阻止することができるプログラム、情報処理装置、及び情報処理方法を提供することにある。   An object of the present invention is to provide a program, an information processing apparatus, and an information processing method that can effectively prevent an attack by malware.

本発明の一態様によるプログラムは、コンピューターを、所定のプロセスから呼び出されるファイル書込関数がデータを書き込むファイルパスと同一のファイルパスに対して、前記所定のプロセスからファイル読出関数が既に呼び出されているという第1の条件と、前記ファイル書込関数が、前記ファイルパスのファイルのヘッダを書き換えるという第2の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断部として機能させることを特徴とする。   In the program according to one aspect of the present invention, the file read function is already called from the predetermined process with respect to the same file path as the file write function to which the file write function called from the predetermined process writes data. Function as a determination unit that determines that the predetermined process is ransomware when the file write function satisfies the second condition that the file write function rewrites the header of the file in the file path. It is characterized by making it.

上述したプログラムにおいて、前記判断部は、前記第1の条件及び前記第2の条件に加えて、前記ファイルパスのファイルがヘッダを有しないテキストファイルであるという第3の条件とを満足する場合には、前記所定のプロセスをランサムウェアとして処理するか否かの処理の選択肢をユーザーに提示するようにしてもよい。   In the above-described program, when the determination unit satisfies the third condition that the file of the file path is a text file having no header in addition to the first condition and the second condition. May present a user with a processing option as to whether or not to process the predetermined process as ransomware.

上述したプログラムにおいて、前記判断部は、前記第1の条件及び前記第2の条件に加えて、前記所定のプロセスから、前記ファイル書込関数の呼び出しの前に、前記ファイルパスに含まれるパスと同一のパスにおける他のファイルを検索するファイル検索関数が呼びだされているという第4の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断するようにしてもよい。   In the above-described program, the determination unit includes, in addition to the first condition and the second condition, a path included in the file path from the predetermined process before the file write function is called. The predetermined process may be determined as ransomware when the fourth condition that a file search function for searching for another file in the same path is called is satisfied.

上述したプログラムにおいて、前記判断部は、前記第1の条件及び前記第2の条件に加えて、前記所定のプロセスから、前記ファイル書込関数の呼び出しの後に、前記ファイルパスに含まれるパスと同一のパスを移動元のパスとし、前記ファイルパスに含まれるパスと同一のパスを移動元のパスとするファイル移動関数が呼びだされているという第5の条件を満足する場合に、前記所定のプロセスをランサムウェアと判断するようにしてもよい。   In the above-described program, the determination unit is the same as the path included in the file path after calling the file write function from the predetermined process in addition to the first condition and the second condition. When the fifth condition is satisfied that the file movement function is called with the path of the file as the movement source path and the same path as the path included in the file path being called, The process may be determined as ransomware.

本発明の一態様によるプログラムは、コンピューターを、所定のプロセスから呼び出されるファイル削除関数が削除するファイルパスと同一のファイルパスに対して、前記所定のプロセスからファイル読出関数が既に呼び出されているという第1の条件と、前記所定のプロセスから呼び出される前記ファイル削除関数が削除する前記ファイルパスと同一のファイルパスを移動先とする第1のファイル移動関数が既に呼び出されているという第2の条件と、前記所定のプロセスから呼び出される第2のファイル移動関数の移動元のファイルパスと同一のファイルパスに対して、前記所定のプロセスからファイル書込関数が既に呼び出されているという第3の条件と、前記第1のファイル移動関数の移動元のファイルパスのファイルのヘッダと、前記ファイル削除関数が削除する前記ファイルパスのファイルのヘッダとが相違しているという第4の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断部として機能させることを特徴とする。   In the program according to one aspect of the present invention, the file read function is already called from the predetermined process with respect to the same file path as the file path deleted by the file deletion function called from the predetermined process. The first condition and the second condition that the first file movement function having the same file path as the file path to be deleted by the file deletion function called from the predetermined process has already been called And a third condition that the file write function is already called from the predetermined process for the same file path as the source file path of the second file move function called from the predetermined process. And a file header of the file path of the movement source of the first file movement function, When the fourth condition that a file header of the file path to be deleted is different from the file path to be deleted by the file deletion function is made to function as a determination unit that determines the predetermined process as ransomware. And

本発明の一態様によるプログラムは、コンピューターを、所定のプロセスから呼び出されるファイル移動関数の移動先のファイルパスと同一のファイルパスに対して、前記所定のプロセスからファイル読出関数が既に呼び出されているという第1の条件と、前記ファイル移動関数の移動元のファイルパスと同一のファイルパスに対して、前記所定のプロセスからファイル書込関数が既に呼び出されているという第2の条件と、前記ファイル移動関数の移動元のファイルパスのファイルのヘッダと、前記ファイル移動関数の移動先のファイルパスのファイルのヘッダとが相違しているという第3の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断部として機能させることを特徴とする。   In the program according to one aspect of the present invention, the file read function is already called from the predetermined process with respect to the same file path as the destination file path of the file move function called from the predetermined process. A second condition that a file write function has already been called from the predetermined process for a file path that is the same as the file path that is the source of the file move function, and the file The predetermined process when the third condition that the header of the file path of the file path of the movement function is different from the header of the file path of the file path of the movement destination of the file movement function is satisfied. It is made to function as a judgment part which judges that is ransomware.

本発明の一態様によるプログラムは、コンピューターに、所定のプロセスから呼び出されるファイル書込関数がデータを書き込むファイルパスと同一のファイルパスに対して、前記所定のプロセスからファイル読出関数が既に呼び出されているという第1の条件と、前記ファイル書込関数が、前記ファイルパスのファイルのヘッダを書き換えるという第2の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する手順を実行させることを特徴とする。   In the program according to one aspect of the present invention, the file read function is already called from the predetermined process to the computer for the same file path as the file write function to which the file write function called from the predetermined process writes data. When the file write function satisfies the second condition that the file write function rewrites the header of the file in the file path, a procedure for determining the predetermined process as ransomware is executed. It is characterized by that.

本発明の一態様によるプログラムは、コンピューターに、所定のプロセスから呼び出されるファイル削除関数が削除するファイルパスと同一のファイルパスに対して、前記所定のプロセスからファイル読出関数が既に呼び出されているという第1の条件と、前記所定のプロセスから呼び出される前記ファイル削除関数が削除する前記ファイルパスと同一のファイルパスを移動先とする第1のファイル移動関数が既に呼び出されているという第2の条件と、前記所定のプロセスから呼び出される第2のファイル移動関数の移動元のファイルパスと同一のファイルパスに対して、前記所定のプロセスからファイル書込関数が既に呼び出されているという第3の条件と、前記第1のファイル移動関数の移動元のファイルパスのファイルのヘッダと、前記ファイル削除関数が削除する前記ファイルパスのファイルのヘッダとが相違しているという第4の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する手順を実行させることを特徴とする。   In the program according to one aspect of the present invention, the file read function is already called from the predetermined process for the same file path as the file path to be deleted by the file deletion function called from the predetermined process. The first condition and the second condition that the first file movement function having the same file path as the file path to be deleted by the file deletion function called from the predetermined process has already been called And a third condition that the file write function is already called from the predetermined process for the same file path as the source file path of the second file move function called from the predetermined process. And a file header of the file path of the movement source of the first file movement function, When the fourth condition that a file header of the file path to be deleted is different from the file header to be deleted by the file deletion function, a procedure for determining the predetermined process as ransomware is executed. To do.

本発明の一態様によるプログラムは、コンピューターに、所定のプロセスから呼び出されるファイル移動関数の移動先のファイルパスと同一のファイルパスに対して、前記所定のプロセスからファイル読出関数が既に呼び出されているという第1の条件と、前記ファイル移動関数の移動元のファイルパスと同一のファイルパスに対して、前記所定のプロセスからファイル書込関数が既に呼び出されているという第2の条件と、前記ファイル移動関数の移動元のファイルパスのファイルのヘッダと、前記ファイル移動関数の移動先のファイルパスのファイルのヘッダとが相違しているという第3の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する手順を実行させることを特徴とする。   In the program according to one aspect of the present invention, the file read function is already called from the predetermined process for the same file path as the destination file path of the file move function called from the predetermined process. A second condition that a file write function has already been called from the predetermined process for a file path that is the same as the file path that is the source of the file move function, and the file The predetermined process when the third condition that the header of the file path of the file path of the movement function is different from the header of the file path of the file path of the movement destination of the file movement function is satisfied. Is executed as a ransomware.

本発明の一態様による情報処理装置は、所定のプロセスから呼び出されるファイル書込関数がデータを書き込むファイルパスと同一のファイルパスに対して、前記所定のプロセスからファイル読出関数が既に呼び出されているという第1の条件と、前記ファイル書込関数が、前記ファイルパスのファイルのヘッダを書き換えるという第2の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断部を有することを特徴とする。   In the information processing apparatus according to one aspect of the present invention, the file read function is already called from the predetermined process with respect to the same file path as the file write function called from the predetermined process. And a determination unit that determines that the predetermined process is ransomware when the file write function satisfies a second condition of rewriting a header of a file in the file path. It is characterized by.

本発明の一態様による情報処理装置は、所定のプロセスから呼び出されるファイル削除関数が削除するファイルパスと同一のファイルパスに対して、前記所定のプロセスからファイル読出関数が既に呼び出されているという第1の条件と、前記所定のプロセスから呼び出される前記ファイル削除関数が削除する前記ファイルパスと同一のファイルパスを移動先とする第1のファイル移動関数が既に呼び出されているという第2の条件と、前記所定のプロセスから呼び出される第2のファイル移動関数の移動元のファイルパスと同一のファイルパスに対して、前記所定のプロセスからファイル書込関数が既に呼び出されているという第3の条件と、前記第1のファイル移動関数の移動元のファイルパスのファイルのヘッダと、前記ファイル削除関数が削除する前記ファイルパスのファイルのヘッダとが相違しているという第4の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断部を有することを特徴とする。   In the information processing apparatus according to one aspect of the present invention, the file read function is already called from the predetermined process for the same file path as the file path to be deleted by the file deletion function called from the predetermined process. And a second condition that a first file movement function having the same file path as the file path to be deleted by the file deletion function called from the predetermined process has already been called. A third condition that a file write function has already been called from the predetermined process for the same file path as the source file path of the second file move function called from the predetermined process; , A file header of the source file path of the first file transfer function, and the file deletion When satisfying the fourth condition that the header of the file of the file path number is deleted is different, characterized by having a determining section for determining the predetermined process and ransomware.

本発明の一態様による情報処理装置は、所定のプロセスから呼び出されるファイル移動関数の移動先のファイルパスと同一のファイルパスに対して、前記所定のプロセスからファイル読出関数が既に呼び出されているという第1の条件と、前記ファイル移動関数の移動元のファイルパスと同一のファイルパスに対して、前記所定のプロセスからファイル書込関数が既に呼び出されているという第2の条件と、前記ファイル移動関数の移動元のファイルパスのファイルのヘッダと、前記ファイル移動関数の移動先のファイルパスのファイルのヘッダとが相違しているという第3の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断部を有することを特徴とする。   In the information processing apparatus according to one aspect of the present invention, the file read function is already called from the predetermined process for the same file path as the destination file path of the file move function called from the predetermined process. A first condition; a second condition that a file write function has already been called from the predetermined process with respect to a file path that is the same as a source file path of the file move function; and the file move When the third condition that the header of the file path of the file path to which the function is moved differs from the header of the file path of the file path to which the file movement function is moved is satisfied, the predetermined process is performed. It has a judgment part which judges as ransomware.

本発明の一態様による情報処理方法は、所定のプロセスから呼び出されるファイル書込関数がデータを書き込むファイルパスと同一のファイルパスに対して、前記所定のプロセスからファイル読出関数が既に呼び出されているという第1の条件と、前記ファイル書込関数が、前記ファイルパスのファイルのヘッダを書き換えるという第2の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断することを特徴とする。   In the information processing method according to one aspect of the present invention, the file read function is already called from the predetermined process with respect to the same file path as the file path in which the file write function called from the predetermined process writes data. The predetermined process is determined to be ransomware when the file write function satisfies the second condition of rewriting the header of the file in the file path. .

本発明の一態様による情報処理方法は、所定のプロセスから呼び出されるファイル削除関数が削除するファイルパスと同一のファイルパスに対して、前記所定のプロセスからファイル読出関数が既に呼び出されているという第1の条件と、前記所定のプロセスから呼び出される前記ファイル削除関数が削除する前記ファイルパスと同一のファイルパスを移動先とする第1のファイル移動関数が既に呼び出されているという第2の条件と、前記所定のプロセスから呼び出される第2のファイル移動関数の移動元のファイルパスと同一のファイルパスに対して、前記所定のプロセスからファイル書込関数が既に呼び出されているという第3の条件と、前記第1のファイル移動関数の移動元のファイルパスのファイルのヘッダと、前記ファイル削除関数が削除する前記ファイルパスのファイルのヘッダとが相違しているという第4の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断することを特徴とする。   According to an information processing method of one aspect of the present invention, a file read function is already called from the predetermined process for the same file path as the file path to be deleted by the file deletion function called from the predetermined process. And a second condition that a first file movement function having the same file path as the file path to be deleted by the file deletion function called from the predetermined process has already been called. A third condition that a file write function has already been called from the predetermined process for the same file path as the source file path of the second file move function called from the predetermined process; , A file header of the source file path of the first file transfer function, and the file deletion When satisfying the fourth condition that the header of the file of the file path number is deleted is different, and wherein the determining the predetermined process and ransomware.

本発明の一態様による情報処理方法は、所定のプロセスから呼び出されるファイル移動関数の移動先のファイルパスと同一のファイルパスに対して、前記所定のプロセスからファイル読出関数が既に呼び出されているという第1の条件と、前記ファイル移動関数の移動元のファイルパスと同一のファイルパスに対して、前記所定のプロセスからファイル書込関数が既に呼び出されているという第2の条件と、前記ファイル移動関数の移動元のファイルパスのファイルのヘッダと、前記ファイル移動関数の移動先のファイルパスのファイルのヘッダとが相違しているという第3の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断することを特徴とする。   In the information processing method according to an aspect of the present invention, the file read function is already called from the predetermined process for the same file path as the destination file path of the file move function called from the predetermined process. A first condition; a second condition that a file write function has already been called from the predetermined process with respect to a file path that is the same as a source file path of the file move function; and the file move When the third condition that the header of the file path of the file path to which the function is moved differs from the header of the file path of the file path to which the file movement function is moved is satisfied, the predetermined process is performed. It is characterized by being determined as ransomware.

本発明の一態様によるプログラムは、コンピューターを、所定のプロセスによりディスク上の実ファイルが前記実ファイルに対応する仮想ファイルとしてメモリ上にマッピングされるという第1の条件と、前記所定のプロセスにより前記仮想ファイルがアンマッピングされるという第2の条件と、アンマッピング時の前記実ファイル又は前記仮想ファイルのファイル構造が不適切な状態に変更されているという第3の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断部として機能させることを特徴とする。   A program according to an aspect of the present invention includes a first condition that a real file on a disk is mapped on a memory as a virtual file corresponding to the real file by a predetermined process; When the second condition that the virtual file is unmapped and the third condition that the file structure of the real file or the virtual file at the time of unmapping is changed to an inappropriate state, The predetermined process is caused to function as a determination unit that determines ransomware.

本発明の一態様によるプログラムは、コンピューターを、所定のプロセスによりディスク上の実ファイルが前記実ファイルに対応する仮想ファイルとしてメモリ上にマッピングされるという第1の条件と、前記第1の条件が連続して発生するという第4の条件と、アンマッピング時の前記実ファイル又は前記仮想ファイルのファイル構造が不適切な状態に変更されているという第3の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断部として機能させることを特徴とする。   A program according to an aspect of the present invention includes a first condition that a real file on a disk is mapped on a memory as a virtual file corresponding to the real file by a predetermined process, and the first condition is The predetermined condition is satisfied when a fourth condition that occurs continuously and a third condition that the file structure of the real file or the virtual file at the time of unmapping is changed to an inappropriate state are satisfied. The process is made to function as a determination unit that determines ransomware.

上述したプログラムにおいて、前記第3の条件は、マッピング時の前記実ファイルのヘッダ情報とアンマッピング時の前記実ファイル又は前記仮想ファイルのヘッダ情報とが相違することであるようにしてもよい。   In the above-described program, the third condition may be that header information of the real file at the time of mapping is different from header information of the real file or the virtual file at the time of unmapping.

本発明の一態様によるプログラムは、コンピューターを、所定のプロセスによりディスク上の実ファイルが前記実ファイルに対応する仮想ファイルとしてメモリ上にマッピングされるという第1の条件と、前記所定のプロセスが前記実ファイルのファイル種別に関連付けられていないプログラムであるという第5の条件と、マッピング時の前記実ファイルの情報とアンマッピング時の前記実ファイル又は前記仮想ファイルの情報とが相違するという第6の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断部として機能させることを特徴とする。   According to one aspect of the present invention, there is provided a program that causes a computer to map a real file on a disk as a virtual file corresponding to the real file on a memory by a predetermined process; The fifth condition that the program is not associated with the file type of the real file, and the sixth condition that the information of the real file at the time of mapping and the information of the real file or the virtual file at the time of unmapping are different. When the condition is satisfied, the predetermined process is made to function as a determination unit that determines to be ransomware.

上述したプログラムにおいて、前記判断部は、前記所定のプロセスにより、前記仮想ファイルを作成する命令、又は、前記仮想ファイルを前記メモリにマッピングする命令が呼び出されると、前記第1の条件を満足すると判断するようにしてもよい。   In the above-described program, the determination unit determines that the first condition is satisfied when an instruction to create the virtual file or an instruction to map the virtual file to the memory is called by the predetermined process. You may make it do.

上述したプログラムにおいて、前記判断部は、前記所定のプロセスにより、前記仮想ファイルを前記メモリからアンマッピングする命令、前記仮想ファイルの一部を前記ディスクに書き込む命令、又は、前記仮想ファイルのハンドルを閉じる命令が呼び出されると、前記第2の条件を満足すると判断するようにしてもよい。   In the above-described program, the determination unit closes an instruction to unmap the virtual file from the memory, an instruction to write a part of the virtual file to the disk, or a handle of the virtual file by the predetermined process. When the instruction is called, it may be determined that the second condition is satisfied.

上述したプログラムにおいて、前記判断部は、前記所定のプロセスにより、前記仮想ファイルを作成する命令、又は、前記仮想ファイルを前記メモリにマッピングする命令が連続して呼び出されると、前記第4の条件を満足すると判断するようにしてもよい。   In the above-described program, when the instruction to create the virtual file or the instruction to map the virtual file to the memory is continuously called by the predetermined process, the determination unit satisfies the fourth condition. You may make it judge that it is satisfied.

上述したプログラムにおいて、前記コンピューターを、更に、前記所定のプロセスにより前記実ファイルが前記仮想ファイルとして前記メモリ上にマッピングされる時に前記実ファイルをバックアップしたバックアップファイルを生成し、前記判断部が前記所定のプロセスをランサムウェアと判断した場合には、前記バックアップファイルを前記ディスク上の前記実ファイルに書き戻すバックアップ部として機能させるようにしてもよい。   In the above-described program, the computer further generates a backup file that backs up the real file when the real file is mapped on the memory as the virtual file by the predetermined process, and the determination unit performs the predetermined process. If the process is determined to be ransomware, the backup file may be made to function as a backup unit that writes back the backup file to the actual file on the disk.

本発明の一態様によるプログラムは、コンピューターを、所定のプロセスによりディスク上の実ファイルへの書き込み命令が発せられたという第7の条件と、前記所定のプロセスが前記実ファイルのファイル種別に関連付けられていないプログラムであるという第8の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断部として機能させることを特徴とする。   A program according to an aspect of the present invention relates to a seventh condition that a command to write to a real file on a disk is issued by a predetermined process, and the predetermined process is associated with the file type of the real file. When the eighth condition that the program is not a program is satisfied, the predetermined process is caused to function as a determination unit that determines to be ransomware.

上述したプログラムにおいて、前記判断部は、前記書き込み命令により前記実ファイルのファイル構造が不適切な状態に変更されているという第9の条件を更に満足する場合に、前記所定のプロセスをランサムウェアと判断するようにしてもよい。   In the above-described program, the determination unit determines that the predetermined process is ransomware when the ninth condition that the file structure of the real file is changed to an inappropriate state by the write command is further satisfied. You may make it judge.

本発明の一態様によるプログラムは、コンピューターに、所定のプロセスによりディスク上の実ファイルが前記実ファイルに対応する仮想ファイルとしてメモリ上にマッピングされるという第1の条件と、前記所定のプロセスにより前記仮想ファイルがアンマッピングされるという第2の条件と、アンマッピング時の前記実ファイル又は前記仮想ファイルのファイル構造が不適切な状態に変更されているという第3の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断手段を実行させることを特徴とする。   A program according to an aspect of the present invention provides a computer with a first condition that a real file on a disk is mapped on a memory as a virtual file corresponding to the real file by a predetermined process, and the predetermined process When the second condition that the virtual file is unmapped and the third condition that the file structure of the real file or the virtual file at the time of unmapping is changed to an inappropriate state, A determination means for determining the predetermined process as ransomware is executed.

本発明の一態様によるプログラムは、コンピューターに、所定のプロセスによりディスク上の実ファイルが前記実ファイルに対応する仮想ファイルとしてメモリ上にマッピングされるという第1の条件と、前記第1の条件が連続して発生するという第4の条件と、アンマッピング時の前記実ファイル又は前記仮想ファイルのファイル構造が不適切な状態に変更されているという第3の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断手段を実行させることを特徴とする。   A program according to an aspect of the present invention includes: a first condition that a real file on a disk is mapped on a computer as a virtual file corresponding to the real file by a predetermined process; The predetermined condition is satisfied when a fourth condition that occurs continuously and a third condition that the file structure of the real file or the virtual file at the time of unmapping is changed to an inappropriate state are satisfied. It is characterized in that a determination means for determining that the process is ransomware is executed.

本発明の一態様によるプログラムは、コンピューターに、所定のプロセスによりディスク上の実ファイルが前記実ファイルに対応する仮想ファイルとしてメモリ上にマッピングされるという第1の条件と、前記所定のプロセスが前記実ファイルのファイル種別に関連付けられていないプログラムであるという第5の条件と、マッピング時の前記実ファイルの情報とアンマッピング時の前記実ファイル又は前記仮想ファイルの情報とが相違するという第6の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断手段を実行させることを特徴とする。   According to one aspect of the present invention, there is provided a program for causing a computer to map a real file on a disk as a virtual file corresponding to the real file on a memory by a predetermined process; The fifth condition that the program is not associated with the file type of the real file, and the sixth condition that the information of the real file at the time of mapping and the information of the real file or the virtual file at the time of unmapping are different. When the condition is satisfied, a determination means for determining the predetermined process as ransomware is executed.

本発明の一態様によるプログラムは、コンピューターに、所定のプロセスによりディスク上の実ファイルへの書き込み命令が発せられたという第7の条件と、前記所定のプロセスが前記実ファイルのファイル種別に関連付けられていないプログラムであるという第8の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断手段を実行させることを特徴とする。   A program according to an aspect of the present invention relates to a seventh condition that a write command to a real file on a disk is issued to a computer by a predetermined process, and the predetermined process is associated with the file type of the real file. When the eighth condition that the program is not yet satisfied is satisfied, a determination means for determining the predetermined process as ransomware is executed.

本発明の一態様による情報処理装置は、所定のプロセスによりディスク上の実ファイルが前記実ファイルに対応する仮想ファイルとしてメモリ上にマッピングされるという第1の条件と、前記所定のプロセスにより前記仮想ファイルがアンマッピングされるという第2の条件と、アンマッピング時の前記実ファイル又は前記仮想ファイルのファイル構造が不適切な状態に変更されているという第3の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断部を有することを特徴とする。   An information processing apparatus according to an aspect of the present invention includes a first condition that a real file on a disk is mapped on a memory as a virtual file corresponding to the real file by a predetermined process, and the virtual process is performed by the predetermined process. When the second condition that the file is unmapped and the third condition that the file structure of the real file or the virtual file at the time of unmapping is changed to an inappropriate state are satisfied, It has a judgment part which judges a predetermined process as ransomware.

本発明の一態様による情報処理装置は、所定のプロセスによりディスク上の実ファイルが前記実ファイルに対応する仮想ファイルとしてメモリ上にマッピングされるという第1の条件と、前記第1の条件が連続して発生するという第4の条件と、アンマッピング時の前記実ファイル又は前記仮想ファイルのファイル構造が不適切な状態に変更されているという第3の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断部を有することを特徴とする。   In the information processing apparatus according to one aspect of the present invention, the first condition that a real file on a disk is mapped on a memory as a virtual file corresponding to the real file by a predetermined process, and the first condition are continuous. The predetermined condition when the fourth condition that the file structure of the real file or the virtual file at the time of unmapping is changed to an inappropriate state is satisfied. It has the judgment part which judges a process as ransomware.

本発明の一態様による情報処理装置は、所定のプロセスによりディスク上の実ファイルが前記実ファイルに対応する仮想ファイルとしてメモリ上にマッピングされるという第1の条件と、前記所定のプロセスが前記実ファイルのファイル種別に関連付けられていないプログラムであるという第5の条件と、マッピング時の前記実ファイルの情報とアンマッピング時の前記実ファイル又は前記仮想ファイルの情報とが相違するという第6の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断部を有することを特徴とする。   An information processing apparatus according to an aspect of the present invention includes a first condition that a real file on a disk is mapped on a memory as a virtual file corresponding to the real file by a predetermined process, and the predetermined process is the real process. The fifth condition that the program is not associated with the file type of the file and the sixth condition that the information on the real file at the time of mapping and the information on the real file or the virtual file at the time of unmapping are different And a determination unit that determines that the predetermined process is ransomware.

本発明の一態様による情報処理装置は、所定のプロセスによりディスク上の実ファイルへの書き込み命令が発せられたという第7の条件と、前記所定のプロセスが前記実ファイルのファイル種別に関連付けられていないプログラムであるという第8の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断部を有することを特徴とする。   An information processing apparatus according to an aspect of the present invention relates to a seventh condition that a write command to a real file on a disk is issued by a predetermined process, and the predetermined process is associated with a file type of the real file. And a determination unit that determines that the predetermined process is ransomware when the eighth condition is satisfied.

本発明の一態様による情報処理方法は、所定のプロセスによりディスク上の実ファイルが前記実ファイルに対応する仮想ファイルとしてメモリ上にマッピングされるという第1の条件と、前記所定のプロセスにより前記仮想ファイルがアンマッピングされるという第2の条件と、アンマッピング時の前記実ファイル又は前記仮想ファイルのファイル構造が不適切な状態に変更されているという第3の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断することを特徴とする。   An information processing method according to an aspect of the present invention includes a first condition that a real file on a disk is mapped on a memory as a virtual file corresponding to the real file by a predetermined process, and the virtual process is performed by the predetermined process. When the second condition that the file is unmapped and the third condition that the file structure of the real file or the virtual file at the time of unmapping is changed to an inappropriate state are satisfied, The predetermined process is determined as ransomware.

本発明の一態様による情報処理方法は、所定のプロセスによりディスク上の実ファイルが前記実ファイルに対応する仮想ファイルとしてメモリ上にマッピングされるという第1の条件と、前記第1の条件が連続して発生するという第4の条件と、アンマッピング時の前記実ファイル又は前記仮想ファイルのファイル構造が不適切な状態に変更されているという第3の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断することを特徴とする。   According to an information processing method of one aspect of the present invention, a first condition that a real file on a disk is mapped on a memory as a virtual file corresponding to the real file by a predetermined process, and the first condition is continuous. The predetermined condition when the fourth condition that the file structure of the real file or the virtual file at the time of unmapping is changed to an inappropriate state is satisfied. It is characterized by judging a process as ransomware.

本発明の一態様による情報処理方法は、所定のプロセスによりディスク上の実ファイルが前記実ファイルに対応する仮想ファイルとしてメモリ上にマッピングされるという第1の条件と、前記所定のプロセスが前記実ファイルのファイル種別に関連付けられていないプログラムであるという第5の条件と、マッピング時の前記実ファイルの情報とアンマッピング時の前記実ファイル又は前記仮想ファイルの情報とが相違するという第6の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断することを特徴とする。   An information processing method according to an aspect of the present invention includes a first condition that a real file on a disk is mapped on a memory as a virtual file corresponding to the real file by a predetermined process, and the predetermined process is the real process. The fifth condition that the program is not associated with the file type of the file and the sixth condition that the information on the real file at the time of mapping and the information on the real file or the virtual file at the time of unmapping are different When the above conditions are satisfied, the predetermined process is determined as ransomware.

本発明の一態様による情報処理方法は、所定のプロセスによりディスク上の実ファイルへの書き込み命令が発せられたという第7の条件と、前記所定のプロセスが前記実ファイルのファイル種別に関連付けられていないプログラムであるという第8の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断することを特徴とする。   An information processing method according to an aspect of the present invention relates to a seventh condition that a write command to a real file on a disk is issued by a predetermined process, and the predetermined process is associated with a file type of the real file. The predetermined process is determined to be ransomware when the eighth condition that the program is not included is satisfied.

以上の通り、本発明によれば、所定のプロセスから呼び出されるファイル書込関数がデータを書き込むファイルパスと同一のファイルパスに対して、所定のプロセスからファイル読出関数が既に呼び出されているという第1の条件と、ファイル書込関数が、ファイルパスのファイルのヘッダを書き換えるという第2の条件とを満足する場合に、所定のプロセスをランサムウェアと判断するようにしたので、マルウェアによる攻撃を有効に阻止することができる。   As described above, according to the present invention, the file read function is already called from the predetermined process with respect to the same file path as the file path in which the file write function called from the predetermined process writes data. Since the predetermined process is judged as ransomware when the condition 1 and the second condition that the file write function rewrites the header of the file in the file path are satisfied, the attack by the malware is effective. Can be prevented.

また、本発明によれば、所定のプロセスによりディスク上の実ファイルが実ファイルに対応する仮想ファイルとしてメモリ上にマッピングされるという第1の条件と、所定のプロセスにより仮想ファイルがアンマッピングされるという第2の条件と、アンマッピング時の実ファイル又は仮想ファイルのファイル構造が不適切な状態に変更されているという第3の条件とを満足する場合に、所定のプロセスをランサムウェアと判断するようにしたので、マルウェアによる攻撃を有効に阻止することができる。   According to the present invention, the first condition that a real file on the disk is mapped on the memory as a virtual file corresponding to the real file by a predetermined process, and the virtual file is unmapped by the predetermined process. And the third condition that the file structure of the real file or virtual file at the time of unmapping is changed to an inappropriate state is determined as the ransomware. As a result, it is possible to effectively prevent malware attacks.

一般的な情報処理装置を示すブロック図である。It is a block diagram which shows a general information processing apparatus. コンピュータープログラムの動作をコンピューターのハードウェアとの関連で示す説明図(その1)である。It is explanatory drawing (the 1) which shows operation | movement of a computer program in relation to the hardware of a computer. コンピュータープログラムの動作をコンピューターのハードウェアとの関連で示す説明図(その2)である。It is explanatory drawing (the 2) which shows operation | movement of a computer program in relation to the hardware of a computer. 本発明の原理(その1)に関し、ランサムウェアCryptoLockerによるファイル暗号化の説明図(その1)である。It is explanatory drawing (the 1) of the file encryption by ransomware CryptoLocker regarding the principle (the 1) of this invention. 本発明の原理(その1)に関し、ランサムウェアCryptoLockerによるファイル暗号化の説明図(その2)である。It is explanatory drawing (the 2) of the file encryption by ransomware CryptoLocker regarding the principle (the 1) of this invention. 本発明の原理(その1)に関し、ランサムウェアCryptoLockerによるファイル暗号化の説明図(その3)である。It is explanatory drawing (the 3) of the file encryption by ransomware CryptoLocker regarding the principle (the 1) of this invention. 本発明の原理(その1)に関し、ランサムウェアCryptoLockerによるファイル暗号化の説明図(その4)である。It is explanatory drawing (the 4) of the file encryption by ransomware CryptoLocker regarding the principle (the 1) of this invention. 本発明の原理(その1)に関し、ランサムウェアCryptoWallによるファイル暗号化の説明図(その1)である。It is explanatory drawing (the 1) of the file encryption by ransomware CryptoWall regarding the principle (the 1) of this invention. 本発明の原理(その1)に関し、ランサムウェアCryptoWallによるファイル暗号化の説明図(その2)である。It is explanatory drawing (the 2) of the file encryption by ransomware CryptoWall regarding the principle (the 1) of this invention. 本発明の原理(その1)に関し、ランサムウェアCryptoWallによるファイル暗号化の説明図(その3)である。It is explanatory drawing (the 3) of the file encryption by ransomware CryptoWall regarding the principle (the 1) of this invention. 本発明の原理(その1)に関し、ランサムウェアCryptoWallによるファイル暗号化の説明図(その4)である。It is explanatory drawing (the 4) of the file encryption by ransomware CryptoWall regarding the principle (the 1) of this invention. 本発明の原理(その1)に関し、ランサムウェアCryptoWallによるファイル暗号化の説明図(その5)である。It is explanatory drawing (the 5) of the file encryption by ransomware CryptoWall regarding the principle (the 1) of this invention. 本発明の原理(その1)に関し、ランサムウェアCryptoWallによるファイル暗号化の説明図(その6)である。It is explanatory drawing (the 6) of the file encryption by ransomware CryptoWall regarding the principle (the 1) of this invention. 本発明の原理(その1)に関し、ランサムウェアCERBERによるファイル暗号化の説明図である。It is explanatory drawing of the file encryption by ransomware CERBER regarding the principle (the 1) of this invention. 本発明の原理(その1)に関し、ランサムウェアTeslaCryptによるファイル暗号化の説明図(その1)である。It is explanatory drawing (the 1) of the file encryption by ransomware TeslaCrypt regarding the principle (the 1) of this invention. 本発明の原理(その1)に関し、ランサムウェアTeslaCryptによるファイル暗号化の説明図(その2)である。It is explanatory drawing (the 2) of the file encryption by ransomware TeslaCrypt regarding the principle (the 1) of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その1)である。It is explanatory drawing (the 1) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その2)である。It is explanatory drawing (the 2) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その3)である。It is explanatory drawing (the 3) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その4)である。It is explanatory drawing (the 4) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その5)である。It is explanatory drawing (the 5) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その6)である。It is explanatory drawing (the 6) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その7)である。It is explanatory drawing (the 7) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その8)である。It is explanatory drawing (the 8) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その9)である。It is explanatory drawing (the 9) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その10)である。It is explanatory drawing (the 10) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その11)である。It is explanatory drawing (the 11) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その12)である。It is explanatory drawing (the 12) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その13)である。It is explanatory drawing (the 13) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その14)である。It is explanatory drawing (the 14) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その15)である。It is explanatory drawing (the 15) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その16)である。It is explanatory drawing (the 16) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その17)である。It is explanatory drawing (the 17) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その18)である。It is explanatory drawing (the 18) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その19)である。It is explanatory drawing (the 19) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その20)である。It is explanatory drawing (the 20) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その21)である。It is explanatory drawing (the 21) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その22)である。It is explanatory drawing (the 22) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その23)である。It is explanatory drawing (the 23) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その24)である。It is explanatory drawing (the 24) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その25)である。It is explanatory drawing (the 25) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その26)である。It is explanatory drawing (the 26) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その27)である。It is explanatory drawing (the 27) explaining the program, information processing apparatus, and information processing method by 1st Embodiment of this invention. 本発明の第2実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その1)である。It is explanatory drawing (the 1) explaining the program, information processing apparatus, and information processing method by 2nd Embodiment of this invention. 本発明の第2実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その2)である。It is explanatory drawing (the 2) explaining the program, information processing apparatus, and information processing method by 2nd Embodiment of this invention. 本発明の第2実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その3)である。It is explanatory drawing (the 3) explaining the program, information processing apparatus, and information processing method by 2nd Embodiment of this invention. 本発明の第2実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その4)である。It is explanatory drawing (the 4) explaining the program, information processing apparatus, and information processing method by 2nd Embodiment of this invention. 本発明の第2実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その5)である。It is explanatory drawing (the 5) explaining the program, information processing apparatus, and information processing method by 2nd Embodiment of this invention. 本発明の第2実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その6)である。It is explanatory drawing (the 6) explaining the program, information processing apparatus, and information processing method by 2nd Embodiment of this invention. 本発明の第2実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その7)である。It is explanatory drawing (the 7) explaining the program, information processing apparatus, and information processing method by 2nd Embodiment of this invention. 本発明の第2実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その8)である。It is explanatory drawing (the 8) explaining the program, information processing apparatus, and information processing method by 2nd Embodiment of this invention. 本発明の原理(その2)に関し、一般的なファイル操作とファイルマッピングによるファイル操作の相違について説明する図である。It is a figure explaining the difference of general file operation and file operation by file mapping regarding the principle (the 2) of this invention. 本発明の原理(その2)に関し、ランサムウェアSporaによるファイル暗号化時のファイル操作の流れを示す図である。It is a figure which shows the flow of the file operation at the time of the file encryption by ransomware Spora regarding the principle (the 2) of this invention. 本発明の原理(その2)に関し、ランサムウェアSporaによるファイル操作とハードウェアとの関係を示す図である。It is a figure which shows the relationship between the file operation by ransomware Spora, and hardware regarding the principle (the 2) of this invention. 本発明の第3実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その1)である。It is explanatory drawing (the 1) explaining the program, information processing apparatus, and information processing method by 3rd Embodiment of this invention. 本発明の第3実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その2)である。It is explanatory drawing (the 2) explaining the program, information processing apparatus, and information processing method by 3rd Embodiment of this invention. 本発明の第3実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その3)である。It is explanatory drawing (the 3) explaining the program, information processing apparatus, and information processing method by 3rd Embodiment of this invention. 本発明の第3実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その4)である。It is explanatory drawing (the 4) explaining the program, information processing apparatus, and information processing method by 3rd Embodiment of this invention. 本発明の第3実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その5)である。It is explanatory drawing (the 5) explaining the program, information processing apparatus, and information processing method by 3rd Embodiment of this invention. 本発明の第3実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その6)である。It is explanatory drawing (the 6) explaining the program, information processing apparatus, and information processing method by 3rd Embodiment of this invention. 本発明の第3実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その7)である。It is explanatory drawing (the 7) explaining the program, information processing apparatus, and information processing method by 3rd Embodiment of this invention. 本発明の第3実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その8)である。It is explanatory drawing (the 8) explaining the program, information processing apparatus, and information processing method by 3rd Embodiment of this invention. 本発明の第3実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その9)である。It is explanatory drawing (the 9) explaining the program, information processing apparatus, and information processing method by 3rd Embodiment of this invention. 本発明の第3実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その10)である。It is explanatory drawing (the 10) explaining the program, information processing apparatus, and information processing method by 3rd Embodiment of this invention. 本発明の第3実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その11)である。It is explanatory drawing (the 11) explaining the program, information processing apparatus, and information processing method by 3rd Embodiment of this invention. 本発明の第3実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その12)である。It is explanatory drawing (the 12) explaining the program, information processing apparatus, and information processing method by 3rd Embodiment of this invention. 本発明の第3実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その13)である。It is explanatory drawing (the 13) explaining the program, information processing apparatus, and information processing method by 3rd Embodiment of this invention. 本発明の第3実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その14)である。It is explanatory drawing (the 14) explaining the program, information processing apparatus, and information processing method by 3rd Embodiment of this invention. 本発明の第3実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その15)である。It is explanatory drawing (the 15) explaining the program, information processing apparatus, and information processing method by 3rd Embodiment of this invention. 本発明の第3実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その16)である。It is explanatory drawing (the 16) explaining the program, information processing apparatus, and information processing method by 3rd Embodiment of this invention. 本発明の第3実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その17)である。It is explanatory drawing (the 17) explaining the program, information processing apparatus, and information processing method by 3rd Embodiment of this invention. 本発明の第3実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その18)である。It is explanatory drawing (the 18) explaining the program, information processing apparatus, and information processing method by 3rd Embodiment of this invention. 本発明の第3実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その19)である。It is explanatory drawing (the 19) explaining the program, information processing apparatus, and information processing method by 3rd Embodiment of this invention. 本発明の第3実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その20)である。It is explanatory drawing (the 20) explaining the program, information processing apparatus, and information processing method by 3rd Embodiment of this invention. 本発明の第3実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その21)である。It is explanatory drawing (the 21) explaining the program, information processing apparatus, and information processing method by 3rd Embodiment of this invention. 本発明の第4実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その1)である。It is explanatory drawing (the 1) explaining the program, information processing apparatus, and information processing method by 4th Embodiment of this invention. 本発明の第4実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その2)である。It is explanatory drawing (the 2) explaining the program, information processing apparatus, and information processing method by 4th Embodiment of this invention. 本発明の第4実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その3)である。It is explanatory drawing (the 3) explaining the program, information processing apparatus, and information processing method by 4th Embodiment of this invention. 本発明の第4実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その4)である。It is explanatory drawing (the 4) explaining the program, information processing apparatus, and information processing method by 4th Embodiment of this invention. 本発明の第4実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その5)である。It is explanatory drawing (the 5) explaining the program, information processing apparatus, and information processing method by 4th Embodiment of this invention. 本発明の第4実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その6)である。It is explanatory drawing (the 6) explaining the program, information processing apparatus, and information processing method by 4th Embodiment of this invention. 本発明の第4実施形態によるプログラム、情報処理装置及び情報処理方法を説明する説明図(その7)である。It is explanatory drawing (the 7) explaining the program, information processing apparatus, and information processing method by 4th Embodiment of this invention.

[情報処理装置]
本発明が適用される一般的な情報処理装置及びその動作について図1乃至図3を用いて説明する。
[Information processing device]
A general information processing apparatus to which the present invention is applied and its operation will be described with reference to FIGS.

図1は一般的な情報処理装置を示すブロック図である。   FIG. 1 is a block diagram showing a general information processing apparatus.

標準的なスタンドアロン環境における情報処理装置10は、コンピューター(PC)20と、外部周辺装置30とから構成されている。   The information processing apparatus 10 in a standard stand-alone environment includes a computer (PC) 20 and an external peripheral device 30.

コンピューター(PC)20は、命令を実行するCPU21と、データおよびプログラムを格納するハードディスク22と、データやプログラムをCPU21が読み込むためのメモリ23と、ユーザーの操作を受け付けるマウスやキーボードのような入出力装置24と、操作内容や処理結果等を表示するディスプレイ25等から構成されている。   The computer (PC) 20 includes a CPU 21 for executing instructions, a hard disk 22 for storing data and programs, a memory 23 for the CPU 21 to read data and programs, and input / output such as a mouse and a keyboard for receiving user operations. The apparatus 24 is configured by a display 25 and the like for displaying operation contents, processing results, and the like.

外部周辺装置30は、処理結果等を印刷するためのプリンター31や、USBメモリ等の外部記憶装置32等から構成されている。   The external peripheral device 30 includes a printer 31 for printing processing results and the like, an external storage device 32 such as a USB memory, and the like.

次に、図2及び図3を用いて、コンピュータープログラム、すなわち、コンピューターに行わせる処理の手順を決められた形式(プログラム言語)に従って書き表したものを実行させる場合の一連の動作について、コンピューター20におけるCPU21、ハードディスク22、メモリ23等のハードウェアとの関連で説明する。   Next, with reference to FIG. 2 and FIG. 3, a series of operations in the case where a computer program, that is, a processing procedure to be performed by a computer written according to a predetermined format (program language) is executed in the computer 20 will be described. Description will be made in relation to hardware such as the CPU 21, the hard disk 22, and the memory 23.

コンピューター20が起動する前は、オペレーションソフトウェア(OS)のプログラムやデータを含むOSデータと、コンピューター20で実行させるプログラムと、文書、図面等のユーザーデータ等がファイルとしてハードディスク22に格納されている(図2(a))。メモリ23にはプログラムやデータ等は展開されていない。   Before the computer 20 is started, OS data including programs and data of operation software (OS), programs to be executed by the computer 20, user data such as documents and drawings, and the like are stored in the hard disk 22 as files ( FIG. 2 (a)). In the memory 23, no program or data is developed.

コンピューター20が起動して、CPU21が、ハードディスク22に格納されたOSデータをメモリ23にロードする命令を実行すると、OSデータがメモリ23上にプロセスとして展開される(図2(b))。   When the computer 20 is activated and the CPU 21 executes an instruction to load the OS data stored in the hard disk 22 into the memory 23, the OS data is expanded as a process on the memory 23 (FIG. 2B).

次に、CPU21がメモリ23上のOSデータのプロセスを実行して、ハードディスク22に格納されたプログラムにアクセスして、そのプログラムを読み込む(図2(c))。ハードディスク22に格納されたプログラムはメモリ23にロードされ、メモリ23上にプロセスとして展開される(図3(a))。   Next, the CPU 21 executes a process of OS data on the memory 23, accesses a program stored in the hard disk 22, and reads the program (FIG. 2C). The program stored in the hard disk 22 is loaded into the memory 23 and expanded as a process on the memory 23 (FIG. 3A).

次に、CPU21がメモリ23上のプログラムのプロセスを実行して、ハードディスク22に格納されたユーザーデータにアクセスして、ハードディスク22へのデータの読み書きを行う(図3(b))。   Next, the CPU 21 executes a program process on the memory 23 to access user data stored in the hard disk 22 and read / write data from / to the hard disk 22 (FIG. 3B).

このように、オペレーションソフトウエアやプログラムにより、CPU21、ハードディスク22、メモリ23との間での動作が行われる。   In this way, operations among the CPU 21, the hard disk 22, and the memory 23 are performed by operation software and programs.

なお、本明細書において「プロセス」とは「メモリ23上に展開されたプログラム」のことであり、「プログラム」とは「ハードディスク等に格納されたプログラム(ファイル)」のことである。理解しやすさのため「プロセス」である「メモリ23上に展開されたプログラム」のことを単に「プログラム」と記載することもある。   In this specification, “process” means “a program developed on the memory 23”, and “program” means “a program (file) stored in a hard disk or the like”. For ease of understanding, “a program developed on the memory 23”, which is a “process”, may be simply referred to as “program”.

また、本明細書において、Windows API関数の文字列末尾に付与されている"W"や"Ex"は、付与されていないものと同じ意味合いとする。例えば、"FindFirstFileW"は"FindFirstFile"と同義であり、"MoveFileEx"は"MoveFile"と同義である。   Further, in this specification, “W” and “Ex” given at the end of the character string of the Windows API function have the same meaning as those not given. For example, “FindFirstFileW” is synonymous with “FindFirstFile”, and “MoveFileEx” is synonymous with “MoveFile”.

[発明の原理(その1)]
本発明の原理(その1)について図4乃至図16を用いて説明する。
[Principle of the Invention (Part 1)]
The principle (part 1) of the present invention will be described with reference to FIGS.

(ランサムウェアの分析)
本願発明者等は、まず、国内外で被害が報告されている主なランサムウェア複数種について、ファイルの暗号化を行う際のファイル操作に関わる挙動について解析した。具体的には、4種類のランサムウェア、CryptoLocker、CryptWall、CERBER、TeslaCryptのファイル操作の挙動について解析した。
(a)ランサムウェアCryptoLockerの分析
APIモニター(API Monitor)という解析ツールを用いてランサムウェアCryptoLockerの動作を分析した。APIモニターは、アプリケーションから呼ばれるWindows API(Application Programming Interface)コールの引数、戻り値を、アプリケーションを変更することなくモニターすることができるプログラムである。Windowsは登録商標である。
(Ransomware analysis)
The inventors of the present application first analyzed the behavior related to file operations when performing file encryption on a plurality of main types of ransomware for which damage has been reported both in Japan and overseas. Specifically, we analyzed the behavior of four types of ransomware, CryptoLocker, CryptWall, CERBER, and TeslaCrypt.
(A) Analysis of Ransomware CryptoLocker The operation of ransomware CryptoLocker was analyzed using an analysis tool called API Monitor. The API monitor is a program that can monitor arguments and return values of a Windows API (Application Programming Interface) call called from an application without changing the application. Windows is a registered trademark.

図4にランサムウェアCryptoLockerのファイル暗号化時に呼び出されたAPIのログ(log)を示す。ランサムウェアCryptoLockerにより、フォルダ"C:\Python27\Lib\compiler"内のファイルが順次暗号化される場合のログである。   FIG. 4 shows an API log called when encrypting a file of the ransomware CryptoLocker. This is a log when files in the folder "C: \ Python27 \ Lib \ compiler" are sequentially encrypted by the ransomware CryptoLocker.

1行目のFindNextFileは、次のファイルを検索するというWindows API関数である。   FindNextFile on the first line is a Windows API function that searches for the next file.

2行目のCreateFileWは、引数"C:\Python27\Lib\compiler\consts.py"のファイルを開くというWindows API関数である。   CreateFileW on the second line is a Windows API function that opens the file with the argument "C: \ Python27 \ Lib \ compiler \ consts.py".

3−4行目のReadFileは、CreateFileWで開いたファイル"C:\Python27\Lib\compiler\consts.py"を読み出すというWindows API関数である。   ReadFile on line 3-4 is a Windows API function that reads the file “C: \ Python27 \ Lib \ compiler \ consts.py” opened by CreateFileW.

5−7行目のWriteFileは、CreateFileWで開いたファイル"C:\Python27\Lib\compiler\consts.py"にデータを書き込むというWindows API関数である。   WriteFile on line 5-7 is a Windows API function that writes data to the file “C: \ Python27 \ Lib \ compiler \ consts.py” opened by CreateFileW.

1−7行目のログは次のことを示している。   The log on the 1-7th line indicates the following.

1行目のFindNextFileにより次のファイルを検索し、2行目のCreateFileWにより引数"C:\Python27\Lib\compiler\consts.py"のファイルを開き、3−4行目のReadFileと5−7行目のWriteFileにより、ファイル"C:\Python27\Lib\compiler\consts.py"の暗号化が実行される。   FindNextFile is searched with FindNextFile on the first line, and the file with the argument "C: \ Python27 \ Lib \ compiler \ consts.py" is opened with CreateFileW on the second line. ReadFile and 5-7 on lines 3-4 The file "C: \ Python27 \ Lib \ compiler \ consts.py" is encrypted by WriteFile on the line.

8行目のFindNextFileは、次のファイルを検索するというWindows API関数である。   FindNextFile on the 8th line is a Windows API function that searches for the next file.

9行目のCreateFileWは、引数"C:\Python27\Lib\compiler\future.py"のファイルを開くというWindows API関数である。   The CreateFileW on the 9th line is a Windows API function that opens the file with the argument “C: \ Python27 \ Lib \ compiler \ future.py”.

10−11行目のReadFileは、CreateFileWで開いたファイル"C:\Python27\Lib\compiler\future.py"を読み出すというWindows API関数である。   ReadFile on line 10-11 is a Windows API function that reads the file “C: \ Python27 \ Lib \ compiler \ future.py” opened by CreateFileW.

12−15行目のWriteFileは、CreateFileWで開いたファイル"C:\Python27\Lib\compiler\future.py"にデータを書き込むというWindows API関数である。   WriteFile on the 12th to 15th lines is a Windows API function for writing data to the file “C: \ Python27 \ Lib \ compiler \ future.py” opened by CreateFileW.

8−15行目のログは次のことを示している。   The logs on the 8th to 15th lines indicate the following.

8行目のFindNextFileにより次のファイルを検索し、9行目のCreateFileWにより引数"C:\Python27\Lib\compiler\future.py"のファイルを開き、10−11行目のReadFileと12−15行目のWriteFileにより、ファイル"C:\Python27\Lib\compiler\future.py"の暗号化が実行される。   Search for the next file using FindNextFile on the 8th line, and open the file with the argument "C: \ Python27 \ Lib \ compiler \ future.py" using CreateFileW on the 9th line. ReadFile and 12-15 on the 10-11th line WriteFile on the line encrypts the file "C: \ Python27 \ Lib \ compiler \ future.py".

16行目のFindNextFileは、次のファイルを検索するというWindows API関数である。   FindNextFile on the 16th line is a Windows API function that searches for the next file.

17行目のCreateFileWは、引数"C:\Python27\Lib\compiler\misc.py"のファイルを開くというWindows API関数である。   CreateFileW on the 17th line is a Windows API function that opens a file with an argument “C: \ Python27 \ Lib \ compiler \ misc.py”.

18−19行目のReadFileは、CreateFileWで開いたファイル"C:\Python27\Lib\compiler\misic.py"を読み出すというWindows API関数である。   ReadFile on the 18th to 19th lines is a Windows API function that reads the file “C: \ Python27 \ Lib \ compiler \ misic.py” opened by CreateFileW.

20−22行目のWriteFileは、CreateFileWで開いたファイル"C:\Python27\Lib\compiler\misic.py"にデータを書き込むというWindows API関数である。   WriteFile on lines 20-22 is a Windows API function that writes data to the file “C: \ Python27 \ Lib \ compiler \ misic.py” opened by CreateFileW.

16−22行目のログは次のことを示している。   The log on lines 16-22 indicates the following.

16行目のFindNextFileにより次のファイルを検索し、17行目のCreateFileWにより引数"C:\Python27\Lib\compiler\misic.py"のファイルを開き、18−19行目のReadFileと20−22行目のWriteFileにより、ファイル"C:\Python27\Lib\compiler\misic.py"の暗号化が実行される。   The next file is searched by FindNextFile on the 16th line, the file of the argument “C: \ Python27 \ Lib \ compiler \ misic.py” is opened by CreateFileW on the 17th line, ReadFile and 20-22 on the 18th to 19th lines WriteFile on the line encrypts the file "C: \ Python27 \ Lib \ compiler \ misic.py".

以下同様にして、フォルダ"C:\Python27\Lib\compiler\"内のファイルが順次暗号化される。   Similarly, the files in the folder "C: \ Python27 \ Lib \ compiler \" are sequentially encrypted.

このログから、ランサムウェアCryptoLockerは、次のようにしてファイルを暗号化していることがわかる。
(1)FindFirstFile、FindNextFileによりファイルを検索する。FindFirstFile、 FindNextFileは、セットで使用される検索用のWindows API関数である。
(2)CreateFileにより暗号化対象のファイルを開く。
(3)開いたファイルに対し、ReadFile、WriteFileでファイルを書き換えて暗号化する。すなわち、ReadFileにより、暗号化対象ファイルのファイル内容を読み込み、読み込んだ暗号化対象ファイル内容をマルウェアが暗号化し、暗号化された後のデータをWriteFileにより元の暗号化対象ファイルに書き込む。
From this log, you can see that the ransomware CryptoLocker encrypts files as follows:
(1) Search for a file using FindFirstFile and FindNextFile. FindFirstFile and FindNextFile are search Windows API functions used in the set.
(2) Open the file to be encrypted with CreateFile.
(3) For the opened file, rewrite and encrypt the file with ReadFile and WriteFile. That is, ReadFile reads the file contents of the encryption target file, the malware encrypts the read encryption target file contents, and writes the encrypted data to the original encryption target file by WriteFile.

図5にランサムウェアCryptoLockerのファイル暗号化時に呼び出されたAPIのログを示す。ランサムウェアCryptoLockerにより、フォルダ"C:\User\Public\Videos"下にあるファイル"Wildlife.wmv"が検索され暗号化される場合のログである。   FIG. 5 shows a log of an API called at the time of file encryption of the ransomware CryptoLocker. This is a log when the file "Wildlife.wmv" under the folder "C: \ User \ Public \ Videos" is searched and encrypted by the ransomware CryptoLocker.

3行目のFindFirstFileは、引数"C:\Users\Public\Videos\*.*"の最初のファイルを検索するというWindows API関数である。   FindFirstFile on the third line is a Windows API function that searches for the first file of the argument “C: \ Users \ Public \ Videos \ *. *”.

4−9行目のFindNextFileは、次のファイルを検索するというWindows API関数である。   FindNextFile on line 4-9 is a Windows API function that searches for the next file.

10行目のFindFirstFileは、引数"C:\Users\Public\Videos\Sample Videos\*.*"の最初のファイルを検索するというWindows API関数である。   FindFirstFile on the 10th line is a Windows API function that searches for the first file of the argument “C: \ Users \ Public \ Videos \ Sample Videos \ *. *”.

11−13行目のFindNextFileは、次のファイルを検索するというWindows API関数である。   FindNextFile on the 11th to 13th lines is a Windows API function that searches for the next file.

14行目のCreateFileWは、引数"C:\Users\Public\Videos\Sample Videos\Wildlife.wmv"のファイルを開くというWindows API関数である。   The CreateFileW on the 14th line is a Windows API function that opens the file of the argument “C: \ Users \ Public \ Videos \ Sample Videos \ Wildlife.wmv”.

15−16行目のReadFileは、CreateFileWで開いたファイル"C:\Users\Public\Videos\Sample Videos\Wildlife.wmv"を読み出すというWindows API関数である。   ReadFile on the 15th to 16th lines is a Windows API function that reads the file “C: \ Users \ Public \ Videos \ Sample Videos \ Wildlife.wmv” opened by CreateFileW.

17−19行目のWriteFileは、CreateFileWで開いたファイル"C:\Users\Public\Videos\Sample Videos\Wildlife.wmv"にデータを書き込むというWindows API関数である。   WriteFile on the 17th to 19th lines is a Windows API function for writing data to a file “C: \ Users \ Public \ Videos \ Sample Videos \ Wildlife.wmv” opened by CreateFileW.

20行目のFindNextFileは、次のファイルを検索するというWindows API関数である。   FindNextFile on the 20th line is a Windows API function that searches for the next file.

3−9行目のログは次のことを示している。   The log on lines 3-9 indicates the following.

3行目のFindFirstFileと4−9行目のFindNextFileにより、フォルダ"C:\Users\Public\Videos\*.*"内のファイルを検索したが、ファイルが見つからない。   A file in the folder “C: \ Users \ Public \ Videos \ *. *” Is searched by FindFirstFile on the 3rd line and FindNextFile on the 4th-9th line, but the file is not found.

10−14行目のログは次のことを示している。   The logs on lines 10-14 indicate the following.

10行目のFindFirstFileにより、フォルダ"C:\Users\Public\Videos\*.*"より下層のフォルダ"C:\Users\Public\Videos\Sample Videos\*.*"に移行し、11−13行目のFindNextFileにより、フォルダ"C:\Users\Public\Videos\Sample Videos\*.*"内を検索し、ファイル"C:\Users\Public\Videos\Sample Videos\Wildlife.wmv"を見つけたので、14行目のCreateFileWにより開く。   With FindFirstFile on the 10th line, the folder "C: \ Users \ Public \ Videos \ *. *" Is moved to a lower folder "C: \ Users \ Public \ Videos \ Sample Videos \ *. *", And 11-13 FindNextFile on the line searched the folder "C: \ Users \ Public \ Videos \ Sample Videos \ *. *" And found the file "C: \ Users \ Public \ Videos \ Sample Videos \ Wildlife.wmv" So, open with CreateFileW on the 14th line.

15−20行目のログは次のことを示している。   The logs on the 15th to 20th lines indicate the following.

CreateFileWにより開いたファイル"C:\Users\Public\Videos\Sample Videos\Wildlife.wmv"を、15−16行目のReadFileと17−19行目のWriteFileにより、暗号化する。   The file "C: \ Users \ Public \ Videos \ Sample Videos \ Wildlife.wmv" opened by CreateFileW is encrypted using ReadFile on the 15th to 16th lines and WriteFile on the 17th to 19th lines.

そして、20行目のFindNextFileにより、フォルダ"C:\Users\Public\Videos\Sample Videos\*.*"内の次のファイルを検索する。   Then, the next file in the folder “C: \ Users \ Public \ Videos \ Sample Videos \ *. *” Is searched by FindNextFile on the 20th line.

図5のように、あるフォルダ下にあるファイルが検索され暗号化される場合も、図4と同様に、FindFirstFile、FindNextFile、CreateFile、ReadFile、WriteFileにより、ファイルを検索し、検索されたファイルを書き換えて暗号化する。   As shown in Fig. 5, when a file under a certain folder is searched and encrypted, the file is searched using FindFirstFile, FindNextFile, CreateFile, ReadFile, and WriteFile as in Fig. 4, and the searched file is rewritten. To encrypt.

図6は、ランサムウェアCryptoLockerによりアクセスされる前と後のファイル"Wildlife.wmv"の状態を示す。図6(a)が、ランサムウェアCryptoLockerによりアクセスされる前の状態であり、図6(b)が、ランサムウェアCryptoLockerによりアクセスされた後の状態である。   FIG. 6 shows the state of the file “Wildlife.wmv” before and after being accessed by the ransomware CryptoLocker. FIG. 6A shows a state before being accessed by the ransomware CryptoLocker, and FIG. 6B shows a state after being accessed by the ransomware CryptoLocker.

図6に示すように、ランサムウェアCryptoLockerによりアクセスされた後には、暗号化されたファイル"Wildlife.wmv"のヘッダが書き換えられている。   As shown in FIG. 6, after being accessed by the ransomware CryptoLocker, the header of the encrypted file “Wildlife.wmv” is rewritten.

図7は、ランサムウェアCryptoLockerにより暗号化される前と後のファイル"Wildlife.wmv"のヘッダを示す。図7(a)が、ランサムウェアCryptoLockerにより暗号化される前のヘッダであり、図7(b)が、ランサムウェアCryptoLockerにより暗号化された後のヘッダである。   FIG. 7 shows the header of the file “Wildlife.wmv” before and after being encrypted by the ransomware CryptoLocker. FIG. 7A shows a header before being encrypted by the ransomware CryptoLocker, and FIG. 7B shows a header after being encrypted by the ransomware CryptoLocker.

図7に示すように、ファイル"Wildlife.wmv"の先頭から末尾までの全てのバイトの部分が書き換えられている。少なくとも、バイナリファイルであれば、ファイルの種類や、サイズ、ファイルの種類に応じた各種情報の情報を表す「ヘッダ」と呼ばれる部分(通常、先頭から数バイトから数十バイト)が書き換えられている。   As shown in FIG. 7, all bytes from the beginning to the end of the file “Wildlife.wmv” are rewritten. At least in the case of a binary file, the part called “header” (typically several bytes to several tens of bytes from the beginning) representing the information of various types of information according to the file type, size, and file type has been rewritten. .

以上のことから、ランサムウェアCryptoLockerの暗号化時のファイル操作に関する挙動は、次の通りであることがわかった。
(1)ファイル検索のWindows API関数であるFindFirstFile、FindNextFileが呼び出される。
(2)ファイルを開くWindows API関数であるCreateFileが呼び出される。
(3)CreateFileの対象ファイルに、ファイルを読み出すWindows API関数であるReadFileと、ファイルにデータを書き込むWindows API関数であるWriteFileが呼び出される。
(4)CreateFileの対象ファイルのヘッダが、ランサムウェアCryptoLockerのアクセス前後で相違している。
(b)ランサムウェアCryptoWallの分析
プログラムのデバッグを支援するプログラムであるデバッガ(Debugger)を用いてランサムウェアCryptoWallの動作を分析した。
From the above, it was found that the behavior related to file operations during encryption of the ransomware CryptoLocker is as follows.
(1) FindFirstFile and FindNextFile, which are Windows API functions for file search, are called.
(2) CreateFile, a Windows API function that opens a file, is called.
(3) ReadFile, which is a Windows API function that reads a file, and WriteFile, which is a Windows API function that writes data to the file, are called to the target file of CreateFile.
(4) The target file header of CreateFile is different before and after the access of ransomware CryptoLocker.
(B) Analysis of ransomware CryptoWall The operation of ransomware CryptoWall was analyzed using a debugger (Debugger) which is a program that supports program debugging.

ランサムウェアCryptoWallは、まずファイルを検索するWindows API関数であるFindFirstFileWにより、ルートドライブから端末内のファイルを検索する。   The ransomware CryptoWall first searches for files in the terminal from the root drive using FindFirstFileW, which is a Windows API function for searching for files.

図8は、ランサムウェアCryptoWallがファイル検索を開始する際の様子を示すデバッガの画面のキャプチャである。   FIG. 8 is a screen capture of the debugger showing how the ransomware CryptoWall starts searching for a file.

最初の図8(a)のキャプチャは、FindFirstFileWに、ドライブのルートである"C:\*"が引数として渡されていることを示している。   The first capture in FIG. 8A shows that “C: \ *”, which is the root of the drive, is passed to FindFirstFileW as an argument.

次の図8(b)のキャプチャは、FindFirstFileWに、ドライブのルート"C:\*"より下層のフォルダである"C:\Users\*"が引数として渡されていることを示している。   The next capture in FIG. 8B shows that “C: \ Users \ *”, which is a folder below the root “C: \ *” of the drive, is passed to FindFirstFileW as an argument.

その次の図8(c)のキャプチャは、FindFirstFileWに、フォルダ"C:\Users\*"より下層のフォルダである"C:\Users\Publice\*"が引数として渡されていることを示している。   The next capture shown in Fig. 8 (c) shows that "C: \ Users \ Publice \ *", which is a folder lower than the folder "C: \ Users \ *", is passed to FindFirstFileW as an argument. ing.

更にその次の図8(d)のキャプチャは、FindFirstFileWに、フォルダ"C:\Users\Public\*"より下層のフォルダである"C:\Users\Publice\Videos\*"が引数として渡されていることを示している。   In the next capture shown in FIG. 8D, “C: \ Users \ Publice \ Videos \ *”, which is a folder below the folder “C: \ Users \ Public \ *”, is passed to FindFirstFileW as an argument. It shows that.

Windows API関数であるFindFirstFileWによる、ルートドライブから端末内の更なるファイル検索の結果、最初に"C:\Users\Public\Videos\Sample Videos\Wildlife.wmv"が検索され、ランサムウェアCryptoWallにより暗号化される。   As a result of further file search in the terminal from the root drive by the Windows API function FindFirstFileW, "C: \ Users \ Public \ Videos \ Sample Videos \ Wildlife.wmv" is first searched and encrypted by the ransomware CryptoWall Is done.

図9は、ランサムウェアCryptoWallがファイル"C:\Users\Public\Videos\Sample Videos\Wildlife.wmv"を暗号化する際の様子を示すデバッガの画面のキャプチャである。   FIG. 9 is a screen capture of the debugger showing how the ransomware CryptoWall encrypts the file “C: \ Users \ Public \ Videos \ Sample Videos \ Wildlife.wmv”.

最初の図9(a)のキャプチャは、Windows API関数であるCreateFileWにより、ファイル"C:\Users\Public\Videos\Sample Videos\Wildlife.wmv"が開かれていることを示している。   The first capture in FIG. 9A shows that the file “C: \ Users \ Public \ Videos \ Sample Videos \ Wildlife.wmv” has been opened by the Windows API function CreateFileW.

次の図9(b)のキャプチャは、Windows API関数であるReadFileと、Windows API関数であるWriteFileが交互に呼び出され、ファイル"C:\Users\Public\Videos\Sample Videos\Wildlife.wmv"が所定のサイズ分ずつ書き換えられて暗号化されていることを示している。   In the next capture in Fig. 9 (b), the Windows API function ReadFile and the Windows API function WriteFile are called alternately, and the file "C: \ Users \ Public \ Videos \ Sample Videos \ Wildlife.wmv" It shows that the data is rewritten and encrypted by a predetermined size.

その次の図9(c)のキャプチャは、Windows API関数であるMoveFileが呼び出され、元のファイル"C:\Users\Public\Videos\Sample Videos\Wildlife.wmv"のファイル名を暗号化後の別のファイル名に変更されていることを示している。   The next capture shown in Fig. 9 (c) is the Windows API function MoveFile called, and the original file "C: \ Users \ Public \ Videos \ Sample Videos \ Wildlife.wmv" is encrypted. Indicates that the file name has been changed to another file name.

図10は、ランサムウェアCryptoWallによりアクセスされる前と後のファイル"Wildlife.wmv"の状態を示す。図6(a)が、ランサムウェアCryptoWallによりアクセスされる前の状態であり、図6(b)が、ランサムウェアCryptoWallによりアクセスされた後の状態である。   FIG. 10 shows the state of the file “Wildlife.wmv” before and after being accessed by the ransomware CryptoWall. FIG. 6A is a state before being accessed by the ransomware CryptoWall, and FIG. 6B is a state after being accessed by the ransomware CryptoWall.

図10に示すように、ランサムウェアCryptoWallによりアクセスされた後には、フォルダ"C:\Users\Public\Videos\Sample Videos\*.*"内に元のファイル名"野生動物.wmv(Wildlif.wmv)"とは別のファイル名に変更され、ファイルのヘッダが書き換えられている。   As shown in FIG. 10, after being accessed by the ransomware CryptoWall, the original file name “wild animal.wmv (Wildlif.wmv in the folder“ C: \ Users \ Public \ Videos \ Sample Videos \ *. * ” ) "Has been changed to a different file name, and the file header has been rewritten.

図11は、ランサムウェアCryptoWallにより暗号化される前と後のファイル"Wildlife.wmv"のヘッダを示す。図11(a)が、ランサムウェアCryptoLockerにより暗号化される前のヘッダであり、図11(b)が、ランサムウェアCryptoLockerにより暗号化された後のヘッダである。暗号化されたファイルはファイル名が変更されている。   FIG. 11 shows the header of the file “Wildlife.wmv” before and after being encrypted by the ransomware CryptoWall. FIG. 11A shows a header before being encrypted by the ransomware CryptoLocker, and FIG. 11B shows a header after being encrypted by the ransomware CryptoLocker. The file name of the encrypted file has been changed.

図11に示すように、ファイル"Wildlife.wmv"の先頭から末尾までの全てのバイトの部分が書き換えられている。少なくとも、バイナリファイルであれば、ファイルの種類や、サイズ、ファイルの種類に応じた各種情報の情報を表す「ヘッダ」と呼ばれる部分(通常、先頭から数バイトから数十バイト)が書き換えられている。   As shown in FIG. 11, all bytes from the beginning to the end of the file “Wildlife.wmv” are rewritten. At least in the case of a binary file, the part called “header” (typically several bytes to several tens of bytes from the beginning) representing the information of various types of information according to the file type, size, and file type has been rewritten. .

次に、別のファイルを暗号化する際の様子について説明する。   Next, how to encrypt another file will be described.

図12及び図13は、ランサムウェアCryptoWallがファイル"C:\Users\Public\Pictures\Sample Pictures\Tulips.jpg"を暗号化する際の様子を示すデバッガの画面のキャプチャである。   12 and 13 are screen shots of the debugger showing how the ransomware CryptoWall encrypts the file “C: \ Users \ Public \ Pictures \ Sample Pictures \ Tulips.jpg”.

最初の図12(a)のキャプチャは、Windows API関数であるCreateFileにより、ファイル"C:\Users\Public\Pictures\Sample Pictures\Tulips.jpg"が開かれていることを示している。   The first capture in FIG. 12A shows that the file “C: \ Users \ Public \ Pictures \ Sample Pictures \ Tulips.jpg” has been opened by the Windows API function CreateFile.

次の図12(b)のキャプチャは、Windows API関数であるReadFileと、Windows API関数であるWriteFileが繰り返し呼び出されることを示している。   The next capture in FIG. 12B shows that ReadFile, which is a Windows API function, and WriteFile, which is a Windows API function, are repeatedly called.

その次の図13のキャプチャは、ファイル"C:\Users\Public\Pictures\Sample Pictures\Tulips.jpg"が暗号化により破損され、サムネイルで表示できなくなっていることを示している。更に、Windows API関数であるMoveFileEXが呼び出され、元のファイル"C:\Users\Public\Pictures\Sample Pictures\Tulips.jpg"が暗号化後の別のファイル名"C:\Users\Public\Pictures\Sample Pictures\p3EiSzLkWhfU5pgrD5SX9PdYPyP5ICa5iXzySi34oaY=.E08A29776586FC717E27.breaking_bad"に変更されていることを示している。   The next capture in FIG. 13 shows that the file “C: \ Users \ Public \ Pictures \ Sample Pictures \ Tulips.jpg” is damaged by encryption and cannot be displayed as a thumbnail. Furthermore, the Windows API function MoveFileEX is called, and the original file "C: \ Users \ Public \ Pictures \ Sample Pictures \ Tulips.jpg" is another file name after encryption "C: \ Users \ Public \ Pictures \ Sample Pictures \ p3EiSzLkWhfU5pgrD5SX9PdYPyP5ICa5iXzySi34oaY = .E08A29776586FC717E27.breaking_bad ".

以上のことから、ランサムウェアCryptoWallの暗号化時のファイル操作に関する挙動は、次の通りであることがわかった。
(1)ファイル検索のWindows API関数であるFindFirstFile、FindNextFileが呼び出される。
(2)ファイルを開くWindows API関数であるCreateFileが呼び出される。
(3)CreateFileの対象ファイルに、ファイルを読み出すWindows API関数であるReadFileと、ファイルにデータを書き込むWindows API関数であるWriteFileが呼び出される。
(4)CreateFileの対象ファイルのヘッダが、ランサムウェアCryptoWallのアクセス前後で相違している。
(5)ファイルを移動するWindows API関数であるMoveFileExが呼び出され、移動元の移動先が同じでファイル名が変更される。
(c)ランサムウェアCERBERの分析
プログラムのデバッグを支援するプログラムであるデバッガ(Debugger)を用いてランサムウェアCERBERの動作を分析した。
From the above, it was found that the behavior related to file operations during encryption of ransomware CryptoWall is as follows.
(1) FindFirstFile and FindNextFile, which are Windows API functions for file search, are called.
(2) CreateFile, a Windows API function that opens a file, is called.
(3) ReadFile, which is a Windows API function that reads a file, and WriteFile, which is a Windows API function that writes data to the file, are called to the target file of CreateFile.
(4) The target file header of CreateFile is different before and after the access of ransomware CryptoWall.
(5) MoveFileEx, which is a Windows API function for moving files, is called, and the file name is changed with the same movement destination.
(C) Analysis of ransomware CERBER The operation of ransomware CERBER was analyzed using a debugger (Debugger) which is a program that supports program debugging.

ランサムウェアCERBERは、まずファイルを検索するWindows API関数であるFindFirstFile、FindNextFileにより、端末内のファイルを検索し、特定の拡張子を持つファイルを暗号化対象ファイルとして、そのリストをあらかじめ作成する。   The ransomware CERBER first searches for a file in the terminal by using FindFirstFile and FindNextFile, which are Windows API functions for searching for a file, and creates a list in advance with a file having a specific extension as an encryption target file.

次に、リスト化した暗号化対象ファイルを、Windows API関数であるCreateFileWにより順に開いたのち、Windows API関数であるReadFileによりファイルを一度読み出し、その後、Windows API関数であるWriteFileによりファイルにデータを書き込むことにより暗号化を行う。更に、WriteFileによるデータの書き込みにより暗号化が終了すると、Windows API関数であるMoveFileWにより、同一フォルダにファイルを移動、すなわちファイル名の変更が行われる。   Next, after opening the listed files to be encrypted in turn with the Windows API function CreateFileW, read the file once with the Windows API function ReadFile, and then write the data to the file with the Windows API function WriteFile. Encryption. Further, when encryption is completed by writing data by WriteFile, the file is moved to the same folder, that is, the file name is changed by MoveFileW which is a Windows API function.

図14は、ランサムウェアCERBERがファイルを暗号化する際の様子を示すデバッガの画面のキャプチャである。   FIG. 14 is a screen capture of the debugger showing how the ransomware CERBER encrypts a file.

最初の図14(a)のキャプチャは、Windows API関数であるCreateFileWにより、ファイル"C:\Python27\Lib\unittest\test\test_assertions.py"が開かれていることを示している。   The first capture in FIG. 14A shows that the file “C: \ Python27 \ Lib \ unittest \ test \ test_assertions.py” is opened by the Windows API function CreateFileW.

次の図14(b)のキャプチャは、Windows API関数であるReadFileにより、CreatFileWで開いたファイルを読み込むことを示している。   The next capture in FIG. 14B shows that a file opened with CreatFileW is read by ReadFile, which is a Windows API function.

更に次の図14(c)のキャプチャは、Windows API関数であるWriteFileにより、CreatFileWが開いたファイルにデータを書き込むことを示している。   Further, the next capture in FIG. 14C shows that WriteFileW writes data to a file opened by WriteFile which is a Windows API function.

更に次の図14(d)のキャプチャは、Windows API関数であるMoveFileWが呼び出され、CreatFileWが開いたファイルのファイル名を変更されたことを示している。   Further, the capture shown in FIG. 14D shows that MoveFileW, which is a Windows API function, is called, and the file name of the file opened by CreatFileW is changed.

以上のことから、ランサムウェアCERBERの暗号化時のファイル操作に関する挙動は、次の通りであることがわかった。
(1)ファイル検索のWindows API関数であるCreateFileが呼び出される。
(2)CreateFileの対象ファイルに、ファイルを読み出すWindows API関数であるReadFileと、ファイルにデータを書き込むWindows API関数であるWriteFileが呼び出される。
(3)CreateFileの対象ファイルのヘッダが、ランサムウェアCERBERのアクセス前後で相違している。
(4)ファイルを移動するWindows API関数であるMoveFileExが呼び出され、移動元の移動先が同じでファイル名が変更される。
(d)ランサムウェアTeslaCryptの分析
プログラムのデバッグを支援するプログラムであるデバッガ(Debugger)を用いてランサムウェアTeslaCryptの動作を分析した。
From the above, it was found that the behavior related to file operations during encryption of ransomware CERBER is as follows.
(1) CreateFile, a Windows API function for file search, is called.
(2) ReadFile, which is a Windows API function that reads a file, and WriteFile, which is a Windows API function that writes data to the file, are called to the target file of CreateFile.
(3) The header of the target file of CreateFile is different before and after the access of ransomware CERBER.
(4) MoveFileEx, which is a Windows API function for moving files, is called, and the file name is changed with the same movement destination.
(D) Analysis of ransomware TeslaCrypt The operation of ransomware TeslaCrypt was analyzed using a debugger (Debugger) which is a program that supports program debugging.

ランサムウェアTeslaCryptは、まずファイルを検索するWindows API関数であるFindFirstFile、FindNextFileにより、Cドライブ直下から端末内のファイルを検索する。暗号化対象ファイルである特定の拡張子を持つファイルが存在した場合、Windows API関数であるCreateFileWにより開いたのち、Windows API関数であるReadFileを複数回実行してメモリ上にファイルを読み出し、そのメモリ上のファイルを暗号化し、その後、Windows API関数であるWriteFileを複数回実行して、暗号化対象ファイルを上書きする。   The ransomware TeslaCrypt first searches for a file in the terminal from directly under the C drive by using FindFirstFile and FindNextFile which are Windows API functions for searching for a file. If there is a file with a specific extension that is the file to be encrypted, it is opened with the Windows API function CreateFileW, then the Windows API function ReadFile is executed multiple times to read the file on the memory, and the memory Encrypt the above file, and then execute the Windows API function WriteFile multiple times to overwrite the file to be encrypted.

図15は、ランサムウェアTeslaCryptがファイルを暗号化する際の様子を示すデバッガの画面のキャプチャである。   FIG. 15 is a screen shot of the debugger showing how the ransomware TeslaCrypt encrypts a file.

最初の図15(a)のキャプチャは、Windows API関数であるFindFirstFile、FindNextFileにより、Cドライブ直下から端末内のファイルを検索していくことを示している。   The first capture in FIG. 15A shows that a file in the terminal is searched from directly under the C drive by the Windows API functions FindFirstFile and FindNextFile.

次の図15(b)のキャプチャは、Windows API関数であるCreateFileWにより、ファイル"C:\Users\test\Desktop\おとり.png"が開かれていることを示している。   The next capture in FIG. 15B shows that the file “C: \ Users \ test \ Desktop \ Decoy.png” has been opened by the Windows API function CreateFileW.

更に次の図15(c)のキャプチャは、Windows API関数であるReadFileにより、CreatFileWが開いたファイルを複数回にわけて読み出すことを示している。   Further, the next capture shown in FIG. 15C shows that the file opened by CreatFileW is read in a plurality of times by ReadFile which is a Windows API function.

更に次の図15(d)のキャプチャは、Windows API関数であるWriteFileにより、CreatFileWが開いたファイルにデータを複数回にわけて書き込むことを示している。   Further, the next capture shown in FIG. 15D shows that data is written in multiple times in the file opened by CreatFileW by WriteFile, which is a Windows API function.

図16は、ランサムウェアTeslaCryptにより暗号化される前と後のファイル"C:\Users\test\Desktop\おとり.png"のヘッダを示す。図16(a)が、ランサムウェアTeslaCryptoにより暗号化される前のヘッダであり、図16(b)が、ランサムウェアTeslaCryptoにより暗号化された後のヘッダである。   FIG. 16 shows the header of the file “C: \ Users \ test \ Desktop \ Decoy.png” before and after being encrypted by the ransomware TeslaCrypt. FIG. 16A is a header before being encrypted by the ransomware TeslaCrypto, and FIG. 16B is a header after being encrypted by the ransomware TeslaCrypto.

図16に示すように、ファイル"おとり.png"の先頭から末尾までの全てのバイトの部分が書き換えられている。少なくとも、バイナリファイルであれば、ファイルの種類や、サイズ、ファイルの種類に応じた各種情報の情報を表す「ヘッダ」と呼ばれる部分(通常、先頭から数バイトから数十バイト)が書き換えられている。   As shown in FIG. 16, all bytes from the beginning to the end of the file “Decoy.png” are rewritten. At least in the case of a binary file, the part called “header” (typically several bytes to several tens of bytes from the beginning) representing the information of various types of information according to the file type, size, and file type has been rewritten. .

以上のことから、ランサムウェアTeslaCryptの暗号化時のファイル操作に関する挙動は、次の通りであることがわかった。
(1)ファイル検索のWindows API関数であるFindFirstFile、FindNextFileが呼び出される。
(2)ファイル検索のWindows API関数であるCreateFileが呼び出される。
(3)CreateFileの対象ファイルに、ファイルを読み出すWindows API関数であるReadFileと、ファイルにデータを書き込むWindows API関数であるWriteFileが呼び出される。
(4)CreateFileの対象ファイルのヘッダが、ランサムウェアTeslaCryptのアクセス前後で相違している。
From the above, it was found that the behavior related to file operations during encryption of ransomware TeslaCrypt is as follows.
(1) FindFirstFile and FindNextFile, which are Windows API functions for file search, are called.
(2) CreateFile, a Windows API function for file search, is called.
(3) ReadFile, which is a Windows API function that reads a file, and WriteFile, which is a Windows API function that writes data to the file, are called to the target file of CreateFile.
(4) The target file header of CreateFile is different before and after the access of ransomware TeslaCrypt.

(本発明の原理)
本願発明者等は、これら4種類のランサムウェアの分析結果から、ファイルを暗号化する際のファイル操作の挙動に、次のような共通する挙動があることに気がついた。
(1)ファイルを開くWindows API関数であるCreateFileが呼び出される。
(2)CreateFileの対象ファイルに、Windows API関数であるReadFile、WriteFileが1回以上呼び出される。
(3)CreateFileの対象ファイルのヘッダが変化している。
(Principle of the present invention)
The inventors of the present application have noticed from the analysis results of these four types of ransomware that the file operation behavior when encrypting a file has the following common behavior.
(1) CreateFile, a Windows API function that opens a file, is called.
(2) ReadFile and WriteFile, which are Windows API functions, are called at least once for the target file of CreateFile.
(3) The header of the target file of CreateFile has changed.

一般のアプリケーションで、このような挙動をするものは想定しにくく、ランサムウェア特有の挙動である。   It is difficult to imagine a general application that behaves like this, and this behavior is unique to ransomware.

そこで、本願発明者等は、このような挙動を検出することにより、ファイルを暗号化しようとする未知のランサムウェアを確実に検出し、未知のランサムウェアによる攻撃を有効に阻止することができると考え、本発明を着想するに至った。   Therefore, the inventors of the present application can detect an unknown ransomware that attempts to encrypt a file by detecting such a behavior, and can effectively prevent an attack by the unknown ransomware. Have come up with the idea of the present invention.

[第1実施形態]
本発明の第1実施形態によるプログラム、情報処理装置及び情報処理方法について図17乃至図43を用いて説明する。
[First Embodiment]
A program, an information processing apparatus, and an information processing method according to the first embodiment of the present invention will be described with reference to FIGS.

(本実施形態の概要)
本実施形態の概要について図17及び図18を用いて説明する。
(Outline of this embodiment)
The outline of the present embodiment will be described with reference to FIGS. 17 and 18.

本実施形態では、ハードディスク22に保存されたユーザーデータへアクセスするという挙動を有するプログラムの全ての挙動が検出対象である。   In the present embodiment, all behaviors of a program having a behavior of accessing user data stored in the hard disk 22 are detection targets.

CPU21がメモリ23上のOSデータのプロセスを実行して、ハードディスク22に格納されたプログラムにアクセスして、そのプログラムを読み込み(図2(c))、ハードディスク22に格納されたプログラムがメモリ23にロードされ、メモリ23上にプロセスとして展開される(図3(a))前に、メモリ23に本発明プログラムのプロセスを常駐させておく(図17(a))。   The CPU 21 executes a process of OS data on the memory 23, accesses a program stored in the hard disk 22, reads the program (FIG. 2C), and stores the program stored in the hard disk 22 in the memory 23. Before being loaded and expanded as a process on the memory 23 (FIG. 3A), the process of the program of the present invention is made resident in the memory 23 (FIG. 17A).

本発明プログラムは、ランサムウェアが導入される危険性のある状態となる前であればいつ実行してメモリ23上にプロセスとして常駐させてもよい。   The program of the present invention may be executed at any time before the ransomware is in danger of being introduced and may be made resident as a process in the memory 23.

例えば、スタートアッププログラムとして、コンピューターの起動時に起動させておく。Windows OSには、PCの起動と共に実行されるプログラムとして「スタートアッププログラム」が登録できる仕組みがある。本実施形態では、その仕組みを利用し本発明プログラムをスタートアッププログラムとして登録しておく。これにより、本発明プログラムがPCの起動直後からメモリ23上に配置している状態にする。   For example, it is started as a startup program when the computer is started. The Windows OS has a mechanism that allows a “startup program” to be registered as a program that is executed when the PC is started. In the present embodiment, the program of the present invention is registered as a startup program using the mechanism. As a result, the program of the present invention is placed on the memory 23 immediately after the PC is started.

また、PCの起動時にプログラムを起動する方法としては、レジストリやサービスの仕組みを使用する方法もあるが、いずれの方法を用いてもよい。   In addition, as a method of starting a program when the PC is started, there is a method of using a registry or a service mechanism, but any method may be used.

これにより、PCの起動直後から常にコンピューターをランサムウェアから保護することができる。   As a result, the computer can always be protected from ransomware immediately after the PC is started.

本発明プログラムは、図17(a)に示すように、ハードディスク22に格納されたプログラムがメモリ23にロードするという動作と、CPU21がプログラムを実行するという動作との間に割り込む。CPU21によるプログラムに基づく動作をフックすることにより、プログラムが実行される直前で、そのプログラムの挙動を本発明プログラムの監視下に置く。   As shown in FIG. 17A, the program of the present invention interrupts between an operation in which the program stored in the hard disk 22 is loaded into the memory 23 and an operation in which the CPU 21 executes the program. By hooking the operation based on the program by the CPU 21, the behavior of the program is placed under the monitoring of the program of the present invention immediately before the program is executed.

これにより、これ以降、監視対象プログラムの全ての挙動は、本発明プログラムが実行直前に把握することができる。必要に応じて、監視対象プログラムの処理に機能を加えたり、変更したりすることができる。   Thereby, thereafter, all behaviors of the monitoring target program can be grasped immediately before execution of the program of the present invention. As necessary, functions can be added to or changed in the processing of the monitoring target program.

本発明プログラムにより、監視対象プログラムの挙動が、ランサムウェア特有の挙動であると判断された場合には、図17(b)に示すように、本発明プログラムは、監視対象プログラムがハードディスク22内のファイルにアクセスを行おうとする直前に、そのアクセスをブロックする。このようにして、未知のランサムウェアによる攻撃をブロックしてファイルの暗号化を阻止する。   When it is determined by the program of the present invention that the behavior of the monitoring target program is unique to the ransomware, as shown in FIG. 17B, the monitoring target program is stored in the hard disk 22 as shown in FIG. Block access just before trying to access the file. In this way, attacks by unknown ransomware are blocked to prevent file encryption.

本発明プログラムは3つの機能を有する。本発明プログラムの3つの機能について図18を用いて説明する。   The program of the present invention has three functions. Three functions of the program of the present invention will be described with reference to FIG.

第1の機能は、現在動作中のプログラムや、後ほど起動するプログラムである監視対象プログラムが使用するWindows APIをフックする機能である。図18に示すように、本発明プログラムから、現在起動中のプロセス、すなわち、notepad.exe、WINWORD.exe、calc.exe、Ramsomware.exe、cmd.exe、…のプロセスが使用するWindows APIをフックする。   The first function is a function for hooking a Windows API used by a currently running program or a monitoring target program that is a program to be activated later. As shown in FIG. 18, from the program of the present invention, a currently running process, that is, a notepad.exe, WINWORD.exe, calc.exe, Ramsomware.exe, cmd.exe,... To do.

第2の機能は、フックしたWindows APIにより、監視対象プログラムの挙動を本発明プログラムに通知、問い合わせをして、その結果に基づいて監視対象プログラムがランサムウェアであるか判断する機能である。   The second function is a function of notifying and inquiring of the program of the present invention the behavior of the monitored program by the hooked Windows API, and determining whether the monitored program is ransomware based on the result.

第3の機能は、フックしたWindows APIからの通知の受領、記録、問い合わせに応答する機能である。   The third function is a function that responds to receipt, recording, and inquiry of notification from the hooked Windows API.

第1の機能と第3の機能は、常駐している本発明プログラムの機能であり、第2の機能は、監視対象プログラム内に組み込まれる本発明プログラムの機能である。   The first function and the third function are functions of the resident program of the present invention, and the second function is a function of the program of the present invention incorporated in the monitoring target program.

(フック対象のWindows API関数)
本発明プログラムは、監視対象プロセスにおいて、ランサムウェアの分析結果から得られた共通の挙動であるWindows API関数をフックすることにより、ランサムウェアの検知および防御を実現する。
(Windows API function to be hooked)
The program of the present invention realizes detection and protection of ransomware by hooking a Windows API function, which is a common behavior obtained from the analysis result of ransomware, in the process to be monitored.

ランサムウェアの共通の挙動であるWindows API関数とは、本発明の原理で指摘したように、CreateFile(ファイル作成関数(ファイルハンドル取得関数))、(ファイル生成関数)、ReadFile(ファイル読出関数)、WriteFile(ファイル書込関数)である。   As pointed out in the principle of the present invention, the Windows API function that is a common behavior of ransomware is CreateFile (file creation function (file handle acquisition function)), (file generation function), ReadFile (file read function), WriteFile (file write function).

本実施形態では、共通のWindows API関数である、ファイルを開きファイルハンドルを取得するためのCreateFile(ファイル生成関数)はフック対象とせず、ReadFile(ファイル読出関数)、WriteFile(ファイル書込関数)のみをフック対象としている。それは次のような理由からである。   In this embodiment, CreateFile (file creation function) for opening a file and acquiring a file handle, which is a common Windows API function, is not a hook target, only ReadFile (file read function) and WriteFile (file write function). Is a hook target. The reason is as follows.

まず、共通のWindows API関数である、ReadFile(ファイル読出関数)、WriteFile(ファイル書込関数)を実行するためには、ファイルのハンドルを取得することは事前に必須の処理であるので、ReadFile(ファイル読出関数)、WriteFile(ファイル書込関数)をフック対象とするだけで、ファイルのハンドルを取得することを検出できる。   First, in order to execute the common Windows API functions, such as ReadFile (file read function) and WriteFile (file write function), it is essential to obtain a file handle in advance. It is possible to detect that the handle of the file is acquired simply by setting the file reading function) and WriteFile (file writing function) as a hook target.

また、ファイルのハンドルを取得するためには、CreateFile(ファイル生成関数)以外のWindows API関数、例えば、OpenFile(ファイルオープン関数)でも実現可能であるので、CreateFile(ファイル生成関数)はファイルのハンドルを取得するために必須のWindows API関数とは言えない。   In addition, since the file handle can be obtained with Windows API functions other than CreateFile (file creation function), for example, OpenFile (file open function), CreateFile (file creation function) It is not a Windows API function that is essential to obtain.

(HookReadFile)
HookReadFileは、ReadFile(ファイル読出関数)をフックするWindows API関数である。
(HookReadFile)
HookReadFile is a Windows API function that hooks ReadFile (file read function).

HookReadFileは、通常のReadFileの動作に加えて、本発明プログラムに対して、次の情報(a)〜(c)を通知する機能を付加したWindows API関数である。   HookReadFile is a Windows API function to which the function of notifying the following information (a) to (c) is added to the program of the present invention in addition to the normal operation of ReadFile.

通知手段としては、プロセス間通信等、プロセスの動作に大きな遅延を発生させない程度の高速な手法が望ましい。ソケット通信やファイルによる受け渡し等でも、高速に実現できる環境であれば、いかなる方法でもよい。
(a)通知元API名。フックするWindows API関数の名前であるReadFileである。
(b)自身のプロセスID。フックするReadFileを呼び出す監視対象プロセスのプロセスIDである。
(c)ReadFileの対象ファイルパス。通知元APIであるReadFileのパラメータに指定されたファイルハンドルを示すファイルパスである。
As the notification means, a high-speed method that does not cause a large delay in the operation of the process, such as inter-process communication, is desirable. Any method may be used as long as the environment can be realized at high speed, such as socket communication or file delivery.
(A) Notification source API name. ReadFile, the name of the Windows API function to hook.
(B) its own process ID; This is the process ID of the monitored process that calls the hooked ReadFile.
(C) Target file path of ReadFile. This is a file path indicating a file handle specified in a parameter of ReadFile that is a notification source API.

ここで「ファイルパス」とは、その「ファイル」を保存している「フォルダ」に辿り着くまでに階層を重ねたフォルダの「経路(path)」を含めたものである。例えば、ハードディスクの「Cドライブ」上のフォルダ「Users」内のフォルダ「user」内のフォルダ「Desktop」内にあるファイル「note.doc」の「ファイルパス」は次の通りである。   Here, the “file path” includes a “path” of folders that are layered up to the “folder” in which the “file” is stored. For example, the “file path” of the file “note.doc” in the folder “Desktop” in the folder “user” in the folder “Users” on the “C drive” of the hard disk is as follows.

C:\Users\user\desktop\note.doc
また、ファイルパス(C:\Users\user\desktop\note.doc)からファイル名(note.doc)を除いたファイルパス(C:\Users\user\desktop\)のことを「フォルダパス」と言う。
C: \ Users \ user \ desktop \ note.doc
Also, the file path (C: \ Users \ user \ desktop \) excluding the file name (note.doc) from the file path (C: \ Users \ user \ desktop \ note.doc) say.

HookReadFile(ReadFileのフック関数)から通知を受けた本発明プログラムは、通知された内容、すなわち、API名、プロセスID、ファイルパスを、順次、通知記録データとしてメモリ23に保存する。この通知記録データは、後述するHookWriteFile(WriteFileのフック関数)において使用される。   Receiving notification from HookReadFile (ReadFile hook function), the program of the present invention sequentially stores the notified contents, that is, the API name, process ID, and file path in the memory 23 as notification record data. This notification record data is used in HookWriteFile (WriteFile hook function) described later.

なお、オペレーティングシステムではプロセスIDを再利用する機能があるので、長時間継続していると、異なるプロセスに対して偶発的に同じプロセスIDが割り当てられる可能性がある。このような偶発的なプロセスIDの一致によるランサムウェアの誤検知を防止するため、通知記録データを定期的にクリアすることが望ましい。   Since the operating system has a function of reusing process IDs, there is a possibility that the same process ID may be accidentally assigned to different processes if the process ID continues for a long time. In order to prevent such erroneous detection of ransomware due to an accidental process ID match, it is desirable to periodically clear the notification record data.

通議記録データの定期的クリアの間隔は任意であるが、長くともオペレーティングシステムの終了時または再起動時にはクリアすることが望ましい。クリア間隔をユーザーが設定できるようにしてもよい。   Although the interval for periodically clearing the conference record data is arbitrary, it is desirable to clear it at the end of the operating system or at the restart. The clear interval may be set by the user.

図19に上述したHookReadFileによる動作のイメージを示す。図19左部に監視対象プログラムのプロセスを示し、図19右部に本発明プログラムのプロセスを示す。   FIG. 19 shows an image of the operation by the above HookReadFile. The left part of FIG. 19 shows the process of the monitoring target program, and the right part of FIG. 19 shows the process of the program of the present invention.

図19左側の監視対象プログラムのプロセスには、本発明プログラムのフック機能であるHookReadFileが組み込まれている。組み込まれたHookReadFileは、通常のReadFileの動作に加えて、(a)通知元API名、(b)自身のプロセスID、(c)ReadFile対象ファイルパスを、図19右側の本発明プロセスに通知する。   The process of the monitoring target program on the left side of FIG. 19 incorporates HookReadFile which is a hook function of the program of the present invention. The incorporated HookReadFile notifies (a) the notification source API name, (b) its own process ID, and (c) the ReadFile target file path to the process of the present invention on the right side of FIG. 19 in addition to the normal ReadFile operation. .

図19右側の本発明プログラムのプロセスは、HookReadFileからの通知への対応を行う。図19左側のHookReadFileからの通知を受け取り、通知記録データとして順次記録する。   The process of the present invention program on the right side of FIG. 19 responds to notifications from HookReadFile. The notification from the HookReadFile on the left side of FIG. 19 is received and sequentially recorded as notification record data.

図19では、HookReadFileは、(a)通知元API名、(b)自身のプロセスID、(c)ReadFile対象ファイルパスとして、(a)[ReadFile]と(b)pid:3421と(c)filename:c:\Users\user\Desktop\note.docの組;(a)[ReadFile]と(b)pid:1568と(c)filename:c:\Users\user\Documents\schedule.xlsの組;(a)[ReadFile]と(b)pid:1568と(c)filename:c:\Users\user\Documents\schedule.xlsの組;・・・・を順次通知し、本発明プログラムは順次通知されたものを通知記録データとして記録している。   In FIG. 19, HookReadFile includes (a) [NotFile] API name, (b) own process ID, (c) ReadFile target file path, (a) [ReadFile], (b) pid: 3421, and (c) filename. : c: \ Users \ user \ Desktop \ note.doc; (a) [ReadFile], (b) pid: 1568, and (c) filename: c: \ Users \ user \ Documents \ schedule.xls; (A) [ReadFile], (b) pid: 1568 and (c) filename: c: \ Users \ user \ Documents \ schedule.xls Are recorded as notification record data.

(HookWriteFile)
HookWriteFileは、WriteFile(ファイル書込関数)をフックするWindows API関数である。
(HookWriteFile)
HookWriteFile is a Windows API function that hooks WriteFile (file write function).

HookWriteFileは、通常のWriteFileの動作に加えて、次の機能を付加したWindows API関数である。   HookWriteFile is a Windows API function that adds the following functions to the normal WriteFile operation.

WriteFileに指定されたパラメータ及びパラメータから取得できる情報が、後述する「ランサムウェアによるファイル暗号化操作であることの判断基準」に合致した場合、ランサムウェアによるファイル暗号化操作であると判断し、WriteFileによるデータ書き込みを行わずにプロセスを終了させる機能。   If the parameters specified in WriteFile and the information that can be acquired from the parameters match the “criteria for file encryption operation by ransomware” described later, it is determined that the file encryption operation is by ransomware, and WriteFile A function that terminates the process without writing the data.

上記の「ランサムウェアによるファイル暗号化操作であることの判断基準」とは、次の条件(A)〜(C)を満足することである。   The above “determination criteria for file encryption operation by ransomware” means that the following conditions (A) to (C) are satisfied.

条件(A):WriteFileの書き込み対象に指定されたファイルハンドルのファイルポインタの現在位置を取得し、その現在位置が先頭またはヘッダ範囲内であること。ファイルポインタの現在位置はSetFilePointer関数を使用する等で取得可能である。   Condition (A): The current position of the file pointer of the file handle specified as the write target of WriteFile is acquired, and the current position is within the head or header range. The current position of the file pointer can be obtained by using the SetFilePointer function.

条件(B):WriteFileの呼び出しにより書き換え前後でデータが変化すること。   Condition (B): Data changes before and after rewriting by calling WriteFile.

条件(C):本発明プログラムに問い合わせた結果、WriteFileが呼び出し時に指定されたファイルに対して、既に自身のプロセスから ReadFileが呼び出されていること。   Condition (C): As a result of inquiring the program of the present invention, ReadFile has already been called from its own process for the file specified when WriteFile is called.

条件(A)と条件(B)により、ファイルの先頭またはヘッダ範囲内情報が変化しているかを判断する。   Based on the condition (A) and the condition (B), it is determined whether the head of the file or the information in the header range has changed.

条件(C)を含めたのは次の理由である。   The reason for including the condition (C) is as follows.

一般的なファイルの暗号化手順では、プログラムの実装方法として、ReadFileで読み取った内容を暗号化した後、WriteFileで別のファイルに直接書き込む手法がとられる。しかし、今回分析したランサムウェアにおいては、そのような手法をとらず、あえて ReadFileで読み込んだファイルをWriteFileで書き換え、その後にリネームするといった動作を行っていた。これは、フォレンジック技術によるファイルの復元を防止するためと考えられる。ReadFileで読み込んだファイルをあえてWriteFileで上書きすることで、ディスク上のデータを上書きするため、フォレンジック技術を用いた方法でも、ファイルの復元ができなくなる可能性が高い。ランサムウェアの作者はあえてその状況を狙っているものと考えられる。本発明プログラムでは、この挙動を検知条件のひとつとしているため、このようなランサムウェアの特性に非常に効果的である。   In a general file encryption procedure, as a method for implementing a program, a method of encrypting the content read by ReadFile and then directly writing to another file by WriteFile is employed. However, the ransomware analyzed this time did not take such a technique, and rewritten the file read by ReadFile with WriteFile, and then renamed it. This is considered to prevent file restoration by the forensic technique. By overwriting the file read with ReadFile with WriteFile, the data on the disk is overwritten. Therefore, there is a high possibility that the file cannot be restored even by a method using forensic technology. The author of ransomware seems to be aiming for the situation. In the program of the present invention, this behavior is one of the detection conditions, so it is very effective for such ransomware characteristics.

この付加した機能により、HookWriteFile(WriteFileのフック関数)内で、呼び出し元プロセスがランサムウェアかどうかを判断し、ランサムウェアである場合、ファイル暗号化の防止、ランサムウェア検知の通知、ランサムウェアのプロセスの強制終了を行うことができる。   With this added function, HookWriteFile (WriteFile hook function) determines whether the calling process is ransomware. If it is ransomware, it prevents file encryption, ransomware detection notification, and ransomware process. Can be forcibly terminated.

条件(A)のイメージを図20に示す。   An image of condition (A) is shown in FIG.

図20(a)(b)左部はメモリ23上の監視対象プログラムのプロセスを示し、図20(a)(b)右部はハードディスク22上の書き込み対象ファイルを示す。   The left part of FIGS. 20A and 20B shows the process of the monitoring target program on the memory 23, and the right part of FIGS. 20A and 20B shows the write target file on the hard disk 22.

メモリ23上の監視対象プロセスに組み込まれたHookWriteFileから、ハードディスク22上の書き込み対象ファイルへの書き込み開始位置が指定される。   A write start position to the write target file on the hard disk 22 is designated from the HookWriteFile incorporated in the monitoring target process on the memory 23.

図20(a)の場合、ハードディスク22上の上側の書き込み対象ファイルに対する書き込み開始位置"0x00000020"はファイルの先頭ではなく、下側の書き込み対象ファイルに対する書き込み開始位置"0x00000000"はファイルの先頭である。書き込み開始位置がファイルの先頭である下側の書き込み対象ファイルへの書き込みが条件(A)を満足し、ランサムウェアによる書き込みの可能性があると判断する。   In the case of FIG. 20A, the write start position “0x00000020” for the upper write target file on the hard disk 22 is not the start of the file, and the write start position “0x00000000” for the lower write target file is the start of the file. . It is determined that the writing to the lower writing target file whose writing start position is the head of the file satisfies the condition (A) and there is a possibility of writing by ransomware.

図20(b)の場合、ハードディスク22上の上側の書き込み対象ファイルに対する書き込み開始位置"0x00000024"はファイルのヘッダの範囲内でなく、下側の書き込み対象ファイルに対する書き込み開始位置"0x00000004"はファイルの先頭ではないがヘッダの範囲内である。書き込み開始位置がファイルのヘッダの範囲内である下側の書き込み対象ファイルへの書き込みが条件(A)を満足し、ランサムウェアによる書き込みの可能性があると判断する。   In the case of FIG. 20B, the write start position “0x00000024” for the upper write target file on the hard disk 22 is not within the range of the file header, and the write start position “0x00000004” for the lower write target file is the file. It is not at the beginning but is within the range of the header. It is determined that writing to the lower writing target file whose writing start position is within the range of the file header satisfies the condition (A) and there is a possibility of writing by ransomware.

なお、ヘッダの範囲内であるかを判断するためには、ファイルの各拡張子に対するヘッダのサイズが予め分かっている必要がある。各拡張子に対応するヘッダのサイズは予めHookWriteFile(WriteFileのフック関数)内に保持しておく。例えば、拡張子が"pdf"であるPDFファイルでは先頭から5バイトがヘッダである。   In order to determine whether it is within the header range, the header size for each extension of the file needs to be known in advance. The size of the header corresponding to each extension is stored in advance in HookWriteFile (WriteFile hook function). For example, in the PDF file with the extension “pdf”, the first 5 bytes are the header.

条件(B)のイメージを図21に示す。   An image of the condition (B) is shown in FIG.

図21左部はメモリ23上の監視対象プログラムのプロセスを示し、図21右部はハードディスク22上の書き込み対象ファイルを示す。   The left part of FIG. 21 shows the process of the monitoring target program on the memory 23, and the right part of FIG. 21 shows the write target file on the hard disk 22.

メモリ23上の監視対象プロセスに組み込まれたHookWriteFileが書き込もうとする書き込み予定データと、ハードディスク22上の書き込み対象ファイルの書き込み前の状態のデータとを比較する。   The write-scheduled data to be written by the HookWriteFile incorporated in the monitoring target process on the memory 23 is compared with the data before the writing of the write target file on the hard disk 22.

図21の場合、HookWriteFileが書き込もうとする書き込み予定データ"00 AA 00 BB 00 CC 00 DD 00 EE 00 FF 00 00 08 00"と、ハードディスク22上の書き込み対象ファイルの書き込み前の状態のデータ"50 4B 03 04 14 00 06 00 08 00 00 00 21 00 A3 EF"とは相違するので、条件(B)を満足し、ランサムウェアによる書き込みの可能性があると判断する。   In the case of FIG. 21, the data to be written “00 AA 00 BB 00 CC 00 DD 00 EE 00 FF 00 00 08 00” to be written by HookWriteFile and the data before writing of the write target file on the hard disk 22 “50 4B Since 03 04 14 00 06 00 08 00 00 00 21 00 A3 EF ", it is judged that the condition (B) is satisfied and there is a possibility of writing by ransomware.

条件(C)のイメージを図22に示す。   An image of the condition (C) is shown in FIG.

図22(a)左部にメモリ23上の監視対象プログラムのプロセスを示し、図22(a)右部にメモリ23上の本発明プログラムのプロセスを示す。   22A shows the process of the monitoring target program on the memory 23 on the left side, and FIG. 22A shows the process of the program of the present invention on the memory 23 on the right side.

図22(a)左部の監視対象プロセスに組み込まれたHookWriteFileは、自身(監視対象プロセス)のプロセスIDと、WriteFileの対象ファイルパスに基づいて、図22(a)右部の本発明プログラムのプロセスに対して、ReadFileの通知記録データ中に、同一プロセスID、同一対象ファイルパスのReadFileの記録があるか否かを問い合わせる。図22右側の本発明プログラムは、同一プロセスID、同一対象ファイルパスのReadFileの記録があるか否かをHookWriteFileに応答する。   The hook write file incorporated in the monitoring target process on the left side of FIG. 22 (a) is based on the process ID of itself (monitoring target process) and the target file path of WriteFile. The process is inquired of whether there is a record of ReadFile with the same process ID and the same target file path in ReadFile notification record data. The program of the present invention on the right side of FIG. 22 responds to HookWriteFile whether there is a record of ReadFile with the same process ID and the same target file path.

図22(a)の場合、監視対象プロセスに組み込まれたHookWriteFileからプロセスID"pid:1568"とファイルパス"C:\Users\user\Documents\schedule.xls"に基づいて、ReadFileの通知記録データに対して問い合わせる。   In the case of FIG. 22A, ReadFile notification record data based on the process ID “pid: 1568” and the file path “C: \ Users \ user \ Documents \ schedule.xls” from the HookWriteFile embedded in the monitored process. Inquire against.

図22(b)にReadFileの通知記録データを示す。   FIG. 22B shows the notification record data of ReadFile.

ReadFileの通知記録データの第4〜6行、第7〜9行、第13〜15行に、HookWriteFileのプロセスID"pid:1568"、ファイルパス"C:\Users\user\Documents\schedule.xls"と同一である、プロセスID"pid:1568"、ファイルパス"C:\Users\user\Documents\schedule.xls"のReadFileの記録があるので、条件(C)を満足し、ランサムウェアによる書き込みの可能性があると判断する。   Lines 4-6, 7-9, and 13-15 of ReadFile notification record data show the HookWriteFile process ID “pid: 1568” and file path “C: \ Users \ user \ Documents \ schedule.xls”. Since there is a ReadFile record with the same process ID “pid: 1568” and file path “C: \ Users \ user \ Documents \ schedule.xls”, the condition (C) is satisfied and the ransomware writes It is determined that there is a possibility.

その結果、図22(a)右側の本発明プログラムは、同一プロセスID、同一対象ファイルパスのReadFileの記録があった旨をHookWriteFileに応答する。   As a result, the program of the present invention on the right side of FIG. 22A responds to HookWriteFile that ReadFile of the same process ID and the same target file path has been recorded.

(除外リスト)
本発明プログラムを、システム上において動作する全てのプロセスから呼び出される全てのReadFile、WriteFileをフックし、そのプロセスがランサムウェアである否かを判断することは、システムに新たな負荷を加えることになる。
(Exclusion list)
Hooking all ReadFile and WriteFile called from all processes running on the system and determining whether the process is ransomware adds a new load to the system. .

そこで、本実施形態では、明らかにランサムウェアではないプログラムを予め登録した「除外リスト」を作成しておき、除外リストに登録されたプログラムに対しては、本発明プログラムを実行しないようにする。   Therefore, in this embodiment, an “exclusion list” in which programs that are clearly not ransomware are registered in advance is created, and the program of the present invention is not executed for the programs registered in the exclusion list.

図23に除外リストの具体例を示す。   FIG. 23 shows a specific example of the exclusion list.

除外リストには正規のプログラムを登録する。例えば、システムにインストールされている「プログラム名」「プログラムファイル」「ファイルのフルパス」「ファイルサイズ」「ハッシュ値」「デジタル著名」等を必要に応じて登録する。   Regular programs are registered in the exclusion list. For example, “program name”, “program file”, “full file path”, “file size”, “hash value”, “digital signature”, and the like installed in the system are registered as necessary.

図23では、正規のプログラムとして、「インターネットエクスプローラー」「MSワード」「MSエクセル」を登録している。   In FIG. 23, “Internet Explorer”, “MS Word”, and “MS Excel” are registered as regular programs.

除外リストは、システムへのプログラムをインストールするたびに更新し、ハードディスク22上に格納しておく。本発明プログラムの起動時に除外リストの内容を読み込むようにする。   The exclusion list is updated each time a program is installed in the system and stored on the hard disk 22. The contents of the exclusion list are read when the program of the present invention is started.

本発明プログラムの動作後、読み込んだ除外リストの情報はメモリ23上にマッピングされる。突然のマシントラブルでメモリ情報が揮発しても内容を失わないよう、ハードディスク22上のファイルに対して常に更新しておくことがよい。   After the operation of the program of the present invention, the read exclusion list information is mapped onto the memory 23. It is preferable to always update the files on the hard disk 22 so that the contents are not lost even if the memory information is volatilized due to a sudden machine trouble.

また、除外リストのファイルは、マルウェアやランサムウェアによる編集を避けるため、暗号化しておくことが望ましい。   Also, it is desirable to encrypt the exclusion list file to avoid editing by malware or ransomware.

(ユーザーによる除外リストへの追加)
「ランサムウェアによるファイル暗号化操作であることの判断基準」の条件(A)は、HookWriteFileからの書き込み対象ファイルへの書き込み開始位置が先頭又はヘッダ範囲内であることである。この条件(A)は、監視対象プログラムがファイルのヘッダを書き換えるものであるかを判断するための条件である。監視対象プログラムがファイルのヘッダを書き換える場合には、監視対象プログラムがランサムウェアの可能性があると判断する。監視対象プログラムがファイルのヘッダ以外の部分を書き換える場合には、通常の書き換え処理でありランサムウェアの可能性がないと判断する。
(User added to exclusion list)
The condition (A) of “Judgment criteria for file encryption operation by ransomware” is that the write start position from HookWriteFile to the write target file is within the head or header range. This condition (A) is a condition for determining whether the monitoring target program rewrites the header of the file. When the monitoring target program rewrites the header of the file, it is determined that the monitoring target program may be ransomware. When the program to be monitored rewrites a part other than the header of the file, it is determined that there is no possibility of ransomware because it is a normal rewriting process.

一般的に、コンピューターが扱うファイルは「テキストファイル(テキスト形式)」と「バイナリファイル(バイナリ形式)」の2種類に分類される。   Generally, files handled by a computer are classified into two types: “text file (text format)” and “binary file (binary format)”.

バイナリファイル、例えば、拡張子が"doc"、"ppt"、"exe"、"pdf"、"jpg"、"bmp"等のファイルは、通常、ファイル種別に応じたヘッダ情報を有している。バイナリファイルの内容を編集して変更し上書き保存した場合でも、通常、ヘッダ情報となるファイルの先頭部分は変更されず、データ部分が変更される。バイナリファイルのヘッダが書き換えられると、そのファイルは適切に開けなくなり、通常のアプリケーションではそのようなことは行われない。したがって、ファイルのヘッダを書き換えるプログラムはランサムウェアの可能性がある。   Binary files, for example, files with extensions "doc", "ppt", "exe", "pdf", "jpg", "bmp", etc. usually have header information corresponding to the file type. . Even when the contents of a binary file are edited and changed and overwritten, the head part of the file serving as header information is normally not changed, but the data part is changed. When the binary file header is rewritten, the file cannot be opened properly, and this is not done in normal applications. Therefore, the program that rewrites the file header may be ransomware.

ファイルの先頭部分のヘッダを書き換えるような処理を行うアプリケーションも存在するが、その場合には、ヘッダの書き換えに応じて、ファイルの拡張子も変更されてファイル種別が変更される。拡張子を含むファイル名が変わらないままで、ヘッダを書き換えることは通常のアプリケーションでは行われない。したがって、ファイル名が変わらないままで、ファイルのヘッダを書き換えるプログラムはランサムウェアの可能性がある。   There are applications that perform processing to rewrite the header at the beginning of the file. In this case, the file type is changed by changing the file extension in accordance with the rewriting of the header. Rewriting the header without changing the file name including the extension is not performed in a normal application. Therefore, a program that rewrites the header of a file without changing the file name may be ransomware.

一方、テキストファイル、例えば、拡張子が"txt"、"csv"等のファイルは、通常、ファイル種別に応じたヘッダ情報を有していない。テキストファイルの場合、ファイルの先頭部分もデータ部分である。したがって、テキストファイルが先頭部分から書き換えられていても、それがランサムウェアによる暗号化か、通常のアプリケーションにより書き換えかを判断することは困難である。   On the other hand, a text file, for example, a file with extensions “txt”, “csv” or the like usually does not have header information corresponding to the file type. In the case of a text file, the top part of the file is also a data part. Therefore, even if the text file is rewritten from the beginning, it is difficult to determine whether the text file is encrypted by ransomware or rewritten by a normal application.

本発明プログラムでは、ファイルの拡張子に基づいて、テキスト形式のファイルであると判断された場合は、その対応をユーザーの判断にゆだねるようにする。   In the program of the present invention, when it is determined that the file is in text format based on the extension of the file, the correspondence is left to the user's determination.

図24は、テキスト形式のファイルの書き換えを検出した場合の警告画面である。   FIG. 24 shows a warning screen when rewriting of a text format file is detected.

警告画面では「以下のプロセスがテキストファイルの改変挙動を行っています。どう処理しますか。」と尋ね、「プロセス名:AAATextEditor.exe」、「該当挙動:ファイル内容の改変」、「対象ファイル:C:\Users\test\Desktop\議事録.txt」、「書き込み内容:"[議事録]\n 出席者:佐藤・・・"」を示す。   The warning screen asks "The following process is modifying the text file. How do you handle it?", "Process name: AAATextEditor.exe", "Applicable behavior: Modification of file contents", "Target file : C: \ Users \ test \ Desktop \ Minutes.txt "," Content to be written: "[Minutes] \ n Attendees: Sato ..." ".

更に「※現在の操作に心当たりのないプロセスおよびファイルである場合、ランサムウェアによるファイルの暗号化処理の可能性があります。」と警告し、その対応処理の選択ボタン「プロセスを終了」、「この警告を放置」、「プロセスを除外に追加」を示す。   In addition, “* If there is a process or file that you are unfamiliar with the current operation, there is a possibility that the file will be encrypted by ransomware.” And the corresponding process selection buttons “End Process”, “This “Leave warning” and “Add process to exclusion”.

ユーザーが「プロセスを終了」を選択した場合には、プロセス"AAATextEditor.exe"を直ちに終了させる。ユーザーが、そのプロセスをランサムウェアであると判断した場合である。   If the user selects “End Process”, the process “AAATextEditor.exe” is immediately ended. This is when the user determines that the process is ransomware.

ユーザーが「この警告を放置」を選択した場合には、プロセス"AAATextEditor.exe"を終了させることなく、そのまま処理を続行する。ユーザーが、そのプロセスをランサムウェアであるか否か判断できない又は判断を保留する場合である。   When the user selects “Leave this warning”, the process is continued without terminating the process “AAATextEditor.exe”. This is the case when the user cannot determine whether the process is ransomware or withholds the determination.

ユーザーが「プロセスを除外に追加」を選択した場合には、プロセス"AAATextEditor.exe"を、図25に示すように、「除外リスト」に追加し、同じプロセスに対する警告を再度行わないようにする。ユーザーが、そのプロセスはランサムウェアでないと判断した場合である。   When the user selects “Add Process to Exclude”, the process “AAATextEditor.exe” is added to the “Exclusion List” as shown in FIG. 25 so that the warning for the same process is not performed again. . If the user determines that the process is not ransomware.

なお、監視対象プログラムからの除外リスト(ホワイトリスト)の参照および追加は、直接ハードディスク22上のファイルへアクセスするよう実装してもよいし、一度常駐プログラムを経由してアクセスするように実装してもよい。   The reference and addition of the exclusion list (white list) from the monitoring target program may be implemented so as to directly access a file on the hard disk 22 or once so as to be accessed via a resident program. Also good.

(対処行動)
本発明プログラムが、監視対象プログラムをランサムウェアであると判断した場合の対処行動について説明する。
(Coping behavior)
The coping behavior when the program of the present invention determines that the monitored program is ransomware will be described.

監視対象のプログラムをランサムウェアであると判断した場合には、WriteFileによるファイルへの書き込みは行わず、監視対象プログラムによるプロセスを強制終了する。   If the monitoring target program is determined to be ransomware, the process by the monitoring target program is forcibly terminated without writing to the file by WriteFile.

プロセスの強制終了は、WriteFileをフックしているHookWriteFile関数内で行う。一般的には、ExitProcess関数や、Exit関数等を用いることで実現できるが、プロセスを終了可能な命令であればいかなるものを使用してもよい。   The process is forcibly terminated in the HookWriteFile function that hooks WriteFile. Generally, this can be realized by using the ExitProcess function, the Exit function, or the like, but any instruction that can terminate the process may be used.

プロセスの強制終了により、ランサムウェアによるファイルの暗号化を防ぐことができる。プロセスの強制終了では、当該ファイルは暗号化されないため、事前のファイルのバックアップ等も不要である。   By forcibly terminating the process, file encryption by ransomware can be prevented. When the process is forcibly terminated, the file is not encrypted, so it is not necessary to back up the file in advance.

なお、直ちにプロセスを終了させることにより不都合が生じる可能性のある環境においては、例えば、ユーザーに強制終了予定であることを事前に通知し、強制終了するか否かの判断を仰ぐようにしてもよい。また、後述する「付加機能による検出精度のコントロール」の機能を用いて対応するようにしてもよい。   In an environment where inconvenience may be caused by terminating the process immediately, for example, the user is notified in advance that the process is scheduled to be forcibly terminated, and the user is asked to determine whether to terminate the process forcibly. Good. Further, a function of “control of detection accuracy by additional function” described later may be used.

(HookReadFileとHookWriteFile)
図26に、本発明プログラムによるHookReadFileによる動作とHookWriteFileによる動作のイメージをまとめて示す。
(HookReadFile and HookWriteFile)
FIG. 26 collectively shows an image of the operation by HookReadFile and the operation by HookWriteFile according to the program of the present invention.

図26左部に監視対象プログラムのプロセスを示し、図26右部に本発明プログラムのプロセスを示す。   The left part of FIG. 26 shows the process of the program to be monitored, and the right part of FIG. 26 shows the process of the program of the present invention.

図26左側の監視対象プログラムのプロセスには、本発明プログラムのフック機能であるHookReadFileとHookWriteFileが組み込まれている。   The process of the monitoring target program on the left side of FIG. 26 incorporates HookReadFile and HookWriteFile which are hook functions of the program of the present invention.

組み込まれたHookReadFileは、通常のReadFileの動作に加えて、(a)通知元API名、(b)自身のプロセスID、(c)ReadFile対象ファイルパスを、図19右側の本発明プロセスに通知する。   The incorporated HookReadFile notifies (a) the notification source API name, (b) its own process ID, and (c) the ReadFile target file path to the process of the present invention on the right side of FIG. 19 in addition to the normal ReadFile operation. .

図26右側の本発明プログラムのプロセスは、図26左側のHookReadFileからの通知を受け取り、通知記録データとして順次記録する。   The process of the present invention program on the right side of FIG. 26 receives notifications from the HookReadFile on the left side of FIG. 26 and sequentially records them as notification record data.

組み込まれたHookWriteFileは、自身(監視対象プロセス)のプロセスIDと、WriteFileの対象ファイルパスに基づいて、図26右部の本発明プログラムのプロセスに対して、ReadFileの通知記録データ中に、同一プロセスID、同一対象ファイルパスのReadFileの記録があるか否かを問い合わせる。図26右側の本発明プログラムは、同一プロセスID、同一対象ファイルパスのReadFileの記録があるか否かをHookWriteFileに応答する。   The incorporated HookWriteFile is the same process in the ReadFile notification record data with respect to the process of the program of the present invention on the right side of FIG. 26 based on the process ID of itself (monitored process) and the target file path of WriteFile. Queries whether there is a record of ReadFile of ID and the same target file path. The program of the present invention on the right side of FIG. 26 responds to HookWriteFile whether there is a record of ReadFile with the same process ID and the same target file path.

組み込まれたHookWriteFileは、更に、書き換え対象ファイルがテキストファイルの場合にユーザーに通知し、その対処方法の選択肢をユーザーに示す。   The incorporated HookWriteFile further notifies the user when the file to be rewritten is a text file, and shows the user the options of how to deal with it.

ユーザーにより監視対象プロセスの除外リストへの追加が選択された場合には、除外リストに当該プロセスを追加する。   If the user selects to add the monitored process to the exclusion list, the process is added to the exclusion list.

ユーザーにより監視対象プロセスの終了が選択された場合には、監視対象プロセスを強制終了する。   When the end of the monitored process is selected by the user, the monitored process is forcibly terminated.

(Windows APIのフック方法)
本発明プログラムが、Windows APIをフックする具体的な方法について、図27乃至図34を用いて説明する。
(Windows API hook method)
A specific method for hooking the Windows API by the program of the present invention will be described with reference to FIGS.

すべてのWindowsプログラムは、起動するとそれぞれのプロセス空間(メモリ空間)と呼ばれる仮想メモリ上に配置される仕組みとなっている。   All Windows programs are arranged in virtual memory called process space (memory space) when started.

それぞれのプロセス空間には、マルウェアのプロセス空間の状態を拡大して表示した図27に示すように、Import Address Table(IAT)という項目があり、IAT にはプログラムが使用する関数(API)の一覧とそれに応じたメモリアドレス(番地)が記録されている。これはプログラムが動作する際に、どういった関数がどこのメモリに読み込まれているかを把握するための一般的な仕組みである。   Each process space has an item called Import Address Table (IAT) as shown in FIG. 27, which is an enlarged view of the state of the malware process space, and IAT contains a list of functions (APIs) used by the program. And a memory address (address) corresponding to this. This is a general mechanism for grasping what function is loaded into which memory when the program runs.

この前提のもとフック制御を行う方法について記述する。   A method for hook control based on this premise will be described.

まず、図28に示すように、監視対象プログラムのプロセス空間に、フック用の WriteFile関数(HookWriteFile関数)を埋め込む。自分以外の他のプロセスにコードを注入する、すなわち、コードをインジェクションするには、そのプロセスのメモリ空間において、VirtualAllocEx関数というWindows APIを利用し、まだ使用されていない領域に一定サイズのメモリ領域を確保する。図28右部の網掛け部分がそのメモリ領域である。   First, as shown in FIG. 28, a hook WriteFile function (HookWriteFile function) is embedded in the process space of the monitoring target program. To inject code into other processes other than yourself, that is, to inject code, use the Windows API called VirtualAllocEx function in the memory space of that process, and allocate a memory area of a certain size to an area that has not been used yet. Secure. The shaded portion on the right side of FIG. 28 is the memory area.

次に、図29に示すように、WriteProcessMemoryというWindows APIを利用し、確保したメモリ領域に実行させたいコード、ここではHookWriteFile関数本体、および、その HookWriteFile関数を監視対象プログラムのプロセス空間内のIATへ組み込むための関数Aを書き込む。この動作を図29の太線矢印で示す。なお、確保したメモリ領域の具体的なアドレスはVirtualAllocExの戻り値を確認することで取得することができる。    Next, as shown in FIG. 29, the Windows API called WriteProcessMemory is used to execute the code to be executed in the reserved memory area, here the HookWriteFile function body, and the HookWriteFile function to the IAT in the process space of the monitored program. Write function A for inclusion. This operation is indicated by a thick arrow in FIG. Note that the specific address of the secured memory area can be obtained by checking the return value of VirtualAllocEx.

次に、図30に示すように、書き込んだコード(関数A)を実行させるために CreateRemoteThreadというWindows APIを呼び出すことにより、その任意のコードをマルウェアのプロセス空間上で実行することができる。この動作を図30の太線矢印で示す。   Next, as shown in FIG. 30, by calling a Windows API called CreateRemoteThread to execute the written code (function A), the arbitrary code can be executed in the malware process space. This operation is indicated by a thick arrow in FIG.

ここで、監視対象プログラムのプロセス空間のみに注目すると、図31に示すようになる。   Here, when attention is paid only to the process space of the monitoring target program, it is as shown in FIG.

次に、図32に示すように、CreateRemoteThreadにより、関数Aが実行されると、関数 Aは、監視対象プログラムのプロセス空間のIATにおける、正規のWriteFile関数のアドレス(図32ではアドレス"0x46700000"番地)を、HookWriteFile関数のアドレス(図32ではアドレス"0x49000000"番地)へ書き換える。これでフックの事前処理が完了する。   Next, as shown in FIG. 32, when the function A is executed by CreateRemoteThread, the function A is the address of the regular WriteFile function in the IAT of the process space of the monitored program (the address “0x46700000” in FIG. 32). ) Is rewritten to the address of the HookWriteFile function (the address “0x49000000” in FIG. 32). This completes the hook pre-processing.

なお、どの関数がどのアドレスに展開されているか、すなわち、IATにあるその関数に対応するアドレス、を知るには、GetProcAddressというWindows APIの引数に関数名を渡すことで、指定した関数がプロセス空間のどのアドレスに対応づけられているのか、具体的なアドレスを知ることができる。   To know which function is expanded to which address, that is, the address corresponding to that function in IAT, pass the function name to the Windows API argument GetProcAddress, and the specified function will be in the process space. It is possible to know the specific address of which address is associated with.

次に、図33及び図34に示すように、監視対象プログラムが、例えば"0x3C0"というファイルハンドルの指すファイル内容を書き換えようとしたと仮定する。その場合、WriteFile関数が呼び出されると、監視対象プログラムは自身のプロセス空間内のIATを参照した結果、正規の WriteFile関数ではなく、HookWriteFile関数に"0x3C0"というパラメータを渡すことになる。   Next, as shown in FIGS. 33 and 34, it is assumed that the monitoring target program tries to rewrite the file content indicated by the file handle “0x3C0”, for example. In this case, when the WriteFile function is called, the monitored program refers to the IAT in its process space, and as a result, passes the parameter “0x3C0” to the HookWriteFile function instead of the regular WriteFile function.

HookWriteFile関数の内部では、任意の処理を行うことが可能である。具体的には、本来WriteFileを使用して書き込むデータの内容を事前にチェックする、変更する等である。本発明プログラムにおけるHookWriteFile関数の内容は、前述のとおりである。   Arbitrary processing can be performed inside the HookWriteFile function. Specifically, the content of data originally written using WriteFile is checked or changed in advance. The contents of the HookWriteFile function in the program of the present invention are as described above.

(付加機能による検出精度のコントロール)
本発明プログラムが監視対象プログラムをランサムウェアであると判断した場合には、ランサムウェアによるファイルの暗号化を防ぐため、監視対象プログラムによるプロセスを強制終了する。
(Control of detection accuracy with additional functions)
When the program of the present invention determines that the monitoring target program is ransomware, the process by the monitoring target program is forcibly terminated to prevent file encryption by the ransomware.

しかしながら、環境によっては、直ちにプロセスを強制終了させることにより不都合が生じる場合がある。そこで、本発明プログラムに付加機能を設けて、ランサムウェアの検出精度をコントロールするようにする。   However, depending on the environment, there may be a problem that the process is immediately terminated. Therefore, an additional function is provided in the program of the present invention to control the detection accuracy of ransomware.

(HookFindNextFileによるコントロール)
HookFindNextFileは、FindNextFile(ファイル検索関数)をフックするWindows API関数である。
(Control by HookFindNextFile)
HookFindNextFile is a Windows API function that hooks FindNextFile (file search function).

ReadFile(ファイル読出関数)をフックするHookReadFile、WriteFile(ファイル書込関数)をフックするHookWriteFileに加えて、HookFindNextFileによりFindNextFile(ファイル検索関数)をフックするようにして、ランサムウェアの検出精度を向上させる。   In addition to HookReadFile that hooks ReadFile (file read function) and HookWriteFile that hooks WriteFile (file write function), HookFindNextFile hooks FindNextFile (file search function) to improve the detection accuracy of ransomware.

FindFirstFileとFindNextFileは、ファイルの検索や列挙に使用するWindows API関数であり、通常、セットで使用される。   FindFirstFile and FindNextFile are Windows API functions used to find and enumerate files and are typically used in sets.

図35に、FindFirstFileとFindNextFileによる動作を示す。   FIG. 35 shows operations by FindFirstFile and FindNextFile.

まず、場所を指定してFindFirstFileを呼び出すと、その場所の最初のファイルの情報がシステムから応答され、最初のファイルの情報(AAA.txt)が取得できる。   First, when FindFirstFile is called by specifying the location, the information on the first file at that location is returned from the system, and the information on the first file (AAA.txt) can be obtained.

次に、FindNextFileを呼び出すと、FindFirstFileにより取得したファイルハンドルから、その場所の次のファイルの情報(BBB.pdf)が取得できる。   Next, when FindNextFile is called, the information (BBB.pdf) of the next file at the location can be acquired from the file handle acquired by FindFirstFile.

以降、FindNextFileを呼び出すことにより、その場所の更に次のファイルの情報(CCC.txt、DDD.exe、…)を順次取得できる。   Thereafter, by calling FindNextFile, information on the next file at that location (CCC.txt, DDD.exe,...) Can be acquired sequentially.

したがって、HookReadFile、HookWriteFileによる上述したランサムウェアの検知時に、FindFirstFileやFindNextFileが常に呼び出されている場合には、ランサムウェアが連続してファイルの暗号化を行っていると判断することができる。   Therefore, if FindFirstFile or FindNextFile is always called when the above-described ransomware is detected by HookReadFile and HookWriteFile, it can be determined that the ransomware is continuously encrypting the file.

図36に示すように、まず、FindFirstFileを呼び出し、ある場所の最初のファイルの情報を取得する。続いて、ReadFileとWriteFileを呼び出し、そのファイルの暗号化処理を行う。次に、FindNextFileを呼び出し、その場所の次のファイルの情報を取得する。続いて、ReadFileとWriteFileを呼び出し、そのファイルの暗号化処理を行う。次に、同様に、FindNextFileを呼び出し、その場所の次のファイルの情報を取得する。続いて、ReadFileとWriteFileを呼び出し、そのファイルの暗号化処理を行う。以降、同様な処理を繰り返して、その場所のファイルを連続して暗号化する。   As shown in FIG. 36, first, FindFirstFile is called to obtain information on the first file at a certain location. Subsequently, ReadFile and WriteFile are called and the files are encrypted. Next, call FindNextFile to get information about the next file in that location. Subsequently, ReadFile and WriteFile are called and the files are encrypted. Next, similarly, FindNextFile is called to obtain information about the next file at that location. Subsequently, ReadFile and WriteFile are called and the files are encrypted. Thereafter, the same processing is repeated to continuously encrypt the files at that location.

このようなファイルの連続した暗号化処理を検出するためには、FindNextFileのみをフックして監視すればよい。FindFirstFileは必ずしもフックして監視しなくともよい。   In order to detect such continuous encryption processing of files, it is only necessary to hook and monitor FindNextFile. FindFirstFile does not have to be hooked and monitored.

FindNextFileをフックするHookFindNextFileは、呼び出されると通常のFindNextFileの動作に加えて、本発明プログラムに対して次の情報(a)〜(c)を通知する。   When called, HookFindNextFile that hooks FindNextFile notifies the following information (a) to (c) to the program of the present invention in addition to the normal operation of FindNextFile.

通知手段としては、プロセス間通信等、プロセスの動作に大きな遅延を発生させない程度の高速な手法が望ましい。ソケット通信やファイルによる受け渡し等でも、高速に実現できる環境であれば、いかなる方法でもよい。
(a)通知元API名。フックするWindows API関数の名前であるFindNextFileである。
(b)自身のプロセスID。フックするFindNextFileを呼び出す監視対象プロセスのプロセスIDである。
(c)通知元APIであるFindNextFileのパラメータで指定されたデータバッファから取得できるファイル名。データバッファには次のファイルの情報が格納されている。
As the notification means, a high-speed method that does not cause a large delay in the operation of the process, such as inter-process communication, is desirable. Any method may be used as long as the environment can be realized at high speed, such as socket communication or file delivery.
(A) Notification source API name. FindNextFile, the name of the Windows API function to hook.
(B) its own process ID; This is the process ID of the monitored process that calls FindNextFile to hook.
(C) File name that can be acquired from the data buffer specified by the parameter of FindNextFile that is the notification source API. The data buffer stores information about the next file.

したがって、HookReadFile、HookWriteFileによりランサムウェアが検知されたことを条件として、その暗号化処理の前に、FindNextFileが呼び出され、かつ、取得された次のファイル名がReadFileおよびWriteFileの対象ファイルと合致するかどうかを確認することにより、暗号化処理が複数のファイルに対して連続して行われていることを判断することができる。   Therefore, on the condition that ransomware is detected by HookReadFile and HookWriteFile, FindNextFile is called before the encryption process, and whether the next file name obtained matches the target file of ReadFile and WriteFile. By confirming whether or not, it is possible to determine that the encryption process is continuously performed on a plurality of files.

上記を判断するためには、例えば、HookReadFile、HookWriteFile、HookNextFileが、それぞれ、本発明プログラムに対して通知する(a)通知元API名、(b)プロセスID、(c)ファイルパスを、通知記録データに記録しておき、その通知記録データに基づいて判断する。   In order to determine the above, for example, HookReadFile, HookWriteFile, and HookNextFile respectively notify (a) a notification source API name, (b) a process ID, and (c) a file path that are notified to the program of the present invention. The data is recorded in advance, and the determination is made based on the notification record data.

図37に通知記録データの具体例を示す。   FIG. 37 shows a specific example of the notification record data.

図37の通知記録データには、第4〜6行に、FindNextFileのプロセスID"pid:1568"、ファイルパス"C:\Users\user\Documents\schedule.xls"の記録があり、第7〜9行、第13〜15行に、ReadFileのプロセスID"pid:1568"、ファイルパス"C:\Users\user\Documents\schedule.xls"の記録があり、第10〜12行、第16〜118行に、WriteFileのプロセスID"pid:1568"、ファイルパス"C:\Users\user\Documents\schedule.xls"の記録がある。   The notification record data in FIG. 37 includes records of FindNextFile process ID “pid: 1568” and file path “C: \ Users \ user \ Documents \ schedule.xls” in the fourth to sixth lines. Lines 9 and 13 to 15 have a record of ReadFile process ID “pid: 1568” and file path “C: \ Users \ user \ Documents \ schedule.xls”. Lines 10 to 12 and 16 to 16 Line 118 has a record of WriteFile process ID “pid: 1568” and file path “C: \ Users \ user \ Documents \ schedule.xls”.

FindNextFileのプロセスIDとファイルパスは、ReadFileとWriteFileのプロセスIDとファイルパスと同一である。WriteFileにより、ファイル"schedule.xls"のヘッダが変更されたことが検出された場合には、暗号化処理が複数のファイルに対して連続して行われていると判断する。   The process ID and file path of FindNextFile are the same as the process ID and file path of ReadFile and WriteFile. When it is detected by WriteFile that the header of the file “schedule.xls” has been changed, it is determined that the encryption process is continuously performed on a plurality of files.

図37の通知記録データには、更に、第22〜36行に、同じフォルダ
"C:\Users\user\Documents\"内のファイル"description.doc"に対して同様な処理を行っていることが記録されている。WriteFileにより、ファイル"description.doc"のヘッダが変更されたことが検出された場合には、暗号化処理が同一フォルダ内の複数のファイルに対して連続して行われていると判断する。
In the notification record data shown in FIG.
It is recorded that the same processing is performed on the file "description.doc" in "C: \ Users \ user \ Documents \". When it is detected by WriteFile that the header of the file “description.doc” has been changed, it is determined that the encryption process is continuously performed on a plurality of files in the same folder.

暗号化処理が複数のファイルに対して連続して行われているかの判断を有効にするか設定することにより、ランサムウェアによる暗号化処理に対する検知挙動の精度をコントロールすることができる。   By setting whether or not to determine whether or not the encryption process is continuously performed on a plurality of files, it is possible to control the accuracy of the detection behavior for the encryption process by the ransomware.

図38は、複数ファイルに対する暗号化処理を有効にするかの設定画面である。図38の設定画面の表現方法は一例であり、他の表現方法でもよい
設定画面では、チェックボタンの後に「複数のファイルに対する暗号化処理を検知条件の入れる」を表示すると共に、「チェックを入れない場合は単一ファイルに対する暗号化処理も検知対象に含まれます」との注意書きを表示する。ユーザーがチェックボタンをチェックすることに検知条件を変更することができる。
FIG. 38 is a setting screen for enabling the encryption processing for a plurality of files. The expression method of the setting screen in FIG. 38 is an example, and other expression methods may be used. In the setting screen, “Enter encryption processing for multiple files with detection conditions” is displayed after the check button, and “ If not, encryption processing for single files is also included in the detection target ”. The detection condition can be changed when the user checks the check button.

例えば、単一のファイルに対する暗号化処理を行う可能性のあるユーザー環境では、この検知条件がないと、正当な暗号化処理をランサムウェアによる処理と誤検知することとなる。このような誤検知、誤検知による過検知を発生させないようにすることができる。   For example, in a user environment where there is a possibility of performing encryption processing on a single file, if there is no such detection condition, legitimate encryption processing is erroneously detected as ransomware processing. Such erroneous detection and overdetection due to erroneous detection can be prevented from occurring.

(HookMoveFileによるコントロール)
HookMoveFileは、MoveFile(MoveFileA、MoveFileW、MoveFileExA、MoveFileExW)(ファイル移動関数)をフックするWindows API関数である。
(Control by HookMoveFile)
HookMoveFile is a Windows API function that hooks MoveFile (MoveFileA, MoveFileW, MoveFileExA, MoveFileExW) (file move function).

ReadFile(ファイル読出関数)をフックするHookReadFile、WriteFile(ファイル書込関数)をフックするHookWriteFileに加えて、HookMoveFileによりMoveFile(ファイル移動関数)をフックするようにして、ランサムウェアの検出精度を向上させる。   In addition to HookReadFile hooking ReadFile (file read function) and HookWriteFile hooking WriteFile (file write function), HookMoveFile hooks MoveFile (file move function) to improve ransomware detection accuracy.

MoveFileは、ファイルの移動及びファイル名の変更を行うためのWindows API関数である。図39に示すように、MoveFileの第一引数は移動元のファイルパス(ファイル名)であり、第二引数は移動先のファイルパス(ファイル名)である。   MoveFile is a Windows API function for moving files and changing file names. As shown in FIG. 39, the first argument of MoveFile is the file path (file name) of the movement source, and the second argument is the file path (file name) of the movement destination.

MoveFileの第一引数と第二引数のファイル名を除くファイルパスが異なる場合は、「ファイルの移動」の処理になる。MoveFileの第一引数と第二引数のファイル名を除くファイルパスが同じ場合は、実質的に「ファイル名の変更」の処理となる。   If the file path excluding the file name of MoveFile's first argument and the second argument is different, the process is "Move File". If the file path excluding the file name of MoveFile is the same as that of the second argument, the process is essentially “change file name”.

ランサムウェアには、暗号化対象のファイル名を暗号化後に変更するものがある。これは、暗号化ファイルの元ファイル名を判断不能にするためであり、ファイルの中身だけではなくファイル名も同時に暗号化処理を行う。   Some ransomware changes the file name to be encrypted after encryption. This is to make it impossible to determine the original file name of the encrypted file, and not only the contents of the file but also the file name are simultaneously encrypted.

そのようなランサムウェアは、図40に示すように、ファイルの暗号化処理が行われた直後にMoveFileを呼び出すことで、ファイル名の暗号化も併せて行う。その流れを検知することで、ランサムウェアによるファイル名の暗号化挙動を本発明プログラムが把握することを可能にする。   As shown in FIG. 40, such ransomware also performs encryption of the file name by calling MoveFile immediately after the file encryption process is performed. By detecting the flow, the program of the present invention can grasp the encryption behavior of the file name by the ransomware.

図40に示すように、FindNextFileを呼び出し、その場所の次のファイルの情報を取得する。続いて、CreateFile、ReadFile、WriteFileを呼び出し、そのファイルの暗号化処理を行う。続いて、MoveFileを呼び出し、そのファイルのファイル名を暗号化している。図40では、MoveFileにより、暗号化されたファイル"ABS.pdf"のファイル名が"g1d4fr.vvv"に変更されている。   As shown in FIG. 40, FindNextFile is called to obtain information on the next file at that location. Subsequently, CreateFile, ReadFile, and WriteFile are called and the files are encrypted. Next, MoveFile is called to encrypt the file name. In FIG. 40, the file name of the encrypted file “ABS.pdf” is changed to “g1d4fr.vvv” by MoveFile.

このようなファイル名の暗号化処理を検出するために、MoveFileをフックして監視する。MoveFileをフックするHookMoveFileは、呼び出されると通常のMoveFileの動作に加えて、本発明プログラムに対して次の情報(a)〜(c)を通知する。   In order to detect such file name encryption processing, MoveFile is hooked and monitored. When called, HookMoveFile that hooks MoveFile notifies the program of the present invention the following information (a) to (c) in addition to the normal operation of MoveFile.

通知手段としては、プロセス間通信等、プロセスの動作に大きな遅延を発生させない程度の高速な手法が望ましい。ソケット通信やファイルによる受け渡し等でも、高速に実現できる環境であれば、いかなる方法でもよい。
(a)通知元API名。フックするWindows API関数の名前であるMoveFileである。
(b)自身のプロセスID。フックするMoveFileを呼び出す監視対象プロセスのプロセスIDである。
(c)通知元APIであるMoveFileの第一引数と第二引数で指定されたファイルパス。
As the notification means, a high-speed method that does not cause a large delay in the operation of the process, such as inter-process communication, is desirable. Any method may be used as long as the environment can be realized at high speed, such as socket communication or file delivery.
(A) Notification source API name. MoveFile, the name of the Windows API function to hook.
(B) its own process ID; This is the process ID of the monitored process that calls MoveFile to hook.
(C) File path specified by the first argument and the second argument of MoveFile which is the notification source API.

したがって、HookReadFile、HookWriteFileによりランサムウェアが検知されたことを条件として、その暗号化処理の後に、MoveFileが呼び出され、かつ、MoveFileの第一引数と第二引数のパス(ファイルパスからファイル名を除いたファイルパス)が同一であるかどうかを確認することにより、ファイル名に対する暗号化処理が行われていることを判断することができる。   Therefore, on the condition that ransomware is detected by HookReadFile and HookWriteFile, MoveFile is called after the encryption process, and the path of the first argument and the second argument of MoveFile (excluding the file name from the file path) It is possible to determine that the encryption process for the file name is being performed by confirming whether the file paths are the same.

上記を判断するためには、例えば、HookReadFile、HookWriteFileが、それぞれ、本発明プログラムに対して通知する(a)通知元API名、(b)プロセスID、(c)ファイルパス、MoveFileが、それぞれ、本発明プログラムに対して通知する(a)通知元API名、(b)プロセスID、(c)第一引数のファイルパス、(d)第二引数のファイルパスを、通知記録データに記録しておき、その通知記録データに基づいて判断する。   In order to determine the above, for example, HookReadFile and HookWriteFile respectively notify (a) a notification source API name, (b) a process ID, (c) a file path, and MoveFile respectively notified to the program of the present invention. (A) Notification source API name, (b) Process ID, (c) File path of the first argument, (d) File path of the second argument are recorded in the notification record data. The determination is made based on the notification record data.

図41に通知記録データの具体例を示す。   FIG. 41 shows a specific example of the notification record data.

図41の通知記録データには、第4〜6行、第10〜12行に、ReadFileのプロセスID"pid:1568"、ファイルパス"C:\Users\user\Documents\schedule.xls"の記録があり、第7〜9行、第13〜15行に、WriteFileのプロセスID"pid:1568"、ファイルパス"C:\Users\user\Documents\schedule.xls"の記録があり、第16〜19行に、MoveFileのプロセスID"pid:1568"、第一引数ファイルパス"C:\Users\user\Documents\schedule.xls"、第二引数ファイルパス"C:\Users\user\Documents\g1d4fr6ps.vvv"の記録がある。   In the notification record data of FIG. 41, the ReadFile process ID “pid: 1568” and the file path “C: \ Users \ user \ Documents \ schedule.xls” are recorded in the 4th to 6th lines and the 10th to 12th lines. In lines 7-9 and 13-15, there is a record of WriteFile process ID “pid: 1568” and file path “C: \ Users \ user \ Documents \ schedule.xls”. Line 19 contains MoveFile process ID "pid: 1568", first argument file path "C: \ Users \ user \ Documents \ schedule.xls", second argument file path "C: \ Users \ user \ Documents \ g1d4fr6ps There is a record of ".vvv".

MoveFileのプロセスIDは、ReadFileとWriteFileのプロセスIDと同一であり、MoveFileの第一引数のファイルパスは、ReadFileとWriteFileのファイルパスと同一であり、MoveFileの第1引数のパスと第2引数のパスは同一である。WriteFileによりファイル"schedule.xls"のヘッダが変更されたことが検出された場合には、"schedule.xls"が暗号化処理され、かつ、"schedule.xls"のファイル名も"g1d4fr6ps.vvv"に暗号化処理されていると判断する。   The process ID of MoveFile is the same as the process ID of ReadFile and WriteFile, the file path of the first argument of MoveFile is the same as the file path of ReadFile and WriteFile, the path of the first argument and the second argument of MoveFile The path is the same. If it is detected by WriteFile that the header of the file "schedule.xls" has been changed, "schedule.xls" is encrypted and the file name of "schedule.xls" is also "g1d4fr6ps.vvv" Is determined to be encrypted.

図41の通知記録データには、更に、第22〜37行に、同じフォルダ
"C:\Users\user\Documents\"内のファイル"description.doc"に対して同様な処理を行っていることが記録されている。WriteFileによりファイル"description.doc"のヘッダが変更されたことが検出された場合には、"description.doc"が暗号化処理され、かつ、"description.doc"のファイル名も"p6dfg7p4.vvv"暗号化処理されていると判断する。
In the notification record data shown in FIG.
It is recorded that the same processing is performed on the file "description.doc" in "C: \ Users \ user \ Documents \". When it is detected that the header of the file “description.doc” has been changed by WriteFile, “description.doc” is encrypted, and the file name of “description.doc” is also “p6dfg7p4.vvv” It is determined that encryption processing has been performed.

ファイルに対する暗号化処理を検知した上で、ファイル名の変更が行われていることを検知した場合、本発明プログラムは、その情報をユーザーに示して、ランサムウェアによる暗号化処理に対する検知挙動の精度をコントロールすることができる。   When it is detected that the file name has been changed after detecting the encryption process for the file, the program of the present invention shows the information to the user, and the accuracy of the detection behavior for the encryption process by the ransomware Can be controlled.

図42は、ファイル名の変化を検知した場合に警告するか否かの設定画面である。図42の設定画面の表現方法は一例であり、他の表現方法でもよい
設定画面では、チェックボタンの後に「「ファイル名の変化」を検知条件に入れる」を表示すると共に、「チェックを入れない場合はファイル名が変化しない暗号化処理も検知対象に含まれます」「チェックを入れた場合はファイル名の変化に関する情報が検知時に表示され、対処を選択可能となります」との注意書きを表示する。ユーザーがチェックボタンをチェックすることで警告するか否かを設定することができる。
FIG. 42 is a setting screen for determining whether or not to warn when a change in file name is detected. The expression method of the setting screen in FIG. 42 is an example, and other expression methods may be used. On the setting screen, “Add“ Change in file name ”to the detection condition” is displayed after the check button and “Do not check” is displayed. If the check box is checked, information about the change in the file name will be displayed at the time of detection, and the action can be selected. " To do. It is possible to set whether or not to warn the user by checking the check button.

図43は、ファイル内容が改変され、かつ、ファイル名が改変された場合の警告画面である。慎重なユーザーはこの情報を元にどう対処するかを選択できユーザビリティが向上するとともに、誤検知、誤検知による過検知のコントロールも可能となる。   FIG. 43 shows a warning screen when the file content is modified and the file name is modified. Careful users can select how to deal with this information and improve usability, as well as control over-detection due to false positives and false positives.

警告画面では「以下のプロセスがテキストファイルの改変挙動を行っています。どう処理しますか。」と尋ね、「プロセス:AAAA.exe」、「該当挙動:ファイル内容の改変、ファイル名の改変、「d1g2r.vvv」に変更しようとしています」、「「対象ファイル:C:\Users\test\Document\BBB.pdf」を示す。   The warning screen asks "The following process is changing the text file. How do you handle it?", "Process: AAAA.exe", "Applicable behavior: File content modification, file name modification, "I'm trying to change to" d1g2r.vvv "", "" Target file: C: \ Users \ test \ Document \ BBB.pdf ".

更に、その対応処理の選択ボタン「プロセスを終了」、「この警告を放置」、「プロセスを除外に追加」を示す。   Furthermore, the corresponding process selection buttons “end process”, “leave this warning”, and “add process to exclusion” are shown.

ユーザーが「プロセスを終了」を選択した場合には、プロセス"AAAA.exe"を直ちに終了させる。ユーザーが、そのプロセスをランサムウェアであると判断した場合である。   If the user selects “End Process”, the process “AAAA.exe” is immediately ended. This is when the user determines that the process is ransomware.

ユーザーが「この警告を放置」を選択した場合には、プロセス"AAAA.exe"を終了させることなく、そのまま処理を続行する。ユーザーが、そのプロセスをランサムウェアであるか否か判断できない又は判断を保留する場合である。   If the user selects “Leave this warning”, the process continues without terminating the process “AAAA.exe”. This is the case when the user cannot determine whether the process is ransomware or withholds the determination.

ユーザーが「プロセスを除外に追加」を選択した場合には、プロセス"AAAA.exe"を、前述した「除外リスト」に追加し、同じプロセスに対する警告を再度行わないようにする。ユーザーが、そのプロセスはランサムウェアでないと判断した場合である。   When the user selects “Add Process to Exclude”, the process “AAAA.exe” is added to the “Exclusion List” described above so that the same process is not warned again. If the user determines that the process is not ransomware.

[第2実施形態]
本発明の第2実施形態によるプログラム、情報処理装置及び情報処理方法について図44乃至図51を用いて説明する。
[Second Embodiment]
A program, an information processing apparatus, and an information processing method according to the second embodiment of the present invention will be described with reference to FIGS.

本発明の第1実施形態は、主なランサムウェアの挙動を分析して共通部分を洗い出し、そこから確実に不正であると判断できる挙動を検知・防御するものである。しかしながら、分析したランサムウェアによる手法でなくても、ファイルの暗号化処理は可能である。   The first embodiment of the present invention analyzes the behavior of main ransomware, identifies common parts, and detects and protects behaviors that can be determined to be illegal from there. However, file encryption processing is possible without using the analyzed ransomware method.

そこで、本願発明者等は、分析したランサムウェア以外の想定しうる挙動を検出することにより、未知のランサムウェアを確実に検出し、ランサムウェアによる攻撃を有効に阻止することができると考え、本実施形態を着想するに至った。   Therefore, the inventors of the present application believe that by detecting possible behavior other than the analyzed ransomware, it is possible to reliably detect unknown ransomware and effectively prevent attacks by ransomware. I came up with an embodiment.

本願発明者等が想定した暗号化手法について説明する。図44に本願発明者等が想定した暗号化手法を示す。   An encryption method assumed by the inventors of the present application will be described. FIG. 44 shows an encryption method assumed by the inventors of the present application.

あるファイルAを暗号化対象とした場合、本発明の第1実施形態では、暗号化されたファイルは元のファイルに直接上書き処理している。しかしながら、直接上書き処理しなくても、暗号化されたファイルを元のファイルが存在したフォルダに存在する状態にすることができる。   When a certain file A is to be encrypted, in the first embodiment of the present invention, the encrypted file is directly overwritten on the original file. However, the encrypted file can be made to exist in the folder in which the original file existed without directly overwriting.

図44の暗号化方法について、ステップの番号順に説明する。
(ステップ1):ReadFileにより、ファイルAを読み込みメモリ23上で暗号化する。
(ステップ2):メモリ23上のファイルAの暗号化されたデータを、WriteFileにより、任意の場所にファイルBとして作成する。
(ステップ3−A):暗号化されたファイルBを、MoveFileにより、ファイル名をファイルCに変更する。
(ステップ3−B):暗号化されたファイルBを、MoveFileにより、ファイル名をファイルAに変更し、ファイルAが存在したフォルダに移動することでファイルAを上書きする。
(ステップ4):MoveFileにより、ファイルCをファイルAが存在したフォルダに移動する。
(ステップ5):DeleteFileにより、ファイルAを削除する。
The encryption method of FIG. 44 will be described in the order of step numbers.
(Step 1): The file A is read and encrypted on the memory 23 by ReadFile.
(Step 2): The encrypted data of the file A on the memory 23 is created as a file B at an arbitrary location by WriteFile.
(Step 3-A): The file name of the encrypted file B is changed to the file C by MoveFile.
(Step 3-B): The file name of the encrypted file B is changed to File A by MoveFile, and the file A is overwritten by moving to the folder where the file A exists.
(Step 4): The file C is moved to the folder in which the file A exists by MoveFile.
(Step 5): File A is deleted by DeleteFile.

ステップ5の後は、ファイルAが存在したフォルダに、暗号化されたファイルAのファイル名がファイルCに変更された「状態1」となる。   After step 5, the state where the file name of the encrypted file A is changed to the file C in the folder in which the file A exists is changed to “state 1”.

ステップ3−Bの後は、ファイルAが存在したフォルダに、暗号化されたファイルAが存在する「状態2」となる。   After step 3-B, the state where the encrypted file A exists in the folder in which the file A exists becomes “state 2”.

図45に暗号化方法の複数のケースを示す。   FIG. 45 shows a plurality of cases of the encryption method.

暗号化方法のケース1は、ステップ1、ステップ2、ステップ3−A、ステップ4、ステップ5の順番に進行し、状態1となるケースである。   Case 1 of the encryption method is a case in which the process proceeds in the order of Step 1, Step 2, Step 3-A, Step 4, and Step 5 and becomes State 1.

暗号化方法のケース1は、ステップ1、ステップ2、ステップ3−Bの順番に進行し、状態2となるケースである。   Case 1 of the encryption method is a case in which the process proceeds in the order of Step 1, Step 2, and Step 3-B and enters State 2.

本実施形態では、例えば、ケース1、ケース2を検知することにより、分析したランサムウェア以外の想定しうる挙動を検出するようにする。   In the present embodiment, for example, by detecting Case 1 and Case 2, an assumed behavior other than the analyzed ransomware is detected.

なお、「状態1」「状態2」となるための挙動はケース1、ケース2に限らないが、そのような別のケースについても、後述する検知方法と同様の方法により検知することが可能である。   Note that the behavior to become “state 1” and “state 2” is not limited to case 1 and case 2, but such other cases can be detected by a method similar to the detection method described later. is there.

本実施形態においても、第1実施形態におけるHookReadFile、HookWriteFileによる暗号化処理を検知する。本実施形態では、それに加えて、MoveFile(MoveFileA、MoveFileW、MoveFileExA、MoveFileExW)(ファイル移動関数)をフックするHookMoveFileや、DeleteFile(ファイル削除関数)をフックするHookDeleteFileを用いる。   Also in this embodiment, the encryption processing by HookReadFile and HookWriteFile in the first embodiment is detected. In this embodiment, in addition to that, HookMoveFile that hooks MoveFile (MoveFileA, MoveFileW, MoveFileExA, MoveFileExW) (file move function) and HookDeleteFile that hooks DeleteFile (file delete function) are used.

そして、HookReadFile、HookWriteFile、HookDeleteFileが、それぞれ、本発明プログラムに対して(a)通知元API名、(b)プロセスID、(c)ファイルパスを通知し、HookMoveFileが、本発明プログラムに対して(a)通知元API名、(b)プロセスID、(c)第一引数のファイルパス、(d)第二引数のファイルパスを通知する。本発明プログラムに通知された、これらデータは、適宜、所定のリストに記録する。   Then, HookReadFile, HookWriteFile, and HookDeleteFile respectively notify (a) the notification source API name, (b) process ID, (c) file path to the program of the present invention, and HookMoveFile notifies the program of the present invention ( a) Notification source API name, (b) Process ID, (c) File path of first argument, (d) File path of second argument are notified. These data notified to the program of the present invention are appropriately recorded in a predetermined list.

(ケース1の検知)
図48に、ケース1の検知の事前処理を示す。
(Detection of Case 1)
FIG. 48 shows pre-processing for detection of case 1.

本発明プログラムに対して、HookReadFileから通知される、(a)通知元API名、(b)プロセスID、(c)ファイルパスを、リストAとして記録する。   For the program of the present invention, (a) the notification source API name, (b) the process ID, and (c) the file path notified from HookReadFile are recorded as a list A.

本発明プログラムに対して、HookWriteFileから通知される、(a)通知元API名、(b)プロセスID、(c)ファイルパスを、リストBとして記録する。   For the program of the present invention, (a) a notification source API name, (b) a process ID, and (c) a file path notified from HookWriteFile are recorded as a list B.

本発明プログラムに対して、HookMoveFileから通知される、(a)通知元API名、(b)プロセスID、(c)第一引数のファイルパス、(d)第二引数のファイルパスを、リストCとして記録する。   For the program of the present invention, a list C shows (a) the notification source API name, (b) the process ID, (c) the file path of the first argument, and (d) the file path of the second argument, which are notified from the HookMoveFile. Record as.

ケース1の検知条件を次に示す。   The detection conditions for Case 1 are as follows.

条件1:あるプロセスにより、DeleteFileが呼び出され、引数のファイルパス(削除対象のファイル)がリストAに含まれている。すなわち、HookDeleteFileから通知されるプロセスIDが、HookReadFileから通知されるプロセスIDと同一であり、かつ、HookDeleteFileから通知されるファイルパスがリストAに含まれている。   Condition 1: DeleteFile is called by a process, and an argument file path (a file to be deleted) is included in the list A. That is, the process ID notified from HookDeleteFile is the same as the process ID notified from HookReadFile, and the file path notified from HookDeleteFile is included in list A.

条件1の具体例を図47に示す。図47に示すように、あるプロセスにより、DeleteFileが呼び出され、引数のファイルパス"C:\DDD\CC.doc"がリストAに含まれている。   A specific example of condition 1 is shown in FIG. As shown in FIG. 47, DeleteFile is called by a certain process, and the file path “C: \ DDD \ CC.doc” of the argument is included in the list A.

この条件1は、あるプロセスが過去にReadFileで読み込んだことがあるファイルをDeleteFileにより削除しようとしていることを意味する。   This condition 1 means that a process is trying to delete a file that has been read by ReadFile in the past by DeleteFile.

条件2:DeleteFileの引数(削除対象ファイルの)のフォルダパスが、リストCの第二引数のフォルダパスと等しい。すなわち、HookDeleteFileから通知されるプロセスIDが、HookMoveFileから通知されるプロセスIDと同一であり、かつ、HookDeleteFileから通知されるファイルパスからファイル名を除いたパスが、リストCの第二引数からファイル名を除いたパスと同一である。   Condition 2: The folder path of the argument of DeleteFile (for the file to be deleted) is equal to the folder path of the second argument in list C. That is, the process ID notified from HookDeleteFile is the same as the process ID notified from HookMoveFile, and the path obtained by removing the file name from the file path notified from HookDeleteFile is the file name from the second argument of list C. It is the same as the path except for.

条件2の具体例を図48に示す。図48に示すように、DeleteFileの引数のフォルダパス"C:\DDD\"が、リストCの第二引数のフォルダパス"C:\DDD\"と等しい。   A specific example of condition 2 is shown in FIG. As shown in FIG. 48, the folder path “C: \ DDD \” of the argument of DeleteFile is equal to the folder path “C: \ DDD \” of the second argument of list C.

この条件2は、あるプロセスが削除しようとしているファイルの場所が、過去にそのプロセスが何らかのファイルを移動先として指定した記録があるということを意味する。   This condition 2 means that the location of a file that a certain process is trying to delete has a record in which the process has designated some file as a destination in the past.

条件3:MoveFileの第一引数のファイルが、リストBに含まれている。すなわち、HookWriteFileから通知されるプロセスIDが、HookMoveFileから通知されるプロセスIDと同一であり、かつ、HookMoveFileから通知される第一引数のファイルパスと同一である。   Condition 3: The file of the first argument of MoveFile is included in the list B. That is, the process ID notified from HookWriteFile is the same as the process ID notified from HookMoveFile, and the same file path as the first argument notified from HookMoveFile.

条件3の具体例を図49に示す。図49に示すように、MoveFileの第一引数のファイル"C:\XXX\VV.doc"が、リストBに含まれている。   A specific example of condition 3 is shown in FIG. As shown in FIG. 49, the first argument file “C: \ XXX \ VV.doc” of MoveFile is included in the list B.

この条件3は、あるプロセスが過去にWriteFileで書き込んだファイルを、MoveFileで移動させようとしていることを意味する。   Condition 3 means that a file written by WriteFile in the past is moved by MoveFile.

条件4:上記の条件2を満足したMoveFileの第一引数のファイルのヘッダが、第1の条件を満足したDeleteFileの引数のファイルのヘッダと異なる。   Condition 4: The header of the first argument file of MoveFile that satisfies the above condition 2 is different from the header of the file of the argument of DeleteFile that satisfies the first condition.

条件4の具体例を図50に示す。図50に示すように、MoveFileの第一引数のファイル"C:\DDD\CC.doc"のヘッダが、第1の条件を満足したDeleteFileの引数のファイル"C:\XXX\VV.doc"のヘッダと異なる。   A specific example of condition 4 is shown in FIG. As shown in FIG. 50, the header of the first argument file “C: \ DDD \ CC.doc” of MoveFile is the file “C: \ XXX \ VV.doc” of the argument of DeleteFile that satisfies the first condition. Different from the header.

この条件4は、第1実施形態におけるファイルのヘッダの相違の判断条件と同じである。   The condition 4 is the same as the determination condition for the difference in file header in the first embodiment.

(ケース2の検知)
図51に、ケース2の検知の事前処理を示す。
(Detection of Case 2)
FIG. 51 shows pre-processing for detection of case 2.

本発明プログラムに対して、HookReadFileから通知される、(a)通知元API名、(b)プロセスID、(c)ファイルパスを、リストAとして記録する。   For the program of the present invention, (a) the notification source API name, (b) the process ID, and (c) the file path notified from HookReadFile are recorded as a list A.

本発明プログラムに対して、HookWriteFileから通知される、(a)通知元API名、(b)プロセスID、(c)ファイルパスを、リストBとして記録する。   For the program of the present invention, (a) a notification source API name, (b) a process ID, and (c) a file path notified from HookWriteFile are recorded as a list B.

ケース2の検知条件を次に示す。   The detection conditions for Case 2 are as follows.

条件1:あるプロセスにより、MoveFileが呼び出され、第二引数のファイルパスがリストAに含まれている。すなわち、HookMoveFileから通知されるプロセスIDが、HookReadFileから通知されるプロセスIDと同一であり、かつ、HookMoveFileから通知される第二引数のファイルパスがリストAに含まれている。   Condition 1: MoveFile is called by a process, and the file path of the second argument is included in the list A. That is, the process ID notified from HookMoveFile is the same as the process ID notified from HookReadFile, and the file path of the second argument notified from HookMoveFile is included in list A.

この条件1は、このプロセスが過去にReadFileで読み込んだ事があるファイルを何らかのファイルで上書きしようとしていることを意味する。   This condition 1 means that this process is trying to overwrite a file that has been read by ReadFile in the past with some file.

条件2:その際、MoveFileの第一引数のファイルパスが、リストBに含まれている。すなわち、HookMoveFileから通知されるプロセスIDが、HookWriteFileから通知されるプロセスIDと同一であり、かつ、HookMoveFileから通知される第一引数のファイルパスがリストBに含まれている。   Condition 2: At this time, the file path of the first argument of MoveFile is included in the list B. That is, the process ID notified from HookMoveFile is the same as the process ID notified from HookWriteFile, and the file path of the first argument notified from HookMoveFile is included in list B.

この条件2は、このプロセスが過去にWriteFileで書き込んだことがあるファイルを、移動させようとしていることを意味する。   This condition 2 means that this process is going to move a file that has been written by WriteFile in the past.

条件3:MoveFileの第一引数のファイルのヘッダが、第二引数のファイルのヘッダと異なる。   Condition 3: The header of the first argument file of MoveFile is different from the header of the file of the second argument.

この条件3は、第1実施形態におけるファイルのヘッダの相違の判断条件と同じである。   Condition 3 is the same as the condition for determining the difference in file headers in the first embodiment.

[発明の原理(その2)]
本発明の原理(その2)について図52乃至図54を用いて説明する。
[Principle of the Invention (Part 2)]
The principle (part 2) of the present invention will be described with reference to FIGS.

(ランサムウェアの分析)
本願発明者等は、国内外で被害が報告されている他のランサムウェアについて更に解析を行った。
(Ransomware analysis)
The inventors of the present application further analyzed other ransomware that has been reported to be damaged domestically and internationally.

発明の原理(その1)に記載したように、通常のランサムウェアがファイルを暗号化する際には、ReadFileおよびWriteFileというWindows APIをファイルの読み書き時に利用する。そこで、発明の原理(その1)に基づく本発明の第1実施形態や本発明の第2実施形態では、ファイルの読み書きの関数、すなわち、ReadFileやWriteFileを用いてファイルが操作された際に、ファイルのヘッダが書き換えられているか否かに着目してランサムウェアを検知している。   As described in the principle of the invention (part 1), when a normal ransomware encrypts a file, Windows APIs such as ReadFile and WriteFile are used when reading and writing the file. Therefore, in the first embodiment of the present invention and the second embodiment of the present invention based on the principle (part 1) of the invention, when a file is operated using a file read / write function, that is, ReadFile or WriteFile, Ransomware is detected based on whether the header of the file has been rewritten.

しかしながら、ランサムウェアの中には、ファイルを暗号化する際に、ファイルマッピングという仕組みを利用してファイル操作を行うタイプのランサムウェアが存在する。このようなランサムウェアでは、ファイルの読み書き関数であるReadFile及びWriteFileを使用しない。このため、発明の原理(その1)に基づく本発明の第1実施形態や本発明の第2実施形態では、このようなランサムウェアを検知することが困難である。
(a)一般的なファイル操作とファイルマッピングによるファイル操作の相違
図52を用いて、一般的なファイル操作とファイルマッピングによるファイル操作の相違について説明する。
However, ransomware includes a type of ransomware that performs file operations using a mechanism called file mapping when a file is encrypted. Such ransomware does not use ReadFile and WriteFile, which are file read / write functions. For this reason, it is difficult to detect such ransomware in the first embodiment of the present invention and the second embodiment of the present invention based on the principle (part 1) of the invention.
(A) Difference between general file operation and file operation by file mapping The difference between a general file operation and a file operation by file mapping will be described with reference to FIG.

図52に示すように、実ファイルはハードディスク22に記憶されている。一般的なファイル操作におけるファイルの読み書きの処理では、その都度、メモリ23にバッファ(図示せず)を用意してファイルを読み込み、編集したデータをファイルに書き戻す、といった一連の処理を行う。   As shown in FIG. 52, the actual file is stored in the hard disk 22. In each file read / write process in general file operations, a series of processes such as preparing a buffer (not shown) in the memory 23, reading the file, and writing the edited data back to the file are performed.

ファイルマッピングとは、オペレーティングシステム(Windows OS)がファイルをメモリデータのように扱うことを可能にする技術である。   File mapping is a technique that enables an operating system (Windows OS) to treat a file like memory data.

ファイルマッピングによるファイル操作では、図52に示すように、ハードディスク22に記憶されている実ファイルの全体を、メモリ23に、仮想ファイル(ファイルマッピングオブジェクト)として展開する。ファイルマッピングによるファイル操作において、ファイルの内容を書き換える際には、その都度、メモリ23に展開された仮想ファイルに対して内容の書き換えが行われる。ファイルの内容の変更結果は一連の処理の最後の段階でハードディスク22の実ファイルへ反映させる。   In the file operation by file mapping, as shown in FIG. 52, the entire real file stored in the hard disk 22 is expanded in the memory 23 as a virtual file (file mapping object). When the file contents are rewritten in the file operation by the file mapping, the contents are rewritten with respect to the virtual file expanded in the memory 23 each time. The result of changing the contents of the file is reflected in the actual file on the hard disk 22 at the final stage of the series of processes.

図52に示すように、プロセスからハードディスク22に記憶された実ファイルにアクセスすることが可能であり、また、プロセスからメモリ23に展開された仮想ファイルにアクセスすることが可能である。   As shown in FIG. 52, the actual file stored in the hard disk 22 can be accessed from the process, and the virtual file expanded in the memory 23 can be accessed from the process.

ファイル操作を行う場合、ハードディスク22に記憶された実ファイルを書き換えるよりも、メモリ23に展開された仮想ファイルを書き換える方が圧倒的に高速である。   When performing file operations, rewriting a virtual file developed in the memory 23 is overwhelmingly faster than rewriting a real file stored in the hard disk 22.

したがって、ファイルマッピングによるファイル操作では、一般的なファイル操作のように、内容を変更する都度、実ファイルに対する読み込み処理と書き込み処理を行う必要がない。したがって、ファイルマッピングによるファイル操作の方が高速にファイルの内容の書き換えが可能である。
(b)ランサムウェアSporaの分析
(ファイル操作について)
本願発明者等が調査した結果、ランサムウェアの中で2017年初頭に出現した「Spora」がファイルマッピングによるファイル操作を行っていることがわかった。
Therefore, in the file operation by the file mapping, it is not necessary to perform the read process and the write process for the actual file every time the contents are changed as in the general file operation. Therefore, the file operation by file mapping can rewrite the contents of the file at a higher speed.
(B) Analysis of Ransomware Spora (File operation)
As a result of investigation by the inventors of the present application, it was found that “Spora” that appeared in early 2017 in ransomware is performing file operations by file mapping.

本願発明者等がランサムウェアSporaを解析した結果、ファイル暗号化時のファイル操作の流れがわかった。図53に、ランサムウェアSporaによるファイル暗号化時のファイル操作の流れを示す。
(ステップ1):CreateFileにより、暗号化対象の実ファイルを開く。
(ステップ2):CreateFileMappingにより、仮想ファイル(ファイルマッピングオブジェクト)を作成する。
(ステップ3):MapViewOfFileにより、プロセスのメモリアドレス空間にマッピングを行う。
(ステップ4):ファイルマッピングオブジェクトをメモリ上で暗号化する。
(ステップ5):UnmapViewOfFileにより、ファイルマッピングオブジェクトをアンマップする。
(ステップ6):CloseHandleにより、ファイルハンドルをクローズする。
As a result of analyzing the ransomware Spora by the inventors of the present application, the flow of file operations during file encryption was found. FIG. 53 shows a flow of file operation when encrypting a file by ransomware Spora.
(Step 1): Use CreateFile to open the actual file to be encrypted.
(Step 2): Create a virtual file (file mapping object) by CreateFileMapping.
(Step 3): Map to the memory address space of the process by MapViewOfFile.
(Step 4): The file mapping object is encrypted on the memory.
(Step 5): Unmap the file mapping object by UnmapViewOfFile.
(Step 6): The file handle is closed by CloseHandle.

また、メモリ23上の仮想ファイルであるファイルマッピングオブジェクトに対する変更が、ハードディスク22上の実ファイルに反映されるタイミングについて解析した。その結果、次のタイミング(1)〜(5)で、ハードディスク22上の実ファイルに暗号化が反映されることがわかった。
(1)UnmapViewOfFileが呼び出されたタイミング。
(2)UnmapViewOfFileExが呼び出されたタイミング。
(3)FlushViewOfFileが呼び出されたタイミング。
(4)CloseHandleが呼び出されたタイミング。
(5)上記(1)〜(4)以外で、ファイルマッピングオブジェクトのハンドルが閉じられたタイミング。
Further, the timing at which a change to the file mapping object, which is a virtual file on the memory 23, is reflected on the actual file on the hard disk 22 was analyzed. As a result, it was found that encryption is reflected in the actual file on the hard disk 22 at the next timings (1) to (5).
(1) Timing when UnmapViewOfFile is called.
(2) Timing when UnmapViewOfFileEx is called.
(3) Timing when FlushViewOfFile is called.
(4) Timing when CloseHandle is called.
(5) The timing when the handle of the file mapping object is closed except for the above (1) to (4).

一般的な正しい処理手順では(1)UnmapViewOfFile、又は(2)UnmapViewOfFileExにより、ファイルマッピングオブジェクトをアンマップした後に、ファイルオブジェクトを(4)CloseHandleで閉じるという流れとなる。なお(3)FlushViewOfFileにより、マップドファイル内にある指定された範囲のデータをディスクに書き込むこともある。   In a general correct processing procedure, after unmapping a file mapping object by (1) UnmapViewOfFile or (2) UnmapViewOfFileEx, the file object is closed by (4) CloseHandle. Note that (3) FlushViewOfFile may write a specified range of data in the mapped file to the disk.

ただし、上記(1)〜(4)の関数が呼び出されなくても、プロセスを終了する等の何らかのトリガーにより、ファイルマッピングオブジェクトのハンドルを閉じることでも、ハードディスク22上の実ファイルに暗号化が反映される。   However, even if the functions (1) to (4) are not called, the encryption is reflected in the actual file on the hard disk 22 even if the handle of the file mapping object is closed by some trigger such as ending the process. Is done.

図54に、ランサムウェアSporaによるファイル操作とハードウェアとの関係を示す。   FIG. 54 shows the relationship between the file operation by the ransomware Spora and the hardware.

まず、プロセスが、CreateFileにより、ハードウェア22上にある暗号化対象の実ファイルを開く(ステップ1)。   First, the process opens an actual file to be encrypted on the hardware 22 by CreateFile (step 1).

次に、図54(a)に示すように、プロセスが、CreateFileMappingにより、実ファイルの仮想ファイル(ファイルマッピングオブジェクト)を作成し(ステップ2)、プロセスが、MapViewOfFileにより、メモリ23上のプロセスのメモリアドレス空間に仮想ファイルをマッピングする(ステップ3)。   Next, as shown in FIG. 54A, the process creates a virtual file (file mapping object) of a real file by CreateFileMapping (step 2), and the process stores the memory of the process on the memory 23 by MapViewOfFile. A virtual file is mapped to the address space (step 3).

図54(a)に示すように、一般的なファイル操作では、ハードディスク22上の実ファイルへのアクセスは、ファイルの読み書き関数であるReadFile及びWriteFileを用いる。しかしながら、ランサムウェアSporaによるファイルの暗号化操作では、ReadFile及びWriteFileを使用しない。   As shown in FIG. 54A, in a general file operation, an access to an actual file on the hard disk 22 uses ReadFile and WriteFile which are file read / write functions. However, ReadFile and WriteFile are not used in file encryption operations by ransomware Spora.

次に、プロセスが、ファイルマッピングオブジェクトをメモリ23上で暗号化する(ステップ4)。   Next, the process encrypts the file mapping object on the memory 23 (step 4).

次に、図54(b)に示すように、プロセスが、UnmapViewOfFileにより、ファイルマッピングオブジェクトをアンマップし(ステップ5)、プロセスが、CloseHandleにより、ファイルハンドルをクローズする(ステップ6)。それにより、メモリ23上の暗号化された仮想ファイル(ファイルマッピングオブジェクト)への変更が、ハードディスク22上の実ファイルに反映される。   Next, as shown in FIG. 54B, the process unmaps the file mapping object using UnmapViewOfFile (step 5), and the process closes the file handle using CloseHandle (step 6). As a result, the change to the encrypted virtual file (file mapping object) on the memory 23 is reflected in the actual file on the hard disk 22.

メモリ23上の仮想ファイル(ファイルマッピングオブジェクト)への変更が、ハードディスク22上の実ファイルに反映されるタイミングとしては、上記のUnmapViewOfFileが呼び出されたタイミング、CloseHandleが呼び出されたタイミングの他に、UnmapViewOfFileExが呼び出されたタイミングや、FlushViewOfFileが呼び出されたタイミングや、上記以外で、ファイルマッピングオブジェクトのハンドルが閉じられたタイミングがある。   The timing at which the change to the virtual file (file mapping object) on the memory 23 is reflected in the actual file on the hard disk 22 is the timing at which UnmapViewOfFile is called, the timing at which CloseHandle is called, and UnmapViewOfFileEx. There is a timing at which the file mapping object handle is closed, other than the above timing when FlushViewOfFile is called, and other times.

本願明細書において「マッピング時」とは、仮想ファイル(ファイルマッピングオブジェクト)がプロセスのメモリアドレス空間にマッピングされた時のことである。例えば、CreateFileにより暗号化対象の実ファイルを開き、CreateFileMappingにより仮想ファイル(ファイルマッピングオブジェクト)を作成し、MapViewOfFileによりプロセスのメモリアドレス空間にマッピングを行った時である。   In the present specification, “when mapping” means when a virtual file (file mapping object) is mapped into the memory address space of the process. For example, when a real file to be encrypted is opened by CreateFile, a virtual file (file mapping object) is created by CreateFileMapping, and mapping is performed in the memory address space of the process by MapViewOfFile.

本願明細書において「アンマッピング時」とは、メモリ23上の仮想ファイルであるファイルマッピングオブジェクトに対する変更が、ハードディスク22上の実ファイルに反映された時である。例えば、次のタイミング(1)〜(5)のタイミングである。
(1)UnmapViewOfFileが呼び出されたタイミング。
(2)UnmapViewOfFileExが呼び出されたタイミング。
(3)FlushViewOfFileが呼び出されたタイミング。
(4)CloseHandleが呼び出されたタイミング。
(5)上記(1)〜(4)以外で、ファイルマッピングオブジェクトのハンドルが閉じられたタイミング。
In the present specification, “when unmapping” refers to a time when a change to a file mapping object, which is a virtual file on the memory 23, is reflected in an actual file on the hard disk 22. For example, it is the timing of the following timings (1) to (5).
(1) Timing when UnmapViewOfFile is called.
(2) Timing when UnmapViewOfFileEx is called.
(3) Timing when FlushViewOfFile is called.
(4) Timing when CloseHandle is called.
(5) The timing when the handle of the file mapping object is closed except for the above (1) to (4).

上記(1)〜(4)の関数が呼び出されなくても、プロセスを終了する等の何らかのトリガーにより、ファイルマッピングオブジェクトのハンドルを閉じることでも、ハードディスク22上の実ファイルに暗号化が反映される。
(ファイル内容の変更について)
ランサムウェアによるファイルの変更と通常のアプリケーションによるファイルの変更との差異は、ヘッダ情報を有するタイプのファイルで顕著に表れる。通常のアプリケーションがファイルを書き換える場合、ファイルのヘッダ情報はそのまま変更せず、ファイルの中間部分のデータが書き換わることが圧倒的に多い。これに対し、ランサムウェアがファイルを暗号化する場合、ファイルのヘッダ情報が書き換わる。
Even if the functions (1) to (4) are not called, the encryption is reflected in the actual file on the hard disk 22 even when the handle of the file mapping object is closed by some trigger such as termination of the process. .
(About changing file contents)
The difference between the change of the file by the ransomware and the change of the file by the normal application is noticeable in the file having the header information. When a normal application rewrites a file, the file header information is not changed as it is, and the data in the middle part of the file is overwhelmingly rewritten. On the other hand, when the ransomware encrypts the file, the file header information is rewritten.

したがって、ファイルの先頭部分を比較することで、ランサムウェアによる暗号化である可能性が高い操作と、そうではない通常のアプリケーションによる操作とを判別することが可能となる。   Therefore, by comparing the head portions of the files, it is possible to determine an operation that is highly likely to be ransomware encryption and an operation that is not otherwise performed by a normal application.

より広範囲にランサムウェアを検知し、かつ誤検知を防ぐためには、ファイルの先頭部分だけの変化を監視するのではなく、「ファイル構造の不適切な状態への変更」を監視することが本質的な要請である。   In order to detect ransomware over a wider area and prevent false detection, it is essential to monitor “changes in the file structure to an inappropriate state” rather than monitoring only the beginning of the file. It is a serious request.

それは、ランサムウェア作成者の目的が、ユーザーからランサム(身代金)を獲得することにあるからである。ユーザーがファイルを開こうとしたときに、そのファイルを開くことができないと、ユーザーはランサムウェアによる感染を認識し、ランサムウェア作成者にランサム(身代金)を支払おうとする。ファイルの内容が大幅に書き換えられた場合も同様である。   This is because the purpose of the ransomware creator is to obtain a ransom from the user. If the user tries to open the file and is unable to open the file, the user will recognize the ransomware infection and attempt to pay the ransomware creator a ransom. The same applies when the contents of the file are rewritten significantly.

ユーザーにランサム(身代金)を支払おうとする動機付けをもたらす「ファイル構造の不適切な状態への変更」には、例えば、次のような態様がある。
(i)ヘッダ情報の変更
ヘッダ情報が変更されるとアプリケーションにより開くことができなくなる。例えば、拡張子「.pdf」のファイルにおいて、ファイルがPDFフォーマットでなくなると、PDFフォーマットに対応したアプリケーションでファイルを開くことができなくなる。
Examples of the “change of the file structure to an inappropriate state” that motivate the user to pay the ransom (ransom) include the following modes.
(I) Change of header information When header information is changed, it cannot be opened by an application. For example, in a file with the extension “.pdf”, if the file is not in the PDF format, the file cannot be opened by an application that supports the PDF format.

ヘッダ情報を持つファイルの多くは、ファイルのヘッダ情報はファイルの先頭部分にある。しかし、ファイルの種類によっては、ファイルのヘッダ情報がファイルの先頭部分にないものもある。ファイルの先頭部分の監視だけでは、様々な種類のファイルのヘッダ情報の変更を監視できない。   In many files having header information, the header information of the file is at the beginning of the file. However, some file types do not have file header information at the beginning of the file. It is not possible to monitor changes in the header information of various types of files only by monitoring the beginning of the file.

ヘッダ情報の位置はファイルの種類ごとに定められている。ファイルの種類に応じて定められたヘッダ情報の位置の部分を監視することにより、ヘッダ情報の変更を監視する。   The position of the header information is determined for each file type. The header information change is monitored by monitoring the position of the header information determined according to the file type.

ファイルの種類に対するヘッダ情報の位置は公開情報により知ることができる。公開情報としては、ファイルのマジックナンバーと呼ばれるヘッダ内の固定値が公開されているものや、各フォーマットに対するRFCの定義が公開されているものがある。
・Magic number (programming)
https://en.wikipedia.org/wiki/Magic_number_(programming)
・Windows Image Media Types
https://tools.ietf.org/html/rfc7903#section-1.2
例えば、拡張子が「GIF」のファイルのマジックヘッダ(ファイルの先頭データ)は「47 49 46 38 39 61」か「47 49 46 38 37 61」となるので、これらのデータが、これら以外に書き換えられる場合には暗号化操作と判断することができる。
The position of the header information with respect to the file type can be known from the public information. As public information, there is information that discloses a fixed value in a header called a magic number of a file, and information that discloses an RFC definition for each format.
・ Magic number (programming)
https://en.wikipedia.org/wiki/Magic_number_(programming)
・ Windows Image Media Types
https://tools.ietf.org/html/rfc7903#section-1.2
For example, the magic header of the file with the extension “GIF” (the first data of the file) is “47 49 46 38 39 61” or “47 49 46 38 37 61”. If it is, it can be determined as an encryption operation.

公開情報に存在しない拡張子のファイルのヘッダ情報については、ファイルの先頭から固定のサイズをヘッダ情報とみなして監視する。また、この監視方法を他の監視方法と併用してもよい。
(ii)フッタ情報の変更
一般的なファイルには「ヘッダ+ボディ」という形式が多いが「ヘッダ+ボディ+フッタ」というファイル形式のファイルもある。そのようなファイルにおいて、フッタ情報が変更されると、アプリケーションにより開くことができなくなる場合がある。
(iii)ボディ情報の変更
ファイルの種類によってはボディの構造に一定のルールが定められている場合がある。
For header information of files with extensions that do not exist in the public information, a fixed size from the beginning of the file is regarded as header information and monitored. Further, this monitoring method may be used in combination with other monitoring methods.
(Ii) Change of footer information A general file has a format of “header + body”, but there is a file format of “header + body + footer”. In such a file, when the footer information is changed, the file may not be opened by the application.
(Iii) Changing body information Depending on the type of file, certain rules may be established for the body structure.

例えば、ボディ内は4つのデータ部分に分かれていて、各データ部分の最後には0x00(ヌル文字)が複数バイト連続するというルールが定められたファイルがある。このようなファイルの場合、各データ部分の最後が暗号化されて0x00(ヌル文字)でなくなった場合、アプリケーションで開くことができなくなる。   For example, there is a file in which the body is divided into four data portions, and a rule is defined that a plurality of bytes of 0x00 (null character) are continued at the end of each data portion. In the case of such a file, if the end of each data part is encrypted and is not 0x00 (null character), it cannot be opened by an application.

また、ボディ内に存在するデータ部分の数や、各データ部分のサイズ、各データ部分の開始位置等のルールがヘッダ上で定義されているファイルがある。このようなファイルの場合、このルールから逸脱する変更がボディに加えられると、アプリケーションで開くことができなくなる。   In addition, there is a file in which rules such as the number of data parts existing in the body, the size of each data part, and the start position of each data part are defined on the header. For such files, if changes that deviate from this rule are made to the body, they cannot be opened by the application.

また、ボディがとる値(バイナリ値)の範囲が定められているファイルがある。このようなファイルの場合、ボディの値が定められた範囲から逸脱する変更がボディに加えられると、アプリケーションで開くことができなくなる。
(ランサムウェアSporaの検知条件)
本願発明者等は、上記のランサムウェアSporaの分析に基づき、ランサムウェアSporaを有効に検知することができる、次のような検知条件を着想するに至った。
(a)条件A:ファイル構造の不適切な状態への変更がある。
In addition, there is a file in which a range of values (binary values) taken by the body is defined. For such files, if changes are made to the body that deviate from the specified range, the application cannot open it.
(Detection conditions for Ransomware Spora)
Based on the analysis of the ransomware Spora, the present inventors have come up with the following detection conditions that can effectively detect the ransomware Spora.
(A) Condition A: There is a change to an inappropriate state of the file structure.

この条件Aは、ファイルのファイル構造が不適切な状態に書き換わることである。   Condition A is that the file structure of the file is rewritten to an inappropriate state.

ファイル構造の不適切な状態への変更には、例えば、ヘッダ情報の変更、フッタ情報の変更、ボディ情報の変更がある。
(i)ヘッダ情報の変更
この場合の条件Aは、同じファイルのヘッダ情報が書き換わることである。
The change to an inappropriate state of the file structure includes, for example, a change in header information, a change in footer information, and a change in body information.
(I) Change of header information Condition A in this case is that the header information of the same file is rewritten.

ファイルマッピングを利用したランサムウェアでは、ハードディスク22上の実ファイルがメモリ23上に仮想ファイルとして展開される。したがって、条件Aは次の条件A1、条件A2のいずれかとなる。   In ransomware using file mapping, a real file on the hard disk 22 is expanded as a virtual file on the memory 23. Therefore, the condition A is either the following condition A1 or condition A2.

条件A1:ファイル操作前の実ファイルのヘッダ情報と、ファイル操作後の所定タイミングにおける実ファイルのヘッダ情報を比較して、書き換わっている。   Condition A1: The header information of the actual file before the file operation and the header information of the actual file at a predetermined timing after the file operation are compared and rewritten.

条件A2:ファイル操作前の実ファイルのヘッダ情報と、ファイル操作後の所定タイミングにおける仮想ファイルのヘッダ情報を比較して、書き換わっている。   Condition A2: The header information of the real file before the file operation and the header information of the virtual file at a predetermined timing after the file operation are compared and rewritten.

ファイル操作後の所定タイミングとは、メモリ23上の仮想ファイルであるファイルマッピングオブジェクトに対する変更が、ハードディスク22上の実ファイルに反映されるタイミングである。具体的には上述した(1)〜(5)のタイミングである。   The predetermined timing after the file operation is a timing at which a change to the file mapping object that is a virtual file on the memory 23 is reflected in the actual file on the hard disk 22. Specifically, it is the timing of (1) to (5) described above.

なお、ファイルマッピングオブジェクトのハンドルが閉じられた(5)のタイミングの場合には、そのタイミングを捕まえることが困難な場合がある。   In the case of the timing of (5) when the handle of the file mapping object is closed, it may be difficult to capture the timing.

実際には、ヘッダ情報を持つファイルの多くは、ファイルのヘッダ情報はファイルの先頭部分にある。   Actually, in many files having header information, the header information of the file is at the head of the file.

ヘッダ情報がファイルの先頭部分にある場合、条件Aは、先頭部分のデータが書き換わることである。この場合、条件Aは次の条件A1、条件A2のいずれかとなる。   When the header information is at the head portion of the file, the condition A is that the data at the head portion is rewritten. In this case, the condition A is either the following condition A1 or condition A2.

条件A1:ファイル操作前の実ファイルの先頭部分のデータと、ファイル操作後の所定タイミングにおける実ファイルの先頭部分のデータを比較して、書き換わっている。   Condition A1: The data at the beginning of the real file before the file operation and the data at the beginning of the real file at a predetermined timing after the file operation are compared and rewritten.

条件A2:ファイル操作前の実ファイルの先頭部分のデータと、ファイル操作後の所定タイミングにおける仮想ファイルの先頭部分のデータを比較して、書き換わっている。
(ii)フッタ情報の変更
この場合の条件Aは、同じファイルのフッタ情報が書き換わることである。
Condition A2: The data at the beginning of the real file before the file operation and the data at the beginning of the virtual file at a predetermined timing after the file operation are compared and rewritten.
(Ii) Change of footer information Condition A in this case is that the footer information of the same file is rewritten.

条件Aは次の条件A1、条件A2のいずれかとなる。   The condition A is either the following condition A1 or condition A2.

条件A1:ファイル操作前の実ファイルのフッタ情報と、ファイル操作後の所定タイミングにおける実ファイルのフッタ情報を比較して、書き換わっている。   Condition A1: The footer information of the actual file before the file operation and the footer information of the actual file at a predetermined timing after the file operation are compared and rewritten.

条件A2:ファイル操作前の実ファイルのフッタ情報と、ファイル操作後の所定タイミングにおける仮想ファイルのフッタ情報を比較して、書き換わっている。
(iii)ボディ情報の変更
この場合の条件Aは、同じファイルのボディのデータが書き換わることである。
Condition A2: The footer information of the real file before the file operation and the footer information of the virtual file at a predetermined timing after the file operation are compared and rewritten.
(Iii) Change of body information Condition A in this case is that the data of the body of the same file is rewritten.

条件Aは次の条件A1、条件A2のいずれかとなる。   The condition A is either the following condition A1 or condition A2.

条件A1:ファイル操作前の実ファイルのボディのデータと、ファイル操作後の所定タイミングにおける実ファイルのボディのデータを比較して、書き換わっている。   Condition A1: The data of the body of the actual file before the file operation is compared with the data of the body of the actual file at a predetermined timing after the file operation.

条件A2:ファイル操作前の実ファイルのボディのデータと、ファイル操作後の所定タイミングにおける仮想ファイルのボディのデータを比較して、書き換わっている。
(b)条件B:ファイルマッピングオブジェクトの連続的な操作がある。
Condition A2: The actual file body data before the file operation and the virtual file body data at the predetermined timing after the file operation are compared and rewritten.
(B) Condition B: There is a continuous operation of the file mapping object.

ファイルマッピングを利用した場合、1ファイルに対して、必ず、CreateFileMappingというAPIと、MapViewOfFileというAPIを一度読み出す必要がある。したがって、連続的なファイルマッピングが発生した場合には、CreateFileMappingというAPIと、MapViewOfFileというAPIが2回以上読み出される。   When file mapping is used, it is necessary to read the API called CreateFileMapping and the API called MapViewOfFile once for each file. Therefore, when continuous file mapping occurs, an API called CreateFileMapping and an API called MapViewOfFile are read twice or more.

したがって、条件Bは、具体的には、CreateFileMappingというAPIと、MapViewOfFileというAPIとが複数回読み出されることである。   Therefore, the condition B is specifically that an API called CreateFileMapping and an API called MapViewOfFile are read out a plurality of times.

条件Bを設けたのには次のような意義がある。理想的には条件Aによりひとつ目のファイルの暗号化を検知できることが望ましいが、それが困難な場合でも、条件Bの検知によりファイルの暗号化操作を確実に検知することができる。   The provision of the condition B has the following significance. Ideally, it is desirable that the encryption of the first file can be detected by the condition A, but even if this is difficult, the encryption operation of the file can be reliably detected by the detection of the condition B.

[第3実施形態]
本発明の第3実施形態によるプログラム、情報処理装置及び情報処理方法について図55乃至図75を用いて説明する。
[Third Embodiment]
A program, an information processing apparatus, and an information processing method according to the third embodiment of the present invention will be described with reference to FIGS.

(本実施形態の概要)
本実施形態の概要について図55及び図56を用いて説明する。
(Outline of this embodiment)
The outline of this embodiment will be described with reference to FIGS. 55 and 56. FIG.

本実施形態では、ハードディスク22に保存されたユーザーデータへアクセスするという挙動を有するプログラムの全ての挙動が検出対象である。   In the present embodiment, all behaviors of a program having a behavior of accessing user data stored in the hard disk 22 are detection targets.

CPU21がメモリ23上のOSデータのプロセスを実行して、ハードディスク22に格納されたプログラムにアクセスして、そのプログラムを読み込み(図2(c))、ハードディスク22に格納されたプログラムがメモリ23にロードされ、メモリ23上にプロセスとして展開される(図3(a))前に、メモリ23に本発明プログラムのプロセスを常駐させておく(図55(a))。   The CPU 21 executes a process of OS data on the memory 23, accesses a program stored in the hard disk 22, reads the program (FIG. 2C), and stores the program stored in the hard disk 22 in the memory 23. Before being loaded and expanded as a process on the memory 23 (FIG. 3A), the process of the program of the present invention is made resident in the memory 23 (FIG. 55A).

本発明プログラムは、ランサムウェアが導入される危険性のある状態となる前であればいつ実行してメモリ23上にプロセスとして常駐させてもよい。   The program of the present invention may be executed at any time before the ransomware is in danger of being introduced and may be made resident as a process in the memory 23.

例えば、スタートアッププログラムとして、コンピューターの起動時に起動させておく。オペレーティングシステム(Windows OS)には、PCの起動と共に実行されるプログラムとして「スタートアッププログラム」が登録できる仕組みがある。本実施形態では、その仕組みを利用し本発明プログラムをスタートアッププログラムとして登録しておく。これにより、本発明プログラムがPCの起動直後からメモリ23上に配置している状態にする。   For example, it is started as a startup program when the computer is started. An operating system (Windows OS) has a mechanism in which a “start-up program” can be registered as a program that is executed when the PC is started. In the present embodiment, the program of the present invention is registered as a startup program using the mechanism. As a result, the program of the present invention is placed on the memory 23 immediately after the PC is started.

また、PCの起動時にプログラムを起動する方法としては、レジストリやサービスの仕組みを使用する方法もあるが、いずれの方法を用いてもよい。   In addition, as a method of starting a program when the PC is started, there is a method of using a registry or a service mechanism, but any method may be used.

これにより、PCの起動直後から常にコンピューターをランサムウェアから保護することができる。   As a result, the computer can always be protected from ransomware immediately after the PC is started.

本発明プログラムは、図55(a)に示すように、ハードディスク22に格納されたプログラムがメモリ23にロードするという動作と、CPU21がプログラムを実行するという動作との間に割り込む。CPU21によるプログラムに基づく動作をフックすることにより、プログラムが実行される直前で、そのプログラムの挙動を本発明プログラムの監視下に置く。   As shown in FIG. 55A, the program of the present invention interrupts between an operation in which the program stored in the hard disk 22 is loaded into the memory 23 and an operation in which the CPU 21 executes the program. By hooking the operation based on the program by the CPU 21, the behavior of the program is placed under the monitoring of the program of the present invention immediately before the program is executed.

これにより、これ以降、監視対象プログラムの全ての挙動は、本発明プログラムが実行直前に把握することができる。必要に応じて、監視対象プログラムの処理に機能を加えたり、変更したりすることができる。   Thereby, thereafter, all behaviors of the monitoring target program can be grasped immediately before execution of the program of the present invention. As necessary, functions can be added to or changed in the processing of the monitoring target program.

本発明プログラムにより、コンピューターを、監視対象プログラムがランサムウェアと判断する判断部として機能させる。   The program of the present invention causes the computer to function as a determination unit that determines that the monitoring target program is ransomware.

本発明プログラムにより、コンピューターに、監視対象プログラムがランサムウェアと判断する判断手順を実行させる。   The computer program causes the computer to execute a determination procedure for determining that the monitoring target program is ransomware.

判断部又は判断手順により、監視対象プログラムの挙動が、ランサムウェア特有の挙動であると判断された場合には、図55(b)に示すように、本発明プログラムは、監視対象プログラムがハードディスク22内のファイルにアクセスを行おうとする直前に、そのアクセスをブロックする。このようにして、未知のランサムウェアによる攻撃をブロックしてファイルの暗号化を阻止する。   When the behavior of the monitoring target program is determined to be ransomware-specific behavior by the determination unit or determination procedure, as shown in FIG. Block the access just before trying to access the file. In this way, attacks by unknown ransomware are blocked to prevent file encryption.

(本発明プログラムの3つの機能)
本発明プログラムは3つの機能を有する。本発明プログラムの3つの機能について図56を用いて説明する。
(Three functions of the program of the present invention)
The program of the present invention has three functions. Three functions of the program of the present invention will be described with reference to FIG.

第1の機能は、現在動作中のプログラムや、後ほど起動するプログラムである監視対象プロセスが使用するWindows APIをフックする機能である。図56に示すように、本発明プログラムから、現在起動中のプロセス、すなわち、notepad.exe、WINWORD.exe、calc.exe、Ramsomware.exe、cmd.exe、…のプロセスが使用するWindows APIをフックする。   The first function is a function for hooking a Windows API used by a monitoring target process that is a program that is currently operating or a program that is activated later. As shown in FIG. 56, the present invention program hooks the Windows API used by the currently running process, that is, notepad.exe, WINWORD.exe, calc.exe, Ramsomware.exe, cmd.exe,. To do.

第2の機能は、フックしたWindows APIにより、監視対象プロセスの挙動を記録する機能である。   The second function is a function for recording the behavior of the process to be monitored by the hooked Windows API.

第3の機能は、第2の機能により記録した挙動によりランサムウェアであるかどうかを判断する機能である。   The third function is a function for determining whether or not the ransomware is based on the behavior recorded by the second function.

第1の機能は、常駐している本発明プログラムの機能であり、第2の機能と第3の機能は、監視対象プロセス内に組み込まれる本発明プログラムの機能である。   The first function is a function of the resident program of the present invention, and the second function and the third function are functions of the program of the present invention incorporated in the monitored process.

なお、常駐している本発明プログラムに第1の機能と第3の機能を持たせ、監視対象プロセス内に組み込まれる本発明プログラムに第2の機能を持たせるようにしてもよい。その場合には、監視対象プロセス内に組み込まれる本発明プログラムが第2の機能により記録した挙動を常駐している本発明プログラムに通知し、常駐している本発明プログラムが第3の機能によりランサムウェアであるどうかを判断する。   The resident program of the present invention may have the first function and the third function, and the program of the present invention incorporated in the process to be monitored may have the second function. In this case, the program of the present invention incorporated in the process to be monitored notifies the resident program of the resident invention of the behavior recorded by the second function, and the resident program of the ransom is ransom by the third function. Whether it is wear.

(第1の機能:監視対象プロセスが使用するAPIをフックする機能)
本発明プログラムは、監視対象プロセスにおいて、ランサムウェアの分析結果から得られた挙動であるAPI及びこれと同等の機能を持つAPIをフックする。本実施形態におけるフック対象APIは次の通りである。
(First function: Function to hook API used by monitored process)
The program of the present invention hooks an API that is a behavior obtained from the analysis result of the ransomware and an API having a function equivalent to this in the monitored process. The hook target API in this embodiment is as follows.

CreateFileMapping
MapViewOfFile/MapViewOfFileEx
UnmapViewOfFile/UnmapViewOfFileEx
FlushViewOfFile
CloseHandle
APIをフックする具体的な方法は後述する。
CreateFileMapping
MapViewOfFile / MapViewOfFileEx
UnmapViewOfFile / UnmapViewOfFileEx
FlushViewOfFile
CloseHandle
A specific method for hooking the API will be described later.

監視対象プロセスは、現在動作中のプログラム及び以降起動するプログラムである。後述する除外リストに挙げられているプログラムは監視対象プロセスから除外される。また、除外リストになくても、デジタル署名が付与されている等によりファイルの出自が明らかであるプログラムや、安全性が確認されているプログラムを監視対象プロセスから除外することができる。   The monitored process is a program that is currently operating and a program that is subsequently started. Programs listed in the exclusion list described later are excluded from the monitored processes. Even if they are not in the exclusion list, programs whose file origins are clear due to digital signatures, etc., and programs whose safety has been confirmed can be excluded from monitored processes.

(第2の機能:フックしたAPIにより監視対象プロセスの挙動を記録する機能)
本発明プログラムは、第1の機能によりフックしたAPIにより監視対象プロセスの挙動を記録する。
(Second function: Function to record the behavior of monitored process by hooked API)
The program of the present invention records the behavior of the monitored process by the API hooked by the first function.

監視対象プロセスの挙動を記録するために、第1の機能で列挙したAPIのうち、CreateFileMapping、MapViewOfFile/MapViewOfFileExのAPIのフック関数を使用する。   In order to record the behavior of the monitoring target process, API hook functions of CreateFileMapping and MapViewOfFile / MapViewOfFileEx are used among the APIs listed in the first function.

(HookCreateFileMapping関数)
HookCreateFileMapping関数は、CreateFileMappingなるAPIをフックする関数である。
(HookCreateFileMapping function)
The HookCreateFileMapping function is a function that hooks an API called CreateFileMapping.

CreateFileMappingは、ファイルマッピングを使用してファイルの読み書きを行う際に、指定されたファイルに対する、名前付きまたは名前なしのファイルマッピングオブジェクトを作成または開くAPIである。   CreateFileMapping is an API that creates or opens a named or unnamed file mapping object for a specified file when reading and writing the file using file mapping.

Microsoft社のリファレンス
https://msdn.microsoft.com/ja-jp/library/cc430039.aspx
には、CreateFileMappingの説明が記載されている。その抜粋を図57に示す。
Microsoft reference
https://msdn.microsoft.com/en-us/library/cc430039.aspx
Describes the CreateFileMapping. An excerpt is shown in FIG.

CreateFileMappingのフック関数であるHookCreateFileMapping関数には、フックにより捕捉した情報及び通常のCreateFileMappingの呼び出しにより取得した情報を記録する機能を持たせる。   The HookCreateFileMapping function, which is a hook function of CreateFileMapping, has a function of recording information captured by the hook and information acquired by calling normal CreateFileMapping.

HookCreateFileMapping関数で記録する情報を次に示す。なお、CreateFileMappingにより指定されたファイルのことを、暗号化を説明する便宜上「暗号化対象ファイル」と称することとする。
(a)暗号化対象ファイルのハンドル
CreateFileMappingAPIが呼び出される際に指定されたファイルハンドル(hFile)。
(b)暗号化対象ファイルパス
ファイルハンドルをもとに取得したファイルパス。ファイルハンドル(hFile)からファイルパスを求めることができる。
(c)ファイルマッピングオブジェクトのハンドル
CreateFileMappingを呼び出すことによって得られる戻り値。
The information recorded by the HookCreateFileMapping function is as follows: Note that the file specified by CreateFileMapping is referred to as an “encryption target file” for convenience of explanation of encryption.
(A) Encrypted file handle
File handle (hFile) specified when the CreateFileMapping API is called.
(B) File path to be encrypted File path acquired based on the file handle. The file path can be obtained from the file handle (hFile).
(C) Handle of file mapping object
The return value obtained by calling CreateFileMapping.

フック関数(HookCreateFileMapping関数)内でフック前のオリジナルのCreateFileMappingを呼び出すことで取得できる。
(d)暗号化対象ファイルの暗号化前のヘッダデータ
ファイルハンドルをもとに取得したヘッダデータ。ファイルハンドル(hFile)に対してReadFile等のAPIを使用してファイルのヘッダデータを読み込むことにより取得できる。図58に示すように、ファイルハンドル(hFile)に基づいて、例えばReadFileのAPIを使用して、暗号化対象ファイルの暗号化前のヘッダデータをハードディスク22から読み込む。
It can be obtained by calling the original CreateFileMapping before the hook in the hook function (HookCreateFileMapping function).
(D) Header data before encryption of the encryption target file Header data acquired based on the file handle. The file handle (hFile) can be obtained by reading the file header data using an API such as ReadFile. As shown in FIG. 58, based on the file handle (hFile), the header data before encryption of the file to be encrypted is read from the hard disk 22 using the API of ReadFile, for example.

このようにHookCreateFileMapping関数により記録される情報は、メモリ23上に、例えば、図59に示すようなリスト形式で記録される。以降、このリストを「メモリマップドリスト」と呼ぶ。   Information recorded by the HookCreateFileMapping function in this manner is recorded on the memory 23 in a list format as shown in FIG. 59, for example. Hereinafter, this list is referred to as a “memory mapped list”.

図59は、暗号化対象ファイルのハンドルが「0xABC」であり、暗号化対象ファイルパスが「C:\test.pdf」であり、ファイルマッピングオブジェクトのハンドルが「0xABCD」であり、暗号化対象ファイルの暗号化前のヘッダデータが「25 50 44 46 2D」であることを示している。
(e)実ファイルのバックアップ機能
HookCreateFileMapping関数には、暗号化対象ファイルのハンドルが指すファイルの実ファイルをバックアップする機能も持たせる。
In FIG. 59, the handle of the encryption target file is “0xABC”, the encryption target file path is “C: \ test.pdf”, the handle of the file mapping object is “0xABCD”, and the encryption target file is This indicates that the header data before encryption is “25 50 44 46 2D”.
(E) Real file backup function
The HookCreateFileMapping function also has a function of backing up the actual file indicated by the handle of the encryption target file.

具体的にはHookCreateFileMapping関数の第一引数に指定された暗号化対象ファイルハンドルからファイルパスを割り出し、そのファイルをハードディスク22上の別の場所に保管する機能である。保管場所はどこでもよい。   Specifically, this is a function for determining a file path from the encryption target file handle specified as the first argument of the HookCreateFileMapping function and storing the file in another location on the hard disk 22. The storage location can be anywhere.

ランサムウェアによる暗号化が検知された場合に、このバックアップから暗号化される前のファイルをコピーし復元する。   When encryption by ransomware is detected, the unencrypted file is copied and restored from this backup.

バックアップはあくまでも一時ファイルであり、暗号化が発生しない場合はディスクを無駄に圧迫することになるので、適宜この一時ファイルを削除する。   The backup is a temporary file to the last, and when encryption does not occur, the disk is squeezed unnecessarily, so this temporary file is deleted as appropriate.

保管する際は、拡張子を含むファイル名やファイルの内容を暗号化することが望ましい。また、特定のプログラム以外からの書き込みができないようなフォルダに保管する等の対策をとることが望ましい。バックアップファイルが攻撃者によって置き換えられたり削除されたりすることを防ぐためである。   When storing, it is desirable to encrypt file names and file contents including extensions. It is also desirable to take measures such as storing in a folder that cannot be written by other than a specific program. This is to prevent backup files from being replaced or deleted by an attacker.

図60に、ファイルマッピング時のファイルバックアップから、暗号化検知後のファイル復元の流れの具体例を示す。   FIG. 60 shows a specific example of the flow of file restoration after encryption detection from file backup at the time of file mapping.

CreateFileMapping関数が呼び出される(ステップ1)と、HookCreateFileMapping関数の第一引数に指定された暗号化対象ファイルハンドル(0x1A)からファイルパス(C:\users\test\Desktop\test.doc)を取得する(ステップ2)。取得したファイルパス(C:\users\test\Desktop\test.doc)から割り出したファイル(test.doc)を別の場所に暗号化を施したファイル(91B4083010E141872685)として保管する(ステップ3)。   When the CreateFileMapping function is called (step 1), the file path (C: \ users \ test \ Desktop \ test.doc) is acquired from the encryption target file handle (0x1A) specified in the first argument of the HookCreateFileMapping function ( Step 2). The file (test.doc) calculated from the acquired file path (C: \ users \ test \ Desktop \ test.doc) is stored as an encrypted file (91B4083010E141872685) in another location (step 3).

その後、ランサムウェアによる暗号化ファイル(C:\users\test\Desktop\test.doc.encrypted)を検知する(ステップ4)と、バックアップしたファイル(91B4083010E141872685)の暗号化を解いて、ファイル(C:\users\test\Desktop\test.doc)を復元する(ステップ5)。   After that, when the ransomware encrypted file (C: \ users \ test \ Desktop \ test.doc.encrypted) is detected (step 4), the backup file (91B4083010E141872685) is decrypted and the file (C: (\ users \ test \ Desktop \ test.doc) is restored (step 5).

なお、バックアップしたファイルは、ディスクを圧迫しないよう定期的に削除する必要がある。削除する頻度は任意であるが、一定の期間を過ぎたものを削除する、バックアップファイルが一定の個数を超えたら古いものから削除する、残りのディスク容量が一定量を下回った場合に古いものから削除する等、ディスク資源が枯渇しないような処理とする必要がある。   In addition, it is necessary to delete the backed up files regularly so as not to compress the disk. The frequency of deletion is arbitrary, but delete files that have passed a certain period of time, delete old files when the number of backup files exceeds a certain number, or start old files when the remaining disk capacity falls below a certain amount. It is necessary to perform processing that does not exhaust the disk resources, such as deleting.

(HookCreateFile関数)
HookCreateFile関数は、CreateFileなるAPIをフックする関数である。
(HookCreateFile function)
The HookCreateFile function is a function that hooks an API called CreateFile.

図60では、CreateFileMappingをフックするHookCreateFileMapping関数によりバックアップファイルを作成した。しかしながら、ファイルが排他モードで開かれている場合にはバックアップが作成できない。   In FIG. 60, a backup file is created by the HookCreateFileMapping function that hooks CreateFileMapping. However, a backup cannot be created if the file is opened in exclusive mode.

このため、バックアップ機能は、CreateFileMapping関数より前に呼び出されるCreateFileをフックするHookCreateFile関数により、排他モードで開かれる前にバックアップしておくことが望ましい。   For this reason, the backup function is preferably backed up before being opened in the exclusive mode by the HookCreateFile function that hooks CreateFile called before the CreateFileMapping function.

CreateFileは、ファイル等のオブジェクトにアクセスするためにオブジェクトを作成するか、利用できるハンドルを返すかする関数である。この関数を呼び出すことで、指定したファイルに読み書きするためのハンドルを取得できる。   CreateFile is a function that creates an object to access an object such as a file or returns an available handle. By calling this function, you can get a handle for reading from and writing to the specified file.

Microsoft社のリファレンス
https://msdn.microsoft.com/ja-jp/library/cc429198.aspx
には、CreateFileの説明が記載されている。その抜粋を図61に示す。
Microsoft reference
https://msdn.microsoft.com/en-us/library/cc429198.aspx
Contains a description of CreateFile. An excerpt is shown in FIG.

CreateFileのフック関数であるHookCreateFile関数に、次の機能を持たせる。   Add the following functions to the HookCreateFile function, which is a hook function of CreateFile.

呼び出し時のパラメータに指定されたファイル名が存在する場合は、そのファイルをバックアップする機能、すなわち別の場所にコピーする機能である。   When the file name specified in the parameter at the time of calling exists, this is a function for backing up the file, that is, a function for copying to another location.

バックアップファイルのファイル名は、どのプロセスによって暗号化されたものかを判別するために、例えば、プロセスIDやプロセス名等を埋め込んでおくのが望ましい。   In order to determine which process the file name of the backup file is encrypted, it is desirable to embed, for example, a process ID, a process name, or the like.

CreateFileは暗号化操作に関わらず頻繁に呼び出される関数であるので、全てをバックアップ対象とするとディスク領域を圧迫するおそれがある。このため、書き込み権限を指定してハンドルを取得しようとする場合、排他モードを指定してハンドルを取得しようとする場合等の条件を満たした場合等のみバックアップ対象とするようにしてもよい。   Since CreateFile is a function that is called frequently regardless of the encryption operation, there is a risk of squeezing the disk space if everything is backed up. For this reason, the backup target may be set only when conditions such as specifying the write authority to acquire a handle or specifying the exclusive mode to acquire a handle are satisfied.

バックアップはあくまでも一時ファイルであり、暗号化が発生しない場合はディスクを無駄に圧迫しないよう削除すべきである。   The backup is only a temporary file and should be deleted so as not to squeeze the disk if encryption does not occur.

例えば、オペレーティングシステム(Windows OS)でも一時領域として使用されるユーザー毎の一時フォルダである %temp%(例:C:\Users\test\AppData\Local\Temp)等に保管するようにしてもよい。   For example, it may be stored in% temp% (eg C: \ Users \ test \ AppData \ Local \ Temp), which is a temporary folder for each user that is used as a temporary area in the operating system (Windows OS). .

なお、バックアップしたファイルは、ディスクを圧迫しないよう定期的に削除する必要がある。削除する頻度は任意であるが、一定の期間を過ぎたものを削除する、バックアップファイルが一定の個数を超えたら古いものから削除する、残りのディスク容量が一定量を下回った場合に古いものから削除する等、ディスク資源が枯渇しないような処理とする必要がある。   In addition, it is necessary to delete the backed up files regularly so as not to compress the disk. The frequency of deletion is arbitrary, but delete files that have passed a certain period of time, delete old files when the number of backup files exceeds a certain number, or start old files when the remaining disk capacity falls below a certain amount. It is necessary to perform processing that does not exhaust the disk resources, such as deleting.

(HookMapViewOfFile関数/HookMapViewOfFileEx関数)
HookMapViewOfFile関数は、MapViewOfFileなるAPIをフックする関数である。HookMapViewOfFileEx関数は、MapViewOfFileExなるAPIをフックする関数である。
(HookMapViewOfFile function / HookMapViewOfFileEx function)
The HookMapViewOfFile function is a function that hooks an API called MapViewOfFile. The HookMapViewOfFileEx function is a function that hooks an API called MapViewOfFileEx.

MapViewOfFileおよびMapViewOfFileExは、CreateFileMappingにより作成されたマッピングオブジェクトを指定して、ファイルのビューをプロセスのアドレス空間にマップする関数である。この関数を呼び出すことで、読み込んだファイルのデータが対応付けられたアドレスを取得できる。   MapViewOfFile and MapViewOfFileEx are functions that map a view of a file to a process address space by specifying a mapping object created by CreateFileMapping. By calling this function, the address associated with the data of the read file can be acquired.

Microsoft社のリファレンス
https://msdn.microsoft.com/ja-jp/library/cc430198.aspx
には、MapViewOfFileの説明が記載されている。その抜粋を図62(a)に示す。
Microsoft reference
https://msdn.microsoft.com/en-us/library/cc430198.aspx
Describes the MapViewOfFile. An excerpt is shown in FIG.

Microsoft社のリファレンス
https://msdn.microsoft.com/ja-jp/library/cc430178.aspx
には、MapViewOfFileExの説明が記載されている。その抜粋を図62(b)に示す。
Microsoft reference
https://msdn.microsoft.com/en-us/library/cc430178.aspx
Describes the MapViewOfFileEx. An excerpt is shown in FIG.

MapViewOfFile、MapViewOfFileExのフック関数であるHookMapViewOfFile関数、HookMapViewOfFileEx関数には、次の機能を持たせる。   The HookMapViewOfFile function and HookMapViewOfFileEx function, which are hook functions of MapViewOfFile and MapViewOfFileEx, have the following functions.

呼び出し時のパラメータに指定されたファイルマッピングオブジェクトハンドル(hFileMappingObject)がメモリマップドリスト内に存在するかを確認し、存在する場合はその行にマップの開始アドレスを追記する機能である。   This function checks whether the file mapping object handle (hFileMappingObject) specified in the parameter at the time of calling exists in the memory-mapped list, and if it exists, adds the start address of the map to that line.

マップの開始アドレスは、MapViewOfFile/MapViewOfFileExを呼び出すことによって得られる戻り値の「マップされたビューの開始アドレス」である。「マップされたビューの開始アドレス」は、HookMapViewOfFile関数/HookMapViewOfFileEx関数内でフック前のオリジナルのMapViewOfFile/MapViewOfFileExを呼び出すことにより取得できる。   The map start address is the “mapped view start address” of the return value obtained by calling MapViewOfFile / MapViewOfFileEx. The “mapped view start address” can be obtained by calling the original MapViewOfFile / MapViewOfFileEx before hooking in the HookMapViewOfFile function / HookMapViewOfFileEx function.

図63に示す具体例では、呼び出し時のパラメータに指定されたファイルマッピングオブジェクトハンドル「0xABCD」がメモリマップドリスト内に存在したので、その行にマップ開始アドレス「0x201000」が追記されている。   In the specific example shown in FIG. 63, since the file mapping object handle “0xABCD” specified as the parameter at the time of calling exists in the memory mapped list, the map start address “0x201000” is added to that line.

(メモリマップドリスト)
上述したように、HookCreateFileMapping関数、HookMapViewOfFile関数/HookMapViewOfFileEx関数により、図64に示すメモリマップドリストが生成される。
(Memory mapped list)
As described above, the memory-mapped list shown in FIG. 64 is generated by the HookCreateFileMapping function, HookMapViewOfFile function / HookMapViewOfFileEx function.

メモリマップドリストの「暗号化対象ファイルのハンドル」「暗号化対象ファイルパス」「ファイルマッピングオブジェクトのハンドル」「暗号化前のヘッダデータ」は、HookCreateFileMapping関数により挿入され、「マップ開始アドレス」はHookMapViewOfFile関数/HookMapViewOfFileEx関数により挿入される。   “Handle of encryption target file”, “File path of encryption target”, “Handle of file mapping object”, “Header data before encryption” of memory mapped list are inserted by HookCreateFileMapping function, and “Map start address” is HookMapViewOfFile Inserted by function / HookMapViewOfFileEx function.

HookCreateFileMapping関数が呼び出されるたびに、新たな「暗号化対象ファイルのハンドル」「暗号化対象ファイルパス」「ファイルマッピングオブジェクトのハンドル」「暗号化前のヘッダデータ」がメモリマップドリストに追加される。なお、既にリストに記録されているものは追加しなくてもよい。そして、HookMapViewOfFile関数/HookMapViewOfFileEx関数が呼び出されるたびに、新たな「マップ開始アドレス」が追加される。   Each time the HookCreateFileMapping function is called, new “handle of encryption target file”, “file path of encryption target”, “handle of file mapping object”, and “header data before encryption” are added to the memory mapped list. It is not necessary to add what is already recorded in the list. Each time the HookMapViewOfFile function / HookMapViewOfFileEx function is called, a new “map start address” is added.

図64は、後述する「(第3の機能(その2):明示的にマップのクローズ・反映処理が行われない場合)」に記録されるメモリマップドリストの例である。   FIG. 64 shows an example of a memory-mapped list recorded in “(third function (part 2): when the map is not explicitly closed / reflected)” to be described later.

具体的には「C:\document\」フォルダ内のファイルが順に暗号化される流れにおいて、2つ目のファイル「2.pdf」がマッピングされたため、ファイル「1.pdf」の暗号化前のヘッダデータと暗号化後(現在)のヘッダデータを比較する状況を示している。   Specifically, since the second file “2.pdf” is mapped in the process of sequentially encrypting the files in the “C: \ document \” folder, the file “1.pdf” is not encrypted. It shows a situation in which the header data is compared with the encrypted (current) header data.

ファイル「1.pdf」のヘッダデータが異なっている場合、当該マッピング処理は暗号化を目的としたものであると判断し、検知する。   If the header data of the file “1.pdf” is different, it is determined that the mapping process is intended for encryption.

図64に示すメモリマップドリストの情報は、ひとつの監視対象プロセスが終了するとクリアされる。   The information in the memory mapped list shown in FIG. 64 is cleared when one monitored process ends.

本発明プログラムを常駐プログラムとして動作させる場合には、ひとつの監視対象プロセスが終了してもメモリマップドリストの情報はクリアされない。そのため、オペレーティングシステムのハンドル値の再利用により、異なるハンドルであるのに、偶発的にハンドル値が一致すると誤って検知するおそれがある。そのような誤検知を防止するため、メモリマップドリストを定期的にクリアすることが望ましい。ユーザーがクリアする間隔を設定できるようにしてもよい。また、オペレーティングシステムの終了時または再起動時にはクリアすることが望ましい。   When the program of the present invention is operated as a resident program, the information in the memory mapped list is not cleared even if one monitored process is terminated. Therefore, by reusing the handle value of the operating system, there is a possibility of erroneously detecting that the handle value coincides accidentally even though the handle is different. In order to prevent such erroneous detection, it is desirable to periodically clear the memory mapped list. You may enable it to set the clearance which a user clears. It is also desirable to clear it when the operating system is terminated or restarted.

ランサムウェアによる暗号化では、ファイルを1つずつ処理する流れをとることが多いため、マッピングによる暗号化においても「マップ」「暗号化」「アンマップ」を交互に繰り返すことが基本的な流れになる。この基本的な流れに対する対応であればメモリマップドリストが大きい必要はない。   In ransomware encryption, there is often a flow of processing files one by one. Therefore, in mapping encryption, the basic flow is to repeat “map”, “encryption”, and “unmap” alternately. Become. If this basic flow is supported, the memory mapped list does not need to be large.

しかしながら、多数のファイルを一気にマップし、その後、多数のファイルに暗号化を施し、その後、多数のファイルを一気にアンマップする、という処理を行う場合には、メモリマップドリストに、多数のファイル分の領域を設ける必要がある。   However, if you perform a process of mapping many files at once, then encrypting many files, and then unmapping many files at once, the memory-mapped list will contain many files. It is necessary to provide this area.

(第3の機能:記録を使用してランサムウェアであるかどうかを判断する機能)
本発明プログラムは、第3の機能は、第2の機能により記録した挙動により監視対象プロセスがランサムウェアであるかどうかを判断する。監視対象プロセスが、明示的にマップのクローズ・反映処理を行う場合と、明示的にマップのクローズ・反映処理が行わない場合とがあり、それぞれの場合を想定した処理を行う。
(Third function: a function for determining whether or not the ransomware is using a record)
In the program according to the present invention, the third function determines whether the monitored process is ransomware based on the behavior recorded by the second function. There are cases where the monitoring target process explicitly performs the map closing / reflecting process, and there are cases where the map closing / reflecting process is not explicitly performed, and the process is performed assuming each case.

(第3の機能(その1):明示的にマップのクローズ・反映処理が行われる場合)
監視対象プロセスの挙動を記録するために、第1の機能で列挙したフック対象APIのうち、次のAPIのフック関数を使用する。
(Third function (part 1): When the map is closed / reflected explicitly)
In order to record the behavior of the monitoring target process, the hook function of the following API is used among the hook target APIs listed in the first function.

UnmapViewOfFile/UnmapViewOfFileEx
FlushViewOfFile
CloseHandle
UnmapViewOfFile関数、UnmapViewOfFileEx関数は、マッピングされたメモリ(以下この状態のメモリを「マップドメモリ」と呼ぶ)を解除(アンマップ)する関数である。アンマップすることにより、マップドメモリ上のデータがファイルへ反映されるため、実質的に実ファイルへの書き込みが行われる動作である。監視対象プロセスがランサムウェアであれば実ファイルが暗号化される。
UnmapViewOfFile / UnmapViewOfFileEx
FlushViewOfFile
CloseHandle
The UnmapViewOfFile function and the UnmapViewOfFileEx function are functions for releasing (unmapping) the mapped memory (hereinafter, the memory in this state is referred to as “mapped memory”). By unmapping, the data in the mapped memory is reflected in the file, so that the operation is substantially written to the actual file. If the monitored process is ransomware, the actual file is encrypted.

FlushViewOfFile関数は、マップされた状態(マップドメモリ)を解除(アンマップ)しないが、この関数を呼び出すことによりマップドメモリ上のデータを実ファイルに反映する関数である。   The FlushViewOfFile function is a function that reflects the data on the mapped memory in the actual file by calling this function, although the mapped state (mapped memory) is not released (unmapped).

CloseHandle関数は、より広範に使用されるAPIである。ファイルマッピングでは、マップされた仮想ファイルの実ファイルへの書き込みが終わった後、マップされた仮想ファイルを閉じる際に呼び出される。したがって、通常のプログラムであれば、CloseHandleを呼び出す前に、UnmapViewOfFile関数やUnmapViewOfFileEx関数により、仮想ファイルがアンマップされる。しかしながら、UnmapViewOfFile関数やUnmapViewOfFileEx関数を呼び出すことなくCloseHandleを呼び出した場合には、マップドメモリのデータが実ファイルへ反映される。したがって、CloseHandle関数も、UnmapViewOfFile関数、UnmapViewOfFileEx関数、FlushViewOfFile関数と同様、実ファイルへの書き込みタイミグとして監視すべきAPIである。   The CloseHandle function is a more widely used API. In file mapping, it is called when the mapped virtual file is closed after the mapped virtual file has been written to the real file. Therefore, in a normal program, before calling CloseHandle, the virtual file is unmapped by the UnmapViewOfFile function or the UnmapViewOfFileEx function. However, when CloseHandle is called without calling the UnmapViewOfFile function or UnmapViewOfFileEx function, the data in the mapped memory is reflected in the actual file. Therefore, the CloseHandle function is also an API that should be monitored as a write timing to an actual file, like the UnmapViewOfFile function, UnmapViewOfFileEx function, and FlushViewOfFile function.

(HookUnmapViewOfFile関数/HookUnmapViewOfFileEx関数)
HookUnmapViewOfFile関数は、UnmapViewOfFileなるAPIをフックする関数である。HookUnmapViewOfFileEx関数は、UnmapViewOfFileExなるAPIをフックする関数である。
(HookUnmapViewOfFile function / HookUnmapViewOfFileEx function)
The HookUnmapViewOfFile function is a function that hooks an API called UnmapViewOfFile. The HookUnmapViewOfFileEx function is a function that hooks an API called UnmapViewOfFileEx.

UnmapViewOfFileおよびUnmapViewOfFileExは、マップされた状態(マップドメモリ)を解除(アンマップ)する関数である。   UnmapViewOfFile and UnmapViewOfFileEx are functions that cancel (unmap) the mapped state (mapped memory).

Microsoft社のリファレンス
https://msdn.microsoft.com/ja-jp/library/cc430200.aspx
には、UnmapViewOfFileの説明が記載されている。その抜粋を図65(a)に示す。
Microsoft reference
https://msdn.microsoft.com/en-us/library/cc430200.aspx
Describes the UnmapViewOfFile. An excerpt is shown in FIG.

Microsoft社のリファレンス
https://msdn.microsoft.com/ja-jp/library/windows/desktop/mt670639(v=vs.85).aspx
には、UnmapViewOfFileExの説明が記載されている。その抜粋を図65(b)に示す。
Microsoft reference
https://msdn.microsoft.com/en-us/library/windows/desktop/mt670639(v=vs.85).aspx
Describes the description of UnmapViewOfFileEx. An excerpt is shown in FIG.

UnmapViewOfFile、UnmapViewOfFileExのフック関数であるHookUnmapViewOfFile関数、HookUnmapViewOfFileEx関数には、通常のUnmapViewOfFile/UnmapViewOfFileExの動作に加え以下の機能を追加する。
(a)呼び出し時のパラメータに指定されたマップドメモリ(lpBaseAddress)がメモリマップドリスト内に存在するかを確認し、存在する場合はその行の「暗号化前のヘッダデータ」を取得する機能。
(b)呼び出し時のパラメータに指定されたマップドメモリ(lpBaseAddress)がメモリマップドリスト内に存在するかを確認し、存在する場合はlpBaseAddressの位置にマップされた「暗号化後のヘッダデータ」(マップドメモリ上の先頭データ)を取得する機能。
In addition to the normal UnmapViewOfFile / UnmapViewOfFileEx operations, the following functions are added to the HookUnmapViewOfFile and HookUnmapViewOfFileEx functions that are hook functions of UnmapViewOfFile and UnmapViewOfFileEx.
(A) A function that checks whether the mapped memory (lpBaseAddress) specified in the parameter at the time of calling exists in the memory mapped list, and if it exists, obtains “header data before encryption” of that line .
(B) Check whether the mapped memory (lpBaseAddress) specified in the parameter at the time of calling exists in the memory mapped list, and if it exists, “encrypted header data” mapped to the position of lpBaseAddress A function to acquire (first data on mapped memory).

UnmapViewOfFileが呼び出されるということは、既にMapViewOfFileが呼ばれていて、かつ、マップドメモリの使用を終え、ファイルにマップドメモリの内容を反映させる等の理由によりマップを解除したい段階と考えられる。このため、この時点のマップドメモリの先頭データはファイル暗号化後のヘッダデータとみなせる。
(c)上記の「暗号化前のヘッダデータ」と「暗号化後のヘッダデータ」とを比較し、それらに差異がある場合、ランサムウェアによるファイル暗号化操作であると判断し、プロセスを終了させる機能。
When UnmapViewOfFile is called, it is considered that MapViewOfFile has already been called and that it is desired to cancel the mapping because the mapped memory is finished and the contents of the mapped memory are reflected in the file. Therefore, the head data of the mapped memory at this time can be regarded as header data after file encryption.
(C) Compare the above-mentioned “header data before encryption” and “header data after encryption”, and if there is a difference, it is determined that the file encryption operation is performed by ransomware, and the process ends. Function to let you.

これらの機能による具体例を図66に示す。図66に示す例では、暗号化対象ファイルのハンドル「0xABC」の「暗号化前のヘッダデータ」は「25 50 44 46 2D」であり、HookUnMapViewOfFileFile/HookUnMapViewOfFile のパラメータの「開始アドレス(lpBaseAddress)」に「0x201000」が指定されている。メモリ23上のアドレス「0x201000」のデータ「50 4B 03 04 14」が「暗号化後のヘッダデータ」である。図66に示す例では、暗号化前のヘッダデータ「25 50 44 46 2D」と、暗号化後のヘッダデータ「50 4B 03 04 14」が相違するので、ランサムウェアによるファイル暗号化操作であると判断し、監視対象プロセスを終了させる。   A specific example of these functions is shown in FIG. In the example shown in FIG. 66, the “header data before encryption” of the handle “0xABC” of the encryption target file is “25 50 44 46 2D”, and the “start address (lpBaseAddress)” of the parameter of HookUnMapViewOfFileFile / HookUnMapViewOfFile “0x201000” is specified. The data “50 4B 03 04 14” at the address “0x201000” on the memory 23 is “encrypted header data”. In the example shown in FIG. 66, the header data “25 50 44 46 2D” before encryption is different from the header data “50 4B 03 04 14” after encryption, so that it is a file encryption operation by ransomware. Determine and terminate the process to be monitored.

(HookFlushViewOfFile関数)
HookFlushViewOfFile関数は、FlushViewOfFileなるAPIをフックする関数である。
(HookFlushViewOfFile function)
The HookFlushViewOfFile function is a function that hooks an API called FlushViewOfFile.

FlushViewOfFileは、マップドファイルのビュー内にある、指定された範囲のデータをディスクに書き込む関数である。   FlushViewOfFile is a function that writes the specified range of data in the mapped file view to disk.

Microsoft社のリファレンス
https://msdn.microsoft.com/ja-jp/library/cc430048.aspx
には、FlushViewOfFileの説明が記載されている。その抜粋を図67に示す。
Microsoft reference
https://msdn.microsoft.com/en-us/library/cc430048.aspx
Describes the FlushViewOfFile. An excerpt is shown in FIG.

FlushViewOfFileはUnmapViewOfFile/UnmapViewOfFileExと同様、呼び出しパラメータにマップの開始アドレス(lpBaseAddress)があるため、HookUnmapViewOfFile/HookUnmapViewOfFileExと同様に暗号化を検知することが可能である。   Since FlushViewOfFile has a map start address (lpBaseAddress) in the call parameter, similarly to UnmapViewOfFile / UnmapViewOfFileEx, encryption can be detected in the same manner as HookUnmapViewOfFile / HookUnmapViewOfFileEx.

FlushViewOfFileのフック関数であるHookFlushViewOfFile関数には、通常のFlushViewOfFileの動作に加え以下の機能を追加する。
(a)呼び出し時のパラメータに指定されたマップドメモリ(lpBaseAddress)がメモリマップドリスト内に存在するかを確認し、存在する場合はその行の「暗号化前のヘッダデータ」を取得する機能。
(b)呼び出し時のパラメータに指定されたマップドメモリ(lpBaseAddress)がメモリマップドリスト内に存在するかを確認し、存在する場合はlpBaseAddressの位置にマップされた「暗号化後のヘッダデータ」(マップドメモリ上の先頭データ)を取得する機能。
(c)上記の「暗号化前のヘッダデータ」と「暗号化後のヘッダデータ」とを比較し、それらに差異がある場合、ランサムウェアによるファイル暗号化操作であると判断し、プロセスを終了させる機能。
In addition to the normal FlushViewOfFile operation, the following functions are added to the HookFlushViewOfFile function that is a hook function of FlushViewOfFile.
(A) A function that checks whether the mapped memory (lpBaseAddress) specified in the parameter at the time of calling exists in the memory mapped list, and if it exists, obtains “header data before encryption” of that line .
(B) Check whether the mapped memory (lpBaseAddress) specified in the parameter at the time of calling exists in the memory mapped list, and if it exists, “encrypted header data” mapped to the position of lpBaseAddress A function to acquire (first data on mapped memory).
(C) Compare the above-mentioned “header data before encryption” and “header data after encryption”, and if there is a difference, it is determined that the file encryption operation is performed by ransomware, and the process ends. Function to let you.

(HookCloseHandle関数)
HookCloseHandle関数は、CloseHandleなるAPIをフックする関数である。
(HookCloseHandle function)
The HookCloseHandle function is a function that hooks an API called CloseHandle.

CloseHandleは、ファイルが閉じられる際に呼び出されるAPIである。   CloseHandle is an API that is called when a file is closed.

Microsoft社のリファレンス
https://msdn.microsoft.com/ja-jp/library/cc429605.aspx
には、CloseHandleの説明が記載されている。その抜粋を図68に示す。
Microsoft reference
https://msdn.microsoft.com/en-us/library/cc429605.aspx
Describes the CloseHandle. An excerpt is shown in FIG.

ファイルマッピングを使用する場合、一般的にはCloseHandleを呼び出す前にアンマップする。そのため一般的にアンマップはHookUnmapViewOfFile/HookUnmapViewOfFileExで検知できる。しかしながら、意図的にアンマップするHookUnmapViewOfFile/HookUnmapViewOfFileExを用いずに、直ちにファイルをクローズする方法も考えられ、この場合にもマップドメモリの内容が実ファイルに反映される可能性があることから、CloseHandleをトリガーとして検知することが望ましい。   When using file mapping, it is generally unmapped before calling CloseHandle. Therefore, unmap can generally be detected by HookUnmapViewOfFile / HookUnmapViewOfFileEx. However, it is possible to immediately close the file without using HookUnmapViewOfFile / HookUnmapViewOfFileEx that intentionally unmaps, and in this case, the contents of the mapped memory may be reflected in the actual file. It is desirable to detect as a trigger.

CloseHandleのフック関数であるHookCloseHandle関数には、通常のCloseHandleの動作に加え次の機能を追加する。   In addition to the normal CloseHandle operation, the following functions are added to the HookCloseHandle function, which is a hook function of CloseHandle.

HookCloseHandle関数においても、実施すべきことの基本的な考え方は、HookUnmapViewOfFile/HookUnmapViewOfFileEx関数の場合と同じである。メモリマップドリストを利用して以前のファイルの状態(暗号化前のヘッダデータ)と、HookCloseHandleが呼び出されたタイミングでの暗号化後のヘッダデータを取得して、これらヘッダデータを比較する。   Also in the HookCloseHandle function, the basic concept of what should be performed is the same as in the case of the HookUnmapViewOfFile / HookUnmapViewOfFileEx function. Using the memory-mapped list, the previous file state (header data before encryption) and the header data after encryption at the timing when HookCloseHandle is called are acquired, and these header data are compared.

HookUnmapViewOfFile/HookUnmapViewOfFileEx関数の場合と異なる点は、ヘッダデータを取得するまでのメモリマップドリストの辿り方である。その辿り方を図69及び図70に示す。   The difference from the case of the HookUnmapViewOfFile / HookUnmapViewOfFileEx function is how the memory mapped list is traced until the header data is acquired. The method of tracing is shown in FIGS.

CloseHandle関数のパラメータには「マップの開始アドレス」は存在せず、ファイルハンドルのみとなる。そのため、前のファイルの状態(暗号化前のヘッダデータ)を取得するには、図69に示すように、メモリマップドリスト内の「暗号化対象ファイルのハンドル」を検索し、パラメータに指定されたファイルハンドルhObjectの値と合致する行の「暗号化前のヘッダデータ」列の値を取得する。   There is no “map start address” in the CloseHandle function parameter, only the file handle. Therefore, in order to obtain the state of the previous file (header data before encryption), as shown in FIG. 69, search for “handle of encryption target file” in the memory-mapped list and specify it as a parameter. Get the value of the “header data before encryption” column in the row that matches the value of the file handle hObject.

ただし「ファイルハンドル」の値は、オペレーティングシステム(Windows OS)により再利用される可能性がある。このため、ハンドルの一致による誤検知にならないために、「ファイルハンドル(hObject)」から「ファイルパス」を求め、「ファイルハンドル」の一致に加え、求めた「ファイルパス」と「暗号化対象ファイルパス」列の値が一致することも条件としてもよい。   However, the value of “file handle” may be reused by the operating system (Windows OS). Therefore, in order to avoid false detection due to matching of handles, “file path” is obtained from “file handle (hObject)”, and in addition to matching of “file handle”, the obtained “file path” and “file to be encrypted” It may be a condition that the values in the “path” column match.

暗号化後のヘッダデータ取得については、図70に示すように、ファイルハンドル(hObject)からReadFile関数等を使用し、ハードディスク22上の実ファイルから先頭データ(ヘッダデータ)を読み取る方法や、フック前のオリジナルのCloseHandleを呼び出し、クローズされたファイルを再度オープンし、ハードディスク22上の実ファイルから先頭データ(ヘッダデータ)を読み取る方法が考えられる。   As for obtaining header data after encryption, as shown in FIG. 70, a method of reading head data (header data) from an actual file on the hard disk 22 using a ReadFile function or the like from a file handle (hObject), or before hooking The original CloseHandle is called, the closed file is reopened, and the head data (header data) is read from the actual file on the hard disk 22.

処理のオーバーヘッドを考えると、ファイルハンドルを使用して先頭データを取得するほうが、よりよいパフォーマンスとなると思われる。   Given the processing overhead, using the file handle to get the top data seems to give better performance.

(第3の機能のまとめ)
明示的にマップのクローズ・反映処理が行われる場合の動作について、図71を用いて時系列に沿って説明する。
(Summary of the third function)
The operation when the map close / reflect processing is explicitly performed will be described in time series with reference to FIG.

まず、ステップ1では、HookCreateFileMappingにより、メモリマップドリストに新しい行が追加される。新しい行には、暗号化対象ファイルのハンドル、暗号化対象ファイルパス、ファイルマッピングオブジェクトのハンドル、暗号化対象ファイルの暗号化前のヘッダデータが記入される。   First, in step 1, a new line is added to the memory-mapped list by HookCreateFileMapping. In the new line, the handle of the encryption target file, the encryption target file path, the handle of the file mapping object, and the header data before encryption of the encryption target file are entered.

図71では、暗号化対象ファイルのハンドルが「0xABC」であり、暗号化対象ファイルパスが「C:\test.pdf」であり、ファイルマッピングオブジェクトのハンドルが「0xABCD」であり、暗号化対象ファイルの暗号化前のヘッダデータが「25 50 44 46 2D」である。   In FIG. 71, the encryption target file handle is “0xABC”, the encryption target file path is “C: \ test.pdf”, the file mapping object handle is “0xABCD”, and the encryption target file is The header data before encryption is “25 50 44 46 2D”.

次に、ステップ2では、HookMapViewOfFile/HookMapViewOfFileExにより、メモリマップドリストに、マップの開始アドレスが記入される。   Next, in step 2, the start address of the map is entered in the memory mapped list by HookMapViewOfFile / HookMapViewOfFileEx.

図71では、呼び出し時のパラメータに指定されたファイルマッピングオブジェクトハンドル「0xABCD」がメモリマップドリスト内に存在したので、その行にマップ開始アドレス「0x201000」が追記される。   In FIG. 71, since the file mapping object handle “0xABCD” specified as the parameter at the time of calling exists in the memory mapped list, the map start address “0x201000” is added to the line.

次に、ステップ3では、監視対象プロセスがランサムウェアであるとマップドメモリのデータが暗号化される。   Next, in step 3, if the monitored process is ransomware, the data in the mapped memory is encrypted.

次に、ステップ4では、HookUnmapViewOfFile/HookUnmapViewOfFileEx、又は、HookFlushViewOfFileにより、まず、UnmapViewOfFile/UnmapViewOfFileEx、又は、HookFlushViewOfFileの呼び出し時のパラメータに指定されたアドレスとマッチするものを「マップの開始アドレス」列から検索する(ステップ4−1)。次に、マッチする行があれば、その行のヘッダデータ(暗号化前)と、マップドメモリから取得した現在のヘッダデータ(暗号化後)とを比較して、差異があれば暗号化されたと判断する。そのようにして、監視対象プロセスがランサムウェアであるか否かを判断する(ステップ4−2)。   Next, in step 4, by using HookUnmapViewOfFile / HookUnmapViewOfFileEx or HookFlushViewOfFile, first, a search is made from the “map start address” column that matches the address specified in the parameter when calling UnmapViewOfFile / UnmapViewOfFileEx or HookFlushViewOfFile. (Step 4-1). Next, if there is a matching line, the header data of that line (before encryption) is compared with the current header data (after encryption) acquired from the mapped memory, and if there is a difference, it is encrypted. Judge that In this way, it is determined whether or not the process to be monitored is ransomware (step 4-2).

図71では、呼び出し時のパラメータ「0xABCD」から、メモリマップドリストの暗号化前のヘッダデータ「25 50 44 46 2D」を取得し、呼び出し時のパラメータ「0xABCD」により指定されたアドレス「0x201000」から現在のヘッダデータ(暗号化後)「50 4B 03 04 14」を取得する。これらを比較すると差異があるので、監視対象プロセスはランサムウェアであると判断する。   In FIG. 71, the header data “25 50 44 46 2D” before encryption of the memory mapped list is acquired from the parameter “0xABCD” at the time of calling, and the address “0x201000” specified by the parameter “0xABCD” at the time of calling is acquired. To obtain the current header data (after encryption) “50 4B 03 04 14”. Since there is a difference when these are compared, it is determined that the process to be monitored is ransomware.

(ランサムウェアの検知処理(その1))
ランサムウェアの検知処理(その1)の詳細について、図72のフローチャートを用いて説明する。
(Ransomware detection process (1))
Details of the ransomware detection process (part 1) will be described with reference to the flowchart of FIG.

HookUnmapViewOfFile/HookUnmapViewOfFileEx、又は、HookFlushViewOfFileを用いた場合のランサムウェアの検知処理である。   This is ransomware detection processing when HookUnmapViewOfFile / HookUnmapViewOfFileEx or HookFlushViewOfFile is used.

まず、UnmapViewOfFile/UnmapViewOfFileEx、又は、HookFlushViewOfFileの呼び出し時のパラメータ「lpBaseAddress」に指定されたアドレスがメモリマップドリストに存在するか否かを判断する(ステップS11)。   First, it is determined whether or not the address specified in the parameter “lpBaseAddress” at the time of calling UnmapViewOfFile / UnmapViewOfFileEx or HookFlushViewOfFile exists in the memory mapped list (step S11).

そのアドレスがメモリマップドリストに存在しなければ、直ちにランサムウェアの検知処理を終了する。   If the address does not exist in the memory mapped list, the ransomware detection process is immediately terminated.

そのアドレスがメモリマップドリストに存在すると、その行のヘッダデータ(暗号化前)を取得する(ステップS12)。これは、前もってハードディスク22の実ファイルから取得したデータである。   If the address exists in the memory-mapped list, the header data of the row (before encryption) is acquired (step S12). This is data acquired from an actual file on the hard disk 22 in advance.

次に、呼び出し時のパラメータ「lpBaseAddress」により指定されたアドレスから現在のヘッダデータ(暗号化後)を取得する(ステップS13)。これは、現在のメモリ23の仮想ファイルから取得したデータである。   Next, the current header data (after encryption) is acquired from the address specified by the parameter “lpBaseAddress” at the time of calling (step S13). This is data acquired from the virtual file in the current memory 23.

次に、取得した暗号化前のヘッダデータと暗号化後のヘッダデータとを比較して、相違するか否かを判断する(ステップS14)。   Next, the obtained header data before encryption and the header data after encryption are compared to determine whether or not they are different (step S14).

暗号化前のヘッダデータと暗号化後のヘッダデータが相違しなければ、直ちにランサムウェアの検知処理を終了する。   If there is no difference between the header data before encryption and the header data after encryption, the ransomware detection process is immediately terminated.

暗号化前のヘッダデータと暗号化後のヘッダデータが相違すれば、監視対象プロセスをランサムウェア又はその疑いとして検知する(ステップS15)。   If the header data before encryption is different from the header data after encryption, the process to be monitored is detected as ransomware or its suspicion (step S15).

(ランサムウェアの検知処理(その2))
ランサムウェアの検知処理(その2)の詳細について、図73のフローチャートを用いて説明する。
(Ransomware detection process (2))
Details of the ransomware detection process (part 2) will be described with reference to the flowchart of FIG.

HookCloseHandleを用いた場合のランサムウェアの検知処理である。   This is ransomware detection processing when HookCloseHandle is used.

まず、HookCloseHandleの呼び出し時のパラメータ「hObject」に指定されたハンドルがメモリマップドリストに存在するか否かを判断する(ステップS21)。   First, it is determined whether or not the handle specified in the parameter “hObject” at the time of calling HookCloseHandle exists in the memory-mapped list (step S21).

そのハンドルがメモリマップドリストに存在しなければ、直ちにランサムウェアの検知処理を終了する。   If the handle does not exist in the memory mapped list, the ransomware detection process is immediately terminated.

そのハンドルがメモリマップドリストに存在すると、そのパラメータ「hObject」からファイルパスを算出する(ステップS22)。   If the handle exists in the memory mapped list, the file path is calculated from the parameter “hObject” (step S22).

次に、メモリマップドリストから「暗号化対象ファイルパス」を取得する(ステップS23)。   Next, “encryption target file path” is acquired from the memory mapped list (step S23).

次に、パラメータから算出されたファイルパスと、メモリマップドリストから取得したファイルパスとが同じであるか否か判断する(ステップS24)。   Next, it is determined whether or not the file path calculated from the parameter is the same as the file path acquired from the memory mapped list (step S24).

ファイルパスが同じでなければ、直ちにランサムウェアの検知処理を終了する。   If the file paths are not the same, the ransomware detection process is immediately terminated.

ファイルパスが同じであると、該当する行のヘッダデータ(暗号化前)を取得する(ステップS25)。これは、前もってハードディスク22の実ファイルから取得したデータである。   If the file paths are the same, the header data (before encryption) of the corresponding line is acquired (step S25). This is data acquired from an actual file on the hard disk 22 in advance.

次に、ファイルパスから現在のヘッダデータ(暗号化後)を取得する(ステップS26)。これは、現在のハードディスク22の実ファイルから取得したデータである。   Next, the current header data (after encryption) is acquired from the file path (step S26). This is data acquired from an actual file on the current hard disk 22.

次に、取得した暗号化前のヘッダデータと暗号化後のヘッダデータとを比較して、相違するか否かを判断する(ステップS27)。   Next, the obtained header data before encryption is compared with the header data after encryption to determine whether or not they are different (step S27).

暗号化前のヘッダデータと暗号化後のヘッダデータが相違しなければ、直ちにランサムウェアの検知処理を終了する。   If there is no difference between the header data before encryption and the header data after encryption, the ransomware detection process is immediately terminated.

暗号化前のヘッダデータと暗号化後のヘッダデータが相違すれば、監視対象プロセスをランサムウェア又はその疑いとして検知する(ステップS28)。   If the header data before encryption is different from the header data after encryption, the process to be monitored is detected as ransomware or its suspicion (step S28).

(バックアップ処理)
本発明プログラムによれば、上述したように、監視対象プロセスがひとつ目のファイルの暗号化を実行した時点で、監視対象プロセスをランサムウェアとして検知することが可能である。しかし、ランサムウェアとして検知した時点で、既にマップドメモリの内容は暗号化された状態となっている。このため、監視対象プロセスを強制的に終了させても、ひとつ目のファイルの暗号化は阻止できない。
(Backup process)
According to the program of the present invention, as described above, the monitoring target process can be detected as ransomware when the monitoring target process executes encryption of the first file. However, the contents of the mapped memory are already encrypted when detected as ransomware. For this reason, even if the process to be monitored is forcibly terminated, the first file cannot be encrypted.

したがって、監視対象プロセスをランサムウェアとして検知した場合には、HookCreateFileMapping関数でバックアップしたファイルをハードディスク22の実ファイルとして書き戻すようにする。本発明プログラムの常駐プログラムにランサムウェアの検知を通知し、バックアップしたファイルを書き戻す。   Therefore, when the monitored process is detected as ransomware, the file backed up by the HookCreateFileMapping function is written back as an actual file on the hard disk 22. The detection of ransomware is notified to the resident program of the present invention program, and the backed up file is written back.

バックアップファイルの書き戻しに際しては、(第2の機能:フックしたAPIにより監視対象プロセスの挙動を記録する機能)の(HookCreateFileMapping関数)に示した処理を適用する。   When the backup file is written back, the processing shown in (HookCreateFileMapping function) of (second function: function of recording the behavior of the process to be monitored by the hooked API) is applied.

(第3の機能(その2):明示的にマップのクローズ・反映処理が行われない場合)
明示的にUnmapViewOfFile/UnmapViewOfFileEx、FlushViewOfFile、CloseHandleを呼び出さずとも、プログラムの終了時には、オペレーティングシステム(Windows OS)によってマップドメモリの内容がファイルに書き出される。ランサムウェアの開発者がAPIの監視から逃れるために、意図的に上述したクローズ処理を行わない方法をとることも考えられる。このため、このような場合にもランサムウェアを検知できるようにする必要がある。
(Third function (part 2): When the map is not explicitly closed / reflected)
Even if UnmapViewOfFile / UnmapViewOfFileEx, FlushViewOfFile, and CloseHandle are not explicitly called, the contents of the mapped memory are written to the file by the operating system (Windows OS) when the program ends. In order for the ransomware developer to escape from the monitoring of the API, it is conceivable to take a method of intentionally not performing the above-described closing process. Therefore, it is necessary to be able to detect ransomware even in such a case.

明示的に上記のAPIが呼び出されない場合には、マップドメモリに対してヘッダデータの差異確認を行うトリガーがなくなる。このため、監視対象プロセスによりファイルが処理された直後に、そのファイルが暗号化されたかを検知することができない。   When the above API is not explicitly called, there is no trigger for checking the difference of header data for the mapped memory. For this reason, immediately after the file is processed by the monitoring target process, it cannot be detected whether the file is encrypted.

そこで、本発明プログラムでは、通常、ランサムウェアがファイルを連続して暗号化するという特徴に着目し、ファイル暗号化の連続性を利用して検知するようにした。   Therefore, in the program of the present invention, the ransomware usually focuses on the feature that files are continuously encrypted, and the detection is performed using the continuity of file encryption.

本発明プログラムは、MapViewOfFile、MapViewOfFileExのフック関数であるHookMapViewOfFile関数、HookMapViewOfFileEx関数に、更に次の機能を追加する。
(a)メモリマップドリストをすべて走査する機能。
(b)走査して取得した全ての行の「暗号化前のヘッダデータ」をそれぞれ取得する機能
(c1)走査して取得した全ての行の「暗号化対象ファイルパス」から、ハードディスク22上の実ファイルから現在のヘッダデータをそれぞれ取得する機能。
(c2)走査して取得した全ての行の「マップの開始アドレス」からメモリ23上の仮想ファイルの現在のヘッダデータを取得する機能。この場合は、マップの開始アドレスがOSにより再利用されていない、すなわち、マップの開始アドレスがメモリマップドリスト内で重複していない状況でのみ有効である。OSにより再利用されている場合、既に新しい情報で置き換えられている可能性があるためである。
(d)上記の全ての行の「暗号化前のヘッダデータ」と「暗号化後のヘッダデータ」とをそれぞれ比較し、それらに差異がある場合、ランサムウェアによるファイル暗号化操作であると判断し、プロセスを終了させる機能。
The present invention program further adds the following functions to the HookMapViewOfFile function and the HookMapViewOfFileEx function that are hook functions of MapViewOfFile and MapViewOfFileEx.
(A) A function of scanning all memory mapped lists.
(B) A function of acquiring “header data before encryption” of all lines acquired by scanning (c1) From the “encryption target file path” of all lines acquired by scanning, on the hard disk 22 The function to get the current header data from the actual file.
(C2) A function of acquiring the current header data of the virtual file on the memory 23 from the “map start address” of all the lines acquired by scanning. This case is effective only in a situation where the map start address is not reused by the OS, that is, the map start address is not duplicated in the memory mapped list. This is because when the information is reused by the OS, it may be replaced with new information.
(D) The “header data before encryption” and the “header data after encryption” in all the above lines are respectively compared, and if there is a difference, it is determined that the file encryption operation is performed by ransomware. And terminate the process.

HookMapViewOfFile関数、HookMapViewOfFileEx関数に上述した機能を追加しても、ひとつ目のファイルの暗号化を検知することはできない。ひとつ目のファイルに対してHookMapViewOfFile関数、HookMapViewOfFileEx関数を実行したときには、ひとつ目のファイルに対する暗号化がまだ実行されていないからである。ふたつ目以降のファイルの暗号化でHookMapViewOfFile関数、HookMapViewOfFileEx関数を実行したときには、ひとつ目のファイルに対する暗号化は既に実行されているので、ひとつ目のファイルの暗号化を検知することができる。   Even if the above functions are added to the HookMapViewOfFile function and the HookMapViewOfFileEx function, the encryption of the first file cannot be detected. This is because when the HookMapViewOfFile function and the HookMapViewOfFileEx function are executed for the first file, the encryption for the first file has not been executed yet. When the HookMapViewOfFile function and the HookMapViewOfFileEx function are executed in the encryption of the second and subsequent files, the encryption of the first file has already been executed, so that the encryption of the first file can be detected.

(ランサムウェアの検知処理)
本発明プログラムによるランサムウェアの検知処理について、図74及び図75を用いて説明する。
(Ransomware detection processing)
Ransomware detection processing by the program of the present invention will be described with reference to FIGS.

図74に示すのは、監視対象プロセスにより連続的にファイルの暗号化が行われた場合の処理である。   FIG. 74 shows processing when file encryption is continuously performed by the monitoring target process.

ひとつ目のファイルに対してステップ1(HookCreateFileMapping)、ステップ2(HookMapViewOfFile/HookMapViewOfFileEx)、ステップ3(ランサムウェアによりマップドメモリのデータ暗号化)が行われる。   Step 1 (HookCreateFileMapping), Step 2 (HookMapViewOfFile / HookMapViewOfFileEx), and Step 3 (data encryption of mapped memory by ransomware) are performed on the first file.

ステップ3まで終了した時点ではメモリマップドリストには、暗号化対象ファイルのハンドルに「0xABC」、暗号化対象ファイルパスに「C:\test.pdf」、ファイルマッピングオブジェクトのハンドルに「0xABCD」、暗号化前のヘッダデータに「25 50 44 46 2D」、マップ開始アドレスに「0x201000」が記録されている。   At the end of step 3, the memory-mapped list contains “0xABC” as the handle of the encryption target file, “C: \ test.pdf” as the file path of the encryption target, “0xABCD” as the handle of the file mapping object, “25 50 44 46 2D” is recorded in the header data before encryption, and “0x201000” is recorded in the map start address.

ひとつ目のファイルに対するステップ3の後、明示的なクローズ処理(UnmapViewOfFile/UnmapViewOfFileEx、FlushViewOfFile、CloseHandle)が行われないまま、オペレーティングシステム(Windows OS)によってマップドメモリの内容がファイルに書き出される。次にふたつ目のファイルに対する処理が行われる。   After step 3 for the first file, the contents of the mapped memory are written to the file by the operating system (Windows OS) without performing explicit close processing (UnmapViewOfFile / UnmapViewOfFileEx, FlushViewOfFile, CloseHandle). Next, the second file is processed.

ふたつ目のファイルに対しても、同様に、ステップ1(HookCreateFileMapping)、ステップ2(HookMapViewOfFile/HookMapViewOfFileEx)、ステップ3(ランサムウェアによりマップドメモリのデータ暗号化)が行われる。   Similarly, step 1 (HookCreateFileMapping), step 2 (HookMapViewOfFile / HookMapViewOfFileEx), and step 3 (mapped memory data encryption using ransomware) are performed for the second file.

ステップ1まで終了した時点ではメモリマップドリストには、暗号化対象ファイルのハンドルに「0xDEF」、暗号化対象ファイルパスに「C:\doc.txt」、ファイルマッピングオブジェクトのハンドルに「0xEF01」、暗号化前のヘッダデータに「61 62 63 64 65」が記録されている。   At the end of step 1, the memory mapped list contains “0xDEF” for the handle of the encryption target file, “C: \ doc.txt” for the file path of the encryption target, “0xEF01” for the handle of the file mapping object, “61 62 63 64 65” is recorded in the header data before encryption.

ステップ2(HookMapViewOfFile/HookMapViewOfFileEx)の詳細について、図75のフローチャートを用いて説明する。HookMapViewOfFile/HookMapViewOfFileExを用いたランサムウェアの検知処理である。   Details of Step 2 (HookMapViewOfFile / HookMapViewOfFileEx) will be described using the flowchart of FIG. Ransomware detection processing using HookMapViewOfFile / HookMapViewOfFileEx.

まず、メモリマップドリストの走査を開始し(ステップS31)。   First, scanning of the memory mapped list is started (step S31).

次に、メモリマップドリストの末尾であるか否か判断する(ステップS32)。メモリマップドリストの末尾であると、走査が終了したとして、直ちにランサムウェアの検知処理を終了する。   Next, it is determined whether it is the end of the memory mapped list (step S32). If it is at the end of the memory mapped list, the ransomware detection process is immediately terminated, assuming that the scanning is completed.

メモリマップドリストの末尾でないと、メモリマップドリストの該当行の「暗号化前のヘッダデータ」を取得する(ステップS33)。これは、前もってハードディスク22の実ファイルから取得したデータである。   If it is not the end of the memory mapped list, “header data before encryption” of the corresponding line of the memory mapped list is acquired (step S33). This is data acquired from an actual file on the hard disk 22 in advance.

次に、メモリマップドリストの該当行の「暗号化対象ファイルパス」を取得する(ステップS34)。これは、前もってハードディスク22の実ファイルから取得したデータである。   Next, the “encryption target file path” of the corresponding line in the memory mapped list is acquired (step S34). This is data acquired from an actual file on the hard disk 22 in advance.

次に、該当行の「暗号化対象ファイルパス」のファイルから現在のヘッダデータ(暗号化後)を取得する(ステップS35)。これは、現在のハードディスク22の実ファイル、又は、現在のメモリ23の仮想ファイルから取得したデータである。   Next, the current header data (after encryption) is acquired from the file of “encryption target file path” in the corresponding line (step S35). This is data acquired from a real file in the current hard disk 22 or a virtual file in the current memory 23.

次に、取得した暗号化前のヘッダデータと暗号化後のヘッダデータとを比較して、相違するか否かを判断する(ステップS36)。   Next, the acquired header data before encryption and the header data after encryption are compared to determine whether or not they are different (step S36).

暗号化前のヘッダデータと暗号化後のヘッダデータが相違しなければ、メモリマップドリストの次の行を走査すべくステップS32に戻る。   If the header data before encryption and the header data after encryption are not different, the process returns to step S32 to scan the next row of the memory mapped list.

暗号化前のヘッダデータと暗号化後のヘッダデータが相違すれば、監視対象プロセスをランサムウェア又はその疑いとして検知する(ステップS37)。   If the header data before encryption is different from the header data after encryption, the process to be monitored is detected as ransomware or its suspicion (step S37).

(バックアップ処理)
本発明プログラムによれば、上述したように、監視対象プロセスがふたつ目のファイルの暗号化を実行した時点で、監視対象プロセスをランサムウェアとして検知することが可能である。しかし、ランサムウェアとして検知した時点で、既にひとつ目のファイル及びふたつ目のファイルのマップドメモリの内容は暗号化された状態となっている。このため、監視対象プロセスを強制的に終了させても、ひとつ目のファイル及びふたつ目のファイルの暗号化は阻止できない。
(Backup process)
According to the program of the present invention, as described above, the monitored process can be detected as ransomware when the monitored process executes the encryption of the second file. However, when detected as ransomware, the contents of the mapped memory of the first file and the second file are already encrypted. For this reason, even if the process to be monitored is forcibly terminated, the encryption of the first file and the second file cannot be prevented.

したがって、監視対象プロセスをランサムウェアとして検知した場合には、HookCreateFileMapping関数でバックアップしたファイルをハードディスク22の実ファイルとして書き戻すようにする。本発明プログラムの常駐プログラムにランサムウェアの検知を通知し、バックアップしたファイルを書き戻す。   Therefore, when the monitored process is detected as ransomware, the file backed up by the HookCreateFileMapping function is written back as an actual file on the hard disk 22. The detection of ransomware is notified to the resident program of the present invention program, and the backed up file is written back.

バックアップファイルの書き戻しに際しては、(第2の機能:フックしたAPIにより監視対象プロセスの挙動を記録する機能)の(HookCreateFileMapping関数)に示した処理を適用する。   When the backup file is written back, the processing shown in (HookCreateFileMapping function) of (second function: function of recording the behavior of the process to be monitored by the hooked API) is applied.

(除外リスト)
本発明プログラムを、システム上において動作する全てのプロセスに対して、そのプロセスがランサムウェアである否かを判断することは、システムに新たな負荷を加えることになる。
(Exclusion list)
To determine whether or not the process of the present invention program is ransomware for all processes operating on the system adds a new load to the system.

そこで、本実施形態では、明らかにランサムウェアではないプログラムを予め登録した「除外リスト」を作成しておき、除外リストに登録されたプログラムに対しては、本発明プログラムを実行しないようにする。   Therefore, in this embodiment, an “exclusion list” in which programs that are clearly not ransomware are registered in advance is created, and the program of the present invention is not executed for the programs registered in the exclusion list.

除外リストには正規のプログラムを登録する。例えば、システムにインストールされている「プログラム名」「プログラムファイル」「ファイルのフルパス」「ファイルサイズ」「ハッシュ値」「デジタル署名」等を必要に応じて登録する。   Regular programs are registered in the exclusion list. For example, “program name”, “program file”, “full file path”, “file size”, “hash value”, “digital signature”, and the like installed in the system are registered as necessary.

除外リストは、システムへのプログラムをインストールするたびに更新し、ハードディスク22上に格納しておく。本発明プログラムの起動時に除外リストの内容を読み込むようにする。   The exclusion list is updated each time a program is installed in the system and stored on the hard disk 22. The contents of the exclusion list are read when the program of the present invention is started.

本発明プログラムの動作後、読み込んだ除外リストの情報はメモリ23上にマッピングされる。突然のマシントラブルでメモリ情報が揮発しても内容を失わないよう、ハードディスク22上のファイルに対して常に更新しておくことがよい。   After the operation of the program of the present invention, the read exclusion list information is mapped onto the memory 23. It is preferable to always update the files on the hard disk 22 so that the contents are not lost even if the memory information is volatilized due to a sudden machine trouble.

また、除外リストのファイルは、マルウェアやランサムウェアによる編集を避けるため、暗号化しておくことが望ましい。   Also, it is desirable to encrypt the exclusion list file to avoid editing by malware or ransomware.

(プロセスの強制終了)
本発明プログラムが、監視対象プロセスがランサムウェアであると判断した場合、当該プロセスを強制終了する。プロセスの強制終了は、フックしている関数内で行う。一般的には、ExitProcess関数や、Exit関数等を用いることで実現できるが、プロセスを終了可能な命令であればいかなるものを使用してもよい。これにより、ランサムウェアによるファイルの暗号化を防ぐことができる。
(Process termination)
When the program of the present invention determines that the process to be monitored is ransomware, the process is forcibly terminated. The process is forcibly terminated in the hooked function. Generally, this can be realized by using the ExitProcess function, the Exit function, or the like, but any instruction that can terminate the process may be used. As a result, file encryption by ransomware can be prevented.

なお、直ちにプロセスを終了させることで問題となる可能性のある環境においては、ユーザーに通知し終了の判断を仰ぐといった対応も可能である。   It should be noted that in an environment where there is a possibility of causing a problem by terminating the process immediately, it is possible to respond to the user and ask for the termination.

[発明の原理(その3)]
本発明の原理(その3)について説明する。
[Principle of the invention (part 3)]
The principle (part 3) of the present invention will be described.

本願発明者等が確認しているランサムウェアの暗号化処理では、対象ファイルの内容全体が暗号化され、ヘッダ情報、データ部全てが書き換えられている。上述した発明の原理(その1)及び発明の原理(その2)では、ランサムウェアが対象ファイルの内容全体を書き換えることを前提として、対象ファイルの少なくともヘッダ情報が書き換えられたか否かを判断して、ランサムウェアを検知している。   In the ransomware encryption process confirmed by the inventors of the present application, the entire contents of the target file are encrypted, and the header information and the data part are all rewritten. In the principle of the invention (part 1) and the principle of the invention (part 2), on the assumption that the ransomware rewrites the entire contents of the target file, it is determined whether or not at least the header information of the target file has been rewritten. , Ransomware is detected.

しかしながら、今後、発明の原理(その1)及び発明の原理(その2)に基づくランサムウェア検知を逃れるために、ファイルのヘッダ情報は書き換えずに、データ部のみを暗号化するランサムウェアが出現する可能性が考えられる。   However, in the future, ransomware that encrypts only the data part without rewriting the file header information will appear in order to escape the ransomware detection based on the principle of the invention (part 1) and the principle of the invention (part 2). There is a possibility.

このようなランサムウェアの暗号化処理においては、暗号化後もファイルフォーマットが成立し、ファイルを正規のアプリケーションで開くことができるが、データ内容が確認することができず、ランサムウェアにより暗号化が達成されることとなる。   In such ransomware encryption processing, the file format is established even after encryption, and the file can be opened with a legitimate application, but the data content cannot be confirmed, and encryption is performed by the ransomware. Will be achieved.

発明の原理(その1)及び発明の原理(その2)に基づく実施形態では、このようなランサムウェアを検知することが困難である。本発明の原理(その3)は、別の手法により、ファイルのヘッダ情報は書き換えずに、データ部のみを暗号化するランサムウェアを検知しようとするものである。   In the embodiment based on the principle (part 1) of the invention and the principle (part 2) of the invention, it is difficult to detect such ransomware. The principle (part 3) of the present invention is to detect ransomware that encrypts only the data portion without rewriting the header information of the file by another method.

まず、ファイルのデータ部の内容は正規のアプリケーションによって常に書き換えられるものであるため、データ部が書き換えられたか否かのみによりランサムウェアを検知することはできない。   First, since the contents of the data portion of the file are always rewritten by a legitimate application, ransomware cannot be detected only by whether or not the data portion has been rewritten.

多くの環境では、特定のファイルを扱うアプリケーションはオペレーションシステム(OS)によって関連付けがなされている。例えば、拡張子が「.doc」「.docx」のファイルを開く際は、自動的に規定のアプリケーションであるMicrosoft社のWordアプリケーションにより開かれる設定となっている。   In many environments, an application that handles a specific file is associated with the operation system (OS). For example, when a file with an extension of “.doc” or “.docx” is opened, it is automatically set to be opened by a Microsoft Word application that is a prescribed application.

したがって、拡張子が「.doc」「.docx」に関連付けされていないプログラムが、拡張子「.doc」「.docx」のファイルのデータ部のみを変更するという処理は、当該プログラムがランサムウェアである可能性があると考えることができる。   Therefore, when a program that is not associated with the extension ".doc" or ".docx" changes only the data part of a file with the extension ".doc" or ".docx", the program is ransomware. It can be considered that there is a possibility.

本発明の原理(その3)は、監視対象プログラムがファイルにアクセスする際に、その監視対象プログラムが当該ファイルの拡張子に関連付けされていないプログラムであって、当該ファイルのデータ部のみを変化させたか否かを判断し、それに基づいてランサムウェアを検知する。   The principle (No. 3) of the present invention is that when a monitored program accesses a file, the monitored program is a program that is not associated with the extension of the file, and only the data portion of the file is changed. Ransomware is detected based on the determination.

当該ファイルのデータ部のみを変化させたことの検知には、データ部の変化を検知するがヘッダ情報の変化は検知しない場合を含み、データ部の変化を検知し、かつヘッダ情報が変化していないことを検知する場合を含む。   The detection that only the data part of the file has been changed includes the case where the change of the data part is detected but the change of the header information is not detected, the change of the data part is detected and the header information is changed. This includes the case where it is detected that there is nothing.

なお、データ部のみの暗号化への対策においては、データ部の「変化」よりも、書き込み対象ファイルの拡張子に関連付けされていないアプリケーションがデータ部に「書き込む可能性がある」ことをランサムウェア検知の優先事項としてもよい。   It should be noted that in the countermeasures against the encryption of only the data part, the ransomware indicates that the application that is not associated with the extension of the file to be written may “write” to the data part rather than the “change” of the data part. It may be a priority for detection.

ユーザーの設定やカスタマイズされた環境によっては、ファイルの拡張子に関連付けられた規定のアプリケーション以外のプログラムにより開いてデータ部を編集することがある。例えば、Microsoft Word以外のプログラムで、拡張子が「.doc」「.docx」のファイルのデータ部を編集することがある。   Depending on the user's settings and the customized environment, the data part may be opened and edited by a program other than the prescribed application associated with the file extension. For example, the data part of a file with extensions “.doc” and “.docx” may be edited by a program other than Microsoft Word.

これに対しては、ユーザーに当該プログラムが「意図したプログラムであるか否か」を問う画面を表示して、ユーザーの回答に応じて、ランサムウェアではないことを示すホワイトプログラムリストに追加する。これにより、それ以降は、繰り返し検知されることがなくなる。   In response to this, a screen for asking the user whether or not the program is the intended program is displayed and added to the white program list indicating that the program is not ransomware according to the user's answer. Thereby, it will not be repeatedly detected after that.

[第4実施形態]
本発明の第4実施形態によるプログラム、情報処理装置及び情報処理方法について図76乃至図82を用いて説明する。
[Fourth Embodiment]
A program, an information processing apparatus, and an information processing method according to the fourth embodiment of the present invention will be described with reference to FIGS.

本実施形態では、監視対象プログラムがファイルにアクセスする際に、まず、監視対象プログラムが当該ファイルの拡張子に関連付けされたプログラムであるか否かを判断する。そして、関連付けされたプログラムでないと判断された場合には、監視対象プログラムが当該ファイルのデータ部のみを変化させたか否かを判断する。当該ファイルのデータ部のみを変化させたと判断された場合には、監視対象プログラムをランサムウェアの疑いありと判断する。   In this embodiment, when a monitoring target program accesses a file, it is first determined whether or not the monitoring target program is a program associated with the extension of the file. When it is determined that the program is not associated, it is determined whether or not the monitoring target program has changed only the data portion of the file. If it is determined that only the data portion of the file has been changed, the monitoring target program is determined to be suspected of ransomware.

(監視対象プログラムがファイルの拡張子に関連付けされているか否かの検出)
本発明プログラムが、監視対象プロセスからのAPIをフックするときには、アクセスするアプリケーション名と、アクセス対象のファイル名(拡張子)を把握している。ファイルの読み書きの際に、アクセス対象ファイルの拡張子を切り出し、その拡張子から関連付けされたアプリケーションのパスを取得し、監視対象プロセスのアプリケーションのパスと比較し、これらパスが同じであれば、関連付けされたアプリケーションと判断する。
(Detection of whether the monitored program is associated with the file extension)
When the program of the present invention hooks an API from a process to be monitored, the name of the application to be accessed and the file name (extension) to be accessed are known. When reading and writing files, extract the extension of the file to be accessed, obtain the path of the associated application from the extension, compare it with the path of the application of the monitored process, and if these paths are the same, associate It is determined that the application has been deleted.

拡張子に関連付けられたアプリケーションのリストは、オペレーティングシステム(Windows OS)では、ハードディスク上にレジストリ値として保管されている。したがって、HKEY_CLASSES_ROOT配下にあるレジストリ値を直接読み取ることで、関連付けされたアプリケーションを取得することができる。   The list of applications associated with the extension is stored as a registry value on the hard disk in the operating system (Windows OS). Therefore, the associated application can be obtained by directly reading the registry value under HKEY_CLASSES_ROOT.

また、拡張子に関連付けられた単一のアプリケーションだけでなく、当該ファイルを右クリックした際に表示される「プログラムから選択」に表示されるアプリケーションの候補の一覧を取得することもできる。   In addition to a single application associated with an extension, a list of application candidates displayed in “Select from program” displayed when the file is right-clicked can be acquired.

ハードディスク上のレジストリ領域から「拡張子に関連付けられたアプリケーション」を取得する流れの具体例を図76に示す。   FIG. 76 shows a specific example of a flow for acquiring “an application associated with an extension” from the registry area on the hard disk.

図76に示すように、レジストリ「HKCR\.docx」からCLSIDと呼ばれる識別子「{84F66100-FF7C-4fb4-B0C0-02CD7FB668FE}」を取得し、この識別子「{84F66100-FF7C-4fb4-B0C0-02CD7FB668FE}」から、拡張子「.docx」に関連付けられたプログラムのパス「C:\Program Files\Microsoft Office\Office15\WINWORD.EXE」を取得する。   As shown in FIG. 76, an identifier “{84F66100-FF7C-4fb4-B0C0-02CD7FB668FE}” called CLSID is acquired from the registry “HKCR \ .docx”, and this identifier “{84F66100-FF7C-4fb4-B0C0-02CD7FB668FE}” is acquired. ”To obtain the program path“ C: \ Program Files \ Microsoft Office \ Office15 \ WINWORD.EXE ”associated with the extension“ .docx ”.

より単純な方法として、オペレーティングシステム(Windows OS)のAssocQueryString APIの引数に「.docx」等の拡張子を指定して呼び出すことで、「C:\Program Files\Microsoft Office\Office15\WINWORD.EXE」のようにアプリケーションの場所を取得できる。   As a simpler method, you can call "C: \ Program Files \ Microsoft Office \ Office15 \ WINWORD.EXE" by calling the operating system (Windows OS) AssocQueryString API with an extension such as ".docx". You can get the location of the application as follows.

例えば、HookCreateFileMapping関数において、ファイルを暗号化しようとしているアプリケーションが当該ファイルの拡張子に関連付けされたアプリケーションであるかどうかを判断する流れを図77に示す。   For example, in the HookCreateFileMapping function, FIG. 77 shows a flow for determining whether or not an application that is to encrypt a file is an application associated with the extension of the file.

関連付けられたアプリケーションを取得するには次のようにする。   To get the associated application:

まず、HookCreateFileMapping関数からファイルのハンドル「0x6C」を取得する。   First, the file handle “0x6C” is acquired from the HookCreateFileMapping function.

次に、ファイルハンドルからGetFinalPathNameByHandle等を使用して、アクセス対象ファイルのファイルパス「C:\users\test\Desktop\test.doc」を取得する。   Next, the file path “C: \ users \ test \ Desktop \ test.doc” of the access target file is acquired from the file handle using GetFinalPathNameByHandle or the like.

次に、取得したファイルパス「C:\users\test\Desktop\test.doc」から拡張子「.doc」のみを切り出す。   Next, only the extension “.doc” is cut out from the acquired file path “C: \ users \ test \ Desktop \ test.doc”.

次に、AssocQueryStringを使用して、切り出された拡張子「.doc」に関連付けられたアプリケーション「C:\Program Files\Microsoft Office\Office15\WINWORD.EXE」を取得する。   Next, the application “C: \ Program Files \ Microsoft Office \ Office15 \ WINWORD.EXE” associated with the extracted extension “.doc” is obtained using AssocQueryString.

一方、監視対象のプロセスに対しては、GetModuleFileName等を使用して、自身のパス
「C:\Program Files\Microsoft Office\Office15\WINWORD.EXE」を取得する。
On the other hand, for the process to be monitored, GetModuleFileName or the like is used to acquire its own path “C: \ Program Files \ Microsoft Office \ Office15 \ WINWORD.EXE”.

そして、このようにして取得した拡張子に関連付けられたアプリケーションと、監視対象のプロセス自身のパスとを比較する。一致する場合には、拡張子に関連付けられたアプリケーションによるデータ変更であるから暗号化ではないと判断する。一致しない場合には、拡張子に関連付けられていないアプリケーションによるデータ変更であるから暗号化の可能性があると判断する。   Then, the application associated with the extension acquired in this way is compared with the path of the monitored process itself. If they match, it is determined that the data is changed by the application associated with the extension, so that it is not encrypted. If they do not match, it is determined that there is a possibility of encryption because the data is changed by an application not associated with the extension.

(ファイルのヘッダ部とデータ部)
本発明プログラムでは、書き込み対象の場所がヘッダ部であるか、データ部であるかの判断が必要である。そこで、ファイルのヘッダ部とデータ部の判断方法を説明する。
(Header and data part of the file)
In the program of the present invention, it is necessary to determine whether the place to be written is the header part or the data part. Therefore, a method for determining the header portion and the data portion of the file will be described.

ヘッダ部の位置やサイズはアプリケーション毎に定義され公開されている。基本的には公開されている各ファイルの形式にしたがう。本発明プログラムでは公開されている各ファイルの形式におけるヘッダ情報のうち、不変となる部分をそのファイル形式のヘッダ情報とする。   The position and size of the header part are defined and published for each application. Basically, it follows the format of each published file. In the program of the present invention, the invariant portion of the header information in each file format that has been made public is used as the header information of the file format.

例えば、図78(a)は、画像形式であるビットマップファイルの公開されているフォーマットの一部である。ヘッダ部には、ファイルヘッダ、情報ヘッダ、カラーテーブル等の情報が記録されている。データ部には、ピクセルデータ(画像データ)が記録されている。   For example, FIG. 78 (a) is a part of a published format of a bitmap file which is an image format. Information such as a file header, an information header, and a color table is recorded in the header portion. Pixel data (image data) is recorded in the data portion.

しかしながら、ヘッダ部のデータは全てが固定値ではない。例えば、図78(a)のヘッダ部において3バイト目(アドレス「00000002」)のデータ「F6 93 25 00」値は、当該ビットマップファイルのファイルサイズを示している。画像ファイルのファイルサイズが変化すれば、この部分のデータも変化する。   However, all data in the header part is not a fixed value. For example, the data “F6 93 25 00” value of the third byte (address “00000002”) in the header part of FIG. 78A indicates the file size of the bitmap file. If the file size of the image file changes, the data in this part also changes.

本発明では、ファイル種別が変化しない限り変化しない部分を「本発明のヘッダ部」とする。例えば、ビットマップファイルでは、図78(b)に示すように、ヘッダ部の先頭2バイト「42 4D」(文字列「BM」)を「本発明のヘッダ部」とし、その他の部分を[本発明のデータ部」とする。   In the present invention, a portion that does not change unless the file type changes is referred to as a “header portion of the present invention”. For example, in the bitmap file, as shown in FIG. 78 (b), the first two bytes “42 4D” (character string “BM”) of the header portion are set to “header portion of the present invention”, and the other portions are set to [Books]. The data portion of the invention ".

なお、ファイル種別が変化しない限り変化しない部分は、必ずしも連続している必要はない。不連続な変化していない部分を「本発明のヘッダ部」としてもよい。例えば、図78(b)では、3〜6バイトを除いた「42 4D xx xx xx xx 00 00 00 00」を「本発明のヘッダ部」としてもよい。「xx」は変化しうるバイトを示す。   The portions that do not change do not necessarily have to be continuous unless the file type changes. The discontinuous unchanging part may be referred to as the “header part of the present invention”. For example, in FIG. 78 (b), “42 4D xx xx xx xx 00 00 00 00” excluding 3 to 6 bytes may be used as the “header portion of the present invention”. “Xx” indicates a variable byte.

ファイル形式が公開されていない又はヘッダ部のサイズが公開されていない場合には、ファイルの先頭部分をヘッダ部、それ以外をデータ部としてもよい。この場合、先頭部分のサイズは任意であるが、一般的に数バイトから数十バイト程度を設定する。そして、ランサムウェアを検知しようとした結果、誤検知が多い場合にはサイズを調整できるようにする。   If the file format is not disclosed or the size of the header part is not disclosed, the head part of the file may be the header part and the other part may be the data part. In this case, the size of the head part is arbitrary, but generally several bytes to several tens of bytes are set. If there are many false detections as a result of trying to detect ransomware, the size can be adjusted.

(一般的なファイル操作とファイルマッピングによるファイル操作)
前述したように、ファイル操作として、一般的なファイル操作とファイルマッピングによるファイル操作が可能である。
(General file operations and file operations by file mapping)
As described above, general file operations and file operations based on file mapping are possible as file operations.

実ファイルはハードディスクに記憶されている。一般的なファイル操作におけるファイルの読み書きの処理では、その都度、メモリにバッファ(図示せず)を用意してファイルを読み込み、編集したデータをファイルに書き戻す、といった一連の処理を行う。   Real files are stored on the hard disk. In each file read / write process in a general file operation, a series of processes such as preparing a buffer (not shown) in the memory, reading the file, and writing the edited data back to the file are performed.

ファイルマッピングによるファイル操作では、ハードディスク22に記憶されている実ファイルの全体を、メモリに、仮想ファイル(ファイルマッピングオブジェクト)として展開する。ファイルマッピングによるファイル操作において、ファイルの内容を書き換える際には、その都度、メモリに展開された仮想ファイルに対して内容の書き換えが行われる。ファイルの内容の変更結果は一連の処理の最後の段階でハードディスクの実ファイルへ反映させる。   In the file operation by file mapping, the entire real file stored in the hard disk 22 is expanded as a virtual file (file mapping object) in the memory. In the file operation by file mapping, each time the contents of the file are rewritten, the contents are rewritten with respect to the virtual file expanded in the memory. The change result of the file contents is reflected in the actual file on the hard disk at the final stage of the series of processing.

発明の原理(その3)は、一般的なファイル操作にも、ファイルマッピングによるファイル操作にも適用することができる。   The principle (part 3) of the invention can be applied to general file operations and file operations by file mapping.

(ファイルマッピングによるファイル操作)
発明の原理(その3)を、ファイルマッピングによるファイル操作に適用した場合について説明する。
(File operation by file mapping)
A case where the principle (part 3) of the invention is applied to file operation by file mapping will be described.

本発明プログラムは、第2実施形態と同様の3つの機能を有する。   The program of the present invention has the same three functions as in the second embodiment.

第1の機能は、現在動作中のプログラムや、後ほど起動するプログラムである監視対象プロセスが使用するWindows APIをフックする機能である。   The first function is a function for hooking a Windows API used by a monitoring target process that is a program that is currently operating or a program that is activated later.

第2の機能は、フックしたWindows APIにより、監視対象プロセスの挙動を記録する機能である。   The second function is a function for recording the behavior of the process to be monitored by the hooked Windows API.

第3の機能は、第2の機能により記録した挙動によりランサムウェアであるかどうかを判断する機能である。   The third function is a function for determining whether or not the ransomware is based on the behavior recorded by the second function.

(Hook関数及びそれに追加する機能)
本実施形態におけるHook関数及びそれに追加する機能を説明する。
(Hook function and additional functions)
The Hook function and functions added to it in this embodiment will be described.

本実施形態におけるフック対象APIは、第3実施形態と同様、次の通りである。   The hook target API in the present embodiment is as follows, as in the third embodiment.

CreateFileMapping
MapViewOfFile/MapViewOfFileEx
UnmapViewOfFile/UnmapViewOfFileEx
FlushViewOfFile
CloseHandle
本実施形態では、上記のフック対象APIをフックするHook関数に次のような機能を追加する。
(a)自身のプロセスが既定のプログラムであるかを確認する機能。
(b)HookCreateFileMapping関数の「暗号化対象ファイルの暗号化前のヘッダデータ」をメモリマップドリストに登録する際に、併せて「暗号化対象ファイルの暗号化前のデータ部のハッシュ値」を取得し登録する機能。
(c)HookMapViewOfFile関数、HookMapViewOfFileEx関数、HookUnmapViewOfFile関数、HookUnmapViewOfFileEx関数、FlushViewOfFile関数、CloseHandle関数において、「暗号化後(フック関数呼び出し時点)のデータ部のハッシュ値」を取得する機能。
(d)自身のプロセスが既定のプログラムでない場合、かつ取得した暗号化前後のデータ部のハッシュ値を比較し異なる場合に検知する機能。
CreateFileMapping
MapViewOfFile / MapViewOfFileEx
UnmapViewOfFile / UnmapViewOfFileEx
FlushViewOfFile
CloseHandle
In the present embodiment, the following function is added to the hook function for hooking the hook target API.
(A) A function for confirming whether its own process is a predetermined program.
(B) When registering “header data before encryption of encryption target file” of the HookCreateFileMapping function in the memory-mapped list, also obtain “hash value of data part before encryption of encryption target file” The function to register.
(C) A function of acquiring “the hash value of the data part after encryption (when the hook function is called)” in the HookMapViewOfFile function, HookMapViewOfFileEx function, HookUnmapViewOfFile function, HookUnmapViewOfFileEx function, FlushViewOfFile function, and CloseHandle function.
(D) A function to detect when the process is not a default program and when the obtained hash values of the data part before and after encryption are different from each other.

(第3の機能のまとめ)
明示的にマップのクローズ・反映処理が行われる場合の動作について、図79を用いて時系列に沿って説明する。
(Summary of the third function)
The operation when the map close / reflect processing is explicitly performed will be described in time series with reference to FIG.

まず、ステップ1では、HookCreateFileMappingにより、メモリマップドリストに新しい行が追加される。新しい行には、暗号化対象ファイルのハンドル、暗号化対象ファイルパス、ファイルマッピングオブジェクトのハンドル、暗号化対象ファイルの暗号化前のヘッダデータ、暗号化前のデータ部のハッシュ値が記入される。   First, in step 1, a new line is added to the memory-mapped list by HookCreateFileMapping. In the new row, the handle of the encryption target file, the encryption target file path, the handle of the file mapping object, the header data before encryption of the encryption target file, and the hash value of the data part before encryption are entered.

図79では、暗号化対象ファイルのハンドルが「0xABC」であり、暗号化対象ファイルパスが「C:\test.pdf」であり、ファイルマッピングオブジェクトのハンドルが「0xABCD」であり、暗号化対象ファイルの暗号化前のヘッダデータが「25 50 44 46 2D」であり、暗号化前のデータ部のハッシュ値が「4669.....CBD7」である。   In FIG. 79, the handle of the encryption target file is “0xABC”, the encryption target file path is “C: \ test.pdf”, the handle of the file mapping object is “0xABCD”, and the encryption target file is The header data before encryption is “25 50 44 46 2D”, and the hash value of the data part before encryption is “4669... CBD7”.

次に、ステップ2では、HookMapViewOfFile/HookMapViewOfFileExにより、メモリマップドリストに、マップの開始アドレスが記入される。   Next, in step 2, the start address of the map is entered in the memory mapped list by HookMapViewOfFile / HookMapViewOfFileEx.

図79では、呼び出し時のパラメータに指定されたファイルマッピングオブジェクトハンドル「0xABCD」がメモリマップドリスト内に存在したので、その行にマップ開始アドレス「0x201000」が追記される。   In FIG. 79, since the file mapping object handle “0xABCD” specified as the parameter at the time of calling exists in the memory mapped list, the map start address “0x201000” is added to the line.

次に、ステップ3では、監視対象プロセスがランサムウェアであるとマップドメモリのデータが暗号化される。   Next, in step 3, if the monitored process is ransomware, the data in the mapped memory is encrypted.

次に、ステップ4では、HookUnmapViewOfFile/HookUnmapViewOfFileEx、又は、HookFlushViewOfFileにより、まず、UnmapViewOfFile/UnmapViewOfFileEx、又は、HookFlushViewOfFileの呼び出し時のパラメータに指定されたアドレスとマッチするものを「マップの開始アドレス」列から検索する(ステップ4−3)。   Next, in step 4, by using HookUnmapViewOfFile / HookUnmapViewOfFileEx or HookFlushViewOfFile, first, a search is made from the “map start address” column that matches the address specified in the parameter when calling UnmapViewOfFile / UnmapViewOfFileEx or HookFlushViewOfFile. (Step 4-3).

次に、マッチする行があれば、その行のデータ部(暗号化前)のハッシュ値と、マップドメモリから取得した現在のデータ部(暗号化後)のハッシュ値を計算する。続いて、暗号化前のデータ部のハッシュ値と暗号化後のデータ部のハッシュ値とを比較して、差異があれば暗号化されたと判断する。そのようにして、監視対象プロセスがランサムウェアであるか否かを判断する(ステップ4−2)。   Next, if there is a matching row, the hash value of the data portion (before encryption) of the row and the hash value of the current data portion (after encryption) obtained from the mapped memory are calculated. Subsequently, the hash value of the data part before encryption and the hash value of the data part after encryption are compared, and if there is a difference, it is determined that the data part is encrypted. In this way, it is determined whether or not the process to be monitored is ransomware (step 4-2).

図79では、呼び出し時のパラメータ「0xABCD」から、暗号化前のデータ部のハッシュ値「4669.....CBD7」を取得し、呼び出し時のパラメータ「0xABCD」により指定されたアドレス「0x201000」から現在の暗号化後のデータ部のハッシュ値「B66A1.....40AB」を取得する。これらを比較すると差異があるので、監視対象プロセスはランサムウェアであると判断する。   In FIG. 79, the hash value “4669 .... CBD7” of the data part before encryption is acquired from the parameter “0xABCD” at the time of calling, and the address “0x201000” specified by the parameter “0xABCD” at the time of calling is acquired. To obtain the hash value “B66A1 ..... 40AB” of the current encrypted data part. Since there is a difference when these are compared, it is determined that the process to be monitored is ransomware.

データ部のハッシュ値が何らかの理由で正しく取得できない場合には、(第3の機能(その2):明示的にマップのクローズ・反映処理が行われない場合)と同様に、2つ目のファイル暗号化処理の初期段階(MapViewOfFile/Exの呼び出しタイミング)で検知を試みる。   If the hash value of the data part cannot be acquired correctly for some reason, the second file is the same as (third function (part 2): when the map is not explicitly closed / reflected). Attempt detection at the initial stage of encryption processing (MapViewOfFile / Ex call timing).

(ランサムウェアの検知処理)
ランサムウェアの検知処理の詳細について、図80のフローチャートを用いて説明する。
(Ransomware detection processing)
Details of the ransomware detection process will be described with reference to the flowchart of FIG.

HookUnmapViewOfFile/HookUnmapViewOfFileEx、又は、HookFlushViewOfFileを用いた場合のランサムウェアの検知処理である。   This is ransomware detection processing when HookUnmapViewOfFile / HookUnmapViewOfFileEx or HookFlushViewOfFile is used.

まず、UnmapViewOfFile/UnmapViewOfFileEx、又は、HookFlushViewOfFileの呼び出し時のパラメータ「lpBaseAddress」に指定されたアドレスがメモリマップドリストに存在するか否かを判断する(ステップS41)。   First, it is determined whether or not the address specified in the parameter “lpBaseAddress” at the time of calling UnmapViewOfFile / UnmapViewOfFileEx or HookFlushViewOfFile exists in the memory mapped list (step S41).

そのアドレスがメモリマップドリストに存在しなければ、直ちにランサムウェアの検知処理を終了する。   If the address does not exist in the memory mapped list, the ransomware detection process is immediately terminated.

そのアドレスがメモリマップドリストに存在すると、その行のヘッダデータ(暗号化前)を取得する(ステップS42)。これは、前もってハードディスク22の実ファイルから取得したデータである。   If the address exists in the memory mapped list, the header data (before encryption) of the row is acquired (step S42). This is data acquired from an actual file on the hard disk 22 in advance.

次に、呼び出し時のパラメータ「lpBaseAddress」により指定されたアドレスから現在のヘッダデータ(暗号化後)を取得する(ステップS43)。これは、現在のメモリ23の仮想ファイルから取得したデータである。   Next, the current header data (after encryption) is acquired from the address specified by the parameter “lpBaseAddress” at the time of calling (step S43). This is data acquired from the virtual file in the current memory 23.

次に、取得した暗号化前のヘッダデータと暗号化後のヘッダデータとを比較して、相違するか否かを判断する(ステップS44)。   Next, the obtained header data before encryption is compared with the header data after encryption to determine whether or not they are different (step S44).

暗号化前のヘッダデータと暗号化後のヘッダデータが相違すれば、監視対象プロセスをランサムウェア又はその疑いとして検知する(ステップS45)。   If the header data before encryption is different from the header data after encryption, the process to be monitored is detected as ransomware or its suspicion (step S45).

暗号化前のヘッダデータと暗号化後のヘッダデータが相違しなければ、監視対象プログラム自身が対象ファイルの拡張子に関連付けられたアプリケーションである否かを判断する(ステップS46)。   If there is no difference between the header data before encryption and the header data after encryption, it is determined whether the monitoring target program itself is an application associated with the extension of the target file (step S46).

監視対象プログラムが対象ファイルの拡張子に関連付けられたアプリケーションであれば、直ちにランサムウェアの検知処理を終了する。   If the monitored program is an application associated with the extension of the target file, the ransomware detection process is immediately terminated.

監視対象プログラムが対象ファイルの拡張子に関連付けられたアプリケーションでなければ、該当した行の暗号化前のデータ部のハッシュ値を取得する(ステップS47)。これは、前もってハードディスク22の実ファイルから取得したデータである。   If the monitoring target program is not an application associated with the extension of the target file, the hash value of the data part before encryption of the corresponding line is acquired (step S47). This is data acquired from an actual file on the hard disk 22 in advance.

次に、lpBaseAddress(マップドメモリ)から現在のデータ部を取得し、そのハッシュ値を計算する(ステップS48)。これは、現在のメモリ23の仮想ファイルから取得したデータである。   Next, the current data part is acquired from lpBaseAddress (mapped memory), and the hash value is calculated (step S48). This is data acquired from the virtual file in the current memory 23.

次に、暗号化前のデータ部のハッシュ値と現在のデータ部のハッシュ値とを比較して、相違するか否かを判断する(ステップS49)。   Next, the hash value of the data part before encryption is compared with the hash value of the current data part to determine whether or not they are different (step S49).

暗号化前のデータ部のハッシュ値と暗号化後のデータ部のハッシュ値が相違すれば、監視対象プロセスをランサムウェア又はその疑いとして検知する(ステップS45)。   If the hash value of the data part before encryption is different from the hash value of the data part after encryption, the process to be monitored is detected as ransomware or its suspicion (step S45).

暗号化前のデータ部のハッシュ値と暗号化後のデータ部のハッシュ値が相違しなければ、ランサムウェアの検知処理を終了する。   If the hash value of the data part before encryption is not different from the hash value of the data part after encryption, the ransomware detection process is terminated.

(一般的なファイル操作)
発明の原理(その3)を、一般的なファイル操作に適用した場合について説明する。
(General file operations)
The case where the principle (part 3) of the invention is applied to general file operations will be described.

一般的なファイル操作におけるファイルの読み書きの処理では、その都度、メモリにバッファ(図示せず)を用意してハードディスク上の実ファイルを読み込み、編集したデータをファイルに書き戻す、といった一連の処理を行う。   In each file read / write process in general file operations, a series of processes such as preparing a buffer (not shown) in memory, reading the actual file on the hard disk, and writing the edited data back to the file are performed. Do.

一般的なファイル操作の場合には、監視対象プログラムが、対象ファイルの拡張子に関連付けされていないアプリケーションであって、データ部に対しWriteFileが呼び出されるか否かを検知する。   In the case of a general file operation, the monitoring target program is an application that is not associated with the extension of the target file, and detects whether WriteFile is called for the data portion.

本実施形態では、WriteFileをフックするHookWriteFile関数に以下の処理を追加する。
(a)自身のプロセスが既定のプログラムであるかを確認する機能。
(b)自身のプロセスが既定のプログラムでない場合に検知する機能。
In the present embodiment, the following processing is added to the HookWriteFile function that hooks WriteFile.
(A) A function for confirming whether its own process is a predetermined program.
(B) A function to detect when its own process is not a default program.

ランサムウェアの検知処理の詳細について、図81のフローチャートを用いて説明する。   Details of the ransomware detection processing will be described with reference to the flowchart of FIG.

HookWriteFile関数を用いた場合のランサムウェアの検知処理である。   This is ransomware detection processing when the HookWriteFile function is used.

まず、書き込み対象ファイルが過去のReadFileの記録に存在するか否かを判断する(ステップS51)。過去のReadFileの記録とは、図22(b)に示すようなReadFileの通知記録データである。ここには、ReadFileのプロセスID、ファイルパスが順次記録されている。   First, it is determined whether or not the write target file exists in the past ReadFile record (step S51). The past ReadFile record is the ReadFile notification record data as shown in FIG. Here, the process ID of ReadFile and the file path are sequentially recorded.

書き込み対象ファイルが過去のReadFileの記録に存在しなければ、直ちにランサムウェアの検知処理を終了する。   If the file to be written does not exist in the past ReadFile record, the ransomware detection process is immediately terminated.

書き込み対象ファイルが過去のReadFileの記録に存在すると、書き込み対象位置がヘッダの範囲内であるか否かを判断する(ステップS52)。   If the write target file exists in the past ReadFile record, it is determined whether or not the write target position is within the header range (step S52).

書き込み対象位置がヘッダの範囲内であると、その行のヘッダデータ(暗号化前)を取得する(ステップS53)。これは、前もってハードディスク22の実ファイルから取得したデータである。   When the write target position is within the header range, the header data (before encryption) of the row is acquired (step S53). This is data acquired from an actual file on the hard disk 22 in advance.

次に、書き込みデータの内容から現在のヘッダデータ(暗号化後)を取得する(ステップS54)。これは、現在のメモリ23の仮想ファイルから取得したデータである。   Next, the current header data (after encryption) is acquired from the contents of the write data (step S54). This is data acquired from the virtual file in the current memory 23.

次に、取得した暗号化前のヘッダデータと暗号化後のヘッダデータとを比較して、相違するか否かを判断する(ステップS55)。   Next, the acquired header data before encryption and the header data after encryption are compared to determine whether or not they are different (step S55).

暗号化前のヘッダデータと暗号化後のヘッダデータが相違すれば、監視対象プロセスをランサムウェア又はその疑いとして検知する(ステップS56)。   If the header data before encryption is different from the header data after encryption, the process to be monitored is detected as ransomware or its suspicion (step S56).

暗号化前のヘッダデータと暗号化後のヘッダデータが相違しなければ、直ちにランサムウェアの検知処理を終了する。   If there is no difference between the header data before encryption and the header data after encryption, the ransomware detection process is immediately terminated.

ステップS52において、書き込み対象位置がヘッダの範囲内でないと判断されると、監視対象プログラム自身が対象ファイルの拡張子に関連付けられたアプリケーションである否かを判断する(ステップS57)。   If it is determined in step S52 that the write target position is not within the header range, it is determined whether the monitoring target program itself is an application associated with the extension of the target file (step S57).

監視対象プログラムが対象ファイルの拡張子に関連付けられたアプリケーションであれば、直ちにランサムウェアの検知処理を終了する。   If the monitored program is an application associated with the extension of the target file, the ransomware detection process is immediately terminated.

監視対象プログラムが対象ファイルの拡張子に関連付けられたアプリケーションでなければ、書き込み前のデータ部(書き込み対象箇所のデータ)を取得する(ステップS58)。これは、現在のハードディスク22の実ファイルから取得するデータである。   If the monitoring target program is not an application associated with the extension of the target file, the data portion before writing (data of the writing target portion) is acquired (step S58). This is data acquired from the actual file on the current hard disk 22.

次に、書き込み対象データを取得する(ステップS59)。これは、現在のメモリ23のバッファから取得するデータである。   Next, write target data is acquired (step S59). This is data acquired from the buffer of the current memory 23.

次に、書き込み前後のデータの内容が相違するか否かを判断する(ステップS60)。すなわち、ステップS58で取得した書き込み前の書き込み対象箇所のデータと、ステップS59で取得した書き込み対象データとを比較して、相違するか否かを判断する(ステップS60)。   Next, it is determined whether or not the contents of data before and after writing are different (step S60). That is, the data of the write target part before writing acquired in step S58 and the write target data acquired in step S59 are compared to determine whether or not they are different (step S60).

書き込み前後のデータの内容が相違すれば、監視対象プロセスをランサムウェア又はその疑いとして検知する(ステップS56)。   If the contents of the data before and after writing are different, the process to be monitored is detected as ransomware or its suspicion (step S56).

書き込み前後のデータの内容が相違しなければ、ランサムウェアの検知処理を終了する。   If there is no difference between the data contents before and after writing, the ransomware detection process is terminated.

上記実施形態では、ファイルへの書き込み命令(WriteFile)によるヘッダデータの変更又はデータ部の書き込み前後のデータの変更を検知したが、ヘッダデータの変更やデータ部のデータの変更以外の他のファイル構造の不適切な状態への変更を検知してもよい。   In the above embodiment, the change of the header data by the write command to the file (WriteFile) or the change of the data before and after the writing of the data part is detected, but other file structures other than the change of the header data and the data part of the data part are detected. A change to an inappropriate state may be detected.

(一般的なファイル操作の変形実施形態)
発明の原理(その3)を、一般的なファイル操作に適用した場合の変形実施形態について説明する。
(Modified embodiment of general file operation)
A modified embodiment in which the principle (part 3) of the invention is applied to general file operations will be described.

第4実施形態における上記説明では、監視対象プログラムが対象ファイルの拡張子に関連付けられたアプリケーションでないことを検知し、かつ、WriteFileによる書き込み前後のデータが相違することを検知した場合に、監視対象プロセスをランサムウェア又はその疑いとして検知している。   In the above description of the fourth embodiment, when it is detected that the monitoring target program is not an application associated with the extension of the target file and it is detected that the data before and after writing by WriteFile is different, the monitoring target process Is detected as ransomware or its suspicion.

しかしながら、WriteFileの呼び出し自体が、監視対象プログラムによる書き込みを行う意思を明確に示していると言える。WriteFileによる書き込み前後のデータの相違を検知しなくとも、監視対象プロセスをランサムウェア又はその疑いとして検知してもよい。   However, it can be said that the call to WriteFile clearly shows the intention to write by the monitored program. Even if the difference between data before and after writing by WriteFile is not detected, the process to be monitored may be detected as ransomware or its suspicion.

このようなランサムウェアの検知処理の詳細について、図82のフローチャートを用いて説明する。   Details of such ransomware detection processing will be described with reference to the flowchart of FIG.

HookWriteFile関数を用いた場合のランサムウェアの検知処理である。   This is ransomware detection processing when the HookWriteFile function is used.

まず、書き込み対象ファイルが過去のReadFileの記録に存在するか否かを判断する(ステップS71)。過去のReadFileの記録とは、図22(b)に示すようなReadFileの通知記録データである。ここには、ReadFileのプロセスID、ファイルパスが順次記録されている。   First, it is determined whether or not the write target file exists in the past ReadFile record (step S71). The past ReadFile record is the ReadFile notification record data as shown in FIG. Here, the process ID of ReadFile and the file path are sequentially recorded.

書き込み対象ファイルが過去のReadFileの記録に存在しなければ、直ちにランサムウェアの検知処理を終了する。   If the file to be written does not exist in the past ReadFile record, the ransomware detection process is immediately terminated.

書き込み対象ファイルが過去のReadFileの記録に存在すると、書き込み対象位置がヘッダの範囲内であるか否かを判断する(ステップS72)。   If the write target file exists in the past ReadFile record, it is determined whether or not the write target position is within the header range (step S72).

書き込み対象位置がヘッダの範囲内であると、その行のヘッダデータ(暗号化前)を取得する(ステップS73)。これは、前もってハードディスク22の実ファイルから取得したデータである。   If the write target position is within the header range, the header data (before encryption) of that line is acquired (step S73). This is data acquired from an actual file on the hard disk 22 in advance.

次に、書き込みデータの内容から現在のヘッダデータ(暗号化後)を取得する(ステップS74)。これは、現在のメモリ23の仮想ファイルから取得したデータである。   Next, the current header data (after encryption) is acquired from the contents of the write data (step S74). This is data acquired from the virtual file in the current memory 23.

次に、取得した暗号化前のヘッダデータと暗号化後のヘッダデータとを比較して、相違するか否かを判断する(ステップS75)。   Next, the acquired header data before encryption is compared with the header data after encryption to determine whether or not they are different (step S75).

暗号化前のヘッダデータと暗号化後のヘッダデータが相違すれば、監視対象プロセスをランサムウェア又はその疑いとして検知する(ステップS76)。   If the header data before encryption is different from the header data after encryption, the process to be monitored is detected as ransomware or its suspicion (step S76).

暗号化前のヘッダデータと暗号化後のヘッダデータが相違しなければ、直ちにランサムウェアの検知処理を終了する。   If there is no difference between the header data before encryption and the header data after encryption, the ransomware detection process is immediately terminated.

ステップS72において、書き込み対象位置がヘッダの範囲内でないと判断されると、監視対象プログラム自身が対象ファイルの拡張子に関連付けられたアプリケーションである否かを判断する(ステップS77)。   If it is determined in step S72 that the write target position is not within the header range, it is determined whether the monitoring target program itself is an application associated with the extension of the target file (step S77).

監視対象プログラムが対象ファイルの拡張子に関連付けられたアプリケーションでなければ、監視対象プロセスをランサムウェア又はその疑いとして検知する(ステップS76)。   If the monitoring target program is not an application associated with the extension of the target file, the monitoring target process is detected as ransomware or its suspicion (step S76).

監視対象プログラムが対象ファイルの拡張子に関連付けられたアプリケーションであれば、ランサムウェアの検知処理を終了する。   If the monitoring target program is an application associated with the extension of the target file, the ransomware detection process is terminated.

上記変形実施形態では、ファイルへの書き込み命令(WriteFile)によるヘッダデータの変更を検知したが、ヘッドデータの変更を検知しなくともよい。また、ヘッダデータの変更やデータ部のデータの変更以外の他のファイル構造の不適切な状態への変更を検知してもよい。   In the modified embodiment, the change of the header data due to the write command to the file (WriteFile) is detected, but the change of the head data may not be detected. Further, a change to an inappropriate state of the file structure other than the change of the header data or the data of the data portion may be detected.

[変形実施形態]
本発明は上記実施形態に限らず種々の変形が可能である。
[Modified Embodiment]
The present invention is not limited to the above embodiment, and various modifications can be made.

例えば、上記実施形態では、マイクロソフトのオペレーティングシステムであるマイクロソフトウィンドウズ(Microsoft Windows)に本発明を適用したが、Android、BSD、iOS、Linux、OS X、Windows Phone、IBM z/OS(全て登録商標)等の他のオペレーティングシステムに本発明を適用してもよい。各オペレーティングシステムに対するランサムウェアによる攻撃を確実かつ有効に阻止することができる。   For example, in the above embodiment, the present invention is applied to Microsoft Windows, which is a Microsoft operating system, but Android, BSD, iOS, Linux, OS X, Windows Phone, IBM z / OS (all registered trademarks). The present invention may be applied to other operating systems. Ransomware attacks against each operating system can be reliably and effectively prevented.

また、上記実施形態では、実ファイルがハードディスクに記録されている場合に本発明を適用したが、ハードディスク以外のディスク、例えば、ソリッドステートドライブ(SSD)等の半導体素子メモリを用いたストレージや、携帯電話、スマートフォン等に用いられる半導体素子メモリを用いたストレージに、実ファイルが記録されている場合に本発明を適用してもよい。   In the above embodiment, the present invention is applied when an actual file is recorded on a hard disk. However, a storage other than a hard disk, for example, a storage using a semiconductor element memory such as a solid state drive (SSD), a portable The present invention may be applied when a real file is recorded in a storage using a semiconductor element memory used for a telephone, a smartphone, or the like.

10…情報処理装置
20…コンピューター(PC)
30…外部周辺装置
21…CPU
22…ハードディスク
23…メモリ
24…入出力装置
25…ディスプレイ
31…プリンター
32…外部記憶装置
10 ... Information processing device 20 ... Computer (PC)
30 ... External peripheral device 21 ... CPU
22 ... Hard disk 23 ... Memory 24 ... Input / output device 25 ... Display 31 ... Printer 32 ... External storage device

その次の図8(c)のキャプチャは、FindFirstFileWに、フォルダ"C:\Users\*"より下層のフォルダである"C:\Users\Public\*"が引数として渡されていることを示している。 The next capture in Fig. 8 (c) shows that "C: \ Users \ Publi c \ *", which is a folder lower than the folder "C: \ Users \ *", is passed to FindFirstFileW as an argument. Show.

更にその次の図8(d)のキャプチャは、FindFirstFileWに、フォルダ"C:\Users\Public\*"より下層のフォルダである"C:\Users\Public\Videos\*"が引数として渡されていることを示している。 In the next capture shown in Fig. 8 (d), "C: \ Users \ Public \ Videos \ *", which is a folder below the folder "C: \ Users \ Public \ *", is passed to FindFirstFileW as an argument. It has been shown.

図10は、ランサムウェアCryptoWallによりアクセスされる前と後のファイル"Wildlife.wmv"の状態を示す。図10(a)が、ランサムウェアCryptoWallによりアクセスされる前の状態であり、図10(b)が、ランサムウェアCryptoWallによりアクセスされた後の状態である。 FIG. 10 shows the state of the file “Wildlife.wmv” before and after being accessed by the ransomware CryptoWall. 10A shows a state before being accessed by the ransomware CryptoWall, and FIG. 10B shows a state after being accessed by the ransomware CryptoWall.

通知記録データの定期的クリアの間隔は任意であるが、長くともオペレーティングシステムの終了時または再起動時にはクリアすることが望ましい。クリア間隔をユーザーが設定できるようにしてもよい。 The interval for periodically clearing the notification record data is arbitrary, but it is desirable to clear it at the time of termination or restart of the operating system at the longest. The clear interval may be set by the user.

図22(a)左部の監視対象プロセスに組み込まれたHookWriteFileは、自身(監視対象プロセス)のプロセスIDと、WriteFileの対象ファイルパスに基づいて、図22(a)右部の本発明プログラムのプロセスに対して、ReadFileの通知記録データ中に、同一プロセスID、同一対象ファイルパスのReadFileの記録があるか否かを問い合わせる。図22(a)右部の本発明プログラムは、同一プロセスID、同一対象ファイルパスのReadFileの記録があるか否かをHookWriteFileに応答する。 The hook write file incorporated in the monitoring target process on the left side of FIG. 22 (a) is based on the process ID of itself (monitoring target process) and the target file path of WriteFile. The process is inquired of whether there is a record of ReadFile with the same process ID and the same target file path in ReadFile notification record data. FIG. 22 (a) The present invention program on the right side responds to HookWriteFile whether there is a record of ReadFile with the same process ID and the same target file path.

組み込まれたHookReadFileは、通常のReadFileの動作に加えて、(a)通知元API名、(b)自身のプロセスID、(c)ReadFile対象ファイルパスを、図26右側の本発明プロセスに通知する。 The incorporated HookReadFile notifies (a) the notification source API name, (b) its own process ID, and (c) the ReadFile target file path to the process of the present invention on the right side of FIG. 26 in addition to the normal ReadFile operation . .

図37の通知記録データには、第4〜6行に、FindNextFileのプロセスID"pid:1568"、ファイルパス"C:\Users\user\Documents\schedule.xls"の記録があり、第7〜9行、第13〜15行に、ReadFileのプロセスID"pid:1568"、ファイルパス"C:\Users\user\Documents\schedule.xls"の記録があり、第10〜12行、第16〜18行に、WriteFileのプロセスID"pid:1568"、ファイルパス"C:\Users\user\Documents\schedule.xls"の記録がある。 The notification record data in FIG. 37 includes records of FindNextFile process ID “pid: 1568” and file path “C: \ Users \ user \ Documents \ schedule.xls” in the fourth to sixth lines. Lines 9 and 13 to 15 have a record of ReadFile process ID “pid: 1568” and file path “C: \ Users \ user \ Documents \ schedule.xls”. Lines 10 to 12 and 16 to 16 On line 18 , there is a record of WriteFile process ID “pid: 1568” and file path “C: \ Users \ user \ Documents \ schedule.xls”.

図38は、複数ファイルに対する暗号化処理の検知を有効にするかの設定画面である。図38の設定画面の表現方法は一例であり、他の表現方法でもよい設定画面では、チェックボタンの後に「複数のファイルに対する暗号化処理を検知条件の入れる」を表示すると共に、「チェックを入れない場合は単一ファイルに対する暗号化処理も検知対象に含まれます」との注意書きを表示する。ユーザーがチェックボタンをチェックすることに検知条件を変更することができる。 FIG. 38 is a setting screen for enabling detection of encryption processing for a plurality of files. The expression method of the setting screen in FIG. 38 is an example, and other expression methods may be used . On the setting screen, after the check button, “Enter encryption processing for multiple files with detection conditions” is displayed, and “If you do not check, encryption processing for single files is also included in the detection target.” Displays a note of. The detection condition can be changed when the user checks the check button.

上記を判断するためには、例えば、HookReadFile、HookWriteFileが、それぞれ、本発明プログラムに対して通知する(a)通知元API名、(b)プロセスID、(c)ファイルパス、MoveFileが、本発明プログラムに対して通知する(a)通知元API名、(b)プロセスID、(c)第一引数のファイルパス、(d)第二引数のファイルパスを、通知記録データに記録しておき、その通知記録データに基づいて判断する。 To determine the above, for example, HookReadFile, HookWriteFile, respectively, notifies the present invention program (a) the reporting API name, (b) process ID, (c) file path, MoveFile is, the present invention (A) Notification source API name to be notified to the program, (b) Process ID, (c) File path of the first argument, (d) File path of the second argument are recorded in the notification record data, Judgment is made based on the notification record data.

警告画面では「以下のプロセスがテキストファイルの改変挙動を行っています。どう処理しますか。」と尋ね、「プロセス:AAAA.exe」、「該当挙動:ファイル内容の改変、ファイル名の改変、「d1g2r.vvv」に変更しようとしています」、「対象ファイル:C:\Users\test\Document\BBB.pdf」を示す。 The warning screen asks "The following process is changing the text file. How do you handle it?", "Process: AAAA.exe", "Applicable behavior: File content modification, file name modification, we are trying to change to "d1g2r.vvv""," Target file: shows the \ Users \ test \ Document \ BBB.pdf ": C.

本発明の第1実施形態は、主なランサムウェアの挙動を分析して共通部分を洗い出し、そこから確実に不正であると判断できる挙動を検知・防御するものである。しかしながら、分析したランサムウェアによる手法でなくても、ファイルの暗号化処理の防御は可能である。 The first embodiment of the present invention analyzes the behavior of main ransomware, identifies common parts, and detects and protects behaviors that can be determined to be illegal from there. However, even without a technique analysis by the ransomware, defense of encryption processing of the file is possible.

条件3:MoveFileの第一引数のファイルが、リストBに含まれている。すなわち、HookWriteFileから通知されるプロセスIDが、HookMoveFileから通知されるプロセスIDと同一であり、かつ、HookWriteFileから通知されるファイルパスが、HookMoveFileから通知される第一引数のファイルパスと同一である。 Condition 3: The file of the first argument of MoveFile is included in the list B. That is, the process ID notified from HookWriteFile is the same as the process ID notified from HookMoveFile , and the file path notified from HookWriteFile is the same as the file path of the first argument notified from HookMoveFile.

図59は、暗号化対象ファイルのハンドルが「0xABC」であり、暗号化対象ファイルパスが「C:\test.pdf」であり、ファイルマッピングオブジェクトのハンドルが「0xABCD」であり、暗号化対象ファイルの暗号化前のヘッダデータが「25 50 44 46 2D」であることを示している。 In Figure 59, Encryption target file handle is “0xABC”, Encryption target file path is “C: \ test.pdf”, and File mapping object handle is “0xABCD”. There, it is shown that "unencrypted header data of the encrypted target file" is "25 50 44 46 2D".

(第3の機能:記録を使用してランサムウェアであるかどうかを判断する機能)
本発明プログラム第3の機能は、第2の機能により記録した挙動により監視対象プロセスがランサムウェアであるかどうかを判断する。監視対象プロセスが、明示的にマップのクローズ・反映処理を行う場合と、明示的にマップのクローズ・反映処理が行わない場合とがあり、それぞれの場合を想定した処理を行う。
(Third function: a function for determining whether or not the ransomware is using a record)
The third function of the program of the present invention determines whether or not the process to be monitored is ransomware based on the behavior recorded by the second function. There are cases where the monitoring target process explicitly performs the map closing / reflecting process, and there are cases where the map closing / reflecting process is not explicitly performed, and the process is performed assuming each case.

まず、メモリマップドリストの走査を開始する(ステップS31)。 First, to start the scanning of the memory-mapped list (step S31).

Claims (23)

コンピューターを、
所定のプロセスによりディスク上の実ファイルが前記実ファイルに対応する仮想ファイルとしてメモリ上にマッピングされるという第1の条件と、前記所定のプロセスにより前記仮想ファイルがアンマッピングされるという第2の条件と、アンマッピング時の前記実ファイル又は前記仮想ファイルのファイル構造が不適切な状態に変更されているという第3の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断部
として機能させるためのプログラム。
Computer
A first condition that a real file on the disk is mapped on the memory as a virtual file corresponding to the real file by a predetermined process, and a second condition that the virtual file is unmapped by the predetermined process And the third condition that the file structure of the real file or the virtual file at the time of unmapping is changed to an inappropriate state, and a determination unit that determines the predetermined process as ransomware Program to function as.
コンピューターを、
所定のプロセスによりディスク上の実ファイルが前記実ファイルに対応する仮想ファイルとしてメモリ上にマッピングされるという第1の条件と、前記第1の条件が連続して発生するという第4の条件と、アンマッピング時の前記実ファイル又は前記仮想ファイルのファイル構造が不適切な状態に変更されているという第3の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断部
として機能させるためのプログラム。
Computer
A first condition that a real file on the disk is mapped on a memory as a virtual file corresponding to the real file by a predetermined process; a fourth condition that the first condition occurs continuously; Function as a determination unit that determines that the predetermined process is ransomware when the third condition that the file structure of the real file or the virtual file at the time of unmapping is changed to an inappropriate state is satisfied Program to let you.
請求項1又は2記載のプログラムにおいて、
前記第3の条件は、マッピング時の前記実ファイルのヘッダ情報とアンマッピング時の前記実ファイル又は前記仮想ファイルのヘッダ情報とが相違することである
ことを特徴とするプログラム。
The program according to claim 1 or 2,
The program according to claim 3, wherein the third condition is that header information of the real file at the time of mapping is different from header information of the real file or the virtual file at the time of unmapping.
コンピューターを、
所定のプロセスによりディスク上の実ファイルが前記実ファイルに対応する仮想ファイルとしてメモリ上にマッピングされるという第1の条件と、前記所定のプロセスが前記実ファイルのファイル種別に関連付けられていないプログラムであるという第5の条件と、マッピング時の前記実ファイルの情報とアンマッピング時の前記実ファイル又は前記仮想ファイルの情報とが相違するという第6の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断部
として機能させるためのプログラム。
Computer
A first condition that a real file on a disk is mapped on a memory as a virtual file corresponding to the real file by a predetermined process, and a program in which the predetermined process is not associated with the file type of the real file. The predetermined process is satisfied when the fifth condition of being present and the sixth condition that the information of the real file at the time of mapping is different from the information of the real file or the virtual file at the time of unmapping are satisfied. Program that functions as a deciding part to determine ransomware.
請求項1乃至4のいずれか1項に記載のプログラムにおいて、
前記判断部は、前記所定のプロセスにより、前記仮想ファイルを作成する命令、又は、前記仮想ファイルを前記メモリにマッピングする命令が呼び出されると、前記第1の条件を満足すると判断する
ことを特徴とするプログラム。
The program according to any one of claims 1 to 4,
The determination unit determines that the first condition is satisfied when an instruction to create the virtual file or an instruction to map the virtual file to the memory is called by the predetermined process. Program to do.
請求項1記載のプログラムにおいて、
前記判断部は、前記所定のプロセスにより、前記仮想ファイルを前記メモリからアンマッピングする命令、前記仮想ファイルの一部を前記ディスクに書き込む命令、又は、前記仮想ファイルのハンドルを閉じる命令が呼び出されると、前記第2の条件を満足すると判断する
ことを特徴とするプログラム。
The program according to claim 1,
When the predetermined process calls an instruction to unmap the virtual file from the memory, an instruction to write a part of the virtual file to the disk, or an instruction to close the handle of the virtual file by the predetermined process And determining that the second condition is satisfied.
請求項2記載のプログラムにおいて、
前記判断部は、前記所定のプロセスにより、前記仮想ファイルを作成する命令、又は、前記仮想ファイルを前記メモリにマッピングする命令が連続して呼び出されると、前記第4の条件を満足すると判断する
ことを特徴とするプログラム。
The program according to claim 2,
The determination unit determines that the fourth condition is satisfied when an instruction to create the virtual file or an instruction to map the virtual file to the memory is continuously called by the predetermined process. A program characterized by
請求項1乃至7のいずれか1項に記載のプログラムにおいて、
前記コンピューターを、更に、
前記所定のプロセスにより前記実ファイルが前記仮想ファイルとして前記メモリ上にマッピングされる時に前記実ファイルをバックアップしたバックアップファイルを生成し、前記判断部が前記所定のプロセスをランサムウェアと判断した場合には、前記バックアップファイルを前記ディスク上の前記実ファイルに書き戻すバックアップ部
として機能させるためのプログラム。
The program according to any one of claims 1 to 7,
The computer further,
When the real file is mapped on the memory as the virtual file by the predetermined process, a backup file is generated that backs up the real file, and the determination unit determines that the predetermined process is ransomware A program for causing the backup file to function as a backup unit for writing back the backup file to the actual file on the disk.
コンピューターを、
所定のプロセスによりディスク上の実ファイルへの書き込み命令が発せられたという第7の条件と、前記所定のプロセスが前記実ファイルのファイル種別に関連付けられていないプログラムであるという第8の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断部
として機能させるためのプログラム。
Computer
A seventh condition that a write command to a real file on the disk is issued by a predetermined process, and an eighth condition that the predetermined process is a program not associated with the file type of the real file. When satisfied, a program for causing the predetermined process to function as a determination unit that determines to be ransomware.
請求項9記載のプログラムにおいて、
前記判断部は、前記書き込み命令により前記実ファイルのファイル構造が不適切な状態に変更されているという第9の条件を更に満足する場合に、前記所定のプロセスをランサムウェアと判断する
ことを特徴とするプログラム。
The program according to claim 9, wherein
The determination unit determines that the predetermined process is ransomware when the ninth condition that the file structure of the real file is changed to an inappropriate state by the write command is further satisfied. Program.
コンピューターに、
所定のプロセスによりディスク上の実ファイルが前記実ファイルに対応する仮想ファイルとしてメモリ上にマッピングされるという第1の条件と、前記所定のプロセスにより前記仮想ファイルがアンマッピングされるという第2の条件と、アンマッピング時の前記実ファイル又は前記仮想ファイルのファイル構造が不適切な状態に変更されているという第3の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断手段
を実行させるプログラム。
On the computer,
A first condition that a real file on the disk is mapped on the memory as a virtual file corresponding to the real file by a predetermined process, and a second condition that the virtual file is unmapped by the predetermined process And the third condition that the file structure of the real file or the virtual file at the time of unmapping is changed to an inappropriate state, and a determination unit that determines the predetermined process as ransomware A program that executes
コンピューターに、
所定のプロセスによりディスク上の実ファイルが前記実ファイルに対応する仮想ファイルとしてメモリ上にマッピングされるという第1の条件と、前記第1の条件が連続して発生するという第4の条件と、アンマッピング時の前記実ファイル又は前記仮想ファイルのファイル構造が不適切な状態に変更されているという第3の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断手段
を実行させるプログラム。
On the computer,
A first condition that a real file on the disk is mapped on a memory as a virtual file corresponding to the real file by a predetermined process; a fourth condition that the first condition occurs continuously; When the third condition that the file structure of the actual file or the virtual file at the time of unmapping is changed to an inappropriate state is satisfied, a determination unit that determines the predetermined process as ransomware is executed Program to make.
コンピューターに、
所定のプロセスによりディスク上の実ファイルが前記実ファイルに対応する仮想ファイルとしてメモリ上にマッピングされるという第1の条件と、前記所定のプロセスが前記実ファイルのファイル種別に関連付けられていないプログラムであるという第5の条件と、マッピング時の前記実ファイルの情報とアンマッピング時の前記実ファイル又は前記仮想ファイルの情報とが相違するという第6の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断手段
を実行させるプログラム。
On the computer,
A first condition that a real file on a disk is mapped on a memory as a virtual file corresponding to the real file by a predetermined process, and a program in which the predetermined process is not associated with the file type of the real file. The predetermined process is satisfied when the fifth condition of being present and the sixth condition that the information of the real file at the time of mapping is different from the information of the real file or the virtual file at the time of unmapping are satisfied. A program that executes a judgment means that judges that ransomware.
コンピューターに、
所定のプロセスによりディスク上の実ファイルへの書き込み命令が発せられたという第7の条件と、前記所定のプロセスが前記実ファイルのファイル種別に関連付けられていないプログラムであるという第8の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断手段
を実行させるプログラム。
On the computer,
A seventh condition that a write command to a real file on the disk is issued by a predetermined process, and an eighth condition that the predetermined process is a program not associated with the file type of the real file. A program that, when satisfied, executes determination means for determining the predetermined process as ransomware.
請求項1乃至14のいずれか1項に記載のプログラムを記録したコンピューター読み取り可能な記録媒体。   The computer-readable recording medium which recorded the program of any one of Claims 1 thru | or 14. 所定のプロセスによりディスク上の実ファイルが前記実ファイルに対応する仮想ファイルとしてメモリ上にマッピングされるという第1の条件と、前記所定のプロセスにより前記仮想ファイルがアンマッピングされるという第2の条件と、アンマッピング時の前記実ファイル又は前記仮想ファイルのファイル構造が不適切な状態に変更されているという第3の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断部
を有することを特徴とする情報処理装置。
A first condition that a real file on the disk is mapped on the memory as a virtual file corresponding to the real file by a predetermined process, and a second condition that the virtual file is unmapped by the predetermined process And the third condition that the file structure of the real file or the virtual file at the time of unmapping is changed to an inappropriate state, and a determination unit that determines the predetermined process as ransomware An information processing apparatus comprising:
所定のプロセスによりディスク上の実ファイルが前記実ファイルに対応する仮想ファイルとしてメモリ上にマッピングされるという第1の条件と、前記第1の条件が連続して発生するという第4の条件と、アンマッピング時の前記実ファイル又は前記仮想ファイルのファイル構造が不適切な状態に変更されているという第3の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断部
を有することを特徴とする情報処理装置。
A first condition that a real file on the disk is mapped on a memory as a virtual file corresponding to the real file by a predetermined process; a fourth condition that the first condition occurs continuously; A determination unit that determines that the predetermined process is ransomware when the third condition that the file structure of the real file or the virtual file at the time of unmapping is changed to an inappropriate state is satisfied; An information processing apparatus characterized by that.
所定のプロセスによりディスク上の実ファイルが前記実ファイルに対応する仮想ファイルとしてメモリ上にマッピングされるという第1の条件と、前記所定のプロセスが前記実ファイルのファイル種別に関連付けられていないプログラムであるという第5の条件と、マッピング時の前記実ファイルの情報とアンマッピング時の前記実ファイル又は前記仮想ファイルの情報とが相違するという第6の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断部
を有することを特徴とする情報処理装置。
A first condition that a real file on a disk is mapped on a memory as a virtual file corresponding to the real file by a predetermined process, and a program in which the predetermined process is not associated with the file type of the real file. The predetermined process is satisfied when the fifth condition of being present and the sixth condition that the information of the real file at the time of mapping is different from the information of the real file or the virtual file at the time of unmapping are satisfied. An information processing apparatus, comprising: a determination unit that determines ransomware.
所定のプロセスによりディスク上の実ファイルへの書き込み命令が発せられたという第7の条件と、前記所定のプロセスが前記実ファイルのファイル種別に関連付けられていないプログラムであるという第8の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する判断部
を有することを特徴とする情報処理装置。
A seventh condition that a write command to a real file on the disk is issued by a predetermined process, and an eighth condition that the predetermined process is a program not associated with the file type of the real file. An information processing apparatus comprising: a determination unit that determines that the predetermined process is ransomware when satisfied.
所定のプロセスによりディスク上の実ファイルが前記実ファイルに対応する仮想ファイルとしてメモリ上にマッピングされるという第1の条件と、前記所定のプロセスにより前記仮想ファイルがアンマッピングされるという第2の条件と、アンマッピング時の前記実ファイル又は前記仮想ファイルのファイル構造が不適切な状態に変更されているという第3の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する
ことを特徴とする情報処理方法。
A first condition that a real file on the disk is mapped on the memory as a virtual file corresponding to the real file by a predetermined process, and a second condition that the virtual file is unmapped by the predetermined process And the third condition that the file structure of the real file or the virtual file at the time of unmapping is changed to an inappropriate state, the predetermined process is determined to be ransomware. A characteristic information processing method.
所定のプロセスによりディスク上の実ファイルが前記実ファイルに対応する仮想ファイルとしてメモリ上にマッピングされるという第1の条件と、前記第1の条件が連続して発生するという第4の条件と、アンマッピング時の前記実ファイル又は前記仮想ファイルのファイル構造が不適切な状態に変更されているという第3の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する
ことを特徴とする情報処理方法。
A first condition that a real file on the disk is mapped on a memory as a virtual file corresponding to the real file by a predetermined process; a fourth condition that the first condition occurs continuously; When the third condition that the file structure of the real file or the virtual file at the time of unmapping is changed to an inappropriate state is satisfied, the predetermined process is determined as ransomware. Information processing method.
所定のプロセスによりディスク上の実ファイルが前記実ファイルに対応する仮想ファイルとしてメモリ上にマッピングされるという第1の条件と、前記所定のプロセスが前記実ファイルのファイル種別に関連付けられていないプログラムであるという第5の条件と、マッピング時の前記実ファイルの情報とアンマッピング時の前記実ファイル又は前記仮想ファイルの情報とが相違するという第6の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する
ことを特徴とする情報処理方法。
A first condition that a real file on a disk is mapped on a memory as a virtual file corresponding to the real file by a predetermined process, and a program in which the predetermined process is not associated with the file type of the real file. The predetermined process is satisfied when the fifth condition of being present and the sixth condition that the information of the real file at the time of mapping is different from the information of the real file or the virtual file at the time of unmapping are satisfied. An information processing method characterized by judging ransomware.
所定のプロセスによりディスク上の実ファイルへの書き込み命令が発せられたという第7の条件と、前記所定のプロセスが前記実ファイルのファイル種別に関連付けられていないプログラムであるという第8の条件とを満足する場合に、前記所定のプロセスをランサムウェアと判断する
ことを特徴とする情報処理方法。
A seventh condition that a write command to a real file on the disk is issued by a predetermined process, and an eighth condition that the predetermined process is a program not associated with the file type of the real file. If satisfied, the predetermined process is determined as ransomware.
JP2017099584A 2016-07-14 2017-05-19 Program, information processing apparatus, and information processing method Active JP6219550B1 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2017099584A JP6219550B1 (en) 2017-05-19 2017-05-19 Program, information processing apparatus, and information processing method
US15/645,270 US10264002B2 (en) 2016-07-14 2017-07-10 Program, information processing device, and information processing method
US16/144,606 US11159541B2 (en) 2016-07-14 2018-09-27 Program, information processing device, and information processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017099584A JP6219550B1 (en) 2017-05-19 2017-05-19 Program, information processing apparatus, and information processing method

Publications (2)

Publication Number Publication Date
JP6219550B1 JP6219550B1 (en) 2017-10-25
JP2018195155A true JP2018195155A (en) 2018-12-06

Family

ID=60156778

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017099584A Active JP6219550B1 (en) 2016-07-14 2017-05-19 Program, information processing apparatus, and information processing method

Country Status (1)

Country Link
JP (1) JP6219550B1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11223649B2 (en) * 2018-05-06 2022-01-11 Nec Corporation User-added-value-based ransomware detection and prevention

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150235025A1 (en) * 2014-02-20 2015-08-20 Mark Mundy Process to prevent malicious changes to electronic files on an electronic storage device
JP5996145B1 (en) * 2016-07-14 2016-09-21 三井物産セキュアディレクション株式会社 Program, information processing apparatus, and information processing method
US9514309B1 (en) * 2014-04-30 2016-12-06 Symantec Corporation Systems and methods for protecting files from malicious encryption attempts
US20160378988A1 (en) * 2015-06-26 2016-12-29 Quick Heal Technologies Private Limited Anti-ransomware
JP2017010531A (en) * 2015-06-19 2017-01-12 エーオー カスペルスキー ラボAO Kaspersky Lab System and method for restoring changed data

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150235025A1 (en) * 2014-02-20 2015-08-20 Mark Mundy Process to prevent malicious changes to electronic files on an electronic storage device
US9514309B1 (en) * 2014-04-30 2016-12-06 Symantec Corporation Systems and methods for protecting files from malicious encryption attempts
JP2017010531A (en) * 2015-06-19 2017-01-12 エーオー カスペルスキー ラボAO Kaspersky Lab System and method for restoring changed data
US20160378988A1 (en) * 2015-06-26 2016-12-29 Quick Heal Technologies Private Limited Anti-ransomware
JP5996145B1 (en) * 2016-07-14 2016-09-21 三井物産セキュアディレクション株式会社 Program, information processing apparatus, and information processing method

Also Published As

Publication number Publication date
JP6219550B1 (en) 2017-10-25

Similar Documents

Publication Publication Date Title
US11159541B2 (en) Program, information processing device, and information processing method
JP5996145B1 (en) Program, information processing apparatus, and information processing method
US12130919B2 (en) Detection of exploitative program code
US12079340B2 (en) Cloud based just in time memory analysis for malware detection
US20240370561A1 (en) Just in time memory analysis for malware detection
JP7537661B2 (en) Advanced Ransomware Detection
CN109800577B (en) A method and device for identifying escaping security monitoring behavior
JP2010182019A (en) Abnormality detector and program
CN105550581A (en) Malicious code detection method and device
US20240028746A1 (en) Exploit detection via induced exceptions
US10902122B2 (en) Just in time memory analysis for malware detection
JP6219550B1 (en) Program, information processing apparatus, and information processing method
JP5955475B1 (en) Program, information processing apparatus, and information processing method
Webb Evaluating tool based automated malware analysis through persistence mechanism detection
US12299120B2 (en) Systems and methods for preventing hollowing attack
Mishra Improving Speed of Virus Scanning-Applying TRIZ to Improve Anti-Virus Programs
RU2665910C1 (en) System and method of detecting the harmful code in the address process space
RU2659738C1 (en) System and method of detecting malicious script
CN118171263A (en) Privilege escalation protection method and device
CN118643493A (en) A risk behavior detection method, program product, electronic device and storage medium
JP2017134805A (en) Program, information processing device and information processing method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170523

A871 Explanation of circumstances concerning accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A871

Effective date: 20170523

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170628

A975 Report on accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A971005

Effective date: 20170810

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20170905

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170908

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20170926

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170927

R150 Certificate of patent or registration of utility model

Ref document number: 6219550

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载