JP2005032185A - Program, security protection device, and its method - Google Patents

Program, security protection device, and its method Download PDF

Info

Publication number
JP2005032185A
JP2005032185A JP2003273633A JP2003273633A JP2005032185A JP 2005032185 A JP2005032185 A JP 2005032185A JP 2003273633 A JP2003273633 A JP 2003273633A JP 2003273633 A JP2003273633 A JP 2003273633A JP 2005032185 A JP2005032185 A JP 2005032185A
Authority
JP
Japan
Prior art keywords
data
overflow
stack
determination
input
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.)
Pending
Application number
JP2003273633A
Other languages
Japanese (ja)
Inventor
Shinya Saito
真也 齊藤
Junji Hamano
淳史 濱野
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.)
Sony Corp
Original Assignee
Sony Corp
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 Sony Corp filed Critical Sony Corp
Priority to JP2003273633A priority Critical patent/JP2005032185A/en
Publication of JP2005032185A publication Critical patent/JP2005032185A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Storage Device Security (AREA)
  • Executing Machine-Instructions (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a program, a security protection device, and its method, capable of correctly grasping the presence of a preparation act of a stack smashing attack. <P>SOLUTION: When a stack overflow is detected in an overflow detection part 101, data of the result rewritten by the overflow are acquired by a data acquisition part 102. In a determination part 103, whether the stack overflow is caused by input of wrong data or not is determined based on data acquired by the acquisition part 102. For instance, the determination is executed based on the result of evaluation of periodicity of a series of the rewritten data. Thereby, a security attack can be prevented by restraining the attack preparation act such as an analysis act of a stack structure. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明はコンピュータのセキュリティ保護のためのプログラム、セキュリティ保護装置および方法に係り、特に、スタックオーバーフローを利用した攻撃からコンピュータを保護するプログラム、セキュリティ保護装置および方法に関するものである。   The present invention relates to a program, a security protection device, and a method for protecting the security of a computer, and more particularly, to a program, a security protection device, and a method for protecting a computer from attacks using stack overflow.

現在、コンピュータのセキュリティに関する多くの問題が報告されている。最も多く報告されているものの一つに、バッファオーバーフローを利用した攻撃があり、その中でも特に、スタックのオーバーフローを利用するスタックスマッシング(stack smashing)と呼ばれる攻撃が数多く報告されている。   Currently, many problems related to computer security have been reported. One of the most reported is an attack using buffer overflow, and in particular, many attacks called stack smashing using stack overflow have been reported.

スタックオーバーフローは、次に述べるような、スタックの構造とC言語における配列の境界チェックの欠如とに起因して発生する。   Stack overflow occurs due to the structure of the stack and the lack of array boundary checking in the C language as described below.

スタックは、最後に置かれたオブジェクトが最初に取り除かれるLILO(last-in first-out)と呼ばれる性質を持つ抽象データ型である。C言語において関数の呼び出しに用いられるスタックは、一般に、スタック・ポインタ、スタック・フレーム、フレーム・ポインタ から構成される。   The stack is an abstract data type having a property called LILO (last-in first-out) in which the last placed object is removed first. A stack used for calling a function in the C language is generally composed of a stack pointer, a stack frame, and a frame pointer.

スタック・ポインタは、スタックの先頭を指す。
スタック・フレームは、関数の引数や、ローカル変数、以前に積まれたスタック・フレームを復元するために必要なデータ(関数呼び出し時の命令ポインタなど)が所定の順序で格納されるメモリ領域である。
フレーム・ポインタは、スタック・フレーム内において基準となるアドレス位置を指示す。主として、ローカル変数を参照するための相対値として利用される。
The stack pointer points to the top of the stack.
The stack frame is a memory area in which function arguments, local variables, and data necessary for restoring a previously stacked stack frame (such as an instruction pointer when calling a function) are stored in a predetermined order. .
The frame pointer indicates a reference address position in the stack frame. It is mainly used as a relative value for referring to a local variable.

関数の呼び出し時および戻り時におけるスタックの動作について、図9および図10を参照して説明する。   The stack operation during function call and return will be described with reference to FIG. 9 and FIG.

図9は、C言語のソース・コードの一例を示す図である。
図9のソース・コードにおける行番号L1の関数‘function()’には、3つの整数の変数‘a’,‘b’,‘c’が引数として渡されている。また、関数‘function()’の内部では、文字型の配列‘buf’がローカル変数として定義されている(行番号L2)。この関数‘function()’がmain関数において呼び出されている(行番号L4、L5)。
FIG. 9 is a diagram illustrating an example of a C language source code.
In the function “function ()” of the line number L1 in the source code of FIG. 9, three integer variables “a”, “b”, and “c” are passed as arguments. In addition, inside the function “function ()”, a character type array “buf” is defined as a local variable (line number L2). This function 'function ()' is called in the main function (line numbers L4 and L5).

図10は、このようなソース・コードが実行された場合におけるスタックの状態の一例を図解した図である。   FIG. 10 is a diagram illustrating an example of the state of the stack when such source code is executed.

関数の呼び出しは、以下の手順で実行される。   The function call is executed in the following procedure.

(1)関数‘function()’の引数(‘a’〜‘c’)がスタックに積まれる。図10に示すように、‘c’、‘b’、‘a’の順でスタックに引数が積まれる。 (1) The arguments ('a' to 'c') of the function 'function ()' are stacked on the stack. As shown in FIG. 10, arguments are stacked on the stack in the order of ‘c’, ‘b’, and ‘a’.

(2)次いで、現在の命令ポインタ(実行すべき命令コードが格納されるメモリのアドレス)が戻りアドレス‘ret’としてスタックに積まれる。 (2) Next, the current instruction pointer (the address of the memory where the instruction code to be executed is stored) is loaded on the stack as the return address ‘ret’.

(3)更に、現在のフレーム・ポインタ‘FP’がスタックに積まれ、フレーム・ポインタ‘sfp’(saved frame pointer)として保存される。 (3) Further, the current frame pointer 'FP' is stacked on the stack and saved as a frame pointer 'sfp' (saved frame pointer).

(4)現在のスタック・ポインタSPが、現在のフレーム・ポインタ‘FP’にコピーされる。これにより、新しいフレーム・ポインタ‘FP’は、上述した戻りアドレス‘ret’を指す。 (4) The current stack pointer SP is copied to the current frame pointer 'FP'. As a result, the new frame pointer ‘FP’ points to the return address ‘ret’ described above.

(5)最後に、ローカル変数‘buf’のメモリ領域を確保するため、スタック・ポインタ‘SP’が更に上位へ進められる。図10は、この時点におけるスタックの状態の一例を示している。 (5) Finally, in order to secure the memory area of the local variable “buf”, the stack pointer “SP” is further advanced. FIG. 10 shows an example of the state of the stack at this point.

関数の戻り時には、以下の動作が実行される。   When the function returns, the following operations are performed:

(1)現在のフレーム・ポインタ‘FP’がスタック・ポインタ‘SP’にコピーされる。これにより、新しいスタック・ポインタ‘SP’は、戻りアドレス‘ret’を指す。 (1) The current frame pointer 'FP' is copied to the stack pointer 'SP'. As a result, the new stack pointer 'SP' points to the return address 'ret'.

(2)また、スタックに積まれていた以前のフレーム・ポインタ‘SFP’がフレーム・ポインタ‘FP’にコピーされる。これにより、フレーム・ポインタ‘FP’が呼び出し元の関数のスタック・フレームに戻る。 (2) Also, the previous frame pointer 'SFP' that was loaded on the stack is copied to the frame pointer 'FP'. As a result, the frame pointer 'FP' returns to the stack frame of the calling function.

(3)そして、スタック・ポインタ‘SP’によって指示されている戻りアドレス‘ret’がスタックから読み出され、命令ポインタにセットされる。これにより、呼び出し元の関数へ処理がジャンプする。以降、スタックに積まれていた引数(‘a’〜‘c’)が順に読み出されることによって、スタック・ポインタ‘SP’は元の状態に戻る。 (3) Then, the return address ‘ret’ indicated by the stack pointer ‘SP’ is read from the stack and set to the instruction pointer. As a result, the process jumps to the calling function. Thereafter, the stack pointer ‘SP’ returns to the original state by sequentially reading the arguments (‘a’ to ‘c’) stacked on the stack.

図11は、このような構造のスタックにオーバーフローが発生した場合におけるスタックの状態の一例を図解した図である。   FIG. 11 is a diagram illustrating an example of a stack state when an overflow occurs in the stack having such a structure.

ローカル変数としての配列‘buf’に、割り当てを超えたデータ(図9の例では、終端文字を含めて10個を超える文字型のデータ)が入力されると、図11の矢印に示すように、配列‘buf’より上位のアドレスに格納されているスタック上のデータが入力データによって上書きされる。このように、割り当てを超えたデータが入力されることによって、スタック上の保持すべきデータが上書きされてしまうことを、スタックオーバーフローと呼んでいる。   When data exceeding the allocation (in the example of FIG. 9, more than 10 character-type data including the terminal character) is input to the array 'buf' as a local variable, as shown by the arrow in FIG. , Data on the stack stored at an address higher than the array 'buf' is overwritten by the input data. In this way, when data exceeding the allocation is input, data to be held on the stack is overwritten, which is called stack overflow.

図12は、スタックオーバーフローを利用したスタックスマッシング攻撃によって、攻撃コードが実行される様子を図解した図である。   FIG. 12 is a diagram illustrating a state in which an attack code is executed by a stack smashing attack using stack overflow.

スタックスマッシング攻撃では、スタックオーバーフローを引き起こす入力データの中に、有害な攻撃コードが挿入される。すなわち、図12に示すように、スタックオーバーフローによって上書きされたメモリ領域に、攻撃コードが書き込まれる。更に、この入力データの中には、攻撃コードを指示するアドレスが含まれており、このアドレスによって、スタックに格納されている戻りアドレス‘ret’が書き換えられる。そのため、関数の戻り時において、本来実行されるべき命令コードの代わりに、攻撃コードが実行されてしまう。   In stack smashing attacks, malicious attack code is inserted into the input data that causes stack overflow. That is, as shown in FIG. 12, the attack code is written in the memory area overwritten by the stack overflow. Further, this input data includes an address indicating an attack code, and the return address ‘ret’ stored in the stack is rewritten by this address. Therefore, when the function returns, the attack code is executed instead of the instruction code that should be executed originally.

例えばUNIX(登録商標)の場合、多くのデーモンプロセスはroot権限で実行されている。そこで、例えば攻撃コードとして‘exec(/bin/sh)’を利用し、デーモンプロセスに対してスタックスマッシング攻撃を行なうことにより、攻撃者はそのホストでのroot権限を獲得できる。   For example, in the case of UNIX (registered trademark), many daemon processes are executed with root authority. Therefore, for example, by using “exec (/ bin / sh)” as an attack code and performing a stack smashing attack on the daemon process, the attacker can acquire the root authority on the host.

このようなスタックスマッシング攻撃に対抗するため、現在幾つかの技術の提案されており、これらは、大きく以下の3つに分類される。   In order to counter such a stack smashing attack, several techniques have been proposed at present, and these are roughly classified into the following three types.

(1)スタック上の情報が上書きされることを事前に検出する方法
(2)スタック上の情報が上書きされたことを検出する方法
(3)メモリ上のコードの実行可否を判定する方法
(1) Method for detecting in advance that information on stack is overwritten (2) Method for detecting that information on stack has been overwritten (3) Method for determining whether or not code on memory is executable

以下では、これらの従来技術について説明する。   Below, these prior arts are demonstrated.

(1)スタック上の情報が上書きされることを事前に検出する方法 (1) Method for detecting in advance that information on the stack is overwritten

[非特許文献1]には、ソース・コードのライブラリを置き換える方法として、libsafeと呼ばれる方法が提案されている。   [Non-Patent Document 1] proposes a method called libsafe as a method for replacing a library of source code.

libsafeでは、スタックオーバーフローを引き起こす可能性のあるライブラリ関数の呼び出しを横取り(intercept)し、関数の引数がスタックのメモリ範囲内に収まるか否かを検査する。そして、正常な場合には適当なライブラリ関数を呼び出し、異常な場合にはその旨を通知するメッセージを残してプログラムを終了することにより、スタックオーバーフローを防止する。   In libsafe, a library function call that may cause a stack overflow is intercepted, and it is checked whether the argument of the function falls within the memory range of the stack. When normal, an appropriate library function is called, and when abnormal, a message notifying that is left and the program is terminated to prevent stack overflow.

C言語における標準ライブラリ(libc)の関数‘strcpy()’を例にして、libsafeの動作を説明する。
図13は、libsafeのライブラリをリンクしたあるプロセスでのメモリの状態を示す図である。
The operation of libsafe will be described by taking the function “strcpy ()” of the standard library (libc) in C language as an example.
FIG. 13 is a diagram illustrating a state of a memory in a certain process linked with a library of libsafe.

プログラムが‘strcpy()’を呼び出すと、標準ライブラリ(libc)ではなく、libsafeのライブラリに実装されている‘strcpy()’が実行される(F1)。これはライブラリのロードの順番を工夫することにより実現される。   When the program calls ‘strcpy ()’, ‘strcpy ()’ implemented in the library of libsafe is executed instead of the standard library (libc) (F <b> 1). This is achieved by devising the order of library loading.

libsafeの‘strcpy()’は、まず、コピー元の文字列(‘src’)の長さとコピー先のバッファ長の上限(すなわちスタック・フレーム長)を計算し、コピー元の文字列がコピー先のバッファ長の上限を越えないかを検査する。
上限を越えない場合、libsafeの‘strcpy()’は、標準ライブラリ(libc)の関数‘memcpy()’を呼び出してこれを実行し(F2,F3)、メイン関数に戻る(F4)。
一方、上限を越えると判定された場合、libsafeの‘strcpy()’はシステムのログ・ファイル(syslog)にメッセージを残し、プログラムを終了させる。
このように、libsafeでは、スタックオーバーフローの発生を事前に検出することにより、スタックスマッシング攻撃を防いでいる。
The libsafe 'strcp ()' first calculates the length of the copy source character string ('src') and the upper limit of the copy destination buffer length (that is, the stack frame length), and the copy source character string is the copy destination. Check whether the upper limit of the buffer length is exceeded.
If the upper limit is not exceeded, libsafe 'strcpy ()' calls the function 'memcpy ()' of the standard library (libc) and executes it (F2, F3), and returns to the main function (F4).
On the other hand, if it is determined that the upper limit is exceeded, libsafe's “strcpy ()” leaves a message in the system log file (syslog) and terminates the program.
Thus, in libsafe, stack smashing attacks are prevented by detecting the occurrence of stack overflow in advance.

(2)スタック上の情報が上書きされたことを検出する方法 (2) Method for detecting that information on the stack has been overwritten

[非特許文献2]には、コンパイラを拡張する方法として、StackGuardと呼ばれる方法が提案されている。
StackGuardでは、図14に示されるように、戻りアドレス‘ret’とローカル変数‘buf’との間に‘Canary Word’と呼ばれる値を挿入する。そして、関数戻り時にこの値をチェックし、スタックオーバーフローの上書きによって値が変更されている場合、スタックスマッシング攻撃が行なわれたものとしてプロセスを終了させる(図15)。
[Non-Patent Document 2] proposes a method called StackGuard as a method for extending a compiler.
In StackGuard, as shown in FIG. 14, a value called “Canary Word” is inserted between the return address “ret” and the local variable “buf”. Then, this value is checked when the function returns, and if the value has been changed by overwriting the stack overflow, the process is terminated assuming that a stack smashing attack has been performed (FIG. 15).

また、[特許文献1]においても、Stack Smashing Protectorと呼ばれる、上述のStackGuardと同様な技術が開示されている。[特許文献1]によれば、関数戻り時に、スタックのプレヴィアス・フレーム・ポインタ(図10におけるフレーム・ポインタ‘sfp’に相当する)と配列(図10における配列‘buf’に相当する)との間にガード変数を格納し、その有効性を確認することにより、スタックスマッシング攻撃を防止する。   [Patent Document 1] also discloses a technique called “Stack Smashing Protector” similar to the above-mentioned StackGuard. According to [Patent Document 1], at the time of function return, the stack's previous frame pointer (corresponding to the frame pointer 'sfp' in FIG. 10) and the array (corresponding to the array 'buf' in FIG. 10) Prevents stack smashing attacks by storing guard variables between them and checking their effectiveness.

(3)メモリ上のコードの実行可否を判定する方法 (3) A method for determining whether or not the code on the memory can be executed

オペレーティング・システムを拡張する方法として、インターネット<URL: http://www.openwall.com/linux/>において開示されている、non−executable stackと呼ばれる方法や、インターネット<URL: http://pageexec.virtualave.net/>において開示されている、PaXと呼ばれる方法が存在する。   As a method for extending the operating system, a method called non-executable stack, disclosed in the Internet <URL: http://www.openwall.com/linux/>, or the Internet <URL: http: // pageexec There is a method called PaX, disclosed in .virtualave.net />.

non−executable stackの方法では、スタックスマッシング攻撃において攻撃コードがスタック上に置かれることに着目し、メモリ上のスタックのページにおいて、CPUによる命令の実行が許可されないように、カーネルを変更している。スタックスマッシング攻撃によりスタック上に置かれた攻撃コードが実行された場合、ページ違反(page fault)としてプロセスを停止させる。   In the non-executable stack method, focusing on the fact that attack code is placed on the stack in a stack smashing attack, the kernel is changed so that execution of instructions by the CPU is not permitted on the page of the stack on the memory. . When an attack code placed on the stack is executed by a stack smashing attack, the process is stopped as a page fault.

一方、PaXの方法では、スタックだけでなく全てのデータページにおいてCPUによる命令実行の許可/不許可をマークできるように、カーネルを変更している。   On the other hand, in the PaX method, the kernel is changed so that the instruction execution permission / non-permission of the CPU can be marked not only in the stack but in all data pages.

何れの方法においても、スタック上に置かれたコードを実行できなくすることにより、スタックスマッシング攻撃を防止している。
Arash Baratloo,他2名、‘Transparent Run-Time Defense Against Stack Smashing Attacks’、In Proceedings of 2000 USENIX Annual Technical Conference、(米国)、2000年 Crispin Cowan,他8名、‘Automatic Adaptive Detection and Prevention of Buffer-Overflow Attacks’、In Proceedings of the 7th USENIX Security Symposium、(米国)、1998年 特開2001−216161号公報
In either method, stack smashing attacks are prevented by making it impossible to execute code placed on the stack.
Arash Baratloo and two others, 'Transparent Run-Time Defense Against Stack Smashing Attacks', In Proceedings of 2000 USENIX Annual Technical Conference, (USA), 2000 Crispin Cowan, 8 others, 'Automatic Adaptive Detection and Prevention of Buffer-Overflow Attacks', In Proceedings of the 7th USENIX Security Symposium, (USA), 1998 JP 2001-216161 A

ところで、上述したスタックスマッシング攻撃を仕掛けるためには、プログラムのセキュリティ・ホールに関する知識が必要である。言い換えると、スタックスマッシング攻撃が仕掛けられる時点では、既にセキュリティ・ホールが攻撃者によって解析されていることになる。そのため、上述の方法により特定の攻撃を防ぐことができたとしても、解析された情報に基づいて別の攻撃者が新たな攻撃を仕掛ける可能性がある。したがって、セキュリティに対する脅威が払拭されたとは言い難い。   By the way, in order to perform the above-described stack smashing attack, knowledge about the security hole of the program is required. In other words, when a stack smashing attack is launched, the security hole has already been analyzed by the attacker. For this reason, even if a specific attack can be prevented by the above-described method, another attacker may start a new attack based on the analyzed information. Therefore, it is hard to say that security threats have been wiped out.

仮に、プログラムのセキュリティ・ホールを探る行為のような、攻撃を仕掛けるための準備行為の有無を把握することができれば、その結果に基づいて、上記のような攻撃に対抗するより効果的な措置を事前に講ずることが可能になり、セキュリティの脅威を減らせることが期待される。   If it is possible to ascertain whether there is any preparatory action for launching an attack, such as an act of searching for a security hole in a program, based on the result, more effective measures can be taken to combat such an attack. It can be taken in advance and is expected to reduce security threats.

しかしながら、スタックスマッシング攻撃に対抗する上述した3つの方法は、何れもスタックオーバーフローの発生や、禁止されたアドレスの命令コードの実行を検出して、プロセスを停止または終了させるのみであり、スタックオーバーフローが攻撃を準備するための行為によって引き起こされたものであるのか、それとも、通常の処理において偶発的に発生したものであるのかを見分ける手立てが存在しない。そのため、攻撃準備行為の有無を正確に把握することができず、攻撃の未然の防止に役立てることができないという不利益がある。   However, the above three methods to counter the stack smashing attack only detect the occurrence of stack overflow and the execution of the instruction code of the prohibited address, and stop or terminate the process. There is no way to tell if it was caused by an act of preparing for an attack or if it occurred accidentally in normal processing. Therefore, there is a disadvantage that it is impossible to accurately grasp the presence / absence of an attack preparation action, and it cannot be used to prevent an attack in advance.

本発明はかかる事情に鑑みてなされたものであり、その目的は、スタックのオーバーフローを利用した攻撃の準備行為の有無を正しく把握することができるプログラム、セキュリティ保護装置およびその方法を提供することにある。   The present invention has been made in view of such circumstances, and an object of the present invention is to provide a program, a security protection device, and a method thereof that can correctly grasp the presence / absence of an attack preparation action using a stack overflow. is there.

上記の目的を達成するため、本発明の第1の観点のプログラムは、不正なデータの入力によりスタックがオーバーフローを起こし得るコンピュータに、上記スタックのオーバーフローを検知する第1のステップと、上記第1のステップにおいて上記オーバーフローが検知された場合、上記オーバーフローによって書き換えられた結果のデータを取得する第2のステップと、上記第2のステップにおいて取得されたデータに基づいて、上記オーバーフローが上記不正データの入力により引き起こされたものであるか否かを判定する第3のステップとを有する処理を実行させる。
好適には、上記第3のステップにおいて、上記書き換えられた結果の一連のデータの周期性を評価し、当該評価結果に基づいて上記判定を行なう。
In order to achieve the above object, a program according to a first aspect of the present invention includes a first step of detecting an overflow of the stack in a computer in which the stack can overflow due to input of illegal data; When the overflow is detected in step (2), the second step of acquiring data resulting from rewriting by the overflow, and the overflow is determined based on the data acquired in the second step. And a third step of determining whether or not it is caused by the input.
Preferably, in the third step, the periodicity of a series of data resulting from the rewriting is evaluated, and the determination is performed based on the evaluation result.

本発明の第1の観点によると、上記第1のステップにおいて上記スタックのオーバーフローが検知された場合、上記第2のステップにおいて、上記オーバーフローにより書き換えられた結果のデータが取得される。上記第3のステップでは、上記第2のステップにおいて取得されたデータに基づいて、上記オーバーフローが上記不正データの入力により引き起こされたものであるか否かが判定される。上記判定は、例えば、上記書き換えられた結果の一連のデータの周期性を評価した結果に基づいてなされる。   According to the first aspect of the present invention, when an overflow of the stack is detected in the first step, data as a result of rewriting due to the overflow is acquired in the second step. In the third step, based on the data acquired in the second step, it is determined whether or not the overflow is caused by the input of the illegal data. The determination is made based on, for example, a result of evaluating the periodicity of a series of data as a result of the rewriting.

上記第2のステップにおいて、上記書き換えを受けたメモリ領域から、アドレス順に並ぶ所定数のデータをデータ列として抽出し、上記第3のステップは、上記第2のステップにおいて抽出されたデータ列の相関値を算出する第4のステップと、上記第4のステップにおいて算出された相関値に基づいて上記判定を行なう第5のステップとを含んでも良い。
上記の処理によると、上記書き換えを受けたメモリ領域から、アドレス順に並ぶ所定数のデータがデータ列として抽出され、抽出されたデータ列の相関値が算出される。そして、この算出された相関値に基づいて上記判定が行なわれる。
In the second step, a predetermined number of data arranged in the order of addresses is extracted as a data string from the rewritten memory area, and the third step is a correlation of the data string extracted in the second step. A fourth step of calculating a value and a fifth step of performing the determination based on the correlation value calculated in the fourth step may be included.
According to the above processing, a predetermined number of data arranged in the order of addresses is extracted as a data string from the rewritten memory area, and a correlation value of the extracted data string is calculated. And the said determination is performed based on this calculated correlation value.

また、本発明の第1の観点は、上記第3のステップにおいて、上記オーバーフローが上記不正データの入力により引き起こされたものであると判定された場合に、次に述べる処理を行なう、第10ないし第13のステップのうち少なくとも1つを有しても良い。
第10のステップは、上記オーバーフローが発生したプロセスを停止させる。
第11のステップは、上記不正データの供給元からのアクセスを禁止する。
第12のステップは、上記不正データの供給元の機器において所定の警告情報を表示させるための表示データを生成する。
第13のステップは、少なくとも、上記不正データの供給元、上記不正データの内容、または、上記不正データの供給方法に関する情報を取得する。
A first aspect of the present invention is the tenth to thirteenth processing, in which, in the third step, when it is determined that the overflow is caused by the input of the illegal data, the following processing is performed. At least one of the thirteenth steps may be included.
The tenth step stops the process in which the overflow has occurred.
In the eleventh step, access from the unauthorized data supplier is prohibited.
In the twelfth step, display data for displaying predetermined warning information in the device that supplies the illegal data is generated.
In the thirteenth step, at least information regarding the source of the illegal data, the content of the illegal data, or the method of supplying the illegal data is acquired.

本発明の第2の観点は、不正なデータをコンピュータに入力することによりスタックにオーバーフローを引き起こす攻撃から、上記コンピュータを保護するセキュリティ保護装置であって、上記スタックのオーバーフローを検知するオーバーフロー検知手段と、上記オーバーフロー検知手段において上記オーバーフローが検知された場合、上記オーバーフローによって書き換えられた結果のデータを取得するデータ取得手段と、上記データ取得手段において取得されたデータに基づいて、上記オーバーフローが上記不正データの入力により引き起こされたものであるか否かを判定する判定手段と、上記判定手段において、上記オーバーフローが上記不正データの入力により引き起こされたものであると判定された場合、少なくとも、上記オーバーフローが発生したプロセスを停止させる処理、上記不正データの供給元からのアクセスを禁止する処理、上記不正データの供給元の機器において所定の警告情報を表示させるための表示データを生成する処理、または、上記不正データの供給元、上記不正データの内容、もしくは、上記不正データの供給方法の少なくとも何れか1つに関する情報を取得する処理を実行する処理手段とを有する。
好適には、上記判定手段は、上記書き換えられた結果の一連のデータの周期性を評価し、当該評価結果に基づいて上記判定を行なう。
According to a second aspect of the present invention, there is provided a security protection device for protecting the computer from an attack that causes an overflow of the stack by inputting illegal data to the computer, and an overflow detection means for detecting the overflow of the stack. When the overflow is detected by the overflow detection means, the overflow is detected based on the data acquired by the data acquisition means for acquiring the data rewritten as a result of the overflow, and the illegal data When the determination means for determining whether or not the overflow is caused by the input of the illegal data, the determination means for determining whether or not the overflow is caused by the input of the illegal data. -A process for stopping the process in which the flow has occurred, a process for prohibiting access from the unauthorized data supplier, a process for generating display data for displaying predetermined warning information on the unauthorized data supplier, or And processing means for executing processing for obtaining information relating to at least one of the source of the illegal data, the content of the illegal data, or the method of supplying the illegal data.
Preferably, the determination means evaluates the periodicity of a series of data as a result of the rewriting, and performs the determination based on the evaluation result.

本発明の第2の観点によると、上記オーバーフロー検知手段において上記オーバーフローが検知された場合、上記データ取得手段において、上記オーバーフローにより書き換えられた結果のデータが取得される。上記判定手段では、上記データ取得手段において取得されたデータに基づいて、上記オーバーフローが上記不正データの入力により引き起こされたものであるか否かが判定される。例えば、上記書き換えられた結果の一連のデータの周期性を評価した結果に基づいて、上記判定が行なわれる。
上記判定手段において、上記オーバーフローが上記不正データの入力により引き起こされたものであると判定された場合、少なくとも、上記オーバーフローが発生したプロセスを停止させる処理、上記不正データの供給元からのアクセスを禁止する処理、上記不正データの供給元の機器において所定の警告情報を表示させるための表示データを生成する処理、または、上記不正データの供給元、上記不正データの内容、もしくは、上記不正データの供給方法の少なくとも何れか1つに関する情報を取得する処理が、上記処理手段において実行される。
According to the second aspect of the present invention, when the overflow is detected by the overflow detection means, the data acquisition means acquires data resulting from rewriting due to the overflow. The determination means determines whether or not the overflow is caused by the input of the illegal data, based on the data acquired by the data acquisition means. For example, the determination is performed based on the result of evaluating the periodicity of a series of data as a result of the rewriting.
If the determination means determines that the overflow is caused by the input of the illegal data, at least a process for stopping the process in which the overflow has occurred and prohibiting access from the source of the illegal data Processing for generating display data for displaying predetermined warning information in the device that is the source of the unauthorized data, or the source of the unauthorized data, the content of the unauthorized data, or the supply of the unauthorized data Processing for acquiring information relating to at least one of the methods is executed in the processing means.

本発明の第3の観点は、不正なデータをコンピュータに入力することによりスタックにオーバーフローを引き起こす攻撃から、上記コンピュータを保護するセキュリティ保護方法であって、上記スタックのオーバーフローを検知する第1の工程と、上記第1の工程において上記オーバーフローが検知された場合、上記オーバーフローによって書き換えられた結果のデータを取得する第2の工程と、上記第2の工程において取得されたデータに基づいて、上記オーバーフローが上記不正データの入力により引き起こされたものであるか否かを判定する第3の工程と、上記第3の工程において、上記オーバーフローが上記不正データの入力により引き起こされたものであると判定された場合、少なくとも、上記オーバーフローが発生したプロセスを停止させるか、上記不正データの供給元からのアクセスを禁止するか、上記不正データの供給元の機器において所定の警告情報を表示させるか、または、上記不正データの供給元、上記不正データの内容、もしくは、上記不正データの供給方法の少なくとも何れか1つに関する情報を取得する第4の工程とを有する。
好適には、上記第3の工程において、上記書き換えられた結果の一連のデータの周期性を評価し、当該評価結果に基づいて上記判定を行なう。
According to a third aspect of the present invention, there is provided a security protection method for protecting the computer from an attack that causes an overflow of the stack by inputting illegal data to the computer, and includes a first step of detecting the overflow of the stack. And when the overflow is detected in the first step, the second step of acquiring data resulting from rewriting by the overflow, and the overflow based on the data acquired in the second step In the third step, it is determined in the third step that the overflow is caused by the input of the illegal data. At least the process where the overflow occurred Either stop the access from the unauthorized data supply source, display predetermined warning information on the unauthorized data supply source device, or supply the unauthorized data source and the contents of the unauthorized data. Or a fourth step of acquiring information relating to at least one of the methods of supplying illegal data.
Preferably, in the third step, the periodicity of a series of data resulting from the rewriting is evaluated, and the determination is performed based on the evaluation result.

本発明の第3の観点によると、上記第1の工程において上記オーバーフローが検知された場合、上記第2の工程において、上記オーバーフローにより書き換えられた結果のデータが取得される。上記第3の工程では、上記第2の工程において取得されたデータに基づいて、上記オーバーフローが上記不正データの入力により引き起こされたものであるか否かが判定される。例えば、上記書き換えられた結果の一連のデータの周期性を評価した結果に基づいて、上記判定が行なわれる。
上記第3の工程において、上記オーバーフローが上記不正データの入力により引き起こされたものであると判定された場合、上記第4の工程において、少なくとも、上記オーバーフローが発生したプロセスが停止されるか、上記不正データの供給元からのアクセスが禁止されるか、上記不正データの供給元の機器において所定の警告情報が表示されるか、または、上記不正データの供給元、上記不正データの内容、もしくは、上記不正データの供給方法の少なくとも何れか1つに関する情報が取得される。
According to the third aspect of the present invention, when the overflow is detected in the first step, data as a result of rewriting due to the overflow is acquired in the second step. In the third step, it is determined based on the data acquired in the second step whether or not the overflow is caused by the input of the illegal data. For example, the determination is performed based on the result of evaluating the periodicity of a series of data as a result of the rewriting.
In the third step, if it is determined that the overflow is caused by the input of the illegal data, in the fourth step, at least the process in which the overflow has occurred is stopped, or Access from the unauthorized data supply source is prohibited, predetermined warning information is displayed on the unauthorized data supply source device, or the unauthorized data supply source, the content of the unauthorized data, or Information on at least one of the illegal data supply methods is acquired.

本発明によれば、コンピュータのスタックにオーバーフローが生じた場合、そのオーバーフローが、不正なデータの入力により引き起こされたものであるか否かを判定することができる。また、この判定結果に基づいて、スタックのオーバーフローを利用した攻撃を仕掛けるための準備行為を防止できる。   According to the present invention, when an overflow occurs in the stack of the computer, it can be determined whether or not the overflow is caused by input of invalid data. Further, based on this determination result, it is possible to prevent a preparatory action for setting up an attack using the stack overflow.

以下、本発明の4つの実施形態について、図面を参照して説明する。   Hereinafter, four embodiments of the present invention will be described with reference to the drawings.

<第1の実施形態>
図1は、本発明の実施形態に係るコンピュータの構成の一例を示すブロック図である。
<First Embodiment>
FIG. 1 is a block diagram showing an example of the configuration of a computer according to an embodiment of the present invention.

図1に示すコンピュータは、CPU10と、記憶装置20と、入出力部30と、プログラムメモリ40と、RAM50とを有する。   The computer shown in FIG. 1 includes a CPU 10, a storage device 20, an input / output unit 30, a program memory 40, and a RAM 50.

CPU10は、プログラムメモリ40に格納される本実施形態に係るプログラムを読み出し、これに基づいて所定の処理を実行する。   The CPU 10 reads the program according to the present embodiment stored in the program memory 40 and executes a predetermined process based on the program.

記憶装置20は、CPU10の処理過程において利用されるデータや、処理結果のデータを記憶する。   The storage device 20 stores data used in the process of the CPU 10 and processing result data.

入出力部30は、CPU10の処理過程において利用されるデータを入力する処理や、処理結果のデータを出力する処理を行なう。
入出力部30には、例えば、LAN(local area network)やインターネットなどのネットワークを介して他の機器との間でデータをやり取りするネットワーク・インターフェース装置や、磁気ディスク、光ディスク、ICカードなどの可搬性を有する記録媒体に対してデータの書き込みや読み出しを行なう装置、キーボードやマウスなどのユーザ・インターフェース装置、ディスプレイ装置などが含まれる。
The input / output unit 30 performs a process of inputting data used in the process of the CPU 10 and a process of outputting process result data.
The input / output unit 30 may be, for example, a network interface device that exchanges data with other devices via a local area network (LAN) or the Internet, a magnetic disk, an optical disk, an IC card, or the like. Examples include a device for writing and reading data on a portable recording medium, a user interface device such as a keyboard and a mouse, a display device, and the like.

プログラムメモリ40は、後述する本実施形態に係るプログラムを記憶する。   The program memory 40 stores a program according to this embodiment to be described later.

RAM50は、CPU10による処理の過程で利用するプログラム・コードやデータを一時的に記憶する。スタックを構成するデータは、このRAM50における所定のスタック領域に格納される。   The RAM 50 temporarily stores program codes and data used in the course of processing by the CPU 10. Data constituting the stack is stored in a predetermined stack area in the RAM 50.

なお、これらのユニット(CPU10、記憶装置20、入出力部30、プログラムメモリ40、RAM50)は、図1の例において、共通のバス60に接続される。各ユニットの間におけるデータの受け渡しは、CPU10の制御の基に、このバス60を介して行なわれる。   These units (CPU 10, storage device 20, input / output unit 30, program memory 40, and RAM 50) are connected to a common bus 60 in the example of FIG. Data is transferred between the units via the bus 60 under the control of the CPU 10.

図2は、本実施形態に係るプログラムの機能的な構成の一例を示すブロック図である。
本実施形態に係るプログラムは、オーバーフロー検知部101と、データ取得部102と、判定部103と、セキュリティ処理部104とを有する。
FIG. 2 is a block diagram illustrating an example of a functional configuration of the program according to the present embodiment.
The program according to the present embodiment includes an overflow detection unit 101, a data acquisition unit 102, a determination unit 103, and a security processing unit 104.

[オーバーフロー検知部101]
オーバーフロー検知部101は、スタックのオーバーフローを検知する。
[Overflow detection unit 101]
The overflow detection unit 101 detects stack overflow.

例えば、オーバーフロー検知部101は、プロセスの処理過程において新たな関数が呼び出された場合、スタック・フレーム中の所定のアドレス(フレーム・ポインタと戻りアドレスとの間や、ローカル変数とフレーム・ポインタとの間など)に、所定値の上書き検出用のデータを挿入する。この値は、例えば、図示しない乱数生成部において生成される乱数を用いて設定する。そして、呼び出し元の関数へ戻る際に、この所定のアドレスに格納されるデータと上記所定値とを比較し、上書き検出用のデータが変化しているか否かを調べる。この結果、上書き検出用のデータが変化している場合に、スタックオーバーフローが発生したと判定する。   For example, when a new function is called in the process of the process, the overflow detection unit 101 determines whether a predetermined address in the stack frame (between a frame pointer and a return address, or between a local variable and a frame pointer). Data for overwriting detection of a predetermined value is inserted in the interval). This value is set using, for example, a random number generated by a random number generator (not shown). When returning to the caller function, the data stored at the predetermined address is compared with the predetermined value to check whether or not the data for overwriting detection has changed. As a result, when the data for overwriting detection has changed, it is determined that a stack overflow has occurred.

また、オーバーフロー検知部101は、新たに呼び出すべき関数に引数として渡されるデータのサイズと、この関数において引数に割り当てられているデータサイズとを比較した結果に基づいて、この関数が呼び出された場合におけるスタックオーバーフローの発生の有無を事前に検知しても良い。上述した引数のチェックは、例えば、‘strcpy()’などの境界チェックを欠いた関数について行なう。   In addition, the overflow detection unit 101, when this function is called based on the result of comparing the data size passed as an argument to the function to be newly called and the data size assigned to the argument in this function Whether or not stack overflow has occurred may be detected in advance. The argument check described above is performed on a function that lacks a boundary check such as ‘strcpy ()’, for example.

[データ取得部102]
データ取得部102は、オーバーフロー検知部101においてスタックオーバーフローが検知された場合、このスタックオーバーフローによって書き換えられた結果のデータを取得する。
[Data acquisition unit 102]
When the overflow detection unit 101 detects a stack overflow, the data acquisition unit 102 acquires data resulting from rewriting due to the stack overflow.

例えば、データ取得部102は、オーバーフロー検知部101においてスタックオーバーフローが検知された場合、そのプロセスを強制終了させて、オペレーティング・システムにコアダンプ(core-dump)・ファイルを出力させる。コアダンプ・ファイルには、強制終了時点におけるプロセスのメモリイメージが記録される。判定部102は、このコアダンプ・ファイルから、スタックオーバーフローによって書き換えられた結果のデータを取得する。   For example, when the overflow detection unit 101 detects a stack overflow, the data acquisition unit 102 forcibly terminates the process and causes the operating system to output a core-dump file. In the core dump file, the memory image of the process at the time of forced termination is recorded. The determination unit 102 acquires data resulting from rewriting due to stack overflow from the core dump file.

[判定部103]
判定部103は、データ取得部102において取得される、スタックオーバーフローによって書き換えられた結果のデータに基づいて、このスタックオーバーフローが、スタックスマッシングなどのセキュリティ攻撃やその準備のために行なわれた、不正なデータの入力により引き起こされたものであるか否かを判定する。
[Determining unit 103]
Based on the data obtained as a result of being rewritten by the stack overflow acquired by the data acquisition unit 102, the determination unit 103 detects that the stack overflow has been performed for security attacks such as stack smashing and the preparation thereof. It is determined whether or not it is caused by data input.

例えば、判定部103は、書き換えられた結果の一連のデータの周期性を評価し、この評価結果に基づいて、スタックオーバーフローが不正データの入力により引き起こされたものであるか否かを判定する。これは、セキュリティ攻撃の準備行為に用いられる不正なデータが、しばしば周期の短い単純なパターンを有していることを利用するものである。   For example, the determination unit 103 evaluates the periodicity of a series of data as a result of rewriting, and determines whether or not the stack overflow is caused by input of invalid data based on the evaluation result. This makes use of the fact that malicious data used for security attack preparation often has a simple pattern with a short period.

また、判定部103は、上記のようなデータの周期性の他にも、例えば、スタックオーバーフローを引き起こしたデータの供給元のネットワーク・アドレスや、当該データの供給元のポート番号、当該データに含まれる特定のデータ・パターン、当該データを有するファイルの名前など、不正データの入力を特徴付けるさまざまな情報に基づいて、上記の判定を行なっても良い。   In addition to the data periodicity as described above, the determination unit 103 includes, for example, the network address of the data supply source causing the stack overflow, the port number of the data supply source, and the data The above determination may be made based on various information that characterizes the input of illegal data, such as a specific data pattern and the name of a file having the data.

[セキュリティ処理部104]
セキュリティ処理部104は、判定部103において、スタックオーバーフローが不正データの入力により引き起こされたものであると判定された場合、そのような不正データの入力からコンピュータのセキュリティを保護するための所定の処理を行なう。
[Security processing unit 104]
When the determination unit 103 determines that the stack overflow is caused by input of illegal data, the security processing unit 104 performs predetermined processing for protecting the security of the computer from such input of illegal data. To do.

例えば、セキュリティ処理部104は、スタックオーバーフローが発生したプロセスを停止させる。これにより、スタックオーバーフローが攻撃準備行為によるものである場合には、これを阻止して、攻撃を未然に防止することができる。また、スタックオーバーフローが攻撃によるものである場合には、不正データに含まれる有害な攻撃コードの実行を阻止することができる。
この場合、セキュリティ処理部104は、判定部103の判定結果を受けて、プロセスを所定期間停止させても良いし、停止の解除を指示する所定のコマンドが入力されるまでの間停止させても良い。
For example, the security processing unit 104 stops the process in which the stack overflow has occurred. As a result, if the stack overflow is caused by an attack preparation action, this can be prevented and the attack can be prevented beforehand. In addition, when the stack overflow is caused by an attack, it is possible to prevent execution of harmful attack codes included in illegal data.
In this case, the security processing unit 104 may stop the process for a predetermined period in response to the determination result of the determination unit 103, or may stop until a predetermined command for instructing release of the stop is input. good.

また、セキュリティ処理部104は、不正データの供給元からのアクセスを禁止しても良い。例えば、不正データの供給元がネットワーク上の機器である場合には、そのネットワーク・アドレスからのアクセスを禁止する。あるいは特定のプロセスが不正データの供給元である場合には、そのプロセス番号からのアクセスを禁止する。このような処理によっても、攻撃準備行為を阻止して、攻撃を未然に防止することができるとともに、攻撃コードの実行を阻止することができる。
この場合、上述と同様に、セキュリティ処理部104は、プロセスを所定期間停止させても良いし、停止の解除を指示する所定のコマンドが入力されるまでの間停止させても良い。
Further, the security processing unit 104 may prohibit access from an unauthorized data supplier. For example, when the source of illegal data is a device on the network, access from the network address is prohibited. Alternatively, when a specific process is a supplier of illegal data, access from the process number is prohibited. Such processing can also prevent an attack preparation action to prevent an attack in advance and also prevent an attack code from being executed.
In this case, as described above, the security processing unit 104 may stop the process for a predetermined period or until a predetermined command instructing release of the stop is input.

また、セキュリティ処理部104は、不正データの供給元の機器において所定の警告情報を表示させるための表示データを生成しても良い。例えば、
「不正な入力が行なわれました。
入力データ:****」
といった内容を、不正データの供給元の機器に装備されたディスプレイ装置に表示させる。これにより、セキュリティ攻撃やその準備行為を仕掛けた者に警告を与えて、そうした行為の抑止を図ることができる。
Further, the security processing unit 104 may generate display data for displaying predetermined warning information on the device that is the source of the unauthorized data. For example,
"Illegal input has been made.
Input data:****"
Such a content is displayed on a display device provided in a device that supplies illegal data. As a result, a warning can be given to a person who has set up a security attack or a preparatory action, and such action can be suppressed.

また、セキュリティ処理部104は、不正データの供給元に関する情報として、例えば、そのネットワーク・アドレスや、プロセス番号、ポート番号を取得しても良い。
あるいは、不正データの内容に関する情報として、入力されたデータや、その中に含まれる攻撃コードを取得しても良い。
更には、不正データの供給方法に関する情報として、不正アクセスによるものか、それとも、コンピュータ・ウィルスによるものか、といった情報を取得しても良い。
このように、不正データの入力に関する種々の情報を取得することによって、攻撃準備行為に対する詳しい知識が得られるため、攻撃の防御に関する効果的な措置を事前に講ずることが可能になる。
Further, the security processing unit 104 may acquire, for example, a network address, a process number, and a port number as information related to the source of unauthorized data.
Alternatively, the input data or the attack code included therein may be acquired as information on the contents of the illegal data.
Furthermore, as information on the method of supplying unauthorized data, information such as whether it is due to unauthorized access or due to a computer virus may be acquired.
As described above, by acquiring various pieces of information related to the input of illegal data, detailed knowledge about the attack preparation action can be obtained, so that it is possible to take effective measures relating to defense against attacks in advance.

ここで、上述したプログラムによる処理を説明する前に、まず、スタックスマッシング攻撃の準備行為について、その一般的な手順を説明する。   Here, before explaining the processing by the above-described program, first, a general procedure for the preparation action of the stack smashing attack will be explained.

(1)攻撃対象のプロセスに適当な長さのデータを入力して、プロセスが強制終了するか否かを調べる。強制終了する場合には、スタックオーバーフローが発生していると推定される。 (1) Input data of an appropriate length to the attack target process and check whether the process is forcibly terminated. In the case of forced termination, it is estimated that a stack overflow has occurred.

(2)スタックオーバーフローの発生が推定されたならば、次に、スタックの構造を解析するための細工が施されたデータをプログラムに入力し、プロセスを強制終了させて、オペレーティング・システムにコアダンプ・ファイルを出力させる。 (2) If the occurrence of a stack overflow is estimated, then data that has been crafted to analyze the stack structure is input to the program, the process is terminated, and the core dump / Output a file.

(3)取得したコアダンプ・ファイルから、各ポインタ(スタック・ポインタ、フレーム・ポインタ、命令ポインタなど)やメモリの内容を解析し、スタック上において呼び出し元関数への戻りアドレスが格納されている位置を推定する。 (3) Analyzing the contents of each pointer (stack pointer, frame pointer, instruction pointer, etc.) and memory from the acquired core dump file, and the position where the return address to the caller function is stored on the stack presume.

(4)上述した(2)および(3)の工程を繰り返し、スタック上の戻りアドレスの位置を特定する。 (4) The steps (2) and (3) described above are repeated to specify the position of the return address on the stack.

(5)特定した戻りアドレスの位置に基づいて、攻撃コードとその指示アドレスとが適切な位置に挿入された不正データを作成する。 (5) Based on the position of the identified return address, illegal data in which the attack code and the instruction address are inserted at an appropriate position is created.

(6)作成した不正データを攻撃対象のプロセスに入力し、所望の動作が実行されるか否かを確認する。 (6) The created illegal data is input to the attack target process, and it is confirmed whether or not a desired operation is executed.

(7)上述した(5)および(6)の工程を繰り返し、攻撃コードを含む不正データを完成させる。 (7) The steps (5) and (6) described above are repeated to complete illegal data including an attack code.

このような攻撃準備行為の手順によると、(1)、(2)および(6)の工程において、スタックオーバーフローが発生する。本実施形態のプログラムでは、スタックオーバーフローの発生が検知された場合に、それがセキュリティ攻撃や上述した攻撃準備行為における不正データの入力によるものであるか否かの判定が行なわる。   According to the procedure of such an attack preparation action, a stack overflow occurs in the steps (1), (2) and (6). In the program of the present embodiment, when occurrence of a stack overflow is detected, it is determined whether or not this is due to an input of illegal data in a security attack or the above-described attack preparation action.

図3は、本実施形態に係るプログラムによる処理の流れの一例を図解したフローチャートである。   FIG. 3 is a flowchart illustrating an example of the flow of processing by the program according to the present embodiment.

ステップST10:
図2には示されていない他のプロセスによる通常の処理が進められる。
Step ST10:
Normal processing by other processes not shown in FIG. 2 proceeds.

ステップST20:
オーバーフロー検知部101は、このプロセスの処理過程において、スタックオーバーフローの発生の有無を監視する。スタックオーバーフローが検知されない場合は、プロセスの処理(ステップST10)を通常通り進行させ、スタックオーバーフローが検知された場合は、データ取得部102へオーバーフローの発生を通知する。
Step ST20:
The overflow detection unit 101 monitors whether or not a stack overflow occurs during the process of this process. If the stack overflow is not detected, the process (step ST10) proceeds as usual. If the stack overflow is detected, the data acquisition unit 102 is notified of the occurrence of the overflow.

ステップST30:
オーバーフロー検知部101からスタックオーバーフローの発生を通知されると、データ取得部102は、このスタックオーバーフローによって書き換えられた結果のデータを取得する。例えば、スタックオーバーフローが検知されたプロセスを強制終了させて、オペレーティング・システムにコアダンプ・ファイルを出力させる。そして、このコアダンプ・ファイルから、スタックオーバーフローによって書き換えられた結果のデータを取得する。
Step ST30:
When the occurrence of a stack overflow is notified from the overflow detection unit 101, the data acquisition unit 102 acquires data resulting from rewriting due to the stack overflow. For example, the process in which the stack overflow is detected is forcibly terminated and the core dump file is output to the operating system. Then, data obtained as a result of rewriting due to the stack overflow is acquired from the core dump file.

ステップST40:
データ取得部102において、スタックオーバーフローにより書き換えられた結果のデータが取得されると、判定部103は、この取得されたデータに基づいて、スタックオーバーフローが、セキュリティ攻撃やそれを準備するための不正データの入力により引き起こされたものであるか否かを判定する。例えば、書き換えを受けた一連のデータの周期性を評価し、その評価結果に基づいて、上記の判定を行なう。
判定の結果、不正なデータの入力によるものではないと判定された場合には、プロセスの処理(ステップST10)を通常通り進行させ、不正なデータの入力によるものと判定された場合には、セキュリティ処理部104へその旨を通知する。
Step ST40:
When the data obtained as a result of rewriting due to the stack overflow is acquired in the data acquisition unit 102, the determination unit 103 determines that the stack overflow is a security attack or illegal data for preparing it based on the acquired data. It is determined whether it is caused by the input of. For example, the periodicity of the rewritten series of data is evaluated, and the above determination is performed based on the evaluation result.
As a result of the determination, if it is determined that the data is not due to illegal data input, the process (step ST10) proceeds as usual, and if it is determined that the data is illegal data input, This is notified to the processing unit 104.

ステップST50:
不正データの入力によるオーバーフローの発生が判定部103より通知されると、セキュリティ処理部104は、不正データの入力からコンピュータのセキュリティを保護するための所定の処理を行なう。
例えば、スタックオーバーフローが発生したプロセスを停止させる処理や、不正データの供給元からのアクセスを禁止する処理、不正データの供給元の機器において所定の警告情報を表示させるための処理、不正データの入力に関する種々の情報を取得する処理を行なう。
Step ST50:
When the determination unit 103 is notified of the occurrence of overflow due to input of illegal data, the security processing unit 104 performs predetermined processing for protecting the security of the computer from the input of illegal data.
For example, processing to stop the process in which stack overflow has occurred, processing to prohibit access from the unauthorized data supply source, processing to display predetermined warning information on the unauthorized data supply device, input of unauthorized data The process which acquires the various information regarding is performed.

以上説明したように、本実施形態に係るプログラムによれば、スタックオーバーフローが検知された場合に、このスタックオーバーフローが、セキュリティ攻撃やその準備行為における不正データの入力により引き起こされたものであるのか否かを判定することができる。すなわち、コンピュータの通常の使用により発生したスタックオーバーフローと、セキュリティ攻撃やその準備行為により発生したスタックオーバーフローとを見分けることができる。したがって、攻撃準備行為の実態を正確に把握することが可能になり、把握した内容を、セキュリティ攻撃に対する事前の対抗措置を講ずるために役立てることができる。   As described above, according to the program according to the present embodiment, when a stack overflow is detected, whether or not the stack overflow is caused by an unauthorized data input in a security attack or a preparation act thereof. Can be determined. That is, it is possible to distinguish between a stack overflow caused by normal use of a computer and a stack overflow caused by a security attack or a preparatory action thereof. Therefore, it is possible to accurately grasp the actual state of the attack preparation action, and the grasped contents can be used for taking a countermeasure against the security attack in advance.

また、本実施形態に係るプログラムによれば、不正データの入力によりスタックオーバーフローが発生したと判定された場合に、コンピュータのセキュリティ保護に係る処理(プロセスの停止、不正アクセスの禁止、警告表示、情報の収集など)を実行することにより、スタック構造の解析行為のような攻撃準備行為を抑止し、セキュリティ攻撃を未然に防止することができるため、セキュリティの脅威を一層減少させることができる。   Further, according to the program according to the present embodiment, when it is determined that stack overflow has occurred due to input of unauthorized data, processing related to computer security protection (process stop, unauthorized access prohibition, warning display, information Etc.) can be suppressed, and security attacks can be prevented in advance, so that security threats can be further reduced.

<第2の実施形態>
次に、本発明の第2の実施形態について述べる。
<Second Embodiment>
Next, a second embodiment of the present invention will be described.

第2の実施形態では、スタックオーバーフローにより書き換えられた結果のデータの相関値に基づいて、不正データの入力の有無が判定される。   In the second embodiment, the presence / absence of illegal data input is determined based on the correlation value of the data resulting from rewriting due to stack overflow.

例として以下に説明する本実施形態に係るプログラムは、図2に示すプログラムにおいて、データ取得部102および判定部103を、次に述べるデータ取得部102Aおよび判定部103Aへ置き換えたものである。このプログラムは、例えば図1に示すコンピュータにおいて実行される。   The program according to the present embodiment described below as an example is obtained by replacing the data acquisition unit 102 and the determination unit 103 with the data acquisition unit 102A and the determination unit 103A described below in the program shown in FIG. This program is executed, for example, in the computer shown in FIG.

まず、図2に示すプログラムに対して異なる構成である、データ取得部102Aおよび判定部103Aについて説明する。   First, the data acquisition unit 102A and the determination unit 103A, which are different configurations from the program shown in FIG. 2, will be described.

[データ取得部102A]
データ取得部102Aは、オーバーフロー検知部101においてスタックオーバーフローが検知された場合、このスタックオーバーフローによって書き換えられたメモリ領域から、アドレス順に並ぶ所定数のデータをデータ列として抽出する。
[Data acquisition unit 102A]
When the overflow detection unit 101 detects a stack overflow, the data acquisition unit 102A extracts a predetermined number of data arranged in the order of addresses as a data string from the memory area rewritten by the stack overflow.

例えば、データ取得部102Aは、オーバーフロー検知部101においてスタックオーバーフローが検知された場合、そのプロセスの強制終了時に出力されるコアダンプ・ファイルから、メモリ上のスタックを含む領域においてアドレス順に並ぶ所定数のデータをデータ列として抽出する。   For example, when a stack overflow is detected by the overflow detection unit 101, the data acquisition unit 102A uses a predetermined number of data arranged in the order of addresses in the area including the stack on the memory from the core dump file output when the process is forcibly terminated. Is extracted as a data string.

[判定部103A]
判定部103Aは、データ取得部102Aにおいて抽出されたデータ列の相関値を算出し、算出した相関値に基づいて、スタックオーバーフローが不正なデータの入力により引き起こされたものであるか否かを判定する。
[Determination unit 103A]
The determination unit 103A calculates the correlation value of the data string extracted by the data acquisition unit 102A, and determines whether the stack overflow is caused by incorrect data input based on the calculated correlation value To do.

例えば、判定部103Aは、データ取得部102Aにおいて2つの同一のデータ列を複数の異なる位相で比較し、それぞれの位相において、この2つの同一データ列の対応するデータ同士が一致する数に応じて、自己相関値を算出する。   For example, the determination unit 103A compares two identical data strings with a plurality of different phases in the data acquisition unit 102A, and according to the number of corresponding data in the two identical data strings in each phase. Calculate an autocorrelation value.

仮に、データ取得部102Aにおいて、データ長N(Nは2以上の正の整数を示す)のデータ列Dが抽出されるものとし、このデータ列Dの先頭からi番目(iは‘0’から‘N−1’までの正の整数を示す)のデータを‘D[i]’と表すことにする。
このような条件の元で、判定部103Aは、例えば、‘0’から‘N−1’までの整数iについて、等式
D[i]=D[i+P]…(1)
が成立する数をカウントし、これを位相Pにおける相関値R[P]とする。
ただし、‘i+P’が‘N−1’を超える場合や‘0’より小さい場合、式(1)は不成立と見なす。したがって、位相Pが‘0’から‘N−1’までの整数の場合に、相関値R[P]は‘1’以上の有意味な値を持ち得る。
Assume that the data acquisition unit 102A extracts a data string D having a data length N (N is a positive integer equal to or greater than 2). Data indicating positive integers up to 'N-1') will be expressed as 'D [i]'.
Under such conditions, the determination unit 103A determines, for example, the equation D [i] = D [i + P] (1) for the integer i from “0” to “N−1”.
Is counted as a correlation value R [P] at phase P.
However, when “i + P” exceeds “N−1” or is smaller than “0”, Formula (1) is regarded as not established. Therefore, when the phase P is an integer from “0” to “N−1”, the correlation value R [P] can have a meaningful value of “1” or more.

図4は、判定部103Aにおける自己相関値の算出方法の一例を説明するための図である。   FIG. 4 is a diagram for explaining an example of an autocorrelation value calculation method in the determination unit 103A.

図4の例では、データ取得部102Aにおいてデータ長N=18のデータ列Dとして、
‘abcdefabcdefabcdef’
というデータ列が抽出される。また、データD[0],D[1],D[2],…,D[17]は、それぞれ‘a’,‘b’,‘c’,…,‘f’である。
In the example of FIG. 4, as the data string D with the data length N = 18 in the data acquisition unit 102 </ b> A,
'abcdefabcdefabcdef'
Is extracted. The data D [0], D [1], D [2],..., D [17] are “a”, “b”, “c”,.

図4(A)は、位相P=0の場合における各データの対応関係を示す。この場合、‘0’から‘17’までの整数iについて式(1)が全て成立するため、相関値R[0]は‘18’となる。
また、図4(B)および(C)は、位相P=1および位相P=2の場合における各データの対応関係を示す。この場合は、‘0’から‘17’までの整数iについて式(1)が何れも成り立たないため、相関値R[0]は‘0’となる。
図4(D)は、位相P=6の場合における各データの対応関係を示す。この場合、‘6’から‘17’までの整数iについて式(1)が成立するため、相関値R[0]は‘12’となる。
FIG. 4A shows the correspondence of each data when the phase P = 0. In this case, since all the expressions (1) hold for the integer i from “0” to “17”, the correlation value R [0] is “18”.
FIGS. 4B and 4C show the correspondence of each data when the phase P = 1 and the phase P = 2. In this case, since none of the expressions (1) hold for the integer i from “0” to “17”, the correlation value R [0] is “0”.
FIG. 4D shows the correspondence of each data when the phase P = 6. In this case, since the equation (1) is established for the integer i from “6” to “17”, the correlation value R [0] is “12”.

このように、図4の例に示すデータが抽出された場合、相関値R[P]は、位相Pが‘0’,‘6’,‘12’の場合において、それぞれ‘18’、‘12’、‘6’となり、他の場合において‘0’となる。   In this way, when the data shown in the example of FIG. 4 is extracted, the correlation value R [P] is “18”, “12” when the phase P is “0”, “6”, “12”, respectively. ',' 6 ', and' 0 'in other cases.

また、データ列の自己相関値は、次のような方法によって算出することもできる。   The autocorrelation value of the data string can also be calculated by the following method.

データ列Dを2つ並べたデータ長2Nのデータ列D2について、等式
D[i]=D2[i+P]…(2)
が成立する数を‘0’から‘N−1’までの整数iについてカウントし、これを位相Pにおける相関値R2[P]とする。ただし、‘i+P’が‘2N−1’を超える場合や‘0’より小さい場合、式(2)は不成立と見なす。
For a data string D2 having a data length of 2N in which two data strings D are arranged, the equation D [i] = D2 [i + P] (2)
Is counted for an integer i from '0' to 'N-1', and this is set as a correlation value R2 [P] at phase P. However, when “i + P” exceeds “2N−1” or is smaller than “0”, Expression (2) is regarded as not established.

例えば、図4と同様に、データ取得部102Aにおいてデータ長N=18のデータ列Dとして、
‘abcdefabcdefabcdef’
が抽出されるものとすると、これを2つ並べたデータ列D2は、
‘abcdefabcdefabcdefabcdefabcdefabcdef’
となる。
この場合、相関値R2[P]は、位相Pが‘0’,‘6’,‘12’の場合において何れも‘18’となり、他の場合において‘0’となる。
For example, as in FIG. 4, in the data acquisition unit 102A, as a data string D having a data length N = 18,
'abcdefabcdefabcdef'
Is extracted, a data string D2 in which two of them are arranged is
'abcdefabcdefabcdefabcdefabcdefabcdef'
It becomes.
In this case, the correlation value R2 [P] is “18” when the phase P is “0”, “6”, and “12”, and “0” in other cases.

なお、上述した例における判定部103Aは、2つの同一データ列に関する自己相関値を算出するが、これに限らず、データ取得部102Aによって共通のメモリ領域から抽出される異なる2つのデータ列に関して、上述と同様な方法により、相互相関値を算出しても良い。   Note that the determination unit 103A in the above-described example calculates autocorrelation values for two identical data sequences, but is not limited to this, regarding two different data sequences extracted from a common memory area by the data acquisition unit 102A. The cross-correlation value may be calculated by the same method as described above.

このようにして各位相における相関値を算出すると、判定部103Aは、算出した相関値が所定のしきい値を超えるか否かを、各位相について調べる。そして、相関値が所定のしきい値を超える位相の数をカウントし、このカウント値が所定数に達する場合、スタックオーバーフローが不正なデータの入力により引き起こされたものであると判定する。   When the correlation value in each phase is calculated in this way, the determination unit 103A checks for each phase whether or not the calculated correlation value exceeds a predetermined threshold value. Then, the number of phases in which the correlation value exceeds a predetermined threshold is counted, and when the count value reaches a predetermined number, it is determined that the stack overflow is caused by incorrect data input.

次に、上述した構成を有するプログラムの処理について、図5に示すフローチャートを参照して説明する。   Next, processing of the program having the above-described configuration will be described with reference to the flowchart shown in FIG.

ステップST10〜ST30:
ステップST10〜ST30の処理は、図3のフローチャートと同様である。
すなわち、通常処理(ステップST10)の過程においてスタックオーバーフローの発生の有無が監視され(ステップST20)、スタックオーバーフローの発生が検知された場合、書き換えられた結果のデータが抽出される(ステップST30)。
Steps ST10 to ST30:
The processing in steps ST10 to ST30 is the same as that in the flowchart of FIG.
That is, the occurrence of stack overflow is monitored during the normal process (step ST10) (step ST20), and when the occurrence of stack overflow is detected, the rewritten data is extracted (step ST30).

ステップST410:
データ取得部102Aにおいて、スタックオーバーフローにより書き換えられたメモリ上の領域から所定データ長のデータ列が抽出されると、判定部103Aは、抽出されたデータ列の各位相の相関値を算出する。
Step ST410:
When the data acquisition unit 102A extracts a data string having a predetermined data length from the area on the memory rewritten due to stack overflow, the determination unit 103A calculates a correlation value of each phase of the extracted data string.

ステップST420:
次に、判定部103Aは、算出した各位相の相関値と、所定のしきい値とを比較し、相関値がしきい値を超える位相の数をカウントする。
Step ST420:
Next, the determination unit 103A compares the calculated correlation value of each phase with a predetermined threshold value, and counts the number of phases whose correlation value exceeds the threshold value.

ステップST440:
そして、判定部103Aは、このカウント値が所定数に達するか否かを判定し、所定数に達する場合、スタックオーバーフローが不正なデータの入力により引き起こされたものであると判定して、ステップST50に移る。また、カウント値が所定数に達しない場合は、ステップST10の通常処理に戻る。
Step ST440:
Then, the determination unit 103A determines whether or not the count value reaches a predetermined number. If the count value reaches the predetermined number, the determination unit 103A determines that the stack overflow is caused by incorrect data input, and performs step ST50. Move on. If the count value does not reach the predetermined number, the process returns to the normal process in step ST10.

ステップST50:
ステップST50の処理は、図3のフローチャートと同様である。
すなわち、セキュリティ処理部104が、不正データの入力からコンピュータのセキュリティを保護するために、プロセスの停止や、不正アクセスの禁止といった、所定の処理を実行する。
Step ST50:
The process of step ST50 is the same as that of the flowchart of FIG.
That is, the security processing unit 104 executes predetermined processing such as process stop and unauthorized access prohibition in order to protect the security of the computer from input of unauthorized data.

以上説明したように、本実施形態に係るプログラムによれば、スタックオーバーフローが検知された場合に、スタックオーバーフローにより書き換えられたメモリ上の領域よりデータ列が抽出され、その相関値に基づいて、スタックオーバーフローが不正なデータの入力により引き起こされたものであるか否かの判定が行なわれる。一般に攻撃準備行為に用いられるデータは、解析を容易にするため、周期性を持つ比較的単純なパターンを有することが多いため、書き換えられた結果のデータの相関値を調べることにより、それが攻撃を準備するために入力されたデータであるか否かを推定することが可能になる。したがって、攻撃準備行為の実態を正確に把握することが可能になり、把握した内容を、セキュリティ攻撃に対する事前の対抗措置を講ずるために役立てることができる。
また、図2に示すプログラムと同様に、セキュリティ処理部104においてコンピュータのセキュリティ保護処理が実行されるため、攻撃準備行為を抑止して、セキュリティ攻撃を未然に防止することができる。
As described above, according to the program according to the present embodiment, when a stack overflow is detected, a data string is extracted from the area on the memory rewritten by the stack overflow, and the stack is determined based on the correlation value. A determination is made whether the overflow is caused by incorrect data input. In general, data used for preparatory attacks often has a relatively simple pattern with periodicity in order to facilitate analysis. By examining the correlation value of the rewritten data, it can be attacked. It is possible to estimate whether or not the data is input to prepare the data. Therefore, it is possible to accurately grasp the actual state of the attack preparation action, and the grasped contents can be used for taking a countermeasure against the security attack in advance.
Further, similarly to the program shown in FIG. 2, since the security processing of the computer is executed in the security processing unit 104, an attack preparation action can be suppressed and a security attack can be prevented in advance.

<第3の実施形態>
次に、本発明の第3の実施形態について述べる。
<Third Embodiment>
Next, a third embodiment of the present invention will be described.

上述した第2の実施形態と第3の実施形態との違いは、第2の実施形態において、相関値が所定のしきい値を超える位相の数に基づいて不正データの入力に関する判定が行なわれるところを、第3の実施形態においては、相関値のばらつきを示す所定の統計量に基づいて上記の判定が行なわれる点にある。   The difference between the second embodiment and the third embodiment described above is that, in the second embodiment, the determination regarding the input of illegal data is performed based on the number of phases whose correlation value exceeds a predetermined threshold value. However, in the third embodiment, the above determination is performed based on a predetermined statistic indicating the variation of the correlation value.

例として以下に説明する本実施形態に係るプログラムは、図2に示すプログラムにおいて、データ取得部102および判定部103を、上述したデータ取得部102Aおよび後述する判定部103Bへ置き換えたものである。このプログラムは、例えば、図1に示すコンピュータにおいて実行される。   The program according to the present embodiment described below as an example is obtained by replacing the data acquisition unit 102 and the determination unit 103 with the data acquisition unit 102A and the determination unit 103B described later in the program illustrated in FIG. This program is executed, for example, in the computer shown in FIG.

まず、第2の実施形態のプログラムに対して異なる構成である、判定部103Bについて説明する。   First, the determination unit 103B, which is a different configuration from the program of the second embodiment, will be described.

[判定部103B]
判定部103Bは、データ取得部102Aにおいて抽出されたデータ列の相関値を各位相において算出し、算出した複数の相関値のばらつきを示す所定の統計量(例えば標準偏差)を算出する。そして、この算出した統計量に基づいて、スタックオーバーフローが不正なデータの入力により引き起こされたものであるか否かを判定する。
[Determination unit 103B]
The determination unit 103B calculates the correlation value of the data string extracted by the data acquisition unit 102A at each phase, and calculates a predetermined statistic (for example, standard deviation) indicating the variation of the calculated plurality of correlation values. Then, based on the calculated statistic, it is determined whether or not the stack overflow is caused by the input of invalid data.

次に、上述した構成を有するプログラムの処理について、図6に示すフローチャートを参照して説明する。   Next, processing of the program having the above-described configuration will be described with reference to the flowchart shown in FIG.

ステップST10〜ST30,ST410:
ステップST10〜ST30,ST410の処理は、図5のフローチャートと同様である。
すなわち、通常処理(ステップST10)の過程においてスタックオーバーフローの発生の有無が監視され(ステップST20)、スタックオーバーフローの発生が検知された場合、書き換えられた結果のデータが抽出され(ステップST30)、その相関値が算出される(ステップST410)。
Steps ST10 to ST30, ST410:
The processing of steps ST10 to ST30 and ST410 is the same as the flowchart of FIG.
That is, the occurrence of stack overflow is monitored during the normal process (step ST10) (step ST20), and when the occurrence of stack overflow is detected, the rewritten result data is extracted (step ST30). A correlation value is calculated (step ST410).

ステップST430:
判定部103Bは、各位相の相関値を算出すると、算出した複数の相関値のばらつきを示す統計量として、例えば標準偏差を算出する。
Step ST430:
When the determination unit 103B calculates the correlation value of each phase, the determination unit 103B calculates, for example, a standard deviation as a statistic indicating the variation of the calculated plurality of correlation values.

ステップST450:
そして、判定部103Bは、算出した標準偏差と所定のしきい値とを比較し、標準偏差が所定のしきい値より大きい場合、すなわち、相関値のばらつき度合いが大きい場合に、スタックオーバーフローが不正なデータの入力により引き起こされたものであると判定して、ステップST50に移る。また、標準偏差がこのしきい値に達しない場合は、ステップST10の通常処理に戻る。
Step ST450:
Then, the determination unit 103B compares the calculated standard deviation with a predetermined threshold, and if the standard deviation is larger than the predetermined threshold, that is, if the degree of variation of the correlation value is large, the stack overflow is incorrect. It is determined that it is caused by the input of correct data, and the process proceeds to step ST50. If the standard deviation does not reach this threshold value, the process returns to the normal process of step ST10.

ステップST50:
ステップST50の処理は、図3のフローチャートと同様であり、プロセスの停止や、不正アクセスの禁止といった、所定のセキュリティ保護処理が実行される。
Step ST50:
The processing in step ST50 is the same as that in the flowchart of FIG. 3, and predetermined security protection processing such as process stop and unauthorized access prohibition is executed.

以上説明したように、本実施形態に係るプログラムによれば、スタックオーバーフローが検知された場合に、スタックオーバーフローにより書き換えられたメモリ上の領域において抽出されたデータ列の相関値のばらつき度合いに基づいて、スタックオーバーフローが不正なデータの入力により引き起こされたものであるか否かの判定が行なわれる。したがって、本実施形態においても、第2の実施形態と同様に、攻撃準備行為の実態を正確に把握することが可能になる。
また、第1、第2の実施形態と同様にして、適切なセキュリティ保護処理が実行されるため、攻撃準備行為の抑止と、セキュリティ攻撃の未然の防止を図ることができる。
As described above, according to the program according to the present embodiment, when a stack overflow is detected, based on the variation degree of the correlation value of the data string extracted in the area on the memory rewritten due to the stack overflow. A determination is made as to whether the stack overflow is caused by incorrect data input. Therefore, also in the present embodiment, as in the second embodiment, it is possible to accurately grasp the actual state of the attack preparation act.
In addition, since appropriate security protection processing is executed in the same manner as in the first and second embodiments, it is possible to suppress an attack preparation act and prevent a security attack.

<第4の実施形態>
次に、本発明の第4の実施形態について述べる。
<Fourth Embodiment>
Next, a fourth embodiment of the present invention will be described.

第4の実施形態では、上述した第2および第3の実施形態における相関値に基づいた判定方法を組み合わせて、スタックオーバーフローが不正データの入力により引き起こされたものであるか否かの判定が行なわれる。   In the fourth embodiment, the determination method based on the correlation value in the second and third embodiments described above is combined to determine whether or not the stack overflow is caused by the input of invalid data. It is.

例として以下に説明する本実施形態に係るプログラムは、図2に示すプログラムにおいて、データ取得部102および判定部103を、上述したデータ取得部102Aおよび後述する判定部103Cへ置き換えたものである。このプログラムは、例えば、図1に示すコンピュータにおいて実行される。   The program according to the present embodiment described below as an example is obtained by replacing the data acquisition unit 102 and the determination unit 103 with the data acquisition unit 102A and the determination unit 103C described later in the program illustrated in FIG. This program is executed, for example, in the computer shown in FIG.

まず、第2の実施形態のプログラムに対して異なる構成である、判定部103Cについて説明する。   First, the determination unit 103C, which is a different configuration from the program of the second embodiment, will be described.

[判定部103C]
判定部103Cは、データ取得部102Aにおいて抽出されたデータ列の相関値を算出し、算出した相関値が所定のしきい値を超えるか否かを、各位相について調べる。そして、相関値が所定のしきい値を超える位相の数をカウントし、このカウント値に基づいて、スタックオーバーフローが不正なデータの入力により引き起こされたものであるか否かに関する第1の仮判定を行なう。
さらに、判定部103Cは、この算出した複数の相関値のばらつきを示す所定の統計量(例えば標準偏差)を算出し、算出した統計量に基づいて、スタックオーバーフローが不正なデータの入力により引き起こされたものであるか否かに関する第2の仮判定を行なう。
そして、判定部103Cは、第1の仮判定および第2の仮判定の判定結果に基づいて、スタックオーバーフローが不正なデータの入力により引き起こされたものであるか否かを最終判定する。
[Determination unit 103C]
The determination unit 103C calculates the correlation value of the data string extracted by the data acquisition unit 102A, and checks whether or not the calculated correlation value exceeds a predetermined threshold value for each phase. Then, the number of phases in which the correlation value exceeds a predetermined threshold value is counted, and a first provisional determination regarding whether or not the stack overflow is caused by incorrect data input based on the count value To do.
Further, the determination unit 103C calculates a predetermined statistic (for example, standard deviation) indicating the variation of the calculated plurality of correlation values, and based on the calculated statistic, stack overflow is caused by incorrect data input. A second provisional determination is made as to whether or not the
Then, the determination unit 103C finally determines whether or not the stack overflow is caused by incorrect data input based on the determination results of the first temporary determination and the second temporary determination.

例えば、判定部103Cは、第1の仮判定および第2の仮判定の何れか一方の判定結果において、スタックオーバーフローが不正データの入力により引き起こされたものであると仮判定される回数をカウントする。
そして、第1の仮判定および第2の仮判定の両方においてスタックオーバーフローが不正データの入力により引き起こされたものであると仮判定される場合、または、上述したカウント数が所定の回数に達する場合に、スタックオーバーフローが不正データの入力により引き起こされたものであると最終判定する。
For example, the determination unit 103C counts the number of times that a stack overflow is temporarily determined to be caused by input of invalid data in one of the first temporary determination and the second temporary determination. .
Then, when it is tentatively determined that the stack overflow is caused by the input of invalid data in both the first tentative determination and the second tentative determination, or when the above-mentioned count number reaches a predetermined number Finally, it is finally determined that the stack overflow is caused by the input of invalid data.

次に、上述した構成を有するプログラムの処理について、図7および図8に示すフローチャートを参照して説明する。   Next, processing of the program having the above-described configuration will be described with reference to flowcharts shown in FIGS.

ステップST2:
まず、後述の判定処理において用いるカウンタ変数Cの値が‘0’にクリアされる。
Step ST2:
First, the value of the counter variable C used in the determination process described later is cleared to “0”.

ステップST4:
次いで、後述の判定処理において用いるフラグ変数F1およびF2の値が‘0’にクリアされる。
Step ST4:
Next, the values of flag variables F1 and F2 used in the determination process described later are cleared to “0”.

ステップST10〜ST30,ST410〜ST430:
ステップST10〜ST30,ST410〜ST430の処理は、図5および図6のフローチャートにおける同一符号の処理と同様である。
すなわち、通常処理(ステップST10)の過程においてスタックオーバーフローの発生の有無が監視され(ステップST20)、スタックオーバーフローの発生が検知された場合、書き換えられた結果のデータが抽出され(ステップST30)、その相関値が算出される(ステップST410)。そして、相関値がしきい値を超える位相の数がカウントされるとともに(ステップST420)、相関値のばらつきを示す標準偏差が算出される(ステップST430)。
Steps ST10 to ST30, ST410 to ST430:
The processes of steps ST10 to ST30 and ST410 to ST430 are the same as the processes with the same reference numerals in the flowcharts of FIGS.
That is, the occurrence of stack overflow is monitored during the normal process (step ST10) (step ST20), and when the occurrence of stack overflow is detected, the rewritten result data is extracted (step ST30). A correlation value is calculated (step ST410). Then, the number of phases where the correlation value exceeds the threshold value is counted (step ST420), and a standard deviation indicating the variation of the correlation value is calculated (step ST430).

ステップST440、ST445:
判定部103Cは、ステップST420においてカウントされた位相の数が、所定のしきい値を超えるか否かの判定を行なう(ステップST440)。所定のしきい値を超える場合は、フラグ変数F1を‘1’に変更し(ステップST445)、所定のしきい値を超えない場合は、フラグ変数F1を‘0’のままにして、ステップST450に移行する。値‘1’のフラグ変数F1は、上述した第1の仮判定において、スタックオーバーフローが不正データの入力によるとの判定結果を示す。
Steps ST440 and ST445:
Determination section 103C determines whether or not the number of phases counted in step ST420 exceeds a predetermined threshold value (step ST440). If the predetermined threshold value is exceeded, the flag variable F1 is changed to '1' (step ST445). If the predetermined threshold value is not exceeded, the flag variable F1 is kept at '0' and step ST450. Migrate to The flag variable F1 having a value “1” indicates a determination result that the stack overflow is caused by input of invalid data in the first provisional determination described above.

ステップST450、ST455:
さらに、判定部103Cは、ステップST430において算出された標準偏差が、所定のしきい値を超えるか否かの判定を行なう。(ステップST450)。所定のしきい値を超える場合は、フラグ変数F2を‘1’に変更し(ステップST455)、所定のしきい値を超えない場合は、フラグ変数F2を‘0’のままにして、ステップST460に移行する。値‘1’のフラグ変数F2は、上述した第2の仮判定において、スタックオーバーフローが不正データの入力によるとの判定結果を示す。
Steps ST450 and ST455:
Further, determination section 103C determines whether or not the standard deviation calculated in step ST430 exceeds a predetermined threshold value. (Step ST450). If the predetermined threshold value is exceeded, the flag variable F2 is changed to “1” (step ST455). If the predetermined threshold value is not exceeded, the flag variable F2 remains “0” and step ST460. Migrate to The flag variable F2 having a value “1” indicates a determination result that the stack overflow is caused by input of invalid data in the second provisional determination described above.

ステップST460:
次いで、判定部103Cは、フラグ変数F1およびF2が共に‘1’であるか否かを調べる(ステップST460)。フラグ変数F1およびF2が共に‘1’である場合は、スタックオーバーフローが不正データの入力によるとの最終判定を下し、ステップST50へ移行する。フラグ変数F1およびF2が共に‘1’でない場合は、ステップST462へ移行する。
Step ST460:
Next, determination section 103C checks whether flag variables F1 and F2 are both “1” (step ST460). When flag variables F1 and F2 are both “1”, a final determination is made that the stack overflow is caused by input of invalid data, and the process proceeds to step ST50. When flag variables F1 and F2 are not both “1”, the process proceeds to step ST462.

ステップST462〜ST466:
ステップST462において、判定部103Cは、フラグ変数F1またはF2が‘1’であるか否かを調べる(ステップST462)。フラグ変数F1またはF2が‘1’である場合は、カウンタ変数Cに‘1’を加算した後、カウンタ変数Cが所定のしきい値を越えるか否かを調べる(ステップST466)。カウンタ変数Cがしきい値を超える場合、判定部103Cは、スタックオーバーフローが不正データの入力によるとの最終判定を下し、ステップST50へ移行する。
ステップST462の判定においてフラグ変数F1およびF2が両方‘0’である場合や、ステップST466の判定においてカウンタ変数Cがしきい値を超えない場合、判定部103Cは、処理をステップST4へ戻す。これにより、フラグ変数F1およびF2が‘0’にクリアされ、ステップST10以降の処理が繰り返される。
Steps ST462 to ST466:
In step ST462, the determination unit 103C checks whether or not the flag variable F1 or F2 is “1” (step ST462). If the flag variable F1 or F2 is “1”, after adding “1” to the counter variable C, it is checked whether or not the counter variable C exceeds a predetermined threshold (step ST466). When the counter variable C exceeds the threshold value, the determination unit 103C makes a final determination that the stack overflow is due to input of invalid data, and proceeds to step ST50.
If both flag variables F1 and F2 are “0” in the determination in step ST462, or if counter variable C does not exceed the threshold value in the determination in step ST466, determination unit 103C returns the process to step ST4. Thereby, the flag variables F1 and F2 are cleared to “0”, and the processes after step ST10 are repeated.

ステップST50:
ステップST50の処理は、図3のフローチャートと同様であり、プロセスの停止や、不正アクセスの禁止といった、所定のセキュリティ保護処理が実行される。
Step ST50:
The processing in step ST50 is the same as that in the flowchart of FIG. 3, and predetermined security protection processing such as process stop and unauthorized access prohibition is executed.

以上説明したように、本実施形態に係るプログラムによれば、スタックオーバーフローが検知された場合に、スタックオーバーフローにより書き換えられたメモリ上の領域よりデータ列が抽出され、その相関値が算出される。そして、一定のデータ長において相関値が極大となる位相の数や、一定のデータ長における相関値のばらつきの度合いに基づいて、スタックオーバーフローが不正なデータの入力により引き起こされたものであるか否かの判定が行なわれる。したがって、本実施形態においても、上述した第2および第3の実施形態と同様に、攻撃準備行為の実態を正確に把握することが可能になる。   As described above, according to the program according to the present embodiment, when a stack overflow is detected, a data string is extracted from the area on the memory rewritten by the stack overflow, and the correlation value is calculated. Whether or not the stack overflow is caused by incorrect data input based on the number of phases where the correlation value becomes maximum at a certain data length and the degree of variation of the correlation value at a certain data length Is determined. Therefore, also in the present embodiment, as in the second and third embodiments described above, it is possible to accurately grasp the actual situation of the attack preparation act.

加えて、本実施形態によれば、相関値の異なる判定方法の組み合わせに基づいて判定が行なわれるため、攻撃準備行為によるスタックオーバーフローの発生をより正確に把握することが可能になる。
また、一方の判定方法においてのみ不正データ入力の仮判定が下される回数をカウントし、それが所定回数に達する場合に不正データ入力の最終判定を下すことから、スタックオーバーフローが頻発する場合において、それが攻撃準備行為によるものか否かを的確に判定することができる。
さらに、第1ないし第3の実施形態と同様にして、適切なセキュリティ保護処理が実行されるため、攻撃準備行為の抑止と、セキュリティ攻撃の未然の防止を図ることができる。
In addition, according to the present embodiment, the determination is performed based on a combination of determination methods having different correlation values, so that it is possible to more accurately grasp the occurrence of stack overflow due to the attack preparation action.
In addition, in the case where stack overflow frequently occurs, the number of times that the temporary determination of illegal data input is made only in one of the determination methods and the final determination of incorrect data input is made when it reaches a predetermined number of times. It is possible to accurately determine whether or not it is due to an attack preparation act.
Furthermore, since the appropriate security protection processing is executed in the same manner as in the first to third embodiments, it is possible to suppress the attack preparation action and prevent the security attack.

なお、本発明は上述した実施形態に限定されない。
例えば、本発明のプログラムは、上述した実施形態のようにROM40に予め書き込まれたものでも良いし、記憶装置20から読み出したものでも良い。あるいは、入出力部30において光ディスクなどの記録媒体から読み出したものや、ネットワークを介して他の機器から入力したものでも良い。あるいは、上述のような幾つかの方法によって取得されたプログラムの部分データを組み合わせたものでも良い。
In addition, this invention is not limited to embodiment mentioned above.
For example, the program of the present invention may be previously written in the ROM 40 as in the above-described embodiment, or may be read from the storage device 20. Or what was read from recording media, such as an optical disk, in the input-output part 30, or what was input from the other apparatus via the network may be used. Or the partial data of the program acquired by the several methods as mentioned above may be combined.

また、本発明は、上述した実施形態のように、プログラムによって実現することも可能であるが、その一部または全部の処理を、専用のハードウェアによって実行させることも可能である。例えば、図2に示すブロック図において、機能ブロックの一部または全部をハードウェアの回路に置き換えることも可能である。その場合の回路は、CPUと同一の半導体チップ上に形成しても良いし、別のチップ上に形成しても良い。   Further, the present invention can be realized by a program as in the above-described embodiment, but part or all of the processing can be executed by dedicated hardware. For example, in the block diagram shown in FIG. 2, some or all of the functional blocks can be replaced with hardware circuits. The circuit in that case may be formed on the same semiconductor chip as the CPU, or may be formed on another chip.

本発明の実施形態に係るコンピュータの構成の一例を示すブロック図である。It is a block diagram which shows an example of a structure of the computer which concerns on embodiment of this invention. 本発明の第1の実施形態に係るプログラムの機能的な構成の一例を示すブロック図である。It is a block diagram which shows an example of a functional structure of the program which concerns on the 1st Embodiment of this invention. 第1の実施形態に係るプログラムによる処理の流れの一例を図解したフローチャートである。It is the flowchart which illustrated an example of the flow of processing by the program concerning a 1st embodiment. 判定部における自己相関値の算出方法の一例を説明するための図である。It is a figure for demonstrating an example of the calculation method of the autocorrelation value in a determination part. 第2の実施形態に係るプログラムによる処理の流れの一例を図解したフローチャートである。It is the flowchart which illustrated an example of the flow of processing by the program concerning a 2nd embodiment. 第3の実施形態に係るプログラムによる処理の流れの一例を図解したフローチャートである。It is the flowchart which illustrated an example of the flow of processing by the program concerning a 3rd embodiment. 第4の実施形態に係るプログラムによる処理の流れの一例を図解した第1のフローチャートである。It is the 1st flowchart illustrating an example of the flow of processing by the program concerning a 4th embodiment. 第4の実施形態に係るプログラムによる処理の流れの一例を図解した第2のフローチャートである。It is the 2nd flowchart which illustrated an example of the flow of processing by the program concerning a 4th embodiment. C言語のソース・コードの一例を示す図である。It is a figure which shows an example of the source code of C language. 図9に示すソース・コードが実行された場合におけるスタックの状態の一例を図解した図である。FIG. 10 is a diagram illustrating an example of a stack state when the source code illustrated in FIG. 9 is executed. スタックオーバーフローが発生した場合におけるスタックの状態の一例を図解した図である。It is the figure which illustrated an example of the state of a stack when stack overflow occurred. スタックスマッシング攻撃によって攻撃コードが実行される様子を図解した図である。It is the figure which illustrated a mode that the attack code was executed by the stack smashing attack. 非特許文献1の方法によるスタックスマッシング攻撃の防御方法を説明するための図である。It is a figure for demonstrating the defense method of the stack smashing attack by the method of a nonpatent literature 1. FIG. 非特許文献2の方法によるスタックスマッシング攻撃の防御方法を説明するための第1の図である。It is the 1st figure for demonstrating the defense method of the stack smashing attack by the method of a nonpatent literature 2. FIG. 非特許文献2の方法によるスタックスマッシング攻撃の防御方法を説明するための第2の図である。It is the 2nd figure for demonstrating the defense method of the stack smashing attack by the method of a nonpatent literature 2. FIG.

符号の説明Explanation of symbols

10…CPU、20…記憶装置、30…入出力部、40…プログラムメモリ、50…RAM、101…オーバーフロー検知部、102,102A…データ取得部、103,103A,103B,103C…判定部、セキュリティ処理部104
DESCRIPTION OF SYMBOLS 10 ... CPU, 20 ... Storage device, 30 ... Input / output unit, 40 ... Program memory, 50 ... RAM, 101 ... Overflow detection unit, 102,102A ... Data acquisition unit, 103,103A, 103B, 103C ... Determination unit, security Processing unit 104

Claims (19)

不正なデータの入力によりスタックがオーバーフローを起こし得るコンピュータに、
上記スタックのオーバーフローを検知する第1のステップと、
上記第1のステップにおいて上記オーバーフローが検知された場合、上記オーバーフローによって書き換えられた結果のデータを取得する第2のステップと、
上記第2のステップにおいて取得されたデータに基づいて、上記オーバーフローが上記不正データの入力により引き起こされたものであるか否かを判定する第3のステップと、
を有する処理を実行させるプログラム。
To a computer where the stack can overflow due to incorrect data input,
A first step of detecting an overflow of the stack;
If the overflow is detected in the first step, a second step of obtaining data resulting from the rewriting by the overflow;
A third step for determining, based on the data acquired in the second step, whether the overflow is caused by the input of the illegal data;
A program for executing a process having
上記第3のステップにおいて、上記書き換えられた結果の一連のデータの周期性を評価し、当該評価結果に基づいて上記判定を行なう、
請求項1に記載のプログラム。
In the third step, the periodicity of a series of data resulting from the rewriting is evaluated, and the determination is performed based on the evaluation result.
The program according to claim 1.
上記第2のステップにおいて、上記書き換えを受けたメモリ領域から、アドレス順に並ぶ所定数のデータをデータ列として抽出し、
上記第3のステップは、
上記第2のステップにおいて抽出されたデータ列の相関値を算出する第4のステップと、
上記第4のステップにおいて算出された相関値に基づいて上記判定を行なう第5のステップと、を含む、
請求項2に記載のプログラム。
In the second step, a predetermined number of data arranged in the order of addresses is extracted as a data string from the rewritten memory area,
The third step is
A fourth step of calculating a correlation value of the data string extracted in the second step;
A fifth step of performing the determination based on the correlation value calculated in the fourth step.
The program according to claim 2.
上記第4のステップにおいて、上記第2のステップで共通のメモリ領域から抽出される2つのデータ列を複数の異なる位相で比較し、それぞれの位相において、上記2つのデータ列の対応するデータ同士が一致する数に応じて上記相関値を算出する、
請求項3に記載のプログラム。
In the fourth step, the two data strings extracted from the common memory area in the second step are compared at a plurality of different phases, and corresponding data in the two data strings are compared with each other in each phase. Calculate the correlation value according to the number of matches,
The program according to claim 3.
上記第5のステップにおいて、上記相関値が所定のしきい値を超える上記位相の数に基づいて上記判定を行なう、
請求項4に記載のプログラム。
In the fifth step, the determination is performed based on the number of phases in which the correlation value exceeds a predetermined threshold value.
The program according to claim 4.
上記第5のステップにおいて、上記第4のステップで算出された複数の上記相関値のばらつきを示す所定の統計量を算出し、当該算出した統計量に基づいて上記判定を行なう、
請求項4に記載のプログラム。
In the fifth step, a predetermined statistic indicating the variation of the plurality of correlation values calculated in the fourth step is calculated, and the determination is performed based on the calculated statistic.
The program according to claim 4.
上記第5のステップは、
上記相関値が所定のしきい値を超える上記位相の数に基づいて、上記判定に関する第1の仮判定を行なう第6のステップと、
上記第6のステップで算出された複数の上記相関値のばらつきを示す所定の統計量を算出し、当該算出した統計量に基づいて、上記判定に関する第2の仮判定を行なう第7のステップと、
上記第1の仮判定および上記第2の仮判定の判定結果に基づいて、上記オーバーフローが上記不正データの入力により引き起こされたものであるか否かを最終判定する第8のステップと、を含む
請求項4に記載のプログラム。
The fifth step is
A sixth step of performing a first provisional determination relating to the determination based on the number of phases in which the correlation value exceeds a predetermined threshold;
A seventh step of calculating a predetermined statistic indicating the variation of the plurality of correlation values calculated in the sixth step, and performing a second provisional determination related to the determination based on the calculated statistic; ,
And an eighth step of finally determining whether or not the overflow is caused by the input of the illegal data based on the determination results of the first and second provisional determinations. The program according to claim 4.
上記第5のステップは、上記第1の仮判定および上記第2の仮判定の何れか一方の判定結果において、上記オーバーフローが上記不正データの入力により引き起こされたものであると仮判定される回数をカウントする第9のステップを有し、
上記第8のステップにおいて、上記第1の仮判定および上記第2の仮判定の両方において上記オーバーフローが上記不正データの入力により引き起こされたものであると仮判定される場合、または、上記第9のステップにおけるカウント数が所定の回数に達する場合に、上記オーバーフローが上記不正データの入力により引き起こされたものであると最終判定する、
請求項7に記載のプログラム。
The fifth step is the number of times that the overflow is temporarily determined to be caused by the input of the illegal data in the determination result of one of the first temporary determination and the second temporary determination. Has a ninth step of counting
In the eighth step, when it is tentatively determined that the overflow is caused by the input of the illegal data in both the first tentative determination and the second tentative determination, or When the number of counts in the step reaches a predetermined number, it is finally determined that the overflow is caused by the input of the invalid data.
The program according to claim 7.
上記第3のステップにおいて、少なくとも、上記オーバーフローを引き起こしたデータの供給元のネットワーク・アドレス、当該データの供給元のポート番号、当該データに含まれる特定のデータ・パターン、または、当該データを有するファイルの名前に基づいて、上記判定を行なう、
請求項1に記載のプログラム。
In the third step, at least the network address of the data supply source causing the overflow, the port number of the data supply source, the specific data pattern included in the data, or the file having the data Make the above determination based on the name of
The program according to claim 1.
上記第3のステップにおいて、上記オーバーフローが上記不正データの入力により引き起こされたものであると判定された場合、上記オーバーフローが発生したプロセスを停止させる第10のステップを有する、
請求項1に記載のプログラム。
In the third step, when it is determined that the overflow is caused by the input of the illegal data, the process includes the tenth step of stopping the process in which the overflow has occurred.
The program according to claim 1.
上記第10のステップにおいて、上記オーバーフローが発生したプロセスを、少なくとも所定期間または所定のコマンドが入力されるまでの間停止させる、
請求項10に記載のプログラム。
In the tenth step, the process in which the overflow has occurred is stopped at least for a predetermined period or until a predetermined command is input.
The program according to claim 10.
上記第3のステップにおいて、上記オーバーフローが上記不正データの入力により引き起こされたものであると判定された場合、上記不正データの供給元からのアクセスを禁止する第11のステップを有する、
請求項1に記載のプログラム。
In the third step, when it is determined that the overflow is caused by the input of the invalid data, the third step includes an eleventh step for prohibiting access from the source of the illegal data.
The program according to claim 1.
上記第11のステップにおいて、上記不正データの供給元からのアクセスを、少なくとも所定期間または所定のコマンドが入力されるまでの間禁止する、
請求項12に記載のプログラム。
In the eleventh step, access from the unauthorized data supplier is prohibited at least for a predetermined period or until a predetermined command is input.
The program according to claim 12.
上記第3のステップにおいて、上記オーバーフローが上記不正データの入力により引き起こされたものであると判定された場合、上記不正データの供給元の機器において所定の警告情報を表示させるための表示データを生成する第12のステップを有する、
請求項1に記載のプログラム。
In the third step, when it is determined that the overflow is caused by the input of the unauthorized data, display data for displaying predetermined warning information on the device that supplies the unauthorized data is generated. Having a twelfth step
The program according to claim 1.
上記第3のステップにおいて、上記オーバーフローが上記不正データの入力により引き起こされたものであると判定された場合、少なくとも、上記不正データの供給元、上記不正データの内容、または、上記不正データの供給方法に関する情報を取得する第13のステップを有する、
請求項1に記載のプログラム。
If it is determined in the third step that the overflow is caused by the input of the illegal data, at least the source of the illegal data, the content of the illegal data, or the supply of the illegal data Having a thirteenth step of obtaining information about the method;
The program according to claim 1.
不正なデータをコンピュータに入力することによりスタックにオーバーフローを引き起こす攻撃から、上記コンピュータを保護するセキュリティ保護装置であって、
上記スタックのオーバーフローを検知するオーバーフロー検知手段と、
上記オーバーフロー検知手段において上記オーバーフローが検知された場合、上記オーバーフローによって書き換えられた結果のデータを取得するデータ取得手段と、
上記データ取得手段において取得されたデータに基づいて、上記オーバーフローが上記不正データの入力により引き起こされたものであるか否かを判定する判定手段と、
上記判定手段において、上記オーバーフローが上記不正データの入力により引き起こされたものであると判定された場合、少なくとも、上記オーバーフローが発生したプロセスを停止させる処理、上記不正データの供給元からのアクセスを禁止する処理、上記不正データの供給元の機器において所定の警告情報を表示させるための表示データを生成する処理、または、上記不正データの供給元、上記不正データの内容、もしくは、上記不正データの供給方法の少なくとも何れか1つに関する情報を取得する処理を実行する処理手段と、
を有するセキュリティ保護装置。
A security protection device for protecting the computer from an attack that causes an overflow of the stack by inputting illegal data to the computer,
Overflow detection means for detecting an overflow of the stack;
When the overflow is detected by the overflow detection means, data acquisition means for acquiring data resulting from rewriting due to the overflow; and
Determination means for determining whether the overflow is caused by the input of the illegal data, based on the data acquired by the data acquisition means;
If the determination means determines that the overflow is caused by the input of the illegal data, at least a process for stopping the process in which the overflow has occurred and prohibiting access from the source of the illegal data Processing for generating display data for displaying predetermined warning information in the device that is the source of the unauthorized data, or the source of the unauthorized data, the content of the unauthorized data, or the supply of the unauthorized data Processing means for executing processing for acquiring information on at least one of the methods;
Having a security protection device.
上記判定手段は、上記書き換えられた結果の一連のデータの周期性を評価し、当該評価結果に基づいて上記判定を行なう、
請求項16に記載のセキュリティ保護装置。
The determination means evaluates the periodicity of a series of data resulting from the rewriting, and performs the determination based on the evaluation result.
The security protection device according to claim 16.
不正なデータをコンピュータに入力することによりスタックにオーバーフローを引き起こす攻撃から、上記コンピュータを保護するセキュリティ保護方法であって、
上記スタックのオーバーフローを検知する第1の工程と、
上記第1の工程において上記オーバーフローが検知された場合、上記オーバーフローによって書き換えられた結果のデータを取得する第2の工程と、
上記第2の工程において取得されたデータに基づいて、上記オーバーフローが上記不正データの入力により引き起こされたものであるか否かを判定する第3の工程と、
上記第3の工程において、上記オーバーフローが上記不正データの入力により引き起こされたものであると判定された場合、少なくとも、上記オーバーフローが発生したプロセスを停止させるか、上記不正データの供給元からのアクセスを禁止するか、上記不正データの供給元の機器において所定の警告情報を表示させるか、または、上記不正データの供給元、上記不正データの内容、もしくは、上記不正データの供給方法の少なくとも何れか1つに関する情報を取得する第4の工程と、
を有するセキュリティ保護方法。
A security protection method for protecting the computer from an attack that causes an overflow of the stack by inputting illegal data to the computer,
A first step of detecting an overflow of the stack;
If the overflow is detected in the first step, a second step of acquiring data resulting from the rewriting by the overflow;
A third step of determining, based on the data acquired in the second step, whether the overflow is caused by the input of the unauthorized data;
In the third step, when it is determined that the overflow is caused by the input of the illegal data, at least the process in which the overflow has occurred is stopped or the access from the supply source of the illegal data is performed. Or displaying predetermined warning information on the device that is the source of the unauthorized data, or at least one of the source of the unauthorized data, the content of the unauthorized data, or the method of supplying the unauthorized data A fourth step of obtaining information about one;
A security protection method.
上記第3の工程において、上記書き換えられた結果の一連のデータの周期性を評価し、当該評価結果に基づいて上記判定を行なう、
請求項18に記載のセキュリティ保護方法。
In the third step, the periodicity of a series of data of the rewritten result is evaluated, and the determination is performed based on the evaluation result.
The security protection method according to claim 18.
JP2003273633A 2003-07-11 2003-07-11 Program, security protection device, and its method Pending JP2005032185A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003273633A JP2005032185A (en) 2003-07-11 2003-07-11 Program, security protection device, and its method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003273633A JP2005032185A (en) 2003-07-11 2003-07-11 Program, security protection device, and its method

Publications (1)

Publication Number Publication Date
JP2005032185A true JP2005032185A (en) 2005-02-03

Family

ID=34210815

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003273633A Pending JP2005032185A (en) 2003-07-11 2003-07-11 Program, security protection device, and its method

Country Status (1)

Country Link
JP (1) JP2005032185A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019026137A1 (en) * 2017-07-31 2019-02-07 日本電気株式会社 Program verification system, method, and program
US10917291B2 (en) 2016-08-04 2021-02-09 New H3C Information Technologies Co., Ltd. RAID configuration

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10917291B2 (en) 2016-08-04 2021-02-09 New H3C Information Technologies Co., Ltd. RAID configuration
WO2019026137A1 (en) * 2017-07-31 2019-02-07 日本電気株式会社 Program verification system, method, and program
JPWO2019026137A1 (en) * 2017-07-31 2020-07-02 日本電気株式会社 Program verification system, method and program
JP7024792B2 (en) 2017-07-31 2022-02-24 日本電気株式会社 Program verification system, method and program
US11409886B2 (en) 2017-07-31 2022-08-09 Nec Corporation Program verification system, method, and program

Similar Documents

Publication Publication Date Title
Wu et al. {KEPLER}: Facilitating control-flow hijacking primitive evaluation for Linux kernel vulnerabilities
KR100777938B1 (en) False code execution prevention method and recording medium of false code execution prevention programs
US8627478B2 (en) Method and apparatus for inspecting non-portable executable files
KR102307534B1 (en) Systems and methods for tracking malicious behavior across multiple software entities
GB2499932B (en) Detecting a return-oriented programming exploit
Chiueh et al. RAD: A compile-time solution to buffer overflow attacks
Guo et al. A study of the packer problem and its solutions
US20030023856A1 (en) Software self-checking systems and methods
US7607122B2 (en) Post build process to record stack and call tree information
JP2007304954A (en) Computer system having memory protecting function
WO2001095067A2 (en) System and method for protecting a networked computer from viruses
Kong et al. Improving software security via runtime instruction-level taint checking
Kollenda et al. Towards automated discovery of crash-resistant primitives in binary executables
KR100745640B1 (en) Method for protecting kernel memory and apparatus thereof
KR100745639B1 (en) Method for protecting file system and registry and apparatus thereof
Hawkins et al. Dynamic canary randomization for improved software security
US20090307536A1 (en) Method for protecting software programs
Zeng et al. Tailored application-specific system call tables
Shahriar et al. Mutation-based testing of format string bugs
JP2005032185A (en) Program, security protection device, and its method
CN109472139B (en) Method and system for preventing Lesox virus from secondarily encrypting host document
JP4643201B2 (en) Buffer overflow vulnerability analysis method, data processing device, analysis information providing device, analysis information extraction processing program, and analysis information provision processing program
Slowinska et al. The age of data: pinpointing guilty bytes in polymorphic buffer overflows on heap or stack
CN113032737B (en) Software protection method and device, electronic equipment and storage medium
Frykholm Countermeasures against buffer overflow attacks