JP6880933B2 - Program test equipment, test control method and test control program - Google Patents
Program test equipment, test control method and test control program Download PDFInfo
- Publication number
- JP6880933B2 JP6880933B2 JP2017070574A JP2017070574A JP6880933B2 JP 6880933 B2 JP6880933 B2 JP 6880933B2 JP 2017070574 A JP2017070574 A JP 2017070574A JP 2017070574 A JP2017070574 A JP 2017070574A JP 6880933 B2 JP6880933 B2 JP 6880933B2
- Authority
- JP
- Japan
- Prior art keywords
- test
- program
- file
- target program
- input file
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Description
本発明は、プログラムテストの制御技術に関する。 The present invention relates to a control technique for program testing.
ファイルファジングによるプログラムテストでは、正常ファイルの一部を書き換えたファイルを入力してテスト対象プログラムの動作を検証する処理を繰り返す。テスト対象プログラムを実行している最中に例外処理が起きれば、変更箇所がテスト対象プログラムの脆弱性に関わる可能性がある。 In the program test by file fuzzing, the process of inputting a file in which a part of the normal file is rewritten and verifying the operation of the program to be tested is repeated. If exception handling occurs while the program under test is running, the changes may be related to the vulnerability of the program under test.
一方、所定時間が経過しても例外処理が起きない場合には、変更箇所がテスト対象プログラムの脆弱性に関わらないと想定される。但し、例外処理が起きなかったと結論付けるタイミングが問題となる。 On the other hand, if exception handling does not occur even after a predetermined time has passed, it is assumed that the changed part is not related to the vulnerability of the program under test. However, the timing to conclude that exception handling did not occur becomes a problem.
早いタイミングでタイムアウトすると、例外処理の発生を見逃すかもしれない。一方、タイムアウトのタイミングが遅すぎると、テストに要する時間が無駄に長くなる。 If you time out early, you may miss the exception handling. On the other hand, if the timeout timing is too late, the test time will be unnecessarily long.
本発明の目的は、一側面では、入力ファイルにおける変更範囲に応じたタイミングでプログラムテストを終わらせるようにすることである。 An object of the present invention is, on the one hand, to end a program test at a timing according to a change range in an input file.
一態様に係るプログラムテスト装置は、(A)ファイルファジングによるプログラムテストに供される入力ファイルの変更箇所がテスト対象プログラムによって読み込まれたことを検出する検出部と、(B)変更箇所がテスト対象プログラムによって読み込まれたことを検出した時点に基づいて決定したタイミングで、テスト対象プログラムの動作を終了させる停止部とを有する。 In the program test apparatus according to one aspect, (A) a detection unit that detects that a changed part of an input file used for a program test by file fuzzing has been read by a program to be tested, and (B) a changed part is a test target. It has a stop unit that terminates the operation of the program to be tested at a timing determined based on the time when it is detected that the program has been read.
一側面としては、入力ファイルにおける変更範囲に応じたタイミングでプログラムテストを終わらせることができる。 On the one hand, the program test can be completed at the timing according to the change range in the input file.
まず、ファイルファジングによるプログラムテストに供される入力ファイルの基礎となるオリジナルファイルについて説明する。図1に、オリジナルファイル101の例を示す。オリジナルファイル101は、例えばテスト対象プログラムである画像ビューワに読み込まれる画像ファイルである。オリジナルファイル101は、公開されている画像ファイルの仕様に従っている。つまり、オリジナルファイル101は、正常なファイルである。
First, the original file that is the basis of the input file used for the program test by file fuzzing will be described. FIG. 1 shows an example of the
この例におけるオリジナルファイル101は、ヘッダ及び本体を含んでいる。ヘッダに含まれるオフセット0x0000000A乃至0x0000000Dに格納されているコード(0x0049492A)は、本体の先頭オフセットを指すポインタである。テスト対象プログラムは、このポインタに基づいて本体のデータを取得する。尚、この例におけるオフセットは、ファイルの先頭位置を基準(0x00000000)とする相対的なアドレスである。
The
テストにおいてテスト対象プログラムに引き渡される入力ファイルは、このようなオリジナルファイル101の一部を変更することによって生成される。入力ファイルをテストファイルということもある。
The input file passed to the program under test in the test is generated by modifying a part of such an
図2に、入力ファイル201の例を示す。1回目に生成される入力ファイル201aにおける変更範囲は、オフセット0x00000000乃至0x00000003である。変更範囲には、置換コード0xFFFFFFFFが設定される。
FIG. 2 shows an example of the input file 201. The range of change in the
変更範囲は、順次1バイト後方へスライドする。従って、2回目に生成される入力ファイル201bにおける変更範囲は、オフセット0x00000001乃至0x00000004である。3回目に生成される入力ファイル201cにおける変更範囲は、オフセット0x00000002乃至0x00000005である。いずれの場合にも、変更範囲に置換コード0xFFFFFFFFが設定される。
The change range slides backward by 1 byte in sequence. Therefore, the range of change in the
図3に示すように、8回目に生成される入力ファイル201hにおける変更範囲は、オフセット0x00000007乃至0x0000000Aである。従って、上述したポインタの一部が書き換えられることになる。入力ファイル201hを用いるテストでは、テスト対象プログラムが本体のデータを取得する際に正しく動作せず、例外処理が実行される。
As shown in FIG. 3, the change range in the
例外処理が実行されれば異常動作が発生したものと看做す。この場合には、当該変更範囲が脆弱性に関わる可能性があると推察される。一方、例外処理が実行されない場合には、正常に動作したものと看做す。従来技術では、テスト対象プログラムを起動してから所定時間が経過した時点で、例外処理が実行されなかったと判断してその回のテストを終える。つまり、タイムアウトによってテスト対象プログラムを停止させ、次回のテストに移る。 If exception handling is executed, it is considered that an abnormal operation has occurred. In this case, it is presumed that the scope of the change may be related to the vulnerability. On the other hand, if exception handling is not executed, it is considered to have operated normally. In the prior art, when a predetermined time elapses after starting the program to be tested, it is determined that the exception handling has not been executed, and the test at that time is completed. In other words, the program under test is stopped by the timeout and the next test is started.
このようにファイルファジングでは、変更範囲が異なる入力ファイル201を用いてテストを繰り返すので、人為的には予測し難い脆弱性を検出し易くなる。 In this way, in file fuzzing, since the test is repeated using the input files 201 having different change ranges, it becomes easy to detect a vulnerability that is difficult to predict artificially.
但し、入力ファイル201における変更箇所が読み出されるタイミングは、変更箇所のオフセットによって異なる。例えば、或る範囲のデータは、早いタイミングで読み出され、別の範囲のデータは、遅いタイミングで読み出される。つまり、変更箇所が読み込まれるタイミングは、入力ファイル201毎に異なる。従って、繰り返されるテストにおいてタイムアウトの基準を一律に定めることは必ずしも妥当でない。或る入力ファイル201を用いるテストでは変更箇所が読み込まれた後も無駄にテストが継続され、別の入力ファイル201を用いるテストでは変更箇所が読み込まれる前にテストが打ち切られるような事態も想定される。つまり、一律に定めたタイムアウトの基準が短い場合には正しく検証が行われないケースが増え、同じくタイムアウトの基準が長い場合にはテストの効率が悪くなるという問題がある。 However, the timing at which the changed portion in the input file 201 is read differs depending on the offset of the changed portion. For example, a range of data is read at an early timing and another range of data is read at a late timing. That is, the timing at which the changed part is read differs for each input file 201. Therefore, it is not always appropriate to set a uniform time-out criterion for repeated tests. In the test using one input file 201, the test is uselessly continued even after the changed part is read, and in the test using another input file 201, the test may be terminated before the changed part is read. File. That is, if the uniformly set timeout standard is short, the verification is not performed correctly in many cases, and if the timeout standard is long, the test efficiency is deteriorated.
尚、画像ファイルを画像ビューワに読み込ませるテストでは、画像が表示された時点でデータの読み込みが完了したことを把握できるので、準備段階でテスト対象プログラムの挙動を分析することによってタイムアウトの基準を設定し易い。一方、出力を伴わない処理に用いられるデータについては、そのデータを用いる処理が完了した時点を外観として把握できないので、テスト対象プログラムの挙動によってタイムアウトの基準を定めることが難しいという問題もある。 In the test of loading the image file into the image viewer, it is possible to know that the data loading is completed when the image is displayed, so the timeout standard is set by analyzing the behavior of the program under test at the preparation stage. Easy to do. On the other hand, for data used for processing that does not involve output, there is also a problem that it is difficult to determine a timeout standard depending on the behavior of the program to be tested because the time when the processing using the data is completed cannot be grasped as an appearance.
ここでは、仕様が公開されている明示的ファイルの例を示したが、仕様が公開されていない暗黙的ファイルに本実施の形態を適用するようにしてもよい。また、ファイルファジングによるテストに供されるオリジナルファイル101及び入力ファイル201は、画像ファイルに限らない。他の形式のファイルがファイルファジングによるプログラムテストに供される場合もある。尚、上述した変更を変異といい、変更箇所と変異箇所といい、変更範囲を変異範囲ということもある。
Here, an example of an explicit file whose specifications are published is shown, but the present embodiment may be applied to an implicit file whose specifications are not published. Further, the
本実施の形態では、ファイルファジングによるプログラムテストを行うテスト制御部において1つの異常判定と3つの正常判定とのうちのいずれかを得る。つまり、テスト結果は、4つに分類される。以下、各テスト結果を得る場合のシーケンスについて説明する。 In the present embodiment, one of one abnormality determination and three normal determinations is obtained in the test control unit that performs the program test by file fuzzing. That is, the test results are classified into four. The sequence for obtaining each test result will be described below.
まず、図4を用いて、テスト対象プログラム407における例外処理の実行を検出する場合のシーケンスについて説明する。例外処理が実行された場合に、テスト制御部401は、入力ファイル201を用いる処理によって異常が起きたと判断する。
First, with reference to FIG. 4, a sequence in which the execution of exception handling in the
テスト制御部401は、オリジナルファイル記憶部403に記憶されているオリジナルファイル101に基づいて入力ファイル201を生成する(S421)。生成された入力ファイル201は入力ファイル記憶部405に記憶される。そして、テスト制御部401は、テスト対象プログラム407を起動する(S423)。
The
テスト対象プログラム407は、動作中に入力ファイル201をオープンする(S425)。そして、テスト対象プログラム407は、入力ファイル201のデータを読み込む動作を繰り返す(S427乃至S431)。読み込まれる範囲は、同一であるとは限らない。
The
この例では、S431においてデータが読み込まれた後に、テスト対象プログラム407が例外処理を実行するものとする(S433)。テスト制御部401は、例外処理が実行されたことを検出すると(S435)、テスト対象プログラム407を強制終了させる(S437)。そして、テスト制御部401は、テスト結果をテスト結果記憶部409に書き込む(S439)。この例におけるテスト結果は、例外処理の実行を検出したことによる異常判定であることを示す。そして、テスト制御部401は、入力ファイル201を削除して(S441)、次のテストに移る。
In this example, it is assumed that the
続いて、図5を用いて入力ファイル201のクローズを検出する場合のシーケンスについて説明する。本実施の形態では、入力ファイル201がクローズされた時点で、テスト制御部401は、当該入力ファイル201を用いる処理が正常であったものと判断する。
Subsequently, a sequence for detecting the closing of the input file 201 will be described with reference to FIG. In the present embodiment, when the input file 201 is closed, the
テスト制御部401は、オリジナルファイル記憶部403に記憶されているオリジナルファイル101に基づいて入力ファイル201を生成する(S501)。生成された入力ファイル201は入力ファイル記憶部405に記憶される。そして、テスト制御部401は、テスト対象プログラム407を起動する(S503)。
The
テスト対象プログラム407は、動作中に入力ファイル201をオープンする(S505)。そして、テスト対象プログラム407は、入力ファイル201のデータを読み込む動作を繰り返す(S507乃至S511)。この間に、例外処理は行われないものとする。そして、テスト対象プログラム407は、入力ファイル201をクローズする(S513)。
The
テスト制御部401は、入力ファイル201がクローズされたことを検出すると(S515)、テスト対象プログラム407を強制終了させる(S517)。そして、テスト制御部401は、テスト結果をテスト結果記憶部409に書き込む(S519)。この例におけるテスト結果は、入力ファイル201のクローズを検出したことによる正常判定であることを示す。そして、テスト制御部401は、入力ファイル201を削除して(S521)、次のテストに移る。
When the
続いて、図6を用いてタイムアウトを検出する場合のシーケンスについて説明する。本実施の形態では、テスト対象プログラム407が起動された時点からの経過時間が上限を超えると、テスト制御部401は、当該入力ファイル201を用いる処理が正常であったものと判断する。
Subsequently, a sequence in which a timeout is detected will be described with reference to FIG. In the present embodiment, when the elapsed time from the time when the
テスト制御部401は、オリジナルファイル記憶部403に記憶されているオリジナルファイル101に基づいて入力ファイル201を生成する(S601)。生成された入力ファイル201は入力ファイル記憶部405に記憶される。そして、テスト制御部401は、テスト対象プログラム407を起動する(S603)。
The
テスト対象プログラム407は、動作中に入力ファイル201をオープンする(S605)。そして、テスト対象プログラム407は、入力ファイル201のデータを読み込む動作を繰り返す(S607乃至S613)。この間に、例外処理は行われないものとする。
The
この例では、S613におけるデータ読み込みを終えた時点でテスト対象プログラム407の実行時間が上限を超え、テスト制御部401がタイムアウトを検出する(S615)。
In this example, when the data reading in S613 is completed, the execution time of the
テスト制御部401は、タイムアウトを検出すると、テスト対象プログラム407を強制終了させる(S617)。そして、テスト制御部401は、テスト結果をテスト結果記憶部409に書き込む(S619)。この例におけるテスト結果は、タイムアウトを検出したことによる正常判定であることを示す。そして、テスト制御部401は、入力ファイル201を削除して(S621)、次のテストに移る。
When the
続いて、図7を用いて変更箇所の読み込みを検出する場合のシーケンスについて説明する。本実施の形態では、入力ファイル201における変更箇所が読み込まれた時点から所定時間(以下、観察時間という。)が経過するまでに例外処理が実行されなければ、テスト制御部401は、当該入力ファイル201を用いる処理が正常であったものと判断する。
Subsequently, a sequence in the case of detecting the reading of the changed portion will be described with reference to FIG. 7. In the present embodiment, if the exception processing is not executed from the time when the changed part in the input file 201 is read to the time when a predetermined time (hereinafter referred to as observation time) elapses, the
テスト制御部401は、オリジナルファイル記憶部403に記憶されているオリジナルファイル101に基づいて入力ファイル201を生成する(S701)。生成された入力ファイル201は入力ファイル記憶部405に記憶される。そして、テスト制御部401は、テスト対象プログラム407を起動する(S703)。
The
テスト対象プログラム407は、動作中に入力ファイル201をオープンする(S705)。そして、テスト対象プログラム407は、入力ファイル201のデータを読み込む動作を繰り返す(S707及びS709)。この例では、S709において変更箇所が読み込まれたものとする。尚、テスト制御部401は、変更範囲の一部又は全部が読取範囲と重複する場合に入力ファイル201における変更箇所が読み込まれたものと判定する。
The
テスト制御部401は、変更箇所の読み込みを検出した後(S711)、観察時間内において例外処理が実行されるか否かを判定する。観察時間内において例外処理の実行を検出した場合には、上述した図4に示したシーケンスの場合と同様に処理される。
After detecting the reading of the changed portion (S711), the
テスト制御部401は、例外処理が実行されないまま観察時間が経過したと判定すると(S713)、テスト対象プログラム407を強制終了させる(S715)。そして、テスト制御部401は、テスト結果をテスト結果記憶部409に書き込む(S717)。この例におけるテスト結果は、変更箇所の読み込みによる正常判定であることを示す。そして、テスト制御部401は、入力ファイル201を削除して(S719)、次のテストに移る。以上で本実施の形態における概要の説明を終える。
When the
以下、プログラムテスト装置800の動作について説明する。図8に、プログラムテスト装置800のモジュール構成例を示す。プログラムテスト装置800は、上述したテスト制御部401、オリジナルファイル記憶部403、入力ファイル記憶部405、テスト対象プログラム407及びテスト結果記憶部409の他に、OS(オペレーティングシステム)801、監視部805、監視結果記憶部807及びテスト仕様記憶部809を有する。
The operation of the
テスト制御部401は、ファイルファジングによるプログラムテストを制御する。オリジナルファイル記憶部403は、オリジナルファイル101を記憶する。具体的には、オリジナルファイル記憶部403は、オリジナルファイル101のパスによって特定される。入力ファイル記憶部405は、入力ファイル201を記憶する。具体的には、入力ファイル記憶部405は、入力ファイル201のパスによって特定される。テスト結果記憶部409は、テスト結果テーブルを記憶する。テスト結果テーブルについては、図11を用いて後述する。
The
OS801は、ファイルシステム803を含んでいる。ファイルシステム803は、ファイル操作を実行する。監視部805は、ファイルシステム803におけるファイル操作を監視する。監視結果記憶部807は、監視結果テーブルを記憶する。監視結果テーブルは、監視部805による監視結果として、ファイルシステム803におけるファイル操作の内容を記録する。監視結果テーブルについては、図9を用いて後述する。テスト仕様記憶部809は、テスト仕様データを記憶する。テスト仕様データについては、図10を用いて後述する。
OS801 includes a
また、テスト制御部401は、生成部821、起動部823、第1検出部825、第2検出部827、第3検出部829、第4検出部831、停止部833、記録処理部835、削除部837及び判定部839を有する。
Further, the
生成部821は、オリジナルファイル101に基づいて入力ファイル201を生成する。起動部823は、テスト対象プログラム407を起動する。第1検出部825は、テスト対象プログラム407における例外処理の実行を検出する。第2検出部827は、入力ファイル201のクローズを検出する。第3検出部829は、タイムアウトを検出する。第4検出部831は、入力ファイル201における変更箇所の読み込みを検出する。停止部833は、テスト対象プログラム407の動作を停止させる。具体的には、停止部833は、テスト対象プログラム407のプロセスを強制終了させる。記録処理部835は、テスト結果を記録する。削除部837は、入力ファイル201を削除する。判定部839は、入力ファイル201における変更箇所が読み込まれた時点から観察時間が過ぎたか否かを判定する。
The
上述したテスト制御部401、監視部805、生成部821、起動部823、第1検出部825、第2検出部827、第3検出部829、第4検出部831、停止部833、記録処理部835、削除部837及び判定部839は、ハードウエア資源(例えば、図15)と、以下で述べる処理をプロセッサに実行させるプログラムとを用いて実現される。
上述したオリジナルファイル記憶部403、入力ファイル記憶部405、テスト結果記憶部409、監視結果記憶部807及びテスト仕様記憶部809は、ハードウエア資源(例えば、図15)を用いて実現される。
The original
図9に、監視結果テーブルの例を示す。この例における監視結果テーブルは、ファイル操作に対応するレコードを有している。監視結果テーブルのレコードは、プロセス名が格納されるフィールドと、ファイルパスが格納されるフィールドと、操作種別が格納されるフィールドと、先頭オフセットが格納されるフィールドと、サイズ(バイト)が格納されるフィールドとを有している。 FIG. 9 shows an example of the monitoring result table. The monitoring result table in this example has records corresponding to file operations. The record of the monitoring result table stores the field where the process name is stored, the field where the file path is stored, the field where the operation type is stored, the field where the start offset is stored, and the size (bytes). Has a field.
プロセス名は、OS801のファイルシステム803に対してファイル操作を要求したプロセスを特定する。ファイルパスは、ファイルシステム803における操作対象であるファイルが格納されている場所及び当該ファイル名を特定する。操作種別は、ファイル操作の種別を特定する。アクセス範囲は、ファイルリードにおいて読み込まれたデータの範囲及びファイルライトにおいて書き込まれたデータの範囲を特定する。具体的には、アクセス範囲は、先頭オフセット及びサイズによって特定される。
The process name identifies the process that requested the file operation from the
図10に、テスト仕様データの例を示す。この例におけるテスト仕様データは、テスト仕様に関する項目を含んでいる。具体的には、テスト対象プログラム407のパスが格納されるフィールドと、入力ファイル201のパスが格納されるフィールドと、テスト時間の上限(ms)が格納されるフィールドと、観察時間(ms)が格納されるフィールドと、オリジナルファイル101のパスが格納されるフィールドと、変更サイズ(バイト)が格納されるフィールドと、置換コードが格納されるフィールドと、シフトサイズ(バイト)が格納されるフィールドとを有している。
FIG. 10 shows an example of test specification data. The test specification data in this example includes items related to the test specification. Specifically, the field where the path of the
テスト対象プログラム407のパスは、テスト対象プログラム407が格納されている場所及びテスト対象プログラム407の名前を特定する。入力ファイル201のパスは、入力ファイル201が格納される場所及び入力ファイル201の名前を特定する。テスト時間の上限は、タイムアウトの基準である。観察時間は、変更箇所の読み込みを検出した後に例外処理が実行されるか否かを判定する期間の長さである。オリジナルファイル101のパスは、オリジナルファイル101が格納されている場所及びオリジナルファイル101の名前を特定する。変更サイズは、変更範囲のデータ長である。置換コードは、変更範囲に設定されるコードである。つまり、変更箇所の内容である。シフトサイズは、入力ファイル201を生成する度に変更範囲をシフトする幅である。
The path of the
図11に、テスト結果テーブルの例を示す。この例におけるテスト結果テーブルは、各回のテストに対応するレコードを有している。テスト結果テーブルのレコードは、回番号が格納されるフィールドと、先頭オフセットが格納されるフィールドと、サイズ(バイト)が格納されるフィールドと、テスト結果が格納されるフィールドと、現象が格納されるフィールドと、実行オフセットが格納されるフィールドとを有している。 FIG. 11 shows an example of a test result table. The test result table in this example has a record corresponding to each test. The record of the test result table stores the field where the time number is stored, the field where the start offset is stored, the field where the size (bytes) is stored, the field where the test result is stored, and the phenomenon. It has a field and a field in which the execution offset is stored.
回番号は、テストの回を特定する。変更範囲は、当該回の入力ファイル201における変更箇所を特定する。この例における変更範囲は、先頭オフセット及びサイズによって特定される。テスト結果には、例外処理の実行の検出に基づく異常判定である旨のコード、クローズの検出に基づく正常判定である旨のコード、タイムアウトの検出に基づく正常判定である旨のコード又は変更箇所の読み込みに基づく正常判定である旨のコードのいずれかである。テスト結果が例外処理の実行の検出に基づく異常判定である旨のコードである場合には、詳細に係るデータとして、現象のフィールドに例外処理の内容が格納され、実行オフセットのフィールドには実行された例外処理の命令コードのオフセットが格納される。尚、詳細に係るデータは省略するようにしてもよい。 The times number identifies the test times. The change range specifies the changed part in the input file 201 of the time. The range of change in this example is specified by the head offset and size. The test results include a code indicating that the judgment is abnormal based on the detection of exception handling execution, a code indicating that the judgment is normal based on the detection of closing, and a code indicating that the judgment is normal based on the detection of timeout, or changes. It is one of the codes indicating that it is a normal judgment based on reading. If the test result is a code indicating that the error judgment is based on the detection of execution of exception handling, the content of exception handling is stored in the phenomenon field and executed in the execution offset field as detailed data. The offset of the instruction code for exception handling is stored. The detailed data may be omitted.
続いて、テスト制御部401におけるメイン処理について説明する。図12に、メイン処理フローを示す。生成部821は、入力ファイル生成処理を実行する(S1201)。
Subsequently, the main processing in the
図13に、入力ファイル生成処理フローを示す。生成部821は、変更範囲の先頭オフセットを特定する(S1301)。1回目の入力ファイル生成処理における変更範囲の先頭オフセットは、0x00000000である。生成部821は、入力ファイル生成処理の度、前回の先頭オフセットに1を加算して、当回の先頭オフセットを特定する。
FIG. 13 shows an input file generation processing flow. The
生成部821は、オリジナルファイル記憶部403に記憶されているオリジナルファイル101のコピーを入力ファイル記憶部405に作成する(S1303)。生成部821は、コピーファイルにおける変更範囲のコードを置換コードに変換する(S1305)。生成部821は、テスト結果テーブルに新たなレコードを設け、変更範囲を設定する(S1307)。そして、生成部821が入力ファイル生成処理を終えると、呼び出し元のメイン処理に復帰する。
The
図12の説明に戻る。起動部823は、テスト対象プログラム407を起動する(S1203)。起動部823は、引数で入力ファイル201のパスをテスト対象プログラム407に渡すようにしてもよい。
Returning to the description of FIG. The
第1検出部825は、例外処理の実行を検出したか否かによって処理を分岐させる(S1205)。具体的には、テスト対象プログラム407が例外処理を実行すると、第1検出部825はOS801からテスト対象プログラム407が例外処理を実行した旨の通知を受ける。第1検出部825は、当該通知を受けた場合に例外処理の実行を検出したと判定する。
The
例外処理の実行を検出したと判定した場合には、停止部833は、テスト対象プログラム407を終了させる(S1207)。そして、記録処理部835は、テスト結果を書き込む(S1209)。具体的には、当該回のレコードのテスト結果のフィールドに、例外処理の実行の検出に基づく異常判定である旨のコードが格納される。更に、現象のフィールドに例外処理の内容が格納され、実行オフセットのフィールドには実行された例外処理の命令コードのオフセットが格納される。例外処理の内容及び例外処理の命令コードのオフセットは、上記通知から得られる。
When it is determined that the execution of the exception handling is detected, the
その後、削除部837は、入力ファイル201を削除し(S1211)、端子Aを介して図14に示したS1419の処理に移る。
After that, the
一方、S1205において例外処理の実行を検出していないと判定した場合には、第2検出部827は、入力ファイル201のクローズを検出したか否かによって処理を分岐させる(S1213)。具体的には、第2検出部827は、監視結果記憶部807に書き込まれた監視結果、つまりファイルシステム803におけるファイル操作の記録に基づいて、入力ファイル201がクローズされたか否かを判定する。
On the other hand, when it is determined in S1205 that the execution of the exception processing is not detected, the
入力ファイル201のクローズを検出したと判定した場合には、停止部833は、テスト対象プログラム407を終了させる(S1215)。そして、記録処理部835は、テスト結果を書き込む(S1217)。具体的には、当該回のレコードのテスト結果のフィールドに、入力ファイル201のクローズの検出に基づく正常判定である旨のコードが格納される。詳細に関するフィールドには、何も格納されない。
When it is determined that the closing of the input file 201 has been detected, the
その後、削除部837は、入力ファイル201を削除し(S1219)、端子Aを介して図14に示したS1419の処理に移る。
After that, the
一方、S1213において入力ファイル201のクローズを検出していないと判定した場合には、端子Bを介して図14に示したS1401の処理に移る。 On the other hand, when it is determined in S1213 that the closing of the input file 201 has not been detected, the process proceeds to the process of S1401 shown in FIG. 14 via the terminal B.
図14の説明に移る。第3検出部829は、タイムアウトを検出したか否かによって処理を分岐させる(S1401)。具体的には、第3検出部829は、S1203でテスト対象プログラム407を起動した時点からの経過時間、つまりテスト時間が上限を超えた場合にタイムアウトを検出したと判定する。
The explanation will move to FIG. The
タイムアウトを検出したと判定した場合には、停止部833は、テスト対象プログラム407を終了させる(S1403)。そして、記録処理部835は、テスト結果を書き込む(S1405)。具体的には、当該回のレコードのテスト結果のフィールドに、タイムアウトの検出に基づく正常判定である旨のコードが格納される。詳細に関するフィールドには、何も格納されない。
When it is determined that the time-out has been detected, the
その後、削除部837は、入力ファイル201を削除し(S1407)、S1419の処理に移る。
After that, the
一方、S1401においてタイムアウトを検出していないと判定した場合には、第4検出部831は、変更箇所の読み込みを検出したか否かによって処理を分岐させる(S1409)。具体的には、第4検出部831は、監視結果テーブルにリードに係るレコードが追加され、当該レコードにおけるアクセス範囲が入力ファイル201における変更範囲の一部又は全部と重複する場合に、変更箇所の読み込みを検出したと判定する。
On the other hand, when it is determined that the timeout has not been detected in S1401, the
変更箇所の読み込みを検出していないと判定した場合には、端子Dを介して図12のS1205に示した処理に戻って、上述した処理を繰り返す。 If it is determined that the reading of the changed portion has not been detected, the process returns to the process shown in S1205 of FIG. 12 via the terminal D, and the above-mentioned process is repeated.
一方、変更箇所の読み込みを検出したと判定した場合には、判定部839は、変更箇所が読み込まれた時点から観察時間が過ぎたか否かを判定する(S1411)。
On the other hand, if it is determined that the read of the changed portion has been detected, the
変更箇所が読み込まれた時点から観察時間が過ぎていないと判定した場合には、端子Dを介して図12のS1205に示した処理に戻って、上述した処理を繰り返す。 If it is determined that the observation time has not passed since the changed portion was read, the process returns to the process shown in S1205 of FIG. 12 via the terminal D, and the above-mentioned process is repeated.
但し、S1411において変更箇所が読み込まれた時点から観察時間が過ぎていないと判定された場合には、繰り返されるS1409において、第4検出部831は、変更箇所の読み込みを検出したと判定する。そして、繰り返されるS1411において、判定部839は、再び変更箇所が読み込まれた時点から観察時間が過ぎたか否かを判定する(S1411)。観察時間が過ぎるまで、このような処理が繰り返される。この間の繰り返しにおけるS1205の処理で、例外処理の実行を検出したと判定すれば、上述したS1207乃至S1211の処理が実行される。
However, if it is determined in S1411 that the observation time has not passed since the changed portion was read, in the repeated S1409, the
繰り返されるS1411において、変更箇所が読み込まれた時点から観察時間が過ぎたと判定された場合に、停止部833は、テスト対象プログラム407を終了させる(S1413)。そして、記録処理部835は、テスト結果を書き込む(S1415)。具体的には、当該回のレコードのテスト結果のフィールドに、変更箇所の読み込みに基づく正常判定である旨のコードが格納される。詳細に関するフィールドには、何も格納されない。
In the repeated S1411, when it is determined that the observation time has passed from the time when the changed portion is read, the
その後、削除部837は、入力ファイル201を削除し(S1417)、S1419の処理に移る。
After that, the
S1419において、生成部821は、メイン処理を終了するか否かを判定する。例えばオリジナルファイル101の最後尾のコードを変更する入力ファイル201によるテストを終えた時点でメイン処理を終える。
In S1419, the
メイン処理を終了しないと判定した場合には、端子Cを介して図12のS1201に示した処理に戻って、上述した処理を繰り返す。以上で、メイン処理の説明を終える。 When it is determined that the main process is not completed, the process returns to the process shown in S1201 of FIG. 12 via the terminal C, and the above-described process is repeated. This is the end of the explanation of the main process.
本実施の形態によれば、入力ファイルにおける変更範囲に応じたタイミングでプログラムテストを終わらせることができる。従って、正しい検証を効率良く行えるようになる。 According to this embodiment, the program test can be completed at the timing according to the change range in the input file. Therefore, correct verification can be performed efficiently.
以上本発明の一実施の形態を説明したが、本発明はこれに限定されるものではない。例えば、上述の機能ブロック構成はプログラムモジュール構成に一致しない場合もある。 Although one embodiment of the present invention has been described above, the present invention is not limited thereto. For example, the functional block configuration described above may not match the program module configuration.
また、上で説明した各記憶領域の構成は一例であって、上記のような構成でなければならないわけではない。さらに、処理フローにおいても、処理結果が変わらなければ、処理の順番を入れ替えることや複数の処理を並列に実行させるようにしても良い。 Further, the configuration of each storage area described above is an example, and does not have to be the configuration as described above. Further, also in the processing flow, if the processing result does not change, the order of the processing may be changed or a plurality of processing may be executed in parallel.
なお、上で述べたプログラムテスト装置800は、コンピュータ装置であって、図15に示すように、メモリ2501とCPU(Central Processing Unit)2503とハードディスク・ドライブ(HDD:Hard Disk Drive)2505と表示装置2509に接続される表示制御部2507とリムーバブル・ディスク2511用のドライブ装置2513と入力装置2515とネットワークに接続するための通信制御部2517とがバス2519で接続されている。オペレーティングシステム(OS:Operating System)及び本実施例における処理を実施するためのアプリケーション・プログラムは、HDD2505に格納されており、CPU2503により実行される際にはHDD2505からメモリ2501に読み出される。CPU2503は、アプリケーション・プログラムの処理内容に応じて表示制御部2507、通信制御部2517、ドライブ装置2513を制御して、所定の動作を行わせる。また、処理途中のデータについては、主としてメモリ2501に格納されるが、HDD2505に格納されるようにしてもよい。本発明の実施例では、上で述べた処理を実施するためのアプリケーション・プログラムはコンピュータ読み取り可能なリムーバブル・ディスク2511に格納されて頒布され、ドライブ装置2513からHDD2505にインストールされる。インターネットなどのネットワーク及び通信制御部2517を経由して、HDD2505にインストールされる場合もある。このようなコンピュータ装置は、上で述べたCPU2503、メモリ2501などのハードウエアとOS及びアプリケーション・プログラムなどのプログラムとが有機的に協働することにより、上で述べたような各種機能を実現する。
The
以上述べた本発明の実施の形態をまとめると、以下のようになる。 The embodiments of the present invention described above can be summarized as follows.
本実施の形態に係るプログラムテスト装置は、(A)ファイルファジングによるプログラムテストに供される入力ファイルの変更箇所がテスト対象プログラムによって読み込まれたことを検出する検出部と、(B)変更箇所がテスト対象プログラムによって読み込まれたことを検出した時点に基づいて決定したタイミングで、テスト対象プログラムの動作を終了させる停止部とを有する。 The program test apparatus according to the present embodiment has (A) a detection unit that detects that a changed part of an input file used for a program test by file fuzzing has been read by a program to be tested, and (B) a changed part. It has a stop unit that terminates the operation of the test target program at a timing determined based on the time when it is detected that the test target program has read it.
このようにすれば、入力ファイルにおける変更範囲に応じたタイミングでプログラムテストを終わらせることができる。尚、(A)検出部は、例えば第4検出部831である。
In this way, the program test can be completed at the timing according to the change range in the input file. The detection unit (A) is, for example, the
なお、上で述べたプログラムテスト装置における処理をコンピュータに行わせるためのプログラムを作成することができ、当該プログラムは、例えばフレキシブルディスク、CD−ROM、光磁気ディスク、半導体メモリ、ハードディスク等のコンピュータ読み取り可能な記憶媒体又は記憶装置に格納されるようにしてもよい。尚、中間的な処理結果は、一般的にメインメモリ等の記憶装置に一時保管される。 It should be noted that a program for causing the computer to perform the processing in the program test apparatus described above can be created, and the program can be read by a computer such as a flexible disk, a CD-ROM, a magneto-optical disk, a semiconductor memory, or a hard disk. It may be stored in a possible storage medium or storage device. The intermediate processing result is generally temporarily stored in a storage device such as a main memory.
以上の実施例を含む実施形態に関し、さらに以下の付記を開示する。 The following additional notes will be further disclosed with respect to the embodiments including the above embodiments.
(付記1)
ファイルファジングによるプログラムテストに供される入力ファイルの変更箇所がテスト対象プログラムによって読み込まれたことを検出する検出部と、
前記変更箇所が前記テスト対象プログラムによって読み込まれたことを検出した時点に基づいて決定したタイミングで、前記テスト対象プログラムの動作を終了させる停止部と
を有するプログラムテスト装置。
(Appendix 1)
A detector that detects that the changed part of the input file used for the program test by file fuzzing has been read by the program under test, and
A program test device having a stop unit that terminates the operation of the test target program at a timing determined based on the time when it is detected that the changed portion has been read by the test target program.
(付記2)
ファイルファジングによるプログラムテストに供される入力ファイルの変更箇所がテスト対象プログラムによって読み込まれたことを検出し、
前記変更箇所が前記テスト対象プログラムによって読み込まれたことを検出した時点に基づいて決定したタイミングで、前記テスト対象プログラムの動作を終了させる
処理を含み、コンピュータにより実行されるテスト制御方法。
(Appendix 2)
Detects that changes in the input file used for program testing by file fuzzing have been read by the program under test,
A test control method executed by a computer including a process of terminating the operation of the test target program at a timing determined based on the time when it is detected that the changed part has been read by the test target program.
(付記3)
ファイルファジングによるプログラムテストに供される入力ファイルの変更箇所がテスト対象プログラムによって読み込まれたことを検出し、
前記変更箇所が前記テスト対象プログラムによって読み込まれたことを検出した時点に基づいて決定したタイミングで、前記テスト対象プログラムの動作を終了させる
処理をコンピュータに実行させるテスト制御プログラム。
(Appendix 3)
Detects that changes in the input file used for program testing by file fuzzing have been read by the program under test,
A test control program that causes a computer to execute a process of terminating the operation of the test target program at a timing determined based on the time when it is detected that the changed part has been read by the test target program.
101 オリジナルファイル 201 入力ファイル
401 テスト制御部 403 オリジナルファイル記憶部
405 入力ファイル記憶部 407 テスト対象プログラム
409 テスト結果記憶部 800 プログラムテスト装置
801 OS 803 ファイルシステム
805 監視部 807 監視結果記憶部
809 テスト仕様記憶部 821 生成部
823 起動部 825 第1検出部
827 第2検出部 829 第3検出部
831 第4検出部 833 停止部
835 記録処理部 837 削除部
839 判定部
101 Original file 201
Claims (3)
前記変更箇所が前記テスト対象プログラムによって読み込まれたことを検出した後、所定時間内に例外処理の発生が検出されない場合に、前記テスト対象プログラムの動作を終了させる停止部と
を有するプログラムテスト装置。 A data storage unit that specifies the access range of the test target program in a specific input file during the execution of the program test by file fuzzing of the test target program, and the access range stores the changed part of the specific input file. It is determined whether or not it overlaps with a part or all of the changed part stored in, and when the access range overlaps with a part or all of the changed part, the changed part is read by the test target program. A detector that detects that, and
A program test device having a stop unit that terminates the operation of the test target program when the occurrence of exception handling is not detected within a predetermined time after detecting that the changed part has been read by the test target program.
前記変更箇所が前記テスト対象プログラムによって読み込まれたことを検出した後、所定時間内に例外処理の発生が検出されない場合に、前記テスト対象プログラムの動作を終了させる
処理を含み、コンピュータにより実行されるテスト制御方法。 A data storage unit that specifies the access range of the test target program in a specific input file during the execution of the program test by file fuzzing of the test target program, and the access range stores the changed part of the specific input file. It is determined whether or not it overlaps with a part or all of the changed part stored in, and when the access range overlaps with a part or all of the changed part, the changed part is read by the test target program. Detect that
After detecting that the changed part has been read by the test target program , if the occurrence of exception processing is not detected within a predetermined time, the operation of the test target program is terminated, which is executed by the computer. Test control method.
前記変更箇所が前記テスト対象プログラムによって読み込まれたことを検出した後、所定時間内に例外処理の発生が検出されない場合に、前記テスト対象プログラムの動作を終了させる
処理をコンピュータに実行させるテスト制御プログラム。 A data storage unit that specifies the access range of the test target program in a specific input file during the execution of the program test by file fuzzing of the test target program, and the access range stores the changed part of the specific input file. It is determined whether or not it overlaps with a part or all of the changed part stored in, and when the access range overlaps with a part or all of the changed part, the changed part is read by the test target program. Detect that
A test control program that causes a computer to execute a process of terminating the operation of the test target program when the occurrence of exception processing is not detected within a predetermined time after detecting that the changed part has been read by the test target program. ..
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2017070574A JP6880933B2 (en) | 2017-03-31 | 2017-03-31 | Program test equipment, test control method and test control program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2017070574A JP6880933B2 (en) | 2017-03-31 | 2017-03-31 | Program test equipment, test control method and test control program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2018173748A JP2018173748A (en) | 2018-11-08 |
| JP6880933B2 true JP6880933B2 (en) | 2021-06-02 |
Family
ID=64107431
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2017070574A Expired - Fee Related JP6880933B2 (en) | 2017-03-31 | 2017-03-31 | Program test equipment, test control method and test control program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP6880933B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2025224853A1 (en) * | 2024-04-24 | 2025-10-30 | 三菱電機株式会社 | Fuzzing test device, fuzzing test method, and fuzzing test program |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR100916329B1 (en) * | 2007-11-01 | 2009-09-11 | 한국전자통신연구원 | Software Vulnerability Checking Device and Method |
-
2017
- 2017-03-31 JP JP2017070574A patent/JP6880933B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2018173748A (en) | 2018-11-08 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP2460113B1 (en) | Automated unpacking of portable executable files | |
| CN105518622B (en) | Method and apparatus for verifying guest code converted in dynamic binary converter | |
| US20150370695A1 (en) | Testing optimized binary modules | |
| US20210141907A1 (en) | Method and device for patching vulnerability of binary | |
| US9298593B2 (en) | Testing a software interface for a streaming hardware device | |
| US20040194063A1 (en) | System and method for automated testing of a software module | |
| US8245085B2 (en) | Dump output control apparatus and dump output control method | |
| CN104252402A (en) | Program debugging method and device | |
| JP7195796B2 (en) | Information processing device, control method for information processing device, and program | |
| CN116724291A (en) | Load block instructions and store block instructions | |
| US8762773B2 (en) | Processing apparatus, data migration method, and computer-readable recording medium having data migration program recorded thereon | |
| JP6880933B2 (en) | Program test equipment, test control method and test control program | |
| US20050283770A1 (en) | Detecting memory address bounds violations | |
| CN108027736B (en) | Runtime code parallelization using out-of-order renaming by pre-allocation of physical registers | |
| CN108628726A (en) | Method and device for recording CPU state information | |
| US11113392B2 (en) | Executable binary code insertion | |
| JP6834838B2 (en) | Computer boot method and computer | |
| JP2018085040A (en) | Program test device, program test program and program test method | |
| US20220197544A1 (en) | Apparatus and method for selecting storage location based on data usage | |
| CN119292850B (en) | Processor verification system and method | |
| KR102385706B1 (en) | Apparatus and method for suitability test of virtual network function | |
| US9229725B2 (en) | Safe conditional-load and conditional-store operations | |
| Kicinski et al. | Xdp hardware offload: Current work, debugging and edge cases | |
| US20210011951A1 (en) | Data processing | |
| CN116450211A (en) | Method for judging compatibility of virtual machine application to Linux Arm64 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20200115 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20201223 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20210119 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20210226 |
|
| 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: 20210406 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20210419 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 6880933 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| LAPS | Cancellation because of no payment of annual fees |