JP2005151492A - Method and apparatus for generating rule to deal with unauthorized access, method and apparatus for dealing with unauthorized access, and system for taking measure to stack-smashing attack - Google Patents

Method and apparatus for generating rule to deal with unauthorized access, method and apparatus for dealing with unauthorized access, and system for taking measure to stack-smashing attack Download PDF

Info

Publication number
JP2005151492A
JP2005151492A JP2003390130A JP2003390130A JP2005151492A JP 2005151492 A JP2005151492 A JP 2005151492A JP 2003390130 A JP2003390130 A JP 2003390130A JP 2003390130 A JP2003390130 A JP 2003390130A JP 2005151492 A JP2005151492 A JP 2005151492A
Authority
JP
Japan
Prior art keywords
unauthorized access
packet
pointer
access countermeasure
rule
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2003390130A
Other languages
Japanese (ja)
Other versions
JP4091528B2 (en
Inventor
Makoto Iwamura
誠 岩村
Masaru Kashiwa
大 柏
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.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone 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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2003390130A priority Critical patent/JP4091528B2/en
Publication of JP2005151492A publication Critical patent/JP2005151492A/en
Application granted granted Critical
Publication of JP4091528B2 publication Critical patent/JP4091528B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To enable a defense against a stack-smashing attack that changes an attack code for each attack, when a buffer overflow occurs. <P>SOLUTION: A packet filtering rule (to deal unauthorized access) generator 1 detects a buffer overflow and extracts, as a mark of a stack-smashing attack, a frame pointer and a return address which are written when the buffer overflow occurs, and in accordance with an operating system, extracts a value of a pointer to an except handler, compares the value thereof with the byte sequence of an input packet log, and generates rules to deal unauthorized access. A packet filtering apparatus 2 receives the rules to deal unauthorized access from the packet filtering rule generator 1, registers the received rules and shuts off a packet of the stack-smashing attack transmitted from the outside on the basis of the registered rules to deal unauthorized access. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は,バッファオーバーフローの脆弱性を悪用したスタックスマッシング攻撃に対する防御技術に関し,特に,攻撃コードを攻撃の度に変化させるスタックスマッシング攻撃に対する防御を実現する不正アクセス対処ルール生成方法,不正アクセス対処方法,不正アクセス対処ルール生成装置,不正アクセス対処装置およびスタックスマッシング攻撃対策システムに関する。   The present invention relates to a defense technique against a stack smashing attack that exploits a buffer overflow vulnerability, and in particular, an unauthorized access countermeasure rule generation method and an unauthorized access countermeasure method that realize a defense against a stack smashing attack that changes an attack code for each attack. , An unauthorized access countermeasure rule generation device, an unauthorized access countermeasure device, and a stack smashing attack countermeasure system.

本明細書中で本発明の説明のために用いている用語を簡単に説明する。
・「スタック」:スタックとは,最後に格納したオブジェクトが最初に取り出されるデータ構造のことをいう。
・「スタックスマッシング攻撃」:スタックメモリ上には,サブルーチン呼び出しの際に呼び出し元へ戻るためのリターンアドレスや,サブルーチン内でのみ利用される局所変数(ローカル変数)が格納される。よって,サブルーチン内でのみ利用される局所変数として宣言されたバッファに対して,バッファの境界を越えて書き込みが発生すると,リターンアドレスが書き換わることになる。スタックスマッシング攻撃は,この性質を利用してプログラムの処理フローを変更し,任意のプログラムを実行させる攻撃である。
・「DoS(Denial Of Service:サービス不能) 攻撃」:DoS攻撃とは,あるサービスを利用不能な状態に陥れる攻撃のことをいう。
・「フック」:ある関数が呼び出されるときに制御を横取りすることを,関数をフックするという。例えばデバッグ目的で,ある関数が正確に呼び出されているかを調べるために,一旦制御を横取りしログ出力するといった利用方法がある。
Terms used to describe the present invention in this specification will be briefly described.
“Stack”: A stack is a data structure in which the last stored object is retrieved first.
“Stack smashing attack”: The stack memory stores a return address for returning to the caller when a subroutine is called, and a local variable (local variable) used only within the subroutine. Therefore, when a write occurs across a buffer boundary in a buffer declared as a local variable used only within a subroutine, the return address is rewritten. A stack smashing attack is an attack that uses this property to change the processing flow of a program and execute an arbitrary program.
“DoS (Denial Of Service) attack”: A DoS attack refers to an attack that causes a service to become unusable.
-"Hook": Intercepting control when a function is called is called hooking a function. For example, in order to check whether a certain function is called accurately for debugging purposes, there is a usage method in which control is temporarily intercepted and a log is output.

スタックメモリ上には,サブルーチン呼び出しの際に呼び出し元へ戻るためのリターンアドレスやフレームポインタ,サブルーチン内でのみ利用される局所変数,またオペレーティングシステムによっては例外ハンドラ(例外発生時に実行されるサブルーチン)のアドレス等が格納される。これを利用して,サブルーチン内でのみ利用される局所変数として宣言されたバッファに対して,バッファの境界を越えて書き込みが発生すると,リターンアドレス等が書き換わることになる。   On the stack memory, the return address and frame pointer for returning to the caller when a subroutine is called, local variables used only within the subroutine, and exception handlers (subroutines executed when an exception occurs) depending on the operating system. Stores addresses and the like. By using this, if a write occurs beyond the buffer boundary for a buffer declared as a local variable used only within a subroutine, the return address and the like are rewritten.

スタックスマッシング攻撃は,この書き換えによりプログラムの処理フローを変更して,任意のプログラムを実行させるという攻撃である。このスタックスマッシング攻撃に対する防御を実現する従来技術として,標準的なメモリコピー関数の呼び出しをプログラム実行時にフック(関数が呼び出される時の制御の横取り)することで,コピー先のバッファのサイズをあらかじめチェックし,バッファオーバーフローを検出する手法がある(例えば,非特許文献1参照)。   The stack smashing attack is an attack in which an arbitrary program is executed by changing the processing flow of the program by this rewriting. As a conventional technique for protecting against this stack smashing attack, the standard memory copy function call is hooked during program execution (control interception when the function is called) to check the size of the copy destination buffer in advance. However, there is a technique for detecting a buffer overflow (see, for example, Non-Patent Document 1).

また,保護対象プログラムに対して,コンパイル時にリターンアドレス等の保護のための特別の値であるガード変数を挿入して,関数のリターン処理の直前に,ガード変数の有効性を確認し,ガード変数が破壊されているときにはプロセスを異常終了する,という処理を挿入するものがある(例えば,特許文献1参照)。これにより,スタックスマッシング攻撃によるサーバの乗っ取りやデータの改竄といった不正侵入からホストを防御できるようになる。
White Paper,「Libsafe:Protectingcritical elements of stacks.」,"http://www.research.avayalabs.com/project/libsafe/", A.Baratloo,N.Singh,and T.Tsai,December 1999. 特開2001−216161号公報
In addition, a guard variable that is a special value for protection such as a return address is inserted into the protection target program at the time of compilation, and the validity of the guard variable is confirmed immediately before the return processing of the function. There is a method that inserts a process of abnormally terminating the process when the device is destroyed (see, for example, Patent Document 1). As a result, the host can be protected from unauthorized intrusion such as server hijacking and data tampering by a stack smashing attack.
White Paper, "Libsafe: Protecting critical elements of stacks.", "Http://www.research.avayalabs.com/project/libsafe/", A. Baratloo, N. Singh, and T. Tsai, December 1999. JP 2001-216161 A

また,本発明者等は,特願2003−130950号(未公開)において,リターンアドレスの書き換えが行われたことを検出すると,その攻撃により書き込まれた不正なリターンアドレスの位置を割り出し,その不正なリターンアドレスの指す位置から不正アクセス対処ルールを導き出し,ネットワークで同様のスタックスマッシング攻撃を遮断する技術を提案している。   Further, when the inventors detect that the return address has been rewritten in Japanese Patent Application No. 2003-130950 (unpublished), the present inventors determine the position of the illegal return address written by the attack, and We have proposed a technique for deriving rules for dealing with unauthorized access from the position indicated by a return address and blocking similar stack smashing attacks on the network.

これにより,スタックスマッシングによるDoS攻撃(Denial Of Service :あるサービスを利用不能な状態に陥れる攻撃)に対する脆弱性を排除することができるようになり,加えて,ネットワークでスタックスマッシング攻撃を防ぐことで,ネットワークに接続された他のホストもスタックスマッシング攻撃から守ることができるようになる。   This makes it possible to eliminate vulnerabilities to stack smashing DoS attacks (Denial Of Service), and in addition, by preventing stack smashing attacks in the network, Other hosts connected to the network can be protected from stack smashing attacks.

しかし,以上のようなスタックスマッシング攻撃に対する不正アクセス対処ルールを生成する技術を用いて,スタックスマッシング攻撃に対するさらに完全な防御を実現するためには,次のような課題を解決する必要がある。   However, in order to realize a more complete defense against the stack smashing attack using the technology for generating the illegal access countermeasure rule against the stack smashing attack as described above, it is necessary to solve the following problems.

リターンアドレスの指す位置には,攻撃者が用意する攻撃プログラムが配置されているが,この攻撃プログラムは攻撃者により変更することが可能である。このため,攻撃の度に攻撃プログラムを変更されると,不正アクセス対処ルールのペイロードとは異なったペイロードのパケットが送られてくることになるため,不正アクセス対処装置では対処できなくなる。さらに,攻撃の度に不正アクセス対処ルールが生成され,この攻撃が継続的に行われると不正アクセス対処ルールの数が増え,不正アクセス対処装置のパケット処理性能が低下してしまう。   An attack program prepared by the attacker is arranged at the position indicated by the return address, but this attack program can be changed by the attacker. For this reason, if the attack program is changed for each attack, a packet with a payload different from the payload of the unauthorized access countermeasure rule is sent, and thus the unauthorized access countermeasure apparatus cannot cope with it. Furthermore, an unauthorized access countermeasure rule is generated for each attack. If this attack is continuously performed, the number of unauthorized access countermeasure rules increases, and the packet processing performance of the unauthorized access countermeasure device decreases.

本発明はかかる事情に鑑みてなされたものであって,その目的は,攻撃プログラムが攻撃の度に変化する,スタックスマッシング攻撃に関する共通の攻撃痕跡を見つけることで,より高度なスタックスマッシング攻撃をネットワークで対策することにある。   The present invention has been made in view of such circumstances, and an object of the present invention is to find a common attack trace related to a stack smashing attack in which an attack program changes each time an attack is performed. It is to take countermeasures.

この目的を達成するために,本発明によるスタックスマッシング攻撃対策システムは,外部から送信されてくる不正なパケットをフィルタリングするために用いられる不正アクセス対処ルールを生成する不正アクセス対処ルール生成装置と,その生成された不正アクセス対処ルールを使って,外部から送信されてくる不正なパケットをフィルタリングする不正アクセス対処装置とから構成され,それぞれ以下の処理を行う。   In order to achieve this object, a stack smashing attack countermeasure system according to the present invention includes an unauthorized access countermeasure rule generation device that generates an unauthorized access countermeasure rule used to filter unauthorized packets transmitted from outside, It is composed of an unauthorized access countermeasure device that filters unauthorized packets transmitted from the outside using the generated unauthorized access countermeasure rules, and performs the following processes respectively.

不正アクセス対処ルール生成装置は,従来技術によってバッファオーバーフローを検出する。具体的には,標準的なメモリコピー関数のコピー先のバッファサイズをあらかじめチェックし,バッファオーバーフローを検出する手法,もしくは,ガード変数が破壊されたかどうかをチェックすることでバッファオーバーフローを検出する手法により,スタックスマッシング攻撃を検出する。   The unauthorized access countermeasure rule generation device detects a buffer overflow by a conventional technique. Specifically, by checking the buffer size of the copy destination of the standard memory copy function in advance and detecting a buffer overflow, or by checking whether the guard variable has been destroyed or not to detect a buffer overflow Detect stack smashing attacks.

これらの二つの検出手法の特徴は,次のとおりである。前者は,標準的なメモリコピー関数以外でのバッファオーバーフローを検出することはできないが,コンパイル作業が必要ないため,実行プログラムがコンパイル済みの状態で配布されていても適用可能である。また後者は,ほとんどのバッファオーバーフローを検出することができるが,コンパイル作業が必要なため,プログラムがソースコードで提供されていなければならない。   The characteristics of these two detection methods are as follows. The former cannot detect a buffer overflow other than the standard memory copy function, but does not require compilation work, so it can be applied even if the executable program is distributed in a compiled state. The latter can detect most buffer overflows, but requires compilation so the program must be provided in source code.

本発明では,プログラムの配布形式によってこれらの検出手法を使い分けることを特徴とする。これにより,様々なアプリケーションに適切なバッファオーバーフロー検知機構を追加することができるようになる。   The present invention is characterized in that these detection methods are selectively used depending on the program distribution format. This makes it possible to add a buffer overflow detection mechanism suitable for various applications.

次に,バッファオーバーフロー検出手法に応じた攻撃痕跡の抽出を行う。まず,標準的なメモリコピー関数のコピー先のバッファサイズをあらかじめチェックし,バッファオーバーフローを検出する手法は,コピー先のバッファがスタック上に存在するかどうかを調べる。もしスタック上に存在する場合には,現在のフレームポインタを起点にフレームポインタを辿り,コピー先バッファが属する関数フレームを探す。そして,コピー先バッファの先頭から次のフレームポインタが格納されている場所の手前までの長さを,バッファサイズとする。ここで得られたバッファサイズと,コピーされようとしているバッファサイズとを比較し,バッファオーバーフローを検出する。   Next, attack traces are extracted according to the buffer overflow detection method. First, a standard memory copy function's copy destination buffer size is checked in advance, and the buffer overflow detection method checks whether the copy destination buffer exists on the stack. If it exists on the stack, the frame pointer is traced starting from the current frame pointer, and the function frame to which the copy destination buffer belongs is searched. The length from the beginning of the copy destination buffer to the position before the next frame pointer is stored is defined as the buffer size. The buffer size obtained here is compared with the buffer size to be copied, and a buffer overflow is detected.

そこで本発明では,ここで得られた関数フレームの位置より,バッファオーバーフローが発生したときに上書きされることになるフレームポインタとリターンアドレスとオペレーティングシステムによっては例外ハンドラヘのポインタを割り出し,それぞれの値を攻撃痕跡として抽出することを特徴とする。   Therefore, in the present invention, a frame pointer, a return address, and a pointer to an exception handler depending on the operating system are calculated from the position of the function frame obtained here when a buffer overflow occurs. It is extracted as an attack trace.

次に,ガード変数によりバッファオーバーフローを検出する手法は,バッファとガード変数との間に他の変数が配置されないように,ローカル変数の配置を変更したり,ガード変数を挿入したりすることで,スタックのレイアウトを変更する。   Next, the method of detecting buffer overflows with guard variables is to change the placement of local variables or insert guard variables so that no other variables are placed between the buffer and guard variables. Change the stack layout.

そこで本発明では,このようにスタックのレイアウトが変更されることを考慮し,レイアウトが変更される前で同様のオーバーフローが生じた際に上書きされるフレームポインタとリターンアドレスとオペレーティングシステムによっては例外ハンドラへのポインタを割り出し,それぞれの値を攻撃の痕跡として抽出することを特徴とする。   Therefore, in the present invention, in consideration of such a change in the stack layout, the frame pointer and return address that are overwritten when a similar overflow occurs before the layout is changed, and an exception handler depending on the operating system. It is characterized in that a pointer to is extracted and each value is extracted as an attack trace.

また本発明では,不正アクセス対処ルール生成装置において,あらかじめネットワーク経由でのプログラムに対する入力をパケットログとして保存する点を特徴とする。続いて,上記処理で得られた攻撃の痕跡と,ネットワーク経由でのプログラムに対する入力パケットログを比較し,一致したバイト列を含むパケットの持つヘッダ情報(IPヘッダ・TCPへッダ・UDPへッダなどの情報)を得る。そして,そのようにして得たスタックスマッシング攻撃の痕跡のバイト列と,そのバイト列を含むパケットの持つヘッダ情報とをルール要素とする不正アクセス対処ルールを生成する。   In addition, the present invention is characterized in that in the unauthorized access countermeasure rule generation device, an input to a program via a network is stored in advance as a packet log. Subsequently, the attack trace obtained by the above processing is compared with the input packet log for the program via the network, and the header information (IP header, TCP header, UDP header) of the packet including the matched byte sequence is compared. Information). Then, an illegal access countermeasure rule is generated using the byte sequence of the stack smashing attack obtained as described above and the header information of the packet including the byte sequence as rule elements.

スタックスマッシング攻撃を成功させるためには,リターンアドレスやフレームポインタ,またはオペレーティングシステムによっては例外ハンドラヘのポインタ等をある限定された値で上書きする必要がある。そこで本発明では,このスタックスマッシング攻撃の性質を利用し,リターンアドレスやフレームポインタ,またはオペレーティングシステムによっては例外ハンドラヘのポインタをスタックスマッシング攻撃の痕跡として抽出した後に,入力パケットログと比較し,不正アクセス対処ルールを生成することで,攻撃の度に攻撃プログラムを変更するような高度なスタックスマッシング攻撃に関しても,ネットワークで対策することが可能となる。   In order to succeed in the stack smashing attack, it is necessary to overwrite the return address, the frame pointer, or the pointer to the exception handler with a limited value depending on the operating system. Therefore, in the present invention, by utilizing the nature of this stack smashing attack, the return address, the frame pointer, or the pointer to the exception handler depending on the operating system is extracted as a trace of the stack smashing attack, and then compared with the input packet log to obtain unauthorized access. By generating countermeasure rules, it is possible to take countermeasures against advanced stack smashing attacks that change the attack program at each attack.

すなわち,本発明の不正アクセス対処ルール生成装置は,外部から送信されてくる不正なパケットをフィルタリングするために用いられる不正アクセス対処ルールを生成する装置であって,外部ネットワークから送信されたパケットを保存する手段と,メモリコピー関数のコピー先のバッファサイズをチェックしてバッファオーバーフローを検出する手段と,前記コピー先バッファが属する関数フレームの位置から,前記バッファオーバーフローが発生したときに書き込まれることになる,フレームポインタとリターンアドレスとオペレーティングシステムによっては例外ハンドラヘのポインタを割り出す手段と,
前記保存されたパケットを検索対象として,前記割り出されたフレームポインタ,リターンアドレスまたはオペレーティングシステムによっては例外ハンドラヘのポインタの値と一致するバイト列を検索する手段と,前記検索されたバイト列を含むパケットの持つヘッダ中の情報を取得する手段と,前記バイト列と前記ヘッダ中の情報とから,フィルタリングするパケットについて記述する不正アクセス対処ルールを生成し記録する手段とを備えることを特徴とする。
That is, the unauthorized access countermeasure rule generation device of the present invention is an apparatus for generating unauthorized access countermeasure rules used for filtering unauthorized packets transmitted from the outside, and stores packets transmitted from an external network. Means for detecting the buffer overflow by checking the buffer size of the copy destination of the memory copy function and the position of the function frame to which the copy destination buffer belongs, and is written when the buffer overflow occurs , The frame pointer, return address, and depending on the operating system, a means to determine the pointer to the exception handler,
Means for searching for the stored packet as a search target, searching for a byte string that matches the value of the determined frame pointer, return address or pointer to an exception handler depending on the operating system, and the searched byte string Means for acquiring information in a header of the packet; and means for generating and recording an illegal access countermeasure rule describing a packet to be filtered from the byte string and the information in the header.

また,本発明の不正アクセス対処ルール生成装置は,外部から送信されてくる不正なパケットをフィルタリングするために用いられる不正アクセス対処ルールを生成する装置であって,外部ネットワークから送信されたパケットを保存する手段と,スタックメモリのバッファとフレームポインタとの間にガード変数を挿入して前記スタックメモリのレイアウトを変更する手段と,前記スタックメモリのバッファとフレームポインタとの間に挿入されたガード変数が破壊されたかをチェックしてバッファオーバーフローを検出する手段と,レイアウトが変更される前の前記スタックメモリのレイアウトから,前記バッファオーバーフローが生じた際に書き込まれることになる,フレームポインタとリターンアドレスとオペレーティングシステムによっては例外ハンドラヘのポインタを割り出す手段と,前記保存されたパケットを検索対象として,前記割り出されたフレームポインタ,リターンアドレスまたはオペレーティングシステムによっては例外ハンドラヘのポインタの値と一致するバイト列を検索する手段と,前記検索されたバイト列を含むパケットの持つヘッダ中の情報を取得する手段と,前記バイト列と前記ヘッダ中の情報とから,フィルタリングするパケットについて記述する不正アクセス対処ルールを生成し記録する手段とを備えることを特徴とする。   The unauthorized access countermeasure rule generation apparatus of the present invention is an apparatus for generating an unauthorized access countermeasure rule used for filtering unauthorized packets transmitted from outside, and stores packets transmitted from an external network. Means for changing the layout of the stack memory by inserting a guard variable between the buffer of the stack memory and the frame pointer, and a guard variable inserted between the buffer of the stack memory and the frame pointer. A frame pointer, a return address, an operating system to be written when the buffer overflow occurs, from a means for detecting whether the buffer overflow has occurred by checking whether it has been destroyed, and the layout of the stack memory before the layout is changed. system Therefore, the means for determining the pointer to the exception handler and the stored packet as a search target, search for a byte string that matches the value of the determined frame pointer, return address or the pointer to the exception handler depending on the operating system. A means for acquiring information in a header of a packet including the retrieved byte sequence, and generating and recording an illegal access countermeasure rule describing the packet to be filtered from the byte sequence and the information in the header And means for performing.

また,本発明の不正アクセス対処装置は,前記不正アクセス対処ルール生成装置から,前記不正アクセス対処ルールを受信し記憶装置に登録する手段と,前記登録された不正アクセス対処ルールをもとに,不正アクセス対処ルールにおけるヘッダ中の情報およびバイト列と,受信したパケットにおけるヘッダ中の情報およびバイト列とを照合し,一致する場合に受信したパケットは不正なパケットとして,外部から送信されてくる不正なパケットをフィルタリングする手段とを備えることを特徴とする。   The unauthorized access countermeasure device according to the present invention may be configured to receive an unauthorized access countermeasure rule from the unauthorized access countermeasure rule generation device and register the unauthorized access countermeasure rule in a storage device based on the registered unauthorized access countermeasure rule. The information and byte string in the header in the access handling rule is compared with the information and byte string in the header in the received packet. If they match, the received packet is an illegal packet sent from the outside as an invalid packet. Means for filtering packets.

また,本発明のスタックスマッシング攻撃対策システムは,前記不正アクセス対処ルール生成装置と,前記不正アクセス対処装置とから構成されることを特徴とする。   Also, the stack smashing attack countermeasure system of the present invention is characterized by comprising the unauthorized access countermeasure rule generation device and the unauthorized access countermeasure device.

本発明が,先に本発明者等が特願2003−130950号において提案した方法と最も異なる点は,不正アクセス対処ルールに登録するバイト列の抽出の仕方である。すなわち,先に提案した方法では,不正なリターンアドレスの指す位置をスタックスマッシュ攻撃の痕跡の開始位置として,その痕跡のバイト列を抽出していたのに対し,本発明では,リターンアドレスやフレームポインタ,またはオペレーティングシステムによっては例外ハンドラへのポインタ等の値そのものを攻撃痕跡として抽出する点が異なる。   The most different point of the present invention from the method previously proposed by the present inventors in Japanese Patent Application No. 2003-130950 is the method of extracting the byte string registered in the illegal access countermeasure rule. That is, in the previously proposed method, the byte position of the trace is extracted with the position indicated by the illegal return address as the start position of the trace of the stack smash attack, whereas in the present invention, the return address and the frame pointer are extracted. Depending on the operating system, the value of the pointer to the exception handler itself is extracted as an attack trace.

本発明によって得られる効果は,攻撃コードを攻撃の度に変化させるスタックスマッシング攻撃に対しても,適切な不正アクセス対処ルールを生成することが可能になることである。   The effect obtained by the present invention is that an appropriate illegal access countermeasure rule can be generated even for a stack smashing attack in which an attack code is changed at each attack.

従来の不正アクセス対処ルール生成方法では,攻撃コードを攻撃の度に変化させられることで,パケットを遮断することができなかったり,不正アクセス対処ルールが攻撃の度に生成され,その数が増えることで不正アクセス対処装置のパケット処理性能が低下していた。   In the conventional illegal access countermeasure rule generation method, the attack code can be changed at each attack, so that the packet cannot be blocked, or the illegal access countermeasure rules are generated at each attack, and the number increases. The packet processing performance of the unauthorized access countermeasure device was degraded.

これに対して,本発明では,リターンアドレスやフレームポインタ,またはオペレーティングシステムによっては例外ハンドラへのポインタ等をある限定された値で上書きする必要がある,というスタックスマッシング攻撃の性質を利用して,リターンアドレスやフレームポインタ,またはオペレーティングシステムによっては例外ハンドラへのポインタ等の値そのものを攻撃痕跡として抽出し,入力パケットログと比較して生成した不正アクセス対処ルールを利用することで,より高度なスタックスマッシング攻撃に関しても,ネットワークで対策し,ネットワーク全体をスタックスマッシング攻撃から守ることが可能になる。   On the other hand, in the present invention, the return address, the frame pointer, or the pointer to the exception handler depending on the operating system needs to be overwritten with a certain limited value. The return address, the frame pointer, or the value of the pointer to the exception handler depending on the operating system itself is extracted as an attack trace, and an illegal access countermeasure rule generated by comparing with the input packet log is used to make a more advanced stack. With regard to smashing attacks, it is possible to take measures against the network and protect the entire network from stack smashing attacks.

次に,本発明の実施の形態について図面を参照して詳細に説明する。図1に,本発明により実現されるスタックスマッシング攻撃対策システムのシステム構成例を図示する。   Next, embodiments of the present invention will be described in detail with reference to the drawings. FIG. 1 shows a system configuration example of a stack smashing attack countermeasure system realized by the present invention.

この図に示すように,本発明により実現されるスタックスマッシング攻撃対策システムは,上述した本発明の不正アクセス対処ルール生成装置の一例であるパケットフィルタリングルール生成装置1と,そこで得られたパケットフィルタリングルールを用いてパケットを遮断する,上述した本発明の不正アクセス対処装置の一例であるパケットフィルタリング装置2とから構成される。   As shown in this figure, the stack smashing attack countermeasure system realized by the present invention includes a packet filtering rule generation apparatus 1 which is an example of the above-described unauthorized access countermeasure rule generation apparatus of the present invention, and a packet filtering rule obtained there. And the packet filtering device 2 which is an example of the unauthorized access countermeasure device of the present invention described above.

ここで,パケットフィルタリングルール生成装置1は,例えば特定のホスト上に構築され,一方,パケットフィルタリング装置2は,ネットワークのゲートウェイ,もしくはネットワーク上に存在する任意のホスト上に構築されることになる。   Here, the packet filtering rule generation device 1 is constructed on, for example, a specific host, while the packet filtering device 2 is constructed on a network gateway or an arbitrary host existing on the network.

図1を用いて,本発明によるスタックスマッシング攻撃対策についての大まかな処理の流れについて説明する。まず,外部ネットワークからスタックスマッシング攻撃によるパケットが,パケットフィルタリングルール生成装置1に送信されてくる。これを受けて,パケットフィルタリングルール生成装置1は,そのスタックスマッシング攻撃に対処するためのパケットフィルタリングルールを自動生成し,パケットフィルタリング装置2に対して,その自動生成したパケットフィルタリングルールを通知する。   With reference to FIG. 1, a rough flow of processing for the countermeasure against the stack smashing attack according to the present invention will be described. First, a packet due to a stack smashing attack is transmitted from the external network to the packet filtering rule generation device 1. In response to this, the packet filtering rule generation device 1 automatically generates a packet filtering rule for coping with the stack smashing attack, and notifies the packet filtering device 2 of the automatically generated packet filtering rule.

パケットフィルタリング装置2は,パケットフィルタリングルール生成装置1から通知されたパケットフィルタリングルールを受信し,以後,外部ネットワークから入ってくる,そのパケットフィルタリングルールに含まれるスタックスマッシング攻撃と一致するパケットを遮断することにより,スタックスマッシング攻撃を遮断する。   The packet filtering device 2 receives the packet filtering rule notified from the packet filtering rule generating device 1, and thereafter blocks packets that come in from the external network and match the stack smashing attack included in the packet filtering rule. To block stack smashing attacks.

図2に,この本発明によるスタックスマッシング攻撃対策についての処理を実現すべく用意されるパケットフィルタリングルール生成装置1の一構成例を図示し,図3に,この本発明によるスタックスマッシング攻撃対策についての処理を実現すべく用意されるパケットフィルタリング装置2の一構成例を図示する。   FIG. 2 shows an example of the configuration of the packet filtering rule generation device 1 prepared for realizing the processing for the countermeasure against the stack smashing attack according to the present invention. FIG. 3 shows the countermeasure against the stack smashing attack countermeasure according to the present invention. An example of the configuration of a packet filtering device 2 prepared to realize processing is illustrated.

パケットフィルタリングルール生成装置1は,図2に示すように,プログラム毎の入力パケットを保存する入力パケット保存部10と,外部ネットワークから送信されてくる入力パケットをログとして入力パケット保存部10にロギングする入力パケットロギング部11と,所定のサーバ処理を実行するサーバプログラム12と,あらかじめサーバプログラム等に組み込まれて,バッファオーバーフロー(すなわち,スタックスマッシング攻撃の有無)を検出するバッファオーバーフロー検出部13と,スタックスマッシング攻撃の痕跡を抽出するスタックスマッシング攻撃痕跡抽出部14と,スタックスマッシング攻撃を遮断するためのパケットフィルタリングルールを生成するパケットフィルタリングルール生成部15と,パケットフィルタリング装置2に対して,生成されたパケットフィルタリングルールを通知するパケットフィルタリングルール通知部16とを備える。   As shown in FIG. 2, the packet filtering rule generation device 1 logs an input packet storage unit 10 that stores an input packet for each program and an input packet transmitted from an external network to the input packet storage unit 10 as a log. An input packet logging unit 11, a server program 12 for executing a predetermined server process, a buffer overflow detection unit 13 that is preliminarily incorporated in a server program or the like and detects a buffer overflow (that is, whether or not a stack smashing attack has occurred), and a stack A stack smashing attack trace extraction unit 14 that extracts a trace of a smashing attack, a packet filtering rule generation unit 15 that generates a packet filtering rule for blocking the stack smashing attack, Against Taringu device 2, and a packet filtering rule notification unit 16 for notifying the generated packet filtering rules.

ここで,入力パケット保存部10は,スタックスマッシング攻撃の痕跡を特定するために用意されるものであって,図4に示すように,プログラム毎に,そのプログラムに送信されてきたパケットのへッダ情報(プロトコル種別,送信元IPアドレス,送信元ポート番号,送信先IPアドレス,送信先ポート番号など)と,そのパケットのペイロードなどを保存することになる。   Here, the input packet storage unit 10 is prepared for identifying the trace of the stack smashing attack, and as shown in FIG. Information (protocol type, source IP address, source port number, destination IP address, destination port number, etc.) and the payload of the packet are stored.

一方,パケットフィルタリング装置2は,図3に示すように,スタックスマッシング攻撃を遮断するためのパケットフィルタリングルールを保存するパケットフィルタリングルールテーブル20と,パケットフィルタリングルール生成装置1から送信されてくるパケットフィルタリングルールを受信するパケットフィルタリングルール受信部21と,受信されたパケットフィルタリングルールをパケットフィルタリングルールテーブル20に登録するパケットフィルタリングルール登録部22と,パケットフィルタリングルールテーブル20に保存されるパケットフィルタリングルールをもとに,外部から送信されてくるスタックスマッシング攻撃のパケットを遮断するパケットフィルタリング部23とを備える。   On the other hand, as shown in FIG. 3, the packet filtering device 2 includes a packet filtering rule table 20 for storing packet filtering rules for blocking a stack smashing attack, and a packet filtering rule transmitted from the packet filtering rule generating device 1. Based on the packet filtering rule receiving unit 21 that receives the packet filtering rule, the packet filtering rule registration unit 22 that registers the received packet filtering rule in the packet filtering rule table 20, and the packet filtering rule stored in the packet filtering rule table 20 And a packet filtering unit 23 for blocking a packet of a stack smashing attack transmitted from the outside.

次に,パケットフィルタリングルール生成装置1の実行するスタックスマッシング攻撃の痕跡の抽出処理について説明する。図5と図6では,標準的なメモリコピー関数の呼び出しをプログラム実行時にフックすることで,コピー先のバッファのサイズをあらかじめチェックし,バッファオーバーフローを検出することにより,スタックスマッシング攻撃の痕跡を抽出する処理を説明する。   Next, the trace smashing attack extraction process executed by the packet filtering rule generation device 1 will be described. In FIGS. 5 and 6, the standard memory copy function call is hooked at the time of program execution, so that the size of the copy destination buffer is checked in advance and the trace of the stack smashing attack is detected by detecting the buffer overflow. Processing to be performed will be described.

また,図7と図8では,保護対象プログラムに対して,コンパイル時にリターンアドレス等の保護のための特別の値であるガード変数を挿入して,関数のリターン処理の直前に,ガード変数の有効性を確認することで,バッファオーバーフローを検出することにより,スタックスマッシング攻撃の痕跡を抽出する処理を説明する。   In FIGS. 7 and 8, a guard variable that is a special value for protection such as a return address is inserted into the protection target program at the time of compilation, and the guard variable is activated immediately before the return processing of the function. A process for extracting traces of a stack smashing attack by detecting buffer overflow by confirming the characteristics will be described.

図5中に示す100は攻撃対象プログラムのスタックメモリ,200は攻撃者が入力可能なコピー元バッファである。スタックスマッシング攻撃の攻撃者は,用意した攻撃プログラムに制御を渡すために,コピー先バッファサイズよりも大きいデータをコピー元バッファ200に格納し,フレームポインタやリターンアドレス,またはオペレーティングシステムによっては例外ハンドラへのポインタを,スタックメモリ100に上書きすることで,攻撃を実行する。   In FIG. 5, reference numeral 100 denotes a stack memory of the attack target program, and reference numeral 200 denotes a copy source buffer that can be input by the attacker. In order to pass control to the prepared attack program, the attacker of the stack smashing attack stores data larger than the copy destination buffer size in the copy source buffer 200 and sends it to the exception handler depending on the frame pointer, return address, or operating system. Is overwritten on the stack memory 100 to execute an attack.

このスタックスマッシング攻撃の有無を検出するために,パケットフィルタリングルール生成装置1は,標準的なメモリコピー関数をフックし,現在のフレームポインタを起点にフレームポインタを辿ることで,コピー先バッファがどの関数フレームに属するかを決定する。そして,コピー先バッファの先頭から次のフレームポインタが格納されている場所の手前までの長さを,コピー先バッファのサイズとし,このサイズがコピー元バッファ200のサイズより小さい場合に,スタックスマッシング攻撃が行われたと判断する。   In order to detect the presence or absence of this stack smashing attack, the packet filtering rule generation device 1 hooks a standard memory copy function and traces the frame pointer from the current frame pointer to determine which function the copy destination buffer has. Determine if it belongs to a frame. The length from the beginning of the copy destination buffer to the position before the next frame pointer is stored as the size of the copy destination buffer. When this size is smaller than the size of the copy source buffer 200, a stack smashing attack is performed. Is determined to have been performed.

パケットフィルタリングルール生成装置1は,スタックスマッシング攻撃が行われたことを検出した場合には,スタックメモリ100に上書きされるであろうフレームポインタやリターンアドレス,またはオペレーティングシステムによっては例外ハンドラへのポインタの値を,スタックスマッシング攻撃の痕跡として抽出する。   When the packet filtering rule generation device 1 detects that a stack smashing attack has been performed, the frame pointer or return address that will be overwritten in the stack memory 100 or the pointer to the exception handler depending on the operating system. The value is extracted as a trace of a stack smashing attack.

図6は,パケットフィルタリングルール生成装置1の実行するスタックスマッシング攻撃の痕跡抽出処理フローである。パケットフィルタリングルール生成装置1は,標準的なメモリコピー関数の実行をフックし,図6の処理フローに示すように,まず,ステップS10でコピー先バッファのサイズがコピー元バッファ200のサイズより小さいかどうかを判断し,大きいかもしくは等しいときには,スタックスマッシング攻撃が行われなかったと判断して,そのまま処理を終了する。   FIG. 6 is a trace extraction process flow of a stack smashing attack executed by the packet filtering rule generation device 1. The packet filtering rule generation device 1 hooks the execution of a standard memory copy function. As shown in the processing flow of FIG. 6, first, in step S10, whether the size of the copy destination buffer is smaller than the size of the copy source buffer 200 or not. If it is greater or equal, it is determined that the stack smashing attack has not been performed, and the process is terminated.

一方,ステップS10で,コピー先バッファのサイズがコピー元バッファ200のサイズより小さいことがわかり,スタックスマッシング攻撃が行われたと判断したときには,ステップS11に進み,スタックスマッシング攻撃が設定したリターンアドレスやフレームポインタ,またオペレーティングシステムによっては例外ハンドラヘのポインタの値をスタックスマッシング攻撃の痕跡とする。   On the other hand, if it is determined in step S10 that the size of the copy destination buffer is smaller than the size of the copy source buffer 200 and it is determined that a stack smashing attack has been performed, the process proceeds to step S11 and the return address or frame set by the stack smashing attack is determined. The pointer or the value of the pointer to the exception handler depending on the operating system is used as a trace of the stack smashing attack.

図7中の300は攻撃対象プログラムのスタックメモリ,400はガード変数やローカル変数の入れ替えが生じない通常コンパイル時のスタックメモリ,500は攻撃者が入力可能なコピー元バッファである。   In FIG. 7, 300 is a stack memory of the attack target program, 400 is a stack memory at the time of normal compilation in which no replacement of guard variables and local variables occurs, and 500 is a copy source buffer that can be input by an attacker.

スタックスマッシング攻撃の攻撃者は,用意した攻撃プログラムに制御を渡すために,コピー先バッファサイズよりも大きいデータをコピー元バッファに格納し,フレームポインタやリターンアドレス,またはオペレーティングシステムによっては例外ハンドラへのポインタを,スタックメモリ300に上書きすることで,スタックスマッシング攻撃を実行する。   In order to pass control to the prepared attack program, the attacker of the stack smashing attack stores data larger than the copy destination buffer size in the copy source buffer and sends it to the frame handler, return address, or exception handler depending on the operating system. A stack smashing attack is executed by overwriting the pointer on the stack memory 300.

このスタックスマッシング攻撃の有無を検出するために,パケットフィルタリングルール生成装置1は,バッファとフレームポインタの間に,特別の値であるガード変数を挿入する。また,バッファとガード変数との間に他の変数が配置されないように,ローカル変数の配置を変更する。そして,関数のリターン処理の直前に,このガード変数の有効性を確認する。この確認で,ガード変数が破壊されていることがわかった場合,スタックスマッシング攻撃が行われたと判断する。   In order to detect the presence or absence of this stack smashing attack, the packet filtering rule generation device 1 inserts a guard variable that is a special value between the buffer and the frame pointer. Also, the arrangement of local variables is changed so that no other variable is arranged between the buffer and the guard variable. The validity of this guard variable is confirmed immediately before the function return process. If it is found from this confirmation that the guard variable has been destroyed, it is determined that a stack smashing attack has been performed.

パケットフィルタリングルール生成装置1は,スタックスマッシング攻撃が行われたことを検出した場合には,ガード変数の挿入やローカル変数の入れ替えが生じる前のスタックメモリ400を通常コンパイル時のスタックメモリ使用ルールから想定することで,攻撃者が上書きしようとしたリターンアドレスやフレームポインタ,またはオペレーティングシステムによっては例外ハンドラヘのポインタの値を割り出し,それらの値をスタックスマッシング攻撃の痕跡とする。   When the packet filtering rule generation device 1 detects that a stack smashing attack has been performed, it assumes the stack memory 400 before the insertion of the guard variable or the replacement of the local variable from the stack memory usage rule at the time of normal compilation. By doing so, the return address, the frame pointer, or the pointer value to the exception handler depending on the operating system that the attacker tried to overwrite is determined, and those values are used as traces of the stack smashing attack.

ここで,スタックスマッシング攻撃の攻撃者は,ローカル変数が入れ替わっていたり,ガード変数が挿入されていることを知らないため,本来のリターンアドレスやフレームポインタ,またはオペレーティングシステムによっては例外ハンドラへのポインタの格納位置とは異なった場所を,書き換えようとする。   Here, since the attacker of the stack smashing attack does not know that the local variable has been switched or the guard variable has been inserted, the original return address, frame pointer, or pointer to the exception handler depending on the operating system. Try to rewrite a location that is different from the storage location.

図8は,パケットフィルタリングルール生成装置1の実行するスタックスマッシング攻撃の痕跡抽出処理フローである。パケットフィルタリングルール生成装置1は,関数リターンの直前で,図8の処理フローが示すように,まず,ステップS20で,ガード変数を読み取り,続くステップS21で,その読み取ったガード変数が書き換えられているか否かを判断し,ガード変数が書き換えられていない場合には,スタックスマッシング攻撃が行われなかったと判断して,そのまま処理を終了する。   FIG. 8 is a trace extraction process flow of a stack smashing attack executed by the packet filtering rule generation device 1. As shown in the processing flow of FIG. 8, the packet filtering rule generation device 1 first reads the guard variable in step S20 and immediately rewrites the read guard variable in step S21. If the guard variable has not been rewritten, it is determined that the stack smashing attack has not been performed, and the process is terminated.

一方,ステップS21で,ガード変数が書き換えられていることでスタックスマッシング攻撃が行われたと判断したときには,ステップS22に進み,スタックスマッシング攻撃が設定したリターンアドレスやフレームポインタ,またはオペレーティングシステムによっては例外ハンドラへのポインタの値をスタックスマッシング攻撃の痕跡とする。   On the other hand, when it is determined in step S21 that the stack smashing attack has been performed because the guard variable has been rewritten, the process proceeds to step S22, and the return address or frame pointer set by the stack smashing attack, or an exception handler depending on the operating system. The value of the pointer to is used as a trace of a stack smashing attack.

次に,図9の処理フローに従って,パケットフィルタリングルール生成装置1の実行するパケットフィルタリングルール生成処理について説明する。まず,スタックスマッシング攻撃の痕跡の検出処理が完了すると,次にステップS30で,入力パケット保存部10に保存される攻撃対象プログラムに送られてきたパケットを検索対象として,リターンアドレスやフレームポインタ,またオペレーティングシステムによっては例外ハンドラへのポインタの値と一致するバイト列を探し出し,そのバイト列をスタックスマッシング攻撃の痕跡とする。   Next, packet filtering rule generation processing executed by the packet filtering rule generation device 1 will be described according to the processing flow of FIG. First, when the stack smashing attack trace detection process is completed, in step S30, a return address, a frame pointer, or a packet sent to the attack target program stored in the input packet storage unit 10 is searched. Some operating systems look for a byte sequence that matches the value of the pointer to the exception handler, and use that sequence as a trace of a stack smashing attack.

続いて,ステップS31で,入力パケット保存部10を参照することで,その検索したバイト列を含むパケットの持つヘッダ情報を取得する。すなわち,プロトコル種別や送受信IPアドレスや送受信ポート番号などを取得する。ステップS32では,検索したバイト列と取得したへッダ情報とから,遮断するパケットについて記述するパケットフィルタリングルールを生成する。ここで生成するパケットフィルタリングルールは,例えば図10に示すように,プロトコル種別が“UDP”で,送信先ポート番号が“53”で,ペイロード(バイト列)が“40 11 b7 a1 c0 …”のパケットについては,スタックスマッシング攻撃のパケットであるので,それについては遮断する必要があるということについて記述するデータである。続いて,ステップS33で,パケットフィルタリング装置2に対して,生成したパケットフィルタリングルールを通知して,処理を終了する。   Subsequently, in step S31, by referring to the input packet storage unit 10, the header information of the packet including the searched byte sequence is acquired. That is, the protocol type, transmission / reception IP address, transmission / reception port number, and the like are acquired. In step S32, a packet filtering rule that describes a packet to be blocked is generated from the retrieved byte string and the acquired header information. The packet filtering rule generated here is, for example, as shown in FIG. 10, with the protocol type “UDP”, the destination port number “53”, and the payload (byte string) “40 11 b7 a1 c0. Since the packet is a packet of a stack smashing attack, it is data describing that it needs to be blocked. Subsequently, in step S33, the packet filtering device 2 is notified of the generated packet filtering rule, and the process ends.

この通知を受けて,パケットフィルタリング装置2は,図3に示した構成に従って,パケットフィルタリングルール生成装置1から通知されたパケットフィルタリングルールを受信して,パケットフィルタリングルールテーブル20に保存する処理を行う。これによって,パケットフィルタリング装置2のパケットフィルタリングルールテーブル20には,図11に示すようなルール構造をもつパケットフィルタリングルール(複数のこともある)が格納されることになる。   Upon receiving this notification, the packet filtering device 2 receives the packet filtering rule notified from the packet filtering rule generating device 1 and stores it in the packet filtering rule table 20 according to the configuration shown in FIG. As a result, the packet filtering rule table 20 of the packet filtering device 2 stores packet filtering rules (which may be plural) having a rule structure as shown in FIG.

次に,図12の処理フローに従って,パケットフィルタリング装置2の実行するパケットフィルタリング処理について説明する。パケットフィルタリング装置2は,外部ネットワークから送信されてくるパケットを受信すると,図12の処理フローに示すように,まず,ステップS40で受信したパケットのペイロードを抽出する。   Next, packet filtering processing executed by the packet filtering device 2 will be described according to the processing flow of FIG. When receiving a packet transmitted from the external network, the packet filtering device 2 first extracts the payload of the packet received in step S40 as shown in the processing flow of FIG.

続いて,ステップS41で受信したパケットのヘッダ情報から,プロトコル種別と送信先ポート番号とを取得する。続いて,ステップS42で,取得したプロトコル種別と一致するプロトコル種別をルール要素とするパケットフィルタリングルールがパケットフィルタリングルールテーブル20に登録されているか否かを判断し,登録されていないと判断したときには,受信したパケットがスタックスマッシング攻撃のパケットではないので,ステップS43に進み,受信したパケットを送信先ホストに転送して処理を終了する。   Subsequently, the protocol type and destination port number are acquired from the header information of the packet received in step S41. Subsequently, in step S42, it is determined whether or not a packet filtering rule having a protocol type matching the acquired protocol type as a rule element is registered in the packet filtering rule table 20, and when it is determined that it is not registered, Since the received packet is not a stack smashing attack packet, the process proceeds to step S43, the received packet is transferred to the destination host, and the process ends.

一方,ステップS42で,プロトコル種別が一致するパケットフィルタリングルールがパケットフィルタリングルールテーブル20に登録されていると判断したときには,ステップS44に進み,そのパケットフィルタリングルールの持つ送信先ポート番号が取得した送信先ポート番号と一致するか否かを判断し,一致しないと判断したときには,受信したパケットがスタックスマッシング攻撃のパケットではないので,ステップS45に進み,受信したパケットを送信先ホストに転送して,処理を終了する。   On the other hand, when it is determined in step S42 that the packet filtering rule having the same protocol type is registered in the packet filtering rule table 20, the process proceeds to step S44, and the transmission destination port number possessed by the packet filtering rule is acquired. It is determined whether or not the port number matches, and if it does not match, the received packet is not a stack smashing attack packet, so the process proceeds to step S45, and the received packet is transferred to the destination host for processing. Exit.

一方,ステップS44で,プロトコル種別が一致するパケットフィルタリングルールが送信先ポート番号についても一致すると判断したときには,ステップS46に進み,そのパケットフィルタリングルールの持つペイロードが抽出したペイロードと一致するか否かを判断する。一致しないと判断したときには,スタックスマッシング攻撃のパケットでないので,ステップS47に進み,受信したパケットを送信先ホストに転送して,処理を終了する。また,ステップS46で,ペイロードについても一致すると判断したときには,受信したパケットがスタックスマッシング攻撃のパケットであるので,ステップS48に進み,受信したパケットを遮断して,処理を終了する。   On the other hand, if it is determined in step S44 that the packet filtering rule having the same protocol type also matches the destination port number, the process proceeds to step S46 to determine whether the payload of the packet filtering rule matches the extracted payload. to decide. If it is determined that they do not match, the packet is not a stack smashing attack packet, so the process proceeds to step S47, the received packet is transferred to the destination host, and the process ends. If it is determined in step S46 that the payloads also match, the received packet is a stack smashing attack packet, so the process proceeds to step S48, where the received packet is blocked and the process ends.

このようにして,パケットフィルタリング装置2は,プロトコルと送信先ポート番号とペイロードとがパケットフィルタリングルールと一致するパケットを受信する場合に,その受信したパケットを遮断するように処理する。   In this way, when receiving a packet whose protocol, destination port number, and payload match the packet filtering rule, the packet filtering device 2 performs processing so as to block the received packet.

ここで,バッファオーバーフローの脆弱性が存在するサービスを外部ネットワークに提供したくない場合には,運用によってパケットフィルタリングルールとして用いるルール要素を減らすこともできる。   Here, when it is not desired to provide an external network with a buffer overflow vulnerability, rule elements used as packet filtering rules can be reduced by operation.

以上のパケットフィルタリングルール生成装置1およびパケットフィルタリング装置2が行う処理は,コンピュータとソフトウェアプログラムとによって実現することができ,そのプログラムをコンピュータ読み取り可能な記録媒体に記録して提供することも,ネットワークを通して提供することも可能である。   The processes performed by the packet filtering rule generation device 1 and the packet filtering device 2 described above can be realized by a computer and a software program, and the program can be recorded and provided on a computer-readable recording medium. It is also possible to provide.

スタックスマッシング攻撃対策システムのシステム構成例を示す図である。It is a figure which shows the system configuration example of a stack smashing attack countermeasure system. パケットフィルタリングルール生成装置の一構成例を示す図である。It is a figure which shows one structural example of a packet filtering rule production | generation apparatus. パケットフィルタリング装置の一構成例を示す図である。It is a figure which shows the example of 1 structure of a packet filtering apparatus. 入力パケット保存部に保存されるデータ構成の例を示す図である。It is a figure which shows the example of the data structure preserve | saved at an input packet preservation | save part. スタックスマッシング攻撃の痕跡の抽出を説明する図である。It is a figure explaining extraction of the trace of a stack smashing attack. スタックスマッシング攻撃の痕跡抽出処理フローを示す図である。It is a figure which shows the trace extraction process flow of a stack smashing attack. スタックスマッシング攻撃の痕跡の抽出を説明する図である。It is a figure explaining extraction of the trace of a stack smashing attack. スタックスマッシング攻撃の痕跡抽出処理フローを示す図である。It is a figure which shows the trace extraction process flow of a stack smashing attack. パケットフィルタリングルール生成処理フローを示す図である。It is a figure which shows a packet filtering rule production | generation processing flow. パケットフィルタリングルールの一例を示す図である。It is a figure which shows an example of a packet filtering rule. パケットフィルタリングルールテーブルに格納されるパケットフィルタリングルールの一例を示す図である。It is a figure which shows an example of the packet filtering rule stored in a packet filtering rule table. パケットフィルタリング処理フローを示す図である。It is a figure which shows a packet filtering process flow.

符号の説明Explanation of symbols

1 パケットフィルタリングルール生成装置
2 パケットフィルタリング装置
10 入力パケット保存部
11 入力パケットロギング部
12 サーバプログラム
13 バッファオーバーフロー検出部
14 スタックスマッシング攻撃痕跡抽出部
15 パケットフィルタリングルール生成部
16 パケットフィルタリングルール通知部
20 パケットフィルタリングルールテーブル
21 パケットフィルタリングルール受信部
22 パケットフィルタリングルール登録部
23 パケットフィルタリング部
DESCRIPTION OF SYMBOLS 1 Packet filtering rule production | generation apparatus 2 Packet filtering apparatus 10 Input packet preservation | save part 11 Input packet logging part 12 Server program 13 Buffer overflow detection part 14 Stack smashing attack trace extraction part 15 Packet filtering rule production | generation part 16 Packet filtering rule notification part 20 Packet filtering Rule table 21 Packet filtering rule reception unit 22 Packet filtering rule registration unit 23 Packet filtering unit

Claims (7)

外部から送信されてくる不正なパケットをフィルタリングするために用いられる不正アクセス対処ルールを生成する方法であって,
外部ネットワークから送信されたパケットを保存するステップと,
メモリコピー関数のコピー先のバッファサイズをチェックしてバッファオーバーフローを検出するステップと,
前記コピー先バッファが属する関数フレームの位置から,前記バッファオーバーフローが発生したときに書き込まれることになる,フレームポインタとリターンアドレスとオペレーティングシステムによっては例外ハンドラヘのポインタを割り出すステップと,
前記保存されたパケットを検索対象として,前記割り出されたフレームポインタ,リターンアドレスまたはオペレーティングシステムによっては例外ハンドラヘのポインタの値と一致するバイト列を検索するステップと,
前記検索されたバイト列を含むパケットの持つヘッダ中の情報を取得するステップと,
前記バイト列と前記ヘッダ中の情報とをルール要素として,フィルタリングするパケットについて記述する不正アクセス対処ルールを生成し記録するステップとを有する
ことを特徴とする不正アクセス対処ルール生成方法。
A method for generating an illegal access countermeasure rule used for filtering illegal packets transmitted from the outside,
Storing packets sent from an external network;
Checking the buffer size of the copy destination of the memory copy function to detect a buffer overflow;
Determining a frame pointer, a return address, and a pointer to an exception handler depending on the operating system to be written when the buffer overflow occurs, from the position of the function frame to which the copy destination buffer belongs;
Searching the stored packet for a byte string that matches the determined frame pointer, return address or the value of the pointer to the exception handler depending on the operating system;
Obtaining information in a header of a packet including the retrieved byte sequence;
An unauthorized access countermeasure rule generation method comprising: generating and recording an unauthorized access countermeasure rule describing a packet to be filtered using the byte string and the information in the header as rule elements.
外部から送信されてくる不正なパケットをフィルタリングするために用いられる不正アクセス対処ルールを生成する方法であって,
外部ネットワークから送信されたパケットを保存するステップと,
スタックメモリのバッファとフレームポインタとの間にガード変数を挿入して前記スタックメモリのレイアウトを変更するステップと,
前記スタックメモリのバッファとフレームポインタとの間に挿入されたガード変数が破壊されたかどうかをチェックしてバッファオーバーフローを検出するステップと,
レイアウトが変更される前の前記スタックメモリのレイアウトから,前記バッファオーバーフローが生じた際に書き込まれることになる,フレームポインタとリターンアドレスとオペレーティングシステムによっては例外ハンドラヘのポインタを割り出すステップと,
前記保存されたパケットを検索対象として,前記割り出されたフレームポインタ,リターンアドレスまたはオペレーティングシステムによっては例外ハンドラヘのポインタの値と一致するバイト列を検索するステップと,
前記検索されたバイト列を含むパケットの持つヘッダ中の情報を取得するステップと,
前記バイト列と前記ヘッダ中の情報とをルール要素として,フィルタリングするパケットについて記述する不正アクセス対処ルールを生成し記録するステップとを有する
ことを特徴とする不正アクセス対処ルール生成方法。
A method for generating an illegal access countermeasure rule used for filtering illegal packets transmitted from the outside,
Storing packets transmitted from an external network;
Inserting a guard variable between the stack memory buffer and the frame pointer to change the stack memory layout;
Detecting a buffer overflow by checking whether a guard variable inserted between the buffer of the stack memory and a frame pointer is destroyed;
Determining a frame pointer, a return address, and a pointer to an exception handler depending on the operating system, to be written when the buffer overflow occurs, from the layout of the stack memory before the layout is changed;
Searching the stored packet for a byte string that matches the determined frame pointer, return address or the value of the pointer to the exception handler depending on the operating system;
Obtaining information in a header of a packet including the searched byte sequence;
An unauthorized access countermeasure rule generation method comprising: generating and recording an unauthorized access countermeasure rule describing a packet to be filtered using the byte string and the information in the header as rule elements.
外部から送信されてくる不正なパケットをフィルタリングする方法であって,
請求項1または請求項2に記載の不正アクセス対処ルール生成方法によって生成された不正アクセス対処ルールを受信し記憶装置に登録するステップと,
前記登録された不正アクセス対処ルールをもとに,不正アクセス対処ルールにおけるヘッダ中の情報およびバイト列と,受信したパケットにおけるヘッダ中の情報およびバイト列とを照合し,一致する場合に受信したパケットは不正なパケットとして,外部から送信されてくる不正なパケットをフィルタリングするステップとを有する
ことを特徴とする不正アクセス対処方法。
A method of filtering illegal packets sent from outside,
Receiving an unauthorized access countermeasure rule generated by the unauthorized access countermeasure rule generating method according to claim 1 and registering it in a storage device;
Based on the registered unauthorized access countermeasure rule, the information and byte string in the header in the unauthorized access countermeasure rule is compared with the information and byte string in the header in the received packet, and the packet received if they match And a method of filtering illegal packets transmitted from the outside as illegal packets.
外部から送信されてくる不正なパケットをフィルタリングするために用いられる不正アクセス対処ルールを生成する装置であって,
外部ネットワークから送信されたパケットを保存する手段と,
メモリコピー関数のコピー先のバッファサイズをチェックしてバッファオーバーフローを検出する手段と,
前記コピー先バッファが属する関数フレームの位置から,前記バッファオーバーフローが発生したときに書き込まれることになる,フレームポインタとリターンアドレスとオペレーティングシステムによっては例外ハンドラヘのポインタを割り出す手段と,
前記保存されたパケットを検索対象として,前記割り出されたフレームポインタ,リターンアドレスまたはオペレーティングシステムによっては例外ハンドラヘのポインタの値と一致するバイト列を検索する手段と,
前記検索されたバイト列を含むパケットの持つヘッダ中の情報を取得する手段と,
前記バイト列と前記ヘッダ中の情報とをルール要素として,フィルタリングするパケットについて記述する不正アクセス対処ルールを生成し記録する手段とを備える
ことを特徴とする不正アクセス対処ルール生成装置。
An apparatus for generating an illegal access countermeasure rule used for filtering illegal packets transmitted from outside,
Means for storing packets sent from an external network;
A means of detecting buffer overflow by checking the buffer size of the copy destination of the memory copy function;
Means for calculating a frame pointer, a return address, and a pointer to an exception handler depending on the operating system, which are written when the buffer overflow occurs from the position of the function frame to which the copy destination buffer belongs;
Means for searching the stored packet for a byte string that matches the determined frame pointer, return address or the value of the pointer to the exception handler depending on the operating system;
Means for obtaining information in a header of a packet including the searched byte sequence;
An unauthorized access countermeasure rule generation device comprising: means for generating and recording an unauthorized access countermeasure rule describing a packet to be filtered using the byte string and information in the header as rule elements.
外部から送信されてくる不正なパケットをフィルタリングするために用いられる不正アクセス対処ルールを生成する装置であって,
外部ネットワークから送信されたパケットを保存する手段と,
スタックメモリのバッファとフレームポインタとの間にガード変数を挿入して前記スタックメモリのレイアウトを変更する手段と,
前記スタックメモリのバッファとフレームポインタとの間に挿入されたガード変数が破壊されたかをチェックしてバッファオーバーフローを検出する手段と,
レイアウトが変更される前の前記スタックメモリのレイアウトから,前記バッファオーバーフローが生じた際に書き込まれることになる,フレームポインタとリターンアドレスとオペレーティングシステムによっては例外ハンドラヘのポインタを割り出す手段と,
前記保存されたパケットを検索対象として,前記割り出されたフレームポインタ,リターンアドレスまたはオペレーティングシステムによっては例外ハンドラヘのポインタの値と一致するバイト列を検索する手段と,
前記検索されたバイト列を含むパケットの持つヘッダ中の情報を取得する手段と,
前記バイト列と前記ヘッダ中の情報とをルール要素として,フィルタリングするパケットについて記述する不正アクセス対処ルールを生成し記録する手段とを備える
ことを特徴とする不正アクセス対処ルール生成装置。
An apparatus for generating an illegal access countermeasure rule used for filtering illegal packets transmitted from outside,
Means for storing packets sent from an external network;
Means for changing the layout of the stack memory by inserting a guard variable between the buffer of the stack memory and the frame pointer;
Means for detecting a buffer overflow by checking whether a guard variable inserted between the buffer of the stack memory and a frame pointer is destroyed;
Means for determining a frame pointer, a return address, and a pointer to an exception handler depending on an operating system, which are written when the buffer overflow occurs from the layout of the stack memory before the layout is changed;
Means for searching the stored packet for a byte string that matches the determined frame pointer, return address or the value of the pointer to the exception handler depending on the operating system;
Means for obtaining information in a header of a packet including the searched byte sequence;
An unauthorized access countermeasure rule generation device comprising: means for generating and recording an unauthorized access countermeasure rule describing a packet to be filtered using the byte string and information in the header as rule elements.
外部から送信されてくる不正なパケットをフィルタリングする装置であって,
請求項4または請求項5に記載の不正アクセス対処ルール生成装置から,前記不正アクセス対処ルールを受信し記憶装置に登録する手段と,
前記登録された不正アクセス対処ルールをもとに,不正アクセス対処ルールにおけるヘッダ中の情報およびバイト列と,受信したパケットにおけるヘッダ中の情報およびバイト列とを照合し,一致する場合に受信したパケットは不正なパケットとして,外部から送信されてくる不正なパケットをフィルタリングする手段とを備える
ことを特徴とする不正アクセス対処装置。
A device that filters illegal packets sent from outside,
Means for receiving the unauthorized access countermeasure rule from the unauthorized access countermeasure rule generating device according to claim 4 and registering it in a storage device;
Based on the registered unauthorized access countermeasure rule, the information and byte string in the header in the unauthorized access countermeasure rule is compared with the information and byte string in the header in the received packet, and the packet received if they match A device for dealing with unauthorized access, comprising means for filtering unauthorized packets transmitted from the outside as unauthorized packets.
外部から送信されてくる不正なパケットをフィルタリングするスタックスマッシング攻撃対策システムであって,
請求項4または請求項5に記載の不正アクセス対処ルール生成装置と,
請求項6に記載の不正アクセス対処装置とを備える
ことを特徴とするスタックスマッシング攻撃対策システム。
A stack smashing countermeasure system that filters illegal packets sent from outside,
An unauthorized access countermeasure rule generation device according to claim 4 or 5,
A stack smashing attack countermeasure system comprising the unauthorized access countermeasure device according to claim 6.
JP2003390130A 2003-11-20 2003-11-20 Unauthorized access countermeasure rule generation method, unauthorized access countermeasure method, unauthorized access countermeasure rule generation apparatus, unauthorized access countermeasure apparatus, and stack smashing attack countermeasure system Expired - Fee Related JP4091528B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003390130A JP4091528B2 (en) 2003-11-20 2003-11-20 Unauthorized access countermeasure rule generation method, unauthorized access countermeasure method, unauthorized access countermeasure rule generation apparatus, unauthorized access countermeasure apparatus, and stack smashing attack countermeasure system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003390130A JP4091528B2 (en) 2003-11-20 2003-11-20 Unauthorized access countermeasure rule generation method, unauthorized access countermeasure method, unauthorized access countermeasure rule generation apparatus, unauthorized access countermeasure apparatus, and stack smashing attack countermeasure system

Publications (2)

Publication Number Publication Date
JP2005151492A true JP2005151492A (en) 2005-06-09
JP4091528B2 JP4091528B2 (en) 2008-05-28

Family

ID=34696614

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003390130A Expired - Fee Related JP4091528B2 (en) 2003-11-20 2003-11-20 Unauthorized access countermeasure rule generation method, unauthorized access countermeasure method, unauthorized access countermeasure rule generation apparatus, unauthorized access countermeasure apparatus, and stack smashing attack countermeasure system

Country Status (1)

Country Link
JP (1) JP4091528B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9954980B2 (en) 2014-11-25 2018-04-24 enSilo Ltd. Systems and methods for malicious code detection accuracy assurance
CN113746827A (en) * 2021-08-31 2021-12-03 中国铁道科学研究院集团有限公司通信信号研究所 Real-time data link byte stream error-proofing method based on multi-band turing machine

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9954980B2 (en) 2014-11-25 2018-04-24 enSilo Ltd. Systems and methods for malicious code detection accuracy assurance
US10264104B2 (en) 2014-11-25 2019-04-16 enSilo Ltd. Systems and methods for malicious code detection accuracy assurance
US10334083B2 (en) 2014-11-25 2019-06-25 enSilo Ltd. Systems and methods for malicious code detection
CN113746827A (en) * 2021-08-31 2021-12-03 中国铁道科学研究院集团有限公司通信信号研究所 Real-time data link byte stream error-proofing method based on multi-band turing machine
CN113746827B (en) * 2021-08-31 2023-02-10 中国铁道科学研究院集团有限公司通信信号研究所 Real-time data link byte stream error-proofing method based on multi-band turing machine

Also Published As

Publication number Publication date
JP4091528B2 (en) 2008-05-28

Similar Documents

Publication Publication Date Title
JP4320013B2 (en) Unauthorized processing determination method, data processing apparatus, computer program, and recording medium
US7334264B2 (en) Computer virus generation detection apparatus and method
US6941473B2 (en) Memory device, stack protection system, computer system, compiler, stack protection method, storage medium and program transmission apparatus
Parampalli et al. A practical mimicry attack against powerful system-call monitors
US7665138B2 (en) Detecting method and architecture thereof for malicious codes
US7260843B2 (en) Intrusion detection method and system
JP4990998B2 (en) Method and apparatus for preventing modification of program execution flow
US20130326621A1 (en) Method and system for dynamic protocol decoding and analysis
US20080133858A1 (en) Secure Bit
JP4995170B2 (en) Fraud detection method, fraud detection device, fraud detection program, and information processing system
US9038161B2 (en) Exploit nonspecific host intrusion prevention/detection methods and systems and smart filters therefor
JP2006268687A (en) Computer virus monitoring program and computer terminal employing the same
JP4091528B2 (en) Unauthorized access countermeasure rule generation method, unauthorized access countermeasure method, unauthorized access countermeasure rule generation apparatus, unauthorized access countermeasure apparatus, and stack smashing attack countermeasure system
KR100554172B1 (en) Integrity management system enhancing security of network, integrity network system having the same and method thereof
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
JP2004054330A (en) Illicit command/data detecting system, illicit command/data detecting method and illicit command/data detecting program
CN113032737B (en) Software protection method and device, electronic equipment and storage medium
JP4253215B2 (en) Unauthorized access countermeasure rule generation method, unauthorized access countermeasure rule generation apparatus, unauthorized access countermeasure rule generation program, and recording medium recording the program
CN106790241A (en) A kind of processing method and processing device of message
JP5177206B2 (en) Software falsification detection device and falsification detection method
JP4728619B2 (en) Software falsification detection device, falsification prevention device, falsification detection method and falsification prevention method
WO2020012474A1 (en) Return-oriented programming attack protection system and method
Liang et al. Automated, sub-second attack signature generation: A basis for building self-protecting servers
KR102156600B1 (en) System and method for creating association between packets collected in network and processes in endpoint computing device
US20160337383A1 (en) Detecting deviation from a data packet send-protocol in a computer system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060410

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080218

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20080226

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080228

R150 Certificate of patent or registration of utility model

Ref document number: 4091528

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110307

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110307

Year of fee payment: 3

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: R3D02

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110307

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120307

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130307

Year of fee payment: 5

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees