Detection device, detection method, and detection program
By obtaining the file location information and size, combined with the storage area information of the file system, the problem of slow file tampering detection speed and poor accuracy in the existing technology is solved, and fast and accurate file tampering detection is achieved.
Patent Information
- Application Number
- CN202280088318.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-11
- Publication Date
- 2024-08-30
AI Technical Summary
When detecting file tampering, the existing technology cannot accurately and quickly identify file changes, especially when the file capacity is large or the number of files is large, and it cannot prevent tampering when the file content is rewritten or the timestamp changes.
By obtaining the location information and file size of the file, and determining changes in this information, we can quickly detect file tampering. Combining the storage area location information of the file system and the file attribute information, the tampering of the file content is detected to reduce the amount and frequency of reading the file content and improve the detection speed.
It achieves accurate and rapid detection of file tampering, reduces detection time, can quickly identify tampering in the case of large files or a large number of files, and improves the detection accuracy of file rewrites or timestamp changes.
Smart Images

Figure CN118575175A
Abstract
Description
Technical Field
[0001] The present invention relates to a detection device, a detection method, and a detection program. Background Art
[0002] Conventionally, as a method for detecting tampering, a method using a digest value of file content is known. For example, when confirming whether there is tampering with the content of a file in a device, a list of combinations of each file path and the digest value of the file content in the device is defined in advance as a determination criterion, and then, when confirming whether there is tampering in the device, the determination criterion and the digest value of the file content in the device are compared in sequence, and whether there is tampering is confirmed by checking for differences.
[0003] In addition, as a method for detecting tampering, in addition to file content, a method using file attribute information is also known. For example, there is also software that detects file tampering based on changes in file attribute information.
[0004] Prior Art Documents
[0005] Patent Documents
[0006] Patent Document 1: Japanese Unexamined Patent Application Publication No. 2019-008376
[0007] Non-Patent Documents
[0008] Non-Patent Document 1: Linux Security from Scratch (8) Construction of a Host-Type IDS Using Tripwire, [online], [searched on January 5, 2022], Internet <https: / / atmarkit.itmedia.co.jp / ait / articles / 0203 / 19 / news002_2.html> Summary of the Invention
[0009] Problems to be Solved by the Invention
[0010] However, in the prior art, there is a problem that it is sometimes impossible to accurately and quickly detect file tampering. For example, in the conventional method using the digest value of file content, when confirming whether there is tampering, in order to generate the digest value of the file content in the device, it is necessary to read all the file content at once. In the case of a large-capacity file or a large number of files in the device, it takes time to read all the file content, and it is impossible to quickly notice device tampering.
[0011] In addition, in the previous methods of using file attribute information, there is a mode in which the attribute information does not change even if the file content is tampered with (a mode in which the content is rewritten while the file size remains the same, a mode in which the file content is tampered with to return to the timestamp before the change, etc.), and it is difficult to prevent such file tampering.
[0012] The present invention has been made in view of the above circumstances, and an object of the present invention is to provide a detection device, a detection method, and a detection program that can accurately and quickly detect tampering of a file.
[0013] Means for solving problems
[0014] In order to solve the above-mentioned problems and achieve the purpose, the detection device of the present invention includes: an acquisition unit, which acquires the location information and file size of a file that is a tampering detection object; and a detection unit, which determines the change of the location information or the file size acquired by the acquisition unit, and detects tampering of the file that is a tampering detection object when the location information or the file size changes.
[0015] Effects of the Invention
[0016] According to the present invention, it is possible to accurately and quickly detect tampering of a file. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 This is a block diagram illustrating the configuration of the detection device according to this embodiment.
[0018] Figure 2 This is a diagram showing an example of the judgment criteria stored in the judgment criteria storage unit.
[0019] Figure 3 It is a diagram for explaining information used for tampering detection.
[0020] Figure 4 This is a diagram that explains the location information of the storage area of the file.
[0021] Figure 5 This is a diagram for explaining the comparison between the detection time of the detection device according to the present embodiment and the conventional detection time.
[0022] Figure 6 This is a diagram for explaining another example of the determination criterion.
[0023] Figure 7 This is a flowchart showing an example of the processing procedure of the pre-processing.
[0024] Figure 8 This is a flowchart showing an example of the processing procedure of the detection process.
[0025] Fig. 9A diagram showing a computer that executes a program. DETAILED DESCRIPTION
[0026] Hereinafter, embodiments of the detection device, detection method, and detection program of the present application will be described in detail based on the drawings. In addition, the present invention is not limited to the embodiments described below.
[0027] [Structure of the detection device]
[0028] Figure 1 is a block diagram illustrating the structure of the detection device of this embodiment. Figure 1 As illustrated, the detection device 10 of the present embodiment includes a communication processing unit 11 , an input unit 12 , an output unit 13 , a control unit 14 , and a storage unit 15 .
[0029] The communication processing unit 11 is implemented by a NIC (Network Interface Card) or the like, and controls the communication between a target device (not shown) storing a file to be detected as a tampering and the control unit 14 via an electric communication line such as a LAN (Local Area Network) or the Internet. For example, the communication processing unit 11 receives a set of a file path, a summary value of the file content, location information of the file, a summary value of the location information, and attribute information of the file from the target device.
[0030] The input unit 12 is implemented using input devices such as a keyboard and a mouse, and inputs various instruction information such as starting a process to the control unit 14 in response to an input operation by an operator. The output unit 13 is implemented by a display device such as a liquid crystal display, etc. For example, the output unit 13 outputs the result of tampering detection.
[0031] The storage unit 15 stores data and programs required for various processes of the control unit 14 and has a determination reference storage unit 15a. For example, the storage unit 15 is a semiconductor memory element such as RAM (Random Access Memory) or flash memory, or a storage device such as a hard disk or an optical disk.
[0032] The judgment criterion storage unit 15a stores a pre-generated judgment criterion for detecting tampering. Figure 2 As illustrated, the determination criterion storage unit 15 a stores, as determination criteria, a file path, a digest value of file content, file location information, a digest value of the file location information, and file attribute information. Figure 2 It is a diagram showing an example of the determination criteria stored in the determination criteria storage unit.
[0033] The control unit 14 has an internal memory for storing programs that define various processing steps and required data, and performs various processing by using these. For example, the control unit 14 includes an acquisition unit 14a, a storage unit 14b, and a detection unit 14c. Here, the control unit 14 is an electronic circuit such as a CPU (Central Processing Unit), an MPU (Micro Processing Unit), an integrated circuit such as an ASIC (Application Specific Integrated Circuit), and an FPGA (Field Programmable Gate Array).
[0034] The acquisition unit 14a acquires the location information and file size of the file as the tampering detection target. The acquisition unit 14a may acquire the digest value of the location information of the file instead of the location information of the file, or may acquire the digest value of the location information of the file together with the location information of the file. For example, the acquisition unit 14a acquires the digest value of the location information and the file size of the file as the tampering detection target.
[0035] The acquisition unit 14 a acquires the position information and the file size of the file to be detected for tampering, for example, when generating a criterion and when performing tampering detection.
[0036] For example, when generating the determination criterion, the acquisition unit 14a acquires a set of a file path, a digest value of the file content, file location information, a digest value of the location information, and file attribute information from a target device for a file to be detected for tampering.
[0037] When performing tampering detection, the acquisition unit 14a acquires the location information and file size of the file as the tampering detection target from the target device. When performing tampering detection, the acquisition unit 14a may also acquire the file path, the summary value of the file content, the location information of the file, the summary value of the location information, and the set of the attribute information of the file from the target device for the file as the tampering detection target.
[0038] The storage unit 14b generates a criterion including the location information or file size acquired by the acquisition unit 14a, and stores it in the criterion storage unit 15a. For example, the storage unit 14b generates a combination of a file path, a digest value of the file content, the location information of the file, a digest value of the location information, and attribute information of the file as a criterion, and stores it in the criterion storage unit 15a.
[0039] The detection unit 14c determines the change of the position information or file size obtained by the acquisition unit 14a, and detects the tampering of the file as the tampering detection target when there is a change in the position information or file size. Alternatively, the detection unit 14c may determine the change of the digest value of the position information or file size obtained by the acquisition unit 14a, and detects the tampering of the file as the tampering detection target when there is a change in the digest value of the position information or file size.
[0040] For example, the detection unit 14c compares the position information and file size included in the judgment criterion stored in the judgment criterion storage unit 15a with the position information and file size obtained when performing tampering detection. When either the position information or the file size is inconsistent, the detection unit 14c determines that the position information or the file size has changed, and detects tampering of the file that is the object of tampering detection.
[0041] The detection unit 14c can further use the summary value of the file content to detect tampering. For example, when there is a change in the location information or the file size, the detection unit 14c can further determine whether the summary value of the file content has changed. When the summary value of the file content has changed, tampering of the file that is the tampering detection object is detected. More specifically, for example, when the detection unit 14c confirms whether the file of the object device has been tampered with, the file path, the location information of the file (or the summary value of the location information) and the attribute information of the file in the judgment basis are compared with the information in the device, and check whether there are inconsistent parts. Then, if there is no inconsistency, the detection unit 14c determines that the device has not been tampered with and ends the confirmation. If there is an inconsistent part, the detection unit 14c compares the summary value of the file content in the judgment basis of the file path with the summary value of the file in the device. If there is inconsistency, it is determined that the content of the file has been tampered with.
[0042] Here, use Figure 3 Describes information used for tamper detection. Figure 3 FIG. 4 is a diagram illustrating information used for tamper detection. Figure 3 As shown in FIG. 1 , there are "overwrite update", "append" and "file replacement" as types of file content modification. Figure 3 In the example of , in the case of overwriting and updating, the file attribute information (i-node number and file size) does not change, so the detection unit 14c cannot detect the tampering of the file content only through the file attribute information, but can detect the tampering through the position information. In addition, in the case of appending, the position information does not change when the size of the appending is very small, and the detection unit 14c cannot detect the tampering only through the position information, but can detect the tampering by combining the file size in the file attribute information.
[0043] Thus, as a method for detecting file tampering, the detection unit 14c detects the situation where the file content has been tampered with by combining the location information of the storage area of the file on the file system and the file size. For example, in a file system such as ext2 of Linux (registered trademark), the storage area is divided into units such as Blocks for management, which is equivalent to the data Block number. In addition, in the case of a file system of Windows (registered trademark), it is equivalent to the cluster number. The Block number indicates the location on the storage medium, and the entire file is read by tracking multiple Block numbers associated with the file. That is, the Block number is an address on the memory, which is difficult for the user to change easily.
[0044] Here, use Figure 4 Describes the location information of the storage area of the file. Figure 4 This is a diagram that describes the location information of the storage area of a file. Block is the smallest unit for storing data used in a file system that is an ext system (in the case of FAT (File Allocation Table), it is equivalent to a cluster). Figure 4 As shown, a file is composed of a plurality of blocks, which are managed by a table of i-nodes. In addition, for example, when the contents of a file are overwritten, another block is written with the contents, and the correspondence between the file and the block is updated.
[0045] Thus, in the detection device 10, the location information (Block number, etc.) of the storage area of the file is used together with the attribute information of the file to detect the tampering of the file, so the tampering of the file can be detected quickly and accurately. Figure 5 As shown in the example, in the detection device 10, based on the results measured in the verification environment, obtaining the location information (Block number, etc.) and the file attribute information can significantly shorten the average detection time of each file compared to the summary value of the file content. That is, compared to obtaining the summary value of the file content, when obtaining the location information and the file attribute information, it can be obtained at a very high speed, and the time that cannot be detected can be shortened.
[0046] Usually, in order to confirm whether the contents of files in a device have been tampered with, the contents of the files in the device are read in sequence and compared with the original contents to confirm whether changes have occurred. However, in the case of particularly large files or a large number of files, although it is possible to strictly confirm that all the contents of the files have been read, it will take time. In the detection device 10, instead of the contents of the files, the location information and file size of the storage area of the files on the file system are read, and compared with the original location information and file size to confirm whether changes have occurred. Here, only the contents of the files whose location information and file size have been changed are read and compared with the original contents. By adopting such a structure, the amount of file contents read and the reading frequency can be reduced, and tampering of the device can be quickly detected. In addition, the location information and attribute information of the files are generally very small in capacity compared with the size of the files themselves, and it only takes a small amount of time to obtain them.
[0047] In addition, there is a pattern in which the attribute information does not change even if the file content is tampered with. Therefore, in the detection device 10, not only the attribute information but also the location information of the storage area of the file is combined for confirmation, which can more accurately detect the situation where the file has been tampered with.
[0048] In addition, examples of the criteria are not limited to Figure 2 The examples shown. For example, Figure 6 As illustrated, if there is a digest value of the block number (digest value of the position information), the block number as the position information is not necessary. Figure 6 This is a diagram for explaining another example of the judgment criterion.
[0049] [Processing steps of the detection device]
[0050] Next, use Figure 7 and Figure 8 An example of a processing procedure of a process executed by the detection device 10 will be described. Figure 7 is a flowchart showing an example of the processing steps of the preprocessing. Figure 8 This is a flowchart showing an example of the processing procedure of the detection process.
[0051] First, use Figure 7 The steps of preprocessing are described below. Figure 7 As shown in the example, the acquisition unit 14a of the detection device 10 acquires the location information and file size of the file as the tampering detection target (step S101). For example, when generating the judgment criterion, the acquisition unit 14a acquires the file path, the digest value of the file content, the location information of the file, the digest value of the location information, and the set of the attribute information of the file from the target device for the file as the tampering detection target.
[0052] Then, the storage unit 14b generates a criterion including the location information or file size acquired by the acquisition unit 14a (step S102), and stores it in the criterion storage unit 15a (step S103). For example, the storage unit 14b generates a combination of a file path, a digest value of the file content, the location information of the file, a digest value of the location information, and attribute information of the file as a criterion, and stores it in the criterion storage unit 15a.
[0053] Next, use Figure 8 To illustrate the processing steps of the detection process. Figure 8 As illustrated, when tampering detection is performed, the acquisition unit 14a acquires the position information and file size of the file that is the tampering detection target (step S201).
[0054] Then, the detection unit 14c compares the position information and file size obtained during the tampering detection with the position information and file size of the judgment standard stored in the judgment standard storage unit 15a (step S202). As a result, the detection unit 14c determines whether the position information and file size are consistent (step S203).
[0055] Then, when both the position information and the file size are consistent (yes in step S203), the detection unit 14c determines that there is no tampering and directly ends the processing. When one or both of the position information and the file size are inconsistent ("no" in step S203), the detection unit 14c detects tampering of the file as the tampering detection object (step S204).
[0056] [Effects of Embodiment]
[0057] In this way, the detection device 10 of the embodiment obtains the location information and file size of the file as the tampering detection target, determines the change of the obtained location information or file size, and detects the tampering of the file as the tampering detection target when there is a change in the location information or file size. Thus, the detection device 10 can accurately and quickly detect the tampering of the file.
[0058] That is, since the detection device 10 uses the location information (block number, etc.) of the storage area of the file together with the file size to detect the tampering of the file, it is possible to quickly and accurately detect the tampering of the file.
[0059] (System structure, etc.)
[0060] The structural elements of the devices shown in the diagrams of the above-mentioned embodiments are conceptual functions and do not necessarily need to be physically constructed as shown. That is, the specific manner of dispersing and integrating the devices is not limited to the manner shown in the diagrams, and all or part of them can be functionally or physically dispersed and integrated in arbitrary units according to various loads, usage conditions, etc. In addition, all or any part of the processing functions performed in each device can be implemented by a CPU and a program parsed and executed by the CPU, or can be implemented as hardware based on wired logic.
[0061] In addition, all or part of the processing described as automatically performed in each processing described in the above embodiment can also be performed manually, or all or part of the processing described as manually performed can also be performed automatically by a known method. In addition, the processing steps, control steps, specific names, and information including various data and parameters shown in the above articles and drawings can be changed arbitrarily except for the cases where they are specially recorded.
[0062] 〔program〕
[0063] In addition, a program in which the processing performed by the detection device 10 described in the above embodiment is described in a language executable by a computer can also be generated. In this case, by executing the program by a computer, the same effect as the above embodiment can be obtained. In addition, the program can also be recorded in a computer-readable recording medium, so that the computer reads and executes the program recorded in the recording medium, thereby achieving the same processing as the above embodiment.
[0064] Fig. 9 FIG. 1 is a diagram showing a computer that executes a program. Fig. 9 As shown, the computer 1000 includes, for example, a memory 1010 , a CPU 1020 , a hard disk drive interface 1030 , a disk drive interface 1040 , a serial port interface 1050 , a video adapter 1060 , and a network interface 1070 , and these components are connected via a bus 1080 .
[0065] like Fig. 9 As shown in FIG. 1 , the memory 1010 includes a ROM (Read Only Memory) 1011 and a RAM 1012. The ROM 1011 stores a boot program such as a BIOS (Basic Input Output System). Fig. 9 As shown, the hard disk drive interface 1030 is connected to the hard disk drive 1031. Fig. 9 As shown, the disk drive interface 1040 is connected to the disk drive 1041. For example, a removable storage medium such as a magnetic disk or an optical disk is inserted into the disk drive 1041. Fig. 9 As shown, the serial port interface 1050 is connected to, for example, a mouse 1051 and a keyboard 1052. Fig. 9 As shown, the video adapter 1060 is connected to a display 1061 , for example.
[0066] like Fig. 9 As shown, the hard disk drive 1031 stores, for example, an OS 1091, an application program 1092, a program module 1093, and program data 1094. That is, the above-mentioned programs are stored in the hard disk drive 1031 as program modules in which instructions executed by the computer 1000 are described, for example.
[0067] In addition, various data described in the above embodiments are stored as program data in, for example, the memory 1010 and the hard disk drive 1031. Then, the CPU 1020 reads the program module 1093 and program data 1094 stored in the memory 1010 and the hard disk drive 1031 to the RAM 1012 as needed to execute various processing steps.
[0068] In addition, the program module 1093 and program data 1094 involved in the program are not limited to being stored in the hard disk drive 1031, and may be stored in a removable storage medium, for example, and read out by the CPU 1020 via a disk drive, etc. Alternatively, the program module 1093 and program data 1094 involved in the program may be stored in another computer connected via a network (LAN (Local Area Network), WAN (Wide Area Network), etc.), and read out by the CPU 1020 via the network interface 1070.
[0069] The above describes the embodiment to which the invention completed by the inventor is applied, but the present invention is not limited to the description and drawings constituting a part of the disclosure of the present invention based on the embodiment. That is, other embodiments, examples, and application technologies completed by those skilled in the art based on the embodiment are all included in the scope of the present invention.
[0070] Description of Reference Numerals
[0071] 10. Detection device
[0072] 11Communication Processing Unit
[0073] 12 Input section
[0074] 13 Output section
[0075] 14. Control Unit
[0076] 14a Acquisition
[0077] 14b Preservation Department
[0078] 14c Detection Department
[0079] 15 Storage
[0080] 15a Judgment criterion storage unit
Claims
1. A detection device, characterized in that: have: an acquisition unit that acquires position information and a file size of a file that is a tampering detection target; and A detection unit determines a change in the position information or the file size acquired by the acquisition unit, and detects tampering of the file as a tampering detection target when the position information or the file size has changed.
2. The detection device according to claim 1, characterized in that: further comprising a storage unit that generates a determination criterion including the position information or the file size acquired by the acquisition unit and stores the determination criterion in a storage unit, When performing tampering detection, the acquisition unit acquires the location information and file size of the file that is the tampering detection target. The detection unit compares the position information and the file size included in the judgment criterion stored in the storage unit with the position information and the file size obtained when performing tampering detection, and when either the position information or the file size is inconsistent, determines that the position information or the file size has changed, and detects tampering with the file that is the object of tampering detection.
3. The detection device according to claim 1, characterized in that: The acquisition unit acquires the digest value of the location information and the file size of the file to be detected for tampering, The detection unit determines a change in the digest value of the location information or the file size acquired by the acquisition unit, and detects tampering of the file as the tampering detection target when the digest value of the location information or the file size has changed.
4. The detection device according to claim 1, characterized in that: When the location information or the file size has changed, the detection unit further determines whether a summary value of the file content has changed, and when the summary value of the file content has changed, the detection unit detects tampering of the file as a tampering detection target.
5. A detection method, performed by a detection device, characterized in that: include: An acquisition step of acquiring location information and file size of a file to be detected for tampering; as well as The detection step determines a change in the position information or the file size acquired in the acquisition step, and detects tampering of the file as the tampering detection target when the position information or the file size has changed.
6. A detection program, which enables a computer to execute the following steps: an acquisition step of acquiring location information and file size of a file to be detected for tampering; and The detection step determines a change in the position information or the file size acquired in the acquisition step, and detects tampering of the file as the tampering detection target when the position information or the file size has changed.
