JP2018085040A - Program test device, program test program and program test method - Google Patents

Program test device, program test program and program test method Download PDF

Info

Publication number
JP2018085040A
JP2018085040A JP2016229026A JP2016229026A JP2018085040A JP 2018085040 A JP2018085040 A JP 2018085040A JP 2016229026 A JP2016229026 A JP 2016229026A JP 2016229026 A JP2016229026 A JP 2016229026A JP 2018085040 A JP2018085040 A JP 2018085040A
Authority
JP
Japan
Prior art keywords
program
file
test
read
files
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2016229026A
Other languages
Japanese (ja)
Inventor
尚 兒島
Takashi Kojima
尚 兒島
中田 正弘
Masahiro Nakada
正弘 中田
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2016229026A priority Critical patent/JP2018085040A/en
Publication of JP2018085040A publication Critical patent/JP2018085040A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/51Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems at application loading time, e.g. accepting, rejecting, starting or inhibiting executable software based on integrity or source reliability

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a program test device, program test program and program test method that improves the efficiency in a test using as testing data a file to be read implicitly by a program.SOLUTION: A program test device comprises a learning object monitoring part 102 that monitors a plurality of files to be read with a test object of program and a file priority determining part 105 that gives priority to the plurality of files in accordance with the reading order and size into a program. A file fuzzing execution part 111 gives files to a file fuzzing processing part 120 in the higher order of priority and controls the execution of file fuzzing.SELECTED DRAWING: Figure 1

Description

本発明は、プログラムテスト装置、プログラムテストプログラムおよびプログラムテスト方法に関する。   The present invention relates to a program test apparatus, a program test program, and a program test method.

プログラムの脆弱性等の不具合を発見するテスト手法として、予測不可能な入力データをプログラムに与えることで意図的に例外を発生させ、例外の挙動を確認する、ファジングが知られている(特許文献1、非特許文献1等を参照)。ファジングは、脆弱性検出に有効なテストデータ(例えば、長い文字列や大きな整数等)を大量に試すブラックボックスセキュリティテスト手法として用いられることが多い。長い文字列は、文字列コピーの際に内部バッファを超えてバッファオーバーフローの例外を引き起こしやすい。大きな整数(例えば、32ビット符合なし整数の最大値「0xFFFFFFFF」等)は、演算処理において整数の最大値を超えて整数オーバーフローの例外を引き起こしやすい。   Fuzzing is known as a test method for detecting problems such as program vulnerabilities, by giving unpredictable input data to a program to intentionally generate an exception and checking the behavior of the exception (Patent Literature) 1, see Non-patent Document 1). Fuzzing is often used as a black box security test method that tries a large amount of test data (for example, a long character string or a large integer) effective for vulnerability detection. Long strings are prone to buffer overflow exceptions when copying strings beyond the internal buffer. A large integer (for example, the maximum value “0xFFFFFFFF” of a 32-bit unsigned integer) is likely to cause an exception of an integer overflow exceeding the maximum value of the integer in the arithmetic processing.

ファイルを読み込むプログラムにテストファイルを渡してパーサ等をテストするファイルファジングは、ファイルを読み込むプログラムであれば適用できるため、ソフトウェアのセキュリティ評価によく利用されている。テストファイルとしては、正常なファイルを部分的に変異させた異常ファイルが用いられる場合がある。   File fuzzing, in which a test file is passed to a program that reads a file and a parser is tested, can be applied to any program that reads a file. Therefore, it is often used for security evaluation of software. As the test file, an abnormal file obtained by partially mutating a normal file may be used.

特開2014−26579号公報JP 2014-26579 A

「ファジング」、ウィキペディア(Wikipedia)、https://ja.wikipedia.org/wiki/%E3%83%95%E3%82%A1%E3%82%B8%E3%83%B3%E3%82%B0、最終更新:2016年4月2日"Fuzzing", Wikipedia, https://en.wikipedia.org/wiki/%E3%83%95%E3%82%A1%E3%82%B8%E3%83%B3%E3%82% B0, last updated: April 2, 2016

従来、ファイルファジングによるテストでは、テストデータとしてテスト対象のプログラムに明示的に読み込まれるファイルが用いられ、暗黙的に読み込まれるファイルは用いられなかった。明示的に読み込まれるファイルとは、ユーザ等により指定される、オープンの対象となるファイルである。暗黙的に読み込まれるファイルとは、プログラムが起動後に自主的に読み込む設定ファイルやデータファイル等である。   Conventionally, in a test by file fuzzing, a file that is explicitly read into a test target program is used as test data, and a file that is implicitly read is not used. An explicitly read file is a file to be opened that is designated by a user or the like. An implicitly read file is a setting file or a data file that is read independently after the program is started.

暗黙的に読み込まれるファイルが用いられなかったのは、暗黙的に読み込まれるファイルは多数存在する可能性があり、全てのファイルをテスト対象のプログラムに読み込ませると膨大な時間がかかるため、現実的ではないからである。例えば、1個のファイルを用いたテストには一般的な計算機環境で1〜2日かかることが多く、もし対象ファイルが30個あった場合は1〜2カ月かかることになり、現実的ではない。   The reason why implicitly read files were not used is that there may be many files that are read implicitly, and it takes a long time to load all the files into the program under test. It is not. For example, a test using one file often takes 1 to 2 days in a general computer environment, and if there are 30 target files, it takes 1 to 2 months, which is not realistic. .

そこで、一側面では、プログラムにより暗黙的に読み込まれるファイルを用いたテストにおける効率の向上を目的とする。   Therefore, in one aspect, an object is to improve the efficiency in a test using a file that is implicitly read by a program.

一つの形態では、テスト対象のプログラムで読み込まれる複数のファイルを監視する監視部と、前記プログラムに読み込まれる順およびサイズに従って、前記複数のファイルに優先度を付与する付与部と、を備える。   In one form, a monitoring unit that monitors a plurality of files read by a test target program, and a grant unit that gives priority to the plurality of files according to the order and size read by the program are provided.

プログラムにより暗黙的に読み込まれるファイルをテスト用データとしたテストにおける効率を向上することができる。   It is possible to improve the efficiency in the test using the file read implicitly by the program as test data.

一実施形態にかかるプログラムテストの流れを示す図である。It is a figure which shows the flow of the program test concerning one Embodiment. 一実施形態にかかるプログラムテスト装置の機能構成例を示す図である。It is a figure which shows the function structural example of the program test apparatus concerning one Embodiment. テスト設定情報の例を示す図である。It is a figure which shows the example of test setting information. プログラムテスト装置のハードウェア構成例を示す図である。It is a figure which shows the hardware structural example of a program test apparatus. 実施形態の処理例を示すフローチャートである。It is a flowchart which shows the process example of embodiment. Process Monitorの監視結果の例を示す図である。It is a figure which shows the example of the monitoring result of Process Monitor. 時系列ファイルリストの例を示す図である。It is a figure which shows the example of a time series file list. 優先順ファイルリストの例を示す図である。It is a figure which shows the example of a priority order file list. ファイルファジングの例を示す図である。It is a figure which shows the example of file fuzzing. テスト結果リストの例を示す図である。It is a figure which shows the example of a test result list | wrist.

以下、本発明の好適な実施形態につき説明する。   Hereinafter, preferred embodiments of the present invention will be described.

<構成>
図1は一実施形態にかかるプログラムテストの流れを示す図である。図1において、プログラムテスト装置1は、学習フェーズのための構成と、実行フェーズのための構成とを備えている。学習フェーズとは、テストの対象となるプログラムが暗黙的に読み込むファイルを優先度付けするフェーズである。実行フェーズとは、学習フェーズにより優先度付けされた所定数のファイルについて、優先度の高い順にファイルファジングを実行するフェーズである。優先度が高い所定数のファイルにファイルファジングの対象を限るとともに、全体のテスト時間に制限を設けることで、テストの質を落とすことなく、現実的な時間内に、効率的にテストを実行することが可能になる。
<Configuration>
FIG. 1 is a diagram showing a flow of a program test according to an embodiment. In FIG. 1, the program test apparatus 1 includes a configuration for a learning phase and a configuration for an execution phase. The learning phase is a phase in which a file to be read implicitly by a program to be tested is prioritized. The execution phase is a phase in which file fuzzing is executed in descending order of priority for a predetermined number of files prioritized in the learning phase. By limiting file fuzzing targets to a predetermined number of high-priority files and setting a limit on the overall test time, tests can be executed efficiently in real time without degrading the quality of the test. It becomes possible.

図1において、プログラムテスト装置1は、学習フェーズの主要な構成として、対象プログラムPの他に、学習対象監視部102とファイル優先度判定部105とを備えている。学習対象監視部102は、対象プログラムPが起動された後に読み込むファイルを監視し、時系列ファイルリストに、そのファイルのパスと、タイミング(起動から読み込みまでの時間)と、ファイルのサイズとを記録する機能を有している。ファイル優先度判定部105は、時系列ファイルリストの複数のファイルについて、タイミングとサイズに着目して、「攻撃されやすさ」の観点から優先度を付与し、優先順ファイルリストに記録する機能を有している。   In FIG. 1, the program test apparatus 1 includes a learning target monitoring unit 102 and a file priority determination unit 105 in addition to the target program P as a main configuration of the learning phase. The learning target monitoring unit 102 monitors a file to be read after the target program P is activated, and records the path, timing (time from activation to reading), and file size in the time-series file list. It has a function to do. The file priority determination unit 105 has a function of assigning a priority from the viewpoint of “ease of attack” and recording it in a priority order file list for a plurality of files in the time-series file list, focusing on timing and size. Have.

また、プログラムテスト装置1は、実行フェーズの主要な構成として、ファイルファジング実行部111とファイルファジング処理部120とを備えている。ファイルファジング実行部111は、学習フェーズで得られた優先順ファイルリストを参照し、優先度の高い順にファイル(ファイル#xとして図示)をファイルファジング処理部120に与えてファイルファジングの実行を制御する機能を有している。ファイルファジング処理部120は、正常なファイルに基づいてテストファイルを生成し、ファイルファジングを実行してテスト結果を出力する機能を有している。ファイルファジング実行部111は、1つのファイルについてファイルファジングが完了した場合、次のファイルの処理に移行する。また、ファイルファジング実行部111は、制限時間に達したり、所定のファイル数について処理が完了した場合、テスト結果一覧を出力して処理を終了する。   In addition, the program test apparatus 1 includes a file fuzzing execution unit 111 and a file fuzzing processing unit 120 as main components of the execution phase. The file fuzzing execution unit 111 refers to the priority order file list obtained in the learning phase, and gives the files (shown as file #x) in descending order of priority to the file fuzzing processing unit 120 to control the execution of file fuzzing. It has a function. The file fuzzing processing unit 120 has a function of generating a test file based on a normal file, executing file fuzzing, and outputting a test result. When the file fuzzing is completed for one file, the file fuzzing execution unit 111 proceeds to processing of the next file. Further, when the time limit is reached or the processing is completed for a predetermined number of files, the file fuzzing execution unit 111 outputs a test result list and ends the processing.

図2はプログラムテスト装置1をより具体的に示した実施形態の機能構成例を示すものである。   FIG. 2 shows an example of the functional configuration of the embodiment showing the program test apparatus 1 more specifically.

図2において、プログラムテスト装置1は、テスト開始前に操作者により設定されるテスト設定情報STを記憶し、このテスト設定情報STは後述する各部で参照される。図3はテスト設定情報STの例を示す図であり、テスト対象プログラム起動コマンドと学習フェーズ監視時間と実行フェーズ最大監視時間と実行フェーズ制限時間とを含んでいる。テスト対象プログラム起動コマンドは、テスト対象の対象プログラムPを起動するためのコマンド文字列である。図示の例における末尾の「/c」は動作モード等を指定するパラメータである。学習フェーズ監視時間は、学習フェーズにおいて対象プログラムPを監視する時間(ミリ秒)である。実行フェーズ最大監視時間は、実行フェーズにおいて1回のファイルファジング処理において対象プログラムPを監視する最大時間(ミリ秒)である。実行フェーズ制限時間は、実行フェーズの処理全体にかけてもよい最大時間(ミリ秒)である。   In FIG. 2, the program test apparatus 1 stores test setting information ST set by the operator before the start of the test, and the test setting information ST is referred to by each unit described later. FIG. 3 is a diagram showing an example of the test setting information ST, which includes a test target program start command, a learning phase monitoring time, an execution phase maximum monitoring time, and an execution phase limit time. The test target program start command is a command character string for starting the test target program P. In the illustrated example, “/ c” at the end is a parameter for designating an operation mode or the like. The learning phase monitoring time is the time (milliseconds) for monitoring the target program P in the learning phase. The execution phase maximum monitoring time is the maximum time (milliseconds) for monitoring the target program P in one file fuzzing process in the execution phase. The execution phase limit time is the maximum time (milliseconds) that may be taken for the entire processing of the execution phase.

図2に戻り、プログラムテスト装置1は、学習フェーズの構成として、学習対象起動部101と学習対象監視部102と時系列ファイルリスト保存部103と学習対象終了部104とファイル優先度判定部105と優先順ファイルリスト保存部106とを備えている。   Returning to FIG. 2, the program test apparatus 1 includes a learning target activation unit 101, a learning target monitoring unit 102, a time-series file list storage unit 103, a learning target end unit 104, and a file priority determination unit 105 as a learning phase configuration. A priority order file list storage unit 106.

学習対象起動部101は、テスト設定情報STのテスト対象プログラム起動コマンドにしたがって対象プログラムPを起動する機能を有している。学習対象監視部102は、対象プログラムPのプロセスである対象プログラム実行体PPが発するファイル読み込みのイベントを監視し、読み込んだファイルの情報を時系列に時系列ファイルリスト保存部103に記録する機能を有している。   The learning target starting unit 101 has a function of starting the target program P in accordance with the test target program start command of the test setting information ST. The learning target monitoring unit 102 has a function of monitoring a file reading event generated by the target program execution body PP, which is a process of the target program P, and recording the read file information in the time-series file list storage unit 103 in time series. Have.

学習対象終了部104は、対象プログラムPの起動からテスト設定情報STの学習フェーズ監視時間が経過した場合に、対象プログラムPの実行を終了させる機能を有している。ファイル優先度判定部105は、時系列ファイルリスト保存部103に記録された複数の読込ファイルについて、タイミングとサイズに着目して、「攻撃されやすさ」の観点から優先度を付与し、優先順ファイルリスト保存部106に記録する機能を有している。   The learning target end unit 104 has a function of ending the execution of the target program P when the learning phase monitoring time of the test setting information ST has elapsed since the start of the target program P. The file priority determination unit 105 gives priority to a plurality of read files recorded in the time-series file list storage unit 103 from the viewpoint of “ease of attack”, focusing on timing and size. The file list storage unit 106 has a function of recording.

一方、プログラムテスト装置1は、実行フェーズの構成として、ファイルファジング実行部111とテストファイル生成部112とテスト対象起動部113とテスト対象監視部114とテスト対象終了部115とテスト結果リスト保存部116とを備えている。テストファイル生成部112とテスト対象起動部113とテスト対象監視部114とテスト対象終了部115とテスト結果リスト保存部116は、図1のファイルファジング処理部120に対応する。   On the other hand, the program test apparatus 1 includes a file fuzzing execution unit 111, a test file generation unit 112, a test target activation unit 113, a test target monitoring unit 114, a test target end unit 115, and a test result list storage unit 116 as the configuration of the execution phase. And. The test file generation unit 112, the test target activation unit 113, the test target monitoring unit 114, the test target end unit 115, and the test result list storage unit 116 correspond to the file fuzzing processing unit 120 in FIG.

図2において、ファイルファジング実行部111は、ファイル優先度判定部105の処理が終了して学習フェーズが終了した後に、ファイルファジングを開始して終了まで制御する機能を有している。すなわち、ファイルファジング実行部111は、優先順ファイルリスト保存部106の優先順ファイルリストを参照し、優先度の高いファイルから順にファイルファジングを実行させる。そして、途中のテスト結果Rをテスト結果リスト保存部116に記録し、最終的にテスト結果リストRLを出力する。テストファイル生成部112は、正常なファイルFに基づいてテストファイルTFを生成する機能を有している。例えば、ファイルFを部分的に変異させることでテストファイルTFを生成する。   In FIG. 2, the file fuzzing execution unit 111 has a function of starting file fuzzing and controlling it to the end after the processing of the file priority determination unit 105 ends and the learning phase ends. That is, the file fuzzing execution unit 111 refers to the priority order file list of the priority order file list storage unit 106 and executes file fuzzing in order from the file with the highest priority. Then, the test result R in the middle is recorded in the test result list storage unit 116, and finally the test result list RL is output. The test file generation unit 112 has a function of generating a test file TF based on a normal file F. For example, the test file TF is generated by partially mutating the file F.

テスト対象起動部113は、テスト設定情報STのテスト対象プログラム起動コマンドによって対象プログラムPを起動する機能を有している。テスト対象監視部114は、対象プログラムPのプロセスである対象プログラム実行体PP'の挙動(エラーの発生等)を監視する機能を有している。テスト対象終了部115は、対象プログラムPの起動からテスト設定情報STの実行フェーズ最大監視時間の経過、またはエラー発生による実行停止により、対象プログラムPを終了し、テスト結果Rを出力する機能を有している。   The test target starting unit 113 has a function of starting the target program P by a test target program start command of the test setting information ST. The test target monitoring unit 114 has a function of monitoring the behavior (error occurrence, etc.) of the target program execution body PP ′, which is the process of the target program P. The test target termination unit 115 has a function of terminating the target program P and outputting the test result R when the execution phase maximum monitoring time of the test setting information ST elapses after the target program P is started or when execution is stopped due to an error. doing.

図4はプログラムテスト装置1のハードウェア構成例を示す図である。図4において、プログラムテスト装置1は、システムバス1001に接続されたCPU(Central Processing Unit)1002、ROM(Read Only Memory)1003、RAM(Random Access Memory)1004、NVRAM(Non-Volatile Random Access Memory)1005を備えている。また、プログラムテスト装置1は、I/F(Interface)1006と、I/F1006に接続された、I/O(Input/Output Device)1007、HDD(Hard Disk Drive)/SSD(Solid State Drive)1008、NIC(Network Interface Card)1009とを備えている。また、プログラムテスト装置1は、I/O1007に接続されたモニタ1010、キーボード1011、マウス1012等を備えている。I/O1007にはCD/DVD(Compact Disk/Digital Versatile Disk)ドライブ等を接続することもできる。   FIG. 4 is a diagram illustrating a hardware configuration example of the program test apparatus 1. In FIG. 4, a program test apparatus 1 includes a CPU (Central Processing Unit) 1002, a ROM (Read Only Memory) 1003, a RAM (Random Access Memory) 1004, and an NVRAM (Non-Volatile Random Access Memory) connected to a system bus 1001. It has 1005. The program test apparatus 1 includes an I / F (Interface) 1006, an I / O (Input / Output Device) 1007, an HDD (Hard Disk Drive) / SSD (Solid State Drive) 1008 connected to the I / F 1006. , NIC (Network Interface Card) 1009. Further, the program test apparatus 1 includes a monitor 1010, a keyboard 1011, a mouse 1012 and the like connected to the I / O 1007. A CD / DVD (Compact Disk / Digital Versatile Disk) drive or the like can be connected to the I / O 1007.

図1および図2で説明したプログラムテスト装置1の機能は、CPU1002において所定のプログラムが実行されることで実現される。プログラムは、記録媒体を経由して取得されるものでもよいし、ネットワークを経由して取得されるものでもよいし、ROM組込でもよい。   The functions of the program test apparatus 1 described with reference to FIGS. 1 and 2 are realized by a predetermined program being executed by the CPU 1002. The program may be acquired via a recording medium, may be acquired via a network, or may be embedded in a ROM.

<動作>
図5は図2に示した実施形態の処理例を示すフローチャートである。図5において、プログラムテスト装置1は、操作者の処理開始指示等を受けて処理を開始すると、まず、学習フェーズを開始する。プログラムテスト装置1の学習対象起動部101は、テスト設定情報STのテスト対象プログラム起動コマンドにしたがって学習対象の対象プログラムPを通常の手順で起動する(ステップS101)。
<Operation>
FIG. 5 is a flowchart showing a processing example of the embodiment shown in FIG. In FIG. 5, when the program test apparatus 1 starts processing in response to an operator processing start instruction or the like, first, it starts a learning phase. The learning target activation unit 101 of the program test apparatus 1 activates the learning target program P according to a normal procedure in accordance with the test target program activation command of the test setting information ST (step S101).

学習対象監視部102は、対象プログラムP(より正確には対応するプロセスである対象プログラム実行体PP)の挙動を監視してファイルアクセスを把握し、対象プログラムPにより読み込まれたファイルを特定する(ステップS102)。特定のプログラム(プロセス)により読み込まれるファイルの特定は既存の技術で可能であり、例えばMicrosoft社が公開するSysinternals Process Monitor(https://technet.microsoft.com/ja-jp/sysinternals/processmonitor.aspx)の機能を利用することができる。図6はProcess Monitorの監視結果の例を示す図であり、現在実行中の全てのプログラムのファイルアクセスを監視することができ、イベント発生時刻、読込元プログラム、アクセス種別(ファイル読込、ファイル書込等)、読込みファイルのパスを取得することができる。これらのイベントから、対象プログラムに該当し、アクセス種別が読込のファイルを特定することで、対象プログラムPが読み込む全ファイルのリストを取得することができる。   The learning target monitoring unit 102 monitors the behavior of the target program P (more precisely, the target program execution body PP which is the corresponding process) to grasp the file access, and specifies the file read by the target program P ( Step S102). The file read by a specific program (process) can be identified by existing technology. For example, Sysinternals Process Monitor (https://technet.microsoft.com/en-us/sysinternals/processmonitor.aspx published by Microsoft) ) Function can be used. FIG. 6 is a diagram showing an example of the monitoring result of Process Monitor. It is possible to monitor file access of all programs currently being executed, event occurrence time, reading source program, access type (file reading, file writing). Etc.), and the path of the read file can be obtained. From these events, the list of all files read by the target program P can be acquired by identifying the files corresponding to the target program and having the access type read.

図5に戻り、学習対象監視部102は、読込ファイルについて取得した情報を時系列ファイルリスト保存部103に保存する。保存される時系列ファイルリストの例を図7に示す。図7において、ファイルパスは読込ファイルのパスである。タイミングは対象プログラム起動時からの経過時間(ミリ秒)である。サイズは読込ファイルのサイズ(バイト)である。読込ファイルのサイズは、パスが特定された際に実際にファイルのプロパティにアクセスすることで取得可能である。   Returning to FIG. 5, the learning target monitoring unit 102 stores the acquired information about the read file in the time-series file list storage unit 103. An example of the time-series file list to be saved is shown in FIG. In FIG. 7, a file path is a path of a read file. The timing is the elapsed time (milliseconds) from the start of the target program. The size is the size (in bytes) of the read file. The size of the read file can be obtained by actually accessing the file properties when the path is specified.

図5に戻り、テスト設定情報STで指定された学習フェーズ監視時間が経過したのち、学習対象終了部104は、学習対象監視部102による対象プログラムPの監視を中止させ、対象プログラムPを終了する(ステップS103)。   Returning to FIG. 5, after the learning phase monitoring time specified by the test setting information ST has elapsed, the learning target end unit 104 stops monitoring the target program P by the learning target monitoring unit 102 and ends the target program P. (Step S103).

次いで、ファイル優先度判定部105は、時系列ファイルリスト保存部103に保存された時系列ファイルリストを読み込み、「攻撃されやすさ」で優先度付け(優先度順に並び替え)する(ステップS104)。   Next, the file priority determination unit 105 reads the time-series file list stored in the time-series file list storage unit 103 and assigns priorities (rearranged in order of priority) according to “ease of attack” (step S104). .

「攻撃されやすさ」は、ここでは、読込タイミングとファイルサイズで決定されるものとする。読込タイミングは、プログラム起動からファイル読込開始までの経過時間がより短いものを優先する。理由は、プログラムの実行中に早い段階で読み込まれるファイルは、プログラムにとって重要なファイルであると考えられ、脆弱性が存在した場合の被害がより大きくなる可能性が高いため、攻撃されやすいからである。ファイルサイズは、より大きいものを優先する。理由は、ファイルサイズが大きいとファイル構造の複雑性も大きくなり、プログラムのファイル読込処理に脆弱性が存在する可能性が高くなるため、攻撃されやすいからである。読込タイミングとファイルサイズは、読込タイミングの方を優先する。よって、まず読込タイミングがより短い方を優先して並び替え、読込タイミングが同じ場合は、ファイルサイズが大きい方を優先して並び替える。   Here, “ease of attack” is determined by the read timing and the file size. As for the read timing, priority is given to a shorter elapsed time from the start of the program to the start of file reading. The reason is that files that are read at an early stage during the execution of the program are considered to be important files for the program and are more likely to be damaged in the presence of vulnerabilities, making them vulnerable to attack. is there. A larger file size is given priority. The reason is that if the file size is large, the complexity of the file structure also increases, and there is a high possibility that there is a vulnerability in the file read processing of the program, so it is easy to be attacked. Reading timing and file size have priority over reading timing. Therefore, first, sorting is performed with priority on the shorter reading timing, and when the reading timing is the same, sorting is performed with priority on the larger file size.

ファイル優先度判定部105は、並び替え後の優先順ファイルリストを優先順ファイルリスト保存部106に保存する。優先順ファイルリストの例を図8に示しており、高い順に並べられた優先度に読込ファイルのファイルパスが対応付けられている。ここまでの処理で学習フェーズは完了し、実行フェーズに移行する。   The file priority determination unit 105 stores the sorted priority file list in the priority file list storage unit 106. An example of the priority order file list is shown in FIG. 8, and the file paths of the read files are associated with the priorities arranged in descending order. The learning phase is completed by the processing so far, and the process proceeds to the execution phase.

図5に戻り、実行フェーズに入り、ファイルファジング実行部111は、ファイルファジングの実行を開始する(ステップS105)。ファイルファジング実行部111は、テスト設定情報STの実行フェーズ制限時間の経過(ステップS106のYes)と、予め優先順ファイルリスト保存部106に登録した所定数のファイルの処理完了(ステップS107のYes)を終了条件とする。   Returning to FIG. 5, the execution phase is entered, and the file fuzzing execution unit 111 starts executing file fuzzing (step S105). The file fuzzing execution unit 111 passes the execution phase time limit of the test setting information ST (Yes in step S106), and completes processing of a predetermined number of files registered in the priority order file list storage unit 106 in advance (Yes in step S107). Is the end condition.

終了条件に該当しない場合(ステップS107のNo)、ファイルファジング実行部111は、優先順ファイルリスト保存部106から優先順ファイルリストを読み込み、そこに記述された優先順にしたがって、ファイルパスからファイルFを取得する。   If the end condition is not met (No in step S107), the file fuzzing execution unit 111 reads the priority order file list from the priority order file list storage unit 106, and loads the file F from the file path according to the priority order described therein. get.

テストファイル生成部112は、ファイルFに基づいてテストファイルTFを生成する(ステップS108)。生成したテストファイルTFは元のファイルFと入れ替えるが、テスト後に元に戻すためにファイルFは一時的に適当な場所に保存しておく。   The test file generation unit 112 generates a test file TF based on the file F (step S108). The generated test file TF is replaced with the original file F. However, the file F is temporarily stored in an appropriate location in order to restore the original file after the test.

図9は正常なファイルからテストファイルを生成する例を示しており、例えば、ヘッダの先頭から4バイトを「0xFFFFFFFF」に変異させてテストファイル#1を生成し、更に変異させる位置を1バイトうしろにずらしてテストファイル#2を生成し、これを続けるものである。画像ファイルの場合、画像ビューア等のプログラムで読み込んだ場合、正常なファイルでは正常に画像が表示されるが、一部を変異させたテストファイルでは正常な表示は行われず、更に、オフセット異常によるエラー発生が生じる場合がある。   FIG. 9 shows an example of generating a test file from a normal file. For example, the test file # 1 is generated by mutating 4 bytes from the head of the header to “0xFFFFFFFF”, and the position to be further mutated is 1 byte. The test file # 2 is generated by shifting and is continued. In the case of an image file, when it is read by a program such as an image viewer, the image is displayed normally in a normal file, but normal display is not performed in a test file that is partially mutated, and an error due to an offset error Occurrence may occur.

図5に戻り、テスト対象起動部113は、テスト設定情報STのテスト対象プログラム起動コマンドにしたがって対象プログラムPを起動し、テスト対象監視部114は対象プログラムPの挙動を監視する(ステップS109)。この場合の対象プログラムPの挙動の監視は、プログラムテスト装置1のOS(Operating System)の出力するログから情報を取得したり、対象プログラムPの状態を取得するOSに対するシステムコールにより情報を取得したりすることで行うことができる。   Returning to FIG. 5, the test target activation unit 113 activates the target program P in accordance with the test target program activation command of the test setting information ST, and the test target monitoring unit 114 monitors the behavior of the target program P (step S109). In this case, the behavior of the target program P is monitored by acquiring information from a log output from the OS (Operating System) of the program test apparatus 1 or by obtaining a system call to the OS that acquires the state of the target program P. Can be done.

その後、テスト対象監視部114は、テスト設定情報STの実行フェーズ最大監視時間の経過後、対象プログラムPを終了する(ステップS110)。1つの対象プログラムPについてのテストが完了した場合、入れ替えたテストファイルTFを正常なファイルFに入れ替える。   Thereafter, the test target monitoring unit 114 ends the target program P after the execution phase maximum monitoring time of the test setting information ST has elapsed (step S110). When the test for one target program P is completed, the replaced test file TF is replaced with a normal file F.

ファイルファジング実行部111は、テスト対象監視部114による監視で得たテスト結果Rをテスト結果リスト保存部116のテスト結果リストに記録する(ステップS111)。   The file fuzzing execution unit 111 records the test result R obtained by monitoring by the test target monitoring unit 114 in the test result list of the test result list storage unit 116 (step S111).

その後、ファイルファジング実行部111は、1つの対象プログラムPについてのテストが完了していない場合は、テストファイルTFを替えたテストを繰り返す。1つの対象プログラムPについてのテストが完了した場合は、優先順ファイルリスト保存部106から優先順ファイルリストの次の順位のファイルについて同様の処理を繰り返す。   Thereafter, when the test for one target program P is not completed, the file fuzzing execution unit 111 repeats the test by replacing the test file TF. When the test for one target program P is completed, the same processing is repeated for the next rank file in the priority order file list from the priority order file list storage unit 106.

実行フェーズ制限時間が経過したか(ステップS106のYes)、全てのファイルのテストが完了したか(ステップS107のYes)のいずれかの時点で、ファイルファジング実行部111は処理を完了する。そして、それまでに収集したテスト結果リストを結果として出力する(ステップS112)。図10はテスト結果リストの例を示しており、読込ファイルのファイルパスにテスト結果へのリンクが対応付けられている。リンクを辿った先のテスト結果には、読込ファイルのファイルパス(省略可)、テスト日時、テスト回数、例外発生回数等が格納されている。   The file fuzzing execution unit 111 completes the process at any time point whether the execution phase limit time has elapsed (Yes in step S106) or all the files have been tested (Yes in step S107). Then, the test result list collected so far is output as a result (step S112). FIG. 10 shows an example of the test result list, and a link to the test result is associated with the file path of the read file. The test result after the link stores the file path of the read file (can be omitted), the test date and time, the number of tests, the number of exception occurrences, and the like.

<総括>
以上説明したように、本実施形態によれば、攻撃されやすいファイルを優先的に用いてテストを行うため、全てのファイをテスト対象プログラムに読み込ませなくても、現実的な時間内でよりセキュリティ品質を高めることができる。
<Summary>
As described above, according to the present embodiment, a file that is easily attacked is preferentially used for testing, so even if all files are not read into the test target program, more security can be achieved within a realistic time. Quality can be improved.

以上、好適な実施の形態により説明した。ここでは特定の具体例を示して説明したが、特許請求の範囲に定義された広範な趣旨および範囲から逸脱することなく、これら具体例に様々な修正および変更を加えることができることは明らかである。すなわち、具体例の詳細および添付の図面により限定されるものと解釈してはならない。   In the above, it demonstrated by preferred embodiment. While specific embodiments have been illustrated and described herein, it will be apparent that various modifications and changes may be made thereto without departing from the broad spirit and scope as defined in the claims. . That is, it should not be construed as being limited by the details of the specific examples and the accompanying drawings.

以上の説明に関し、更に以下の項を開示する。
(付記1)
テスト対象のプログラムで読み込まれる複数のファイルを監視する監視部と、
前記プログラムに読み込まれる順およびサイズに従って、前記複数のファイルに優先度を付与する付与部と、
を備えたことを特徴とするプログラムテスト装置。
(付記2)
前記付与部は、前記ファイルのサイズよりも前記プログラムに読み込まれる順を優先して前記優先度を決定する、
ことを特徴とする付記1に記載のプログラムテスト装置。
(付記3)
前記優先度の高いファイルから順に前記テスト対象のプログラムに読み込まれ、
予め設定された時間が経過した場合または所定のファイル数の処理が完了した場合にテストが終了する、
ことを特徴とする付記1または2に記載のプログラムテスト装置。
(付記4)
前記テストでは、前記ファイルごとに正常ファイルを部分的に変異して生成した複数の異常ファイルが前記プログラムに読み込まれる、
ことを特徴とする付記3に記載のプログラムテスト装置。
(付記5)
テスト対象のプログラムで読み込まれる複数のファイルを監視し、
前記プログラムに読み込まれる順およびサイズに従って、前記複数のファイルに優先度を付与する、
処理をコンピュータに実行させることを特徴とするプログラムテストプログラム。
(付記6)
サイズよりも前記プログラムに読み込まれる順を優先して前記優先度を決定する、
ことを特徴とする付記5に記載のプログラムテストプログラム。
(付記7)
前記優先度の高いファイルから順に前記テスト対象のプログラムに読み込まれ、
予め設定された時間が経過した場合または所定のファイル数の処理が完了した場合にテストが終了する、
ことを特徴とする付記5または6に記載のプログラムテストプログラム。
(付記8)
前記テストでは、前記ファイルごとに正常ファイルを部分的に変異して生成した複数の異常ファイルが前記プログラムに読み込まれる、
ことを特徴とする付記7に記載のプログラムテストプログラム。
(付記9)
テスト対象のプログラムを実行し、
前記プログラムで読み込まれる複数のファイルを監視し、
前記プログラムに読み込まれる順およびサイズに従って、前記複数のファイルに優先度を付与する、
処理をコンピュータが実行することを特徴とするプログラムテスト方法。
(付記10)
サイズよりも前記プログラムに読み込まれる順を優先して前記優先度を決定する、
ことを特徴とする付記9に記載のプログラムテスト方法。
(付記11)
前記優先度の高いファイルから順に前記テスト対象のプログラムに読み込ませ、
予め設定された時間が経過した場合または所定のファイル数の処理が完了した場合にテストを終了する、
ことを特徴とする付記9または10に記載のプログラムテスト方法。
(付記12)
前記ファイルごとに正常ファイルを部分的に変異して生成した複数の異常ファイルを前記プログラムに読み込ませる、
ことを特徴とする付記11に記載のプログラムテスト方法。
Regarding the above description, the following items are further disclosed.
(Appendix 1)
A monitoring unit that monitors multiple files read by the program under test;
An assigning unit that gives priority to the plurality of files according to the order and size read by the program;
A program test apparatus comprising:
(Appendix 2)
The assigning unit determines the priority by prioritizing the order of reading into the program rather than the size of the file;
The program test apparatus according to appendix 1, wherein:
(Appendix 3)
Read into the program under test in order from the highest priority file,
The test ends when a preset time has elapsed or when a predetermined number of files have been processed,
The program test apparatus according to appendix 1 or 2, characterized by the above.
(Appendix 4)
In the test, a plurality of abnormal files generated by partially mutating normal files for each file are read into the program.
The program test apparatus according to Supplementary Note 3, wherein
(Appendix 5)
Monitor multiple files read by the program under test,
Giving priority to the plurality of files according to the order and size read by the program;
A program test program for causing a computer to execute processing.
(Appendix 6)
Determining the priority by prioritizing the order of loading into the program over size;
The program test program according to appendix 5, characterized by:
(Appendix 7)
Read into the program under test in order from the highest priority file,
The test ends when a preset time has elapsed or when a predetermined number of files have been processed,
The program test program according to appendix 5 or 6, characterized by the above.
(Appendix 8)
In the test, a plurality of abnormal files generated by partially mutating normal files for each file are read into the program.
The program test program according to appendix 7, characterized by:
(Appendix 9)
Run the program under test,
Monitor multiple files read by the program,
Giving priority to the plurality of files according to the order and size read by the program;
A program test method, wherein a computer executes a process.
(Appendix 10)
Determining the priority by prioritizing the order of loading into the program over size;
The program test method according to appendix 9, wherein:
(Appendix 11)
Read the program under test in order from the highest priority file,
End the test when a preset time has elapsed or when processing of a predetermined number of files is completed,
The program test method according to appendix 9 or 10, characterized by the above.
(Appendix 12)
Causing the program to read a plurality of abnormal files generated by partially mutating normal files for each file,
The program test method as set forth in appendix 11, wherein:

学習対象監視部102は「監視部」の一例である。ファイル優先度判定部105は「付与部」の一例である。   The learning target monitoring unit 102 is an example of a “monitoring unit”. The file priority determination unit 105 is an example of a “grant unit”.

1 プログラムテスト装置
101 学習対象起動部
102 学習対象監視部
103 時系列ファイルリスト保存部
104 学習対象終了部
105 ファイル優先度判定部
106 優先順ファイルリスト保存部
111 ファイルファジング実行部
112 テストファイル生成部
113 テスト対象起動部
114 テスト対象監視部
115 テスト対象終了部
116 テスト結果リスト保存部
120 ファイルファジング処理部
ST テスト設定情報
P 対象プログラム
PP、PP' 対象プログラム実行体
F ファイル
TF テストファイル
R テスト結果
RL テスト結果リスト
DESCRIPTION OF SYMBOLS 1 Program test apparatus 101 Learning object starting part 102 Learning object monitoring part 103 Time series file list preservation | save part 104 Learning object end part 105 File priority determination part 106 Priority order file list preservation | save part 111 File fuzzing execution part 112 Test file generation part 113 Test target activation unit 114 Test target monitoring unit 115 Test target end unit 116 Test result list storage unit 120 File fuzzing processing unit ST Test setting information P Target program PP, PP 'Target program execution body F file TF test file R Test result RL test Results list

Claims (6)

テスト対象のプログラムで読み込まれる複数のファイルを監視する監視部と、
前記プログラムに読み込まれる順およびサイズに従って、前記複数のファイルに優先度を付与する付与部と、
を備えたことを特徴とするプログラムテスト装置。
A monitoring unit that monitors multiple files read by the program under test;
An assigning unit that gives priority to the plurality of files according to the order and size read by the program;
A program test apparatus comprising:
前記付与部は、前記ファイルのサイズよりも前記プログラムに読み込まれる順を優先して前記優先度を決定する、
ことを特徴とする請求項1に記載のプログラムテスト装置。
The assigning unit determines the priority by prioritizing the order of reading into the program rather than the size of the file;
The program test apparatus according to claim 1.
前記優先度の高いファイルから順に前記テスト対象のプログラムに読み込まれ、
予め設定された時間が経過した場合または所定のファイル数の処理が完了した場合にテストが終了する、
ことを特徴とする請求項1または2に記載のプログラムテスト装置。
Read into the program under test in order from the highest priority file,
The test ends when a preset time has elapsed or when a predetermined number of files have been processed,
The program test apparatus according to claim 1, wherein the program test apparatus is a program test apparatus.
前記テストでは、前記ファイルごとに正常ファイルを部分的に変異して生成した複数の異常ファイルが前記プログラムに読み込まれる、
ことを特徴とする請求項3に記載のプログラムテスト装置。
In the test, a plurality of abnormal files generated by partially mutating normal files for each file are read into the program.
The program test apparatus according to claim 3.
テスト対象のプログラムで読み込まれる複数のファイルを監視し、
前記プログラムに読み込まれる順およびサイズに従って、前記複数のファイルに優先度を付与する、
処理をコンピュータに実行させることを特徴とするプログラムテストプログラム。
Monitor multiple files read by the program under test,
Giving priority to the plurality of files according to the order and size read by the program;
A program test program for causing a computer to execute processing.
テスト対象のプログラムを実行し、
前記プログラムで読み込まれる複数のファイルを監視し、
前記プログラムに読み込まれる順およびサイズに従って、前記複数のファイルに優先度を付与する、
処理をコンピュータが実行することを特徴とするプログラムテスト方法。
Run the program under test,
Monitor multiple files read by the program,
Giving priority to the plurality of files according to the order and size read by the program;
A program test method, wherein a computer executes a process.
JP2016229026A 2016-11-25 2016-11-25 Program test device, program test program and program test method Pending JP2018085040A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016229026A JP2018085040A (en) 2016-11-25 2016-11-25 Program test device, program test program and program test method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016229026A JP2018085040A (en) 2016-11-25 2016-11-25 Program test device, program test program and program test method

Publications (1)

Publication Number Publication Date
JP2018085040A true JP2018085040A (en) 2018-05-31

Family

ID=62238476

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016229026A Pending JP2018085040A (en) 2016-11-25 2016-11-25 Program test device, program test program and program test method

Country Status (1)

Country Link
JP (1) JP2018085040A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020110727A1 (en) * 2018-11-29 2020-06-04 日本電信電話株式会社 Information creation device, information creation method, and information creation program

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020110727A1 (en) * 2018-11-29 2020-06-04 日本電信電話株式会社 Information creation device, information creation method, and information creation program
JP2020087215A (en) * 2018-11-29 2020-06-04 日本電信電話株式会社 Information generation apparatus, information generation method, and information generation program
JP7031569B2 (en) 2018-11-29 2022-03-08 日本電信電話株式会社 Information creation device, information creation method, and information creation program
AU2019387658B2 (en) * 2018-11-29 2023-03-16 Nippon Telegraph And Telephone Corporation Information creation device, information creation method, and information creation program
US11922233B2 (en) 2018-11-29 2024-03-05 Nippon Telegraph And Telephone Corporation Information creation device, information creation method, and information creation program

Similar Documents

Publication Publication Date Title
US8752182B2 (en) Pinpointing security vulnerabilities in computer software applications
JP2018041438A (en) System and method for detecting malicious codes in file
US9438617B2 (en) Application security testing
JP2018041438A5 (en)
EP2663944B1 (en) Malware detection
JP6404273B2 (en) System and method for performing anti-virus scanning of files in a virtual machine
US20140289726A1 (en) Function exit instrumentation for tail-call optimized code
JP6282217B2 (en) Anti-malware system and anti-malware method
JP2010257150A (en) Device and method for detection of fraudulence processing, and program
US9195562B2 (en) Recording external processes
US8650546B2 (en) Static analysis based on observed string values during execution of a computer-based software application
TWI656453B (en) Detection system and detection method
US10275595B2 (en) System and method for characterizing malware
JP2016218997A (en) Determining valid inputs for unknown binary program
JP2016149123A (en) Method of determining valid input for unknown binary module and non-transitory computer-readable medium
JP2018085040A (en) Program test device, program test program and program test method
JP5437964B2 (en) Analysis method, analysis apparatus, and analysis program
JP5906855B2 (en) Test data creation method, test data creation program, and test data creation device
US9734458B2 (en) Predicting outcome based on input
CN115688092A (en) Terminal weak control method and device, electronic equipment and storage medium
US9582410B2 (en) Testing software on a computer system
Safitri A study: Volatility forensic on hidden files
JP4111151B2 (en) Policy analysis system and method, and policy analysis program
JP7188208B2 (en) MALWARE ANALYSIS DEVICE, MALWARE ANALYSIS METHOD, AND PROGRAM
JP7261101B2 (en) Defect detection device, defect detection method, and defect detection program