Vulnerability detection method and system
By selecting matching calibration files and execution files in the historical database for path analysis, suspected vulnerability files are detected, and the problem of large vulnerability detection range and low efficiency in the existing technology is solved, real-time monitoring and interception of high-risk vulnerabilities is achieved, and the improvement of high-risk vulnerabilities is improved. Real-time and efficiency of vulnerability detection.
Patent Information
- Application Number
- CN202410026624.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-09
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-01-09
AI Technical Summary
Among the existing vulnerability detection methods, the vulnerability detection range is large, resulting in large calculation volume, long time and low efficiency, and the inability to effectively narrow the detection range to improve real-time and efficiency.
By selecting the historical execution file matching the content of the execution file as the calibration file in the history database, the path source of the execution file is analyzed, suspected vulnerability files are determined, and the vulnerability level is detected through code matching, and the execution files with new codes are filtered out. , reduce overall computing time and realize real-time monitoring and interception.
Timely intercepting high-risk vulnerabilities is achieved, real-time and efficiency of vulnerability detection is improved, and real-time monitoring and interception of malicious files is ensured.
Smart Images

Figure CN117972714B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software testing, and in particular to a vulnerability detection method and system. Background Art
[0002] The purpose of vulnerability detection is to discover potential security vulnerabilities in software, systems or networks and to repair them in a timely manner to prevent attackers from exploiting these vulnerabilities for malicious activities. Common vulnerabilities include firmware update vulnerabilities, command injection vulnerabilities, information leakage vulnerabilities, buffer overflow vulnerabilities, etc. Common vulnerability detection methods include using vulnerability scanning tools to actively scan the target system, input the target program and monitor its execution status to capture abnormal program behavior and discover vulnerabilities, and analyze the static properties of software and systems to discover vulnerabilities. However, how to customize vulnerability scanning strategies based on system characteristics and requirements is becoming a topic of concern to technicians.
[0003] Chinese patent publication number: CN114048488B, discloses a vulnerability detection method and system, the technical point of which is to implement vulnerability detection of the application to be detected based on IAST by running the implanted detection code during the application running stage; it can be seen that the existing vulnerability detection methods lack a method for pre-detecting the execution process to narrow the scope of vulnerability detection, reduce the calculation of vulnerability detection of all executable files, and timely intercept executable files containing high-risk vulnerabilities, thereby improving the real-time and efficiency of vulnerability detection. Summary of the invention
[0004] To this end, the present invention provides a vulnerability detection method to overcome the problem in the prior art that due to the large vulnerability detection range, the execution file calculation amount is large and the calculation time is long, resulting in low vulnerability detection efficiency.
[0005] To achieve the above object, the present invention provides a vulnerability detection method.
[0006] Step S1, determining a number of executable files within a target detection range for active scanning and detection, and obtaining file type information, file path information, component code, and file transmission information corresponding to each of the executable files, wherein the file transmission information includes a file location start point and a file location end point;
[0007] Step S2, for any of the execution files, obtaining the corresponding file type information file and transmission information, and selecting a matching historical execution file in the historical database as a calibration file;
[0008] Step S3, obtaining the standard path information of the calibration file determined in step S2 and matching it with the current path information corresponding to the execution file to determine whether the currently detected execution file is a suspected vulnerability file;
[0009] Step S4, obtaining all suspected vulnerability files detected in the step S3, performing code matching on any of the suspected vulnerability files according to the standard code segment in the corresponding calibration file, determining whether to store the corresponding execution file in the historical database according to the code matching result, determining the difference code segment of the execution file, determining whether the corresponding suspected vulnerability file is a vulnerability file according to the character length of the difference code segment, performing vulnerability scanning on the vulnerability file, and classifying each vulnerability into a circumventable vulnerability and a non-circumventable vulnerability according to the scanning result;
[0010] Step S5, classifying the executable files into circumventable vulnerability files and non-circumventable vulnerability files according to the vulnerability types, storing the repairable vulnerability files in the first register, and storing the non-repairable vulnerability files in the second register.
[0011] Furthermore, in step S3, for the currently detected execution file and the corresponding calibration file, the file path information of the execution file is obtained and recorded as the current path information, the standard path information of the calibration file is obtained and matched with the current path information.
[0012] If the standard path information of the calibration file is consistent with the current path information corresponding to the execution file, it is determined that the currently detected execution file has no vulnerability. When the execution file completes the execution operation, the execution file is stored in the historical database, and a matching determination is performed between the next execution file and the corresponding calibration file;
[0013] If the standard path information of the calibration file is inconsistent with the current path information corresponding to the execution file, the currently detected execution file is determined to be a suspected vulnerability file, and the next execution file is continued to be matched with the corresponding calibration file.
[0014] Furthermore, in step S4, all suspected vulnerability files detected in step S3 are obtained, and the corresponding code segments are matched and determined. For any of the suspected vulnerability files, its constituent codes are extracted, and the standard variable code segments in the constituent codes are deleted to obtain the code segments to be detected of the suspected vulnerability files, and the standard code segments of the calibration files are obtained. The code segments to be detected are matched with the standard code segments, and each unmatched difference code segment between the calibration file and the suspected vulnerability file is determined and marked as a suspected vulnerability code segment, until the matching and determination of the code segment corresponding to the suspected vulnerability file is completed, and the suspected vulnerability file is determined.
[0015] If there is no suspected vulnerability code segment in the suspected vulnerability file, it is determined that the suspected vulnerability file does not have a vulnerability, and when the execution file completes the execution operation, the execution file is stored in the historical database, and the code segment corresponding to the next suspected vulnerability file is determined;
[0016] If there are suspected vulnerability code segments in the suspected vulnerability file, vulnerability detection and determination are performed on each suspected vulnerability code segment in the suspected vulnerability file to determine whether the suspected vulnerability file has a vulnerability.
[0017] Furthermore, if it is determined that there is a suspected vulnerability code segment in the suspected vulnerability file, a length determination is performed on any suspected vulnerability code segment in the suspected vulnerability file, the character length of the suspected vulnerability code segment is obtained and recorded as the real-time character length, the corresponding code segment in the calibration file corresponding to the suspected vulnerability file is obtained and recorded as the standard character length, and the real-time character length of the suspected vulnerability code segment is compared with the standard character length.
[0018] If the real-time character length is less than or equal to the standard character length, the suspected vulnerability code segment is determined to be normal, and the next suspected vulnerability code segment in the suspected vulnerability file is determined, until the length of the suspected vulnerability code segment in the suspected vulnerability file is determined, and the suspected vulnerability file is again subjected to the above-mentioned extraction of its constituent codes, and the corresponding code segment is matched and determined;
[0019] If the real-time character length is greater than or equal to the standard character length, the suspected vulnerability code segment is determined to be a vulnerability, and the currently detected executable file is a vulnerability file. Any vulnerability in the vulnerability file is obtained and matched with each preset memory vulnerability in the vulnerability resource database to classify the vulnerability.
[0020] Further, in step S4, when it is determined that the real-time character length is greater than or equal to the standard character length, the suspected vulnerability code segment is determined to be a vulnerability, and the currently detected executable file is determined to be a vulnerability file. For any of the vulnerability files, any vulnerability in the vulnerability file is obtained, and the vulnerability is matched with each preset memory vulnerability in the vulnerability resource database.
[0021] If there is a preset memory vulnerability matching the vulnerability in the vulnerability resource database, determining that the vulnerability is an circumventable vulnerability;
[0022] If there is no preset memory vulnerability matching the vulnerability in the vulnerability resource database, the vulnerability is determined to be an unavoidable vulnerability.
[0023] Further, for any vulnerability file, each vulnerability in the vulnerability file is obtained, and each vulnerability is matched with each preset memory vulnerability in the vulnerability resource database, and each vulnerability in the vulnerability file is determined according to the vulnerability resource database.
[0024] If there is a preset memory vulnerability that matches a vulnerability in the vulnerability file, the vulnerability is determined to be an circumventable vulnerability;
[0025] If there is no preset memory vulnerability that matches the vulnerabilities in the vulnerability file, the vulnerability is determined to be an unavoidable vulnerability.
[0026] Furthermore, in step S2, the file type information and file transfer information of any execution file are obtained, and the file type information and file transfer information of the execution file are matched with the file types corresponding to each historical execution file in the historical database.
[0027] If there are historical execution files corresponding to the file type information and file transfer information of the execution file in the history database, the corresponding historical execution files are recorded as files to be selected, and the accumulated time difference is determined according to the standard time difference to screen the files to be selected, and selectable files are screened out;
[0028] If there is no historical execution file corresponding to the file type information and file transfer information of the execution file in the history database, the execution file is determined to be a vulnerable file.
[0029] Furthermore, in the step S2, a standard time difference value for selecting a file to be selected is set. When it is determined that there are historical execution files corresponding to the file type information and file transfer information of the execution file in the historical database, the corresponding historical execution files are recorded as files to be selected, and the execution time information corresponding to any of the files to be selected is obtained and recorded as the historical execution time for screening, and the current execution time of the execution file is obtained. The accumulated time difference value is calculated based on the historical execution time of the file to be selected and the current execution time of the execution file, and the accumulated time difference is determined based on the standard time difference value.
[0030] If the accumulated time difference is less than or equal to the standard time difference, the corresponding to-be-selected file is marked as a selectable file, the real-time similarity is calculated, and each real-time similarity is compared with the standard similarity to determine the calibration file corresponding to the execution file;
[0031] If the accumulated time difference is greater than the standard time difference, the corresponding file to be selected will be marked as an unselectable file and deleted, and the above-mentioned operation of obtaining the file type information and file transfer information of any execution file will be repeated to match the file type information and file transfer information of the execution file with the file types corresponding to each historical execution file in the historical database.
[0032] Furthermore, when it is determined that the cumulative time difference is less than or equal to the standard time difference, the corresponding file to be selected is recorded as a selectable file, the content similarity between the execution file and each selectable file is calculated respectively, and the selectable file with the highest content similarity is selected as the calibration file corresponding to the execution file.
[0033] Furthermore, the present invention also provides a vulnerability detection system, which is applicable to the above-mentioned vulnerability detection method, comprising:
[0034] A history database for storing a number of historical execution files, wherein the historical execution files include file type information, file path information, component codes, and file transmission information, wherein the file transmission information includes a file location start point and a file location end point;
[0035] The detector is used to actively scan and detect several executable files within the target detection range, determine the files to be selected according to the file type information of the executable files and the historical executable files, and determine the selectable files and calibration files according to the content similarity between the executable files and each of the files to be selected;
[0036] A vulnerability resource database, used to store a number of preset memory vulnerabilities and the name, description, cause, impact range, level and repair method of each preset memory vulnerability;
[0037] A scanner is used to scan the vulnerable file, determine whether the vulnerable file is repairable according to the preset memory vulnerabilities and corresponding vulnerability repair methods in the vulnerability resource database, and intercept and process the unrepairable file;
[0038] The first register is used to store a repairable vulnerability file;
[0039] The second register is used to store the unrepairable vulnerability file;
[0040] An analyzer is connected to the detector, the scanner, the first register and the second register respectively; the analyzer is used to control the operation of the detector and the scanner, to determine whether each of the executable files is a vulnerable file based on the detection result of the detector, to store the files with repairable vulnerabilities in the first register, and to store the files with unrepairable vulnerabilities in the second register.
[0041] Compared with the prior art, the beneficial effect of the present invention lies in that, by selecting historical execution files that match the execution file content in the historical database as calibration files and analyzing the path source of the execution file, the execution files of unknown origin are preliminarily determined to be suspected vulnerability files, and by performing code matching on the suspected vulnerability files, it is detected whether new code is entered, and by performing vulnerability matching on the new code segments to determine the vulnerability level, high-risk vulnerabilities are intercepted in time, and real-time monitoring and interception of malicious files are achieved. By screening out execution files with new code for vulnerability matching, the calculation time of the overall execution file is reduced to increase the real-time performance of the detection.
[0042] In particular, the transmission paths of the execution file and the corresponding calibration file are compared to detect the source of the execution file. If it is determined that the standard path information of the calibration file is consistent with the current path information corresponding to the execution file, it means that the execution file and the calibration file have not only the same content but also the same transmission path. In this case, the execution file is determined to be safe and the historical database is expanded by storing it in the historical database. If it is determined that the standard path information of the calibration file is inconsistent with the current path information corresponding to the execution file, the execution file may have been tampered with and further analysis is required.
[0043] Furthermore, by preprocessing the code, that is, deleting irrelevant code segments of the suspected vulnerability file, it is convenient to match the constituent code in the suspected vulnerability file with the standard code segments in the calibration file to extract the unmatched vulnerability code, avoid judging irrelevant code segments as vulnerability code, improve matching accuracy, and ensure effective vulnerability detection. If it is determined that there is no suspected vulnerability code segment in the suspected vulnerability file, the execution file is stored in the historical database to expand the historical database and improve the accuracy of the next execution file matching the calibration file. If it is determined that there is a suspected vulnerability code segment in the suspected vulnerability file, the character length of the suspected vulnerability code segment is further determined to determine whether the suspected vulnerability code segment is a vulnerability.
[0044] In particular, the character length of the suspected vulnerability code segment is determined to determine whether there is any new code input. If the real-time character length is determined to be less than or equal to the standard character length, it means that the character length of the suspected vulnerability code segment is reduced, which may be caused by code loss, but it is not a malicious file. Therefore, it is determined that there is no vulnerability here. If the real-time character length is determined to be greater than or equal to the standard character length, it means that there is a new code segment input, and further vulnerability detection is required to accurately determine whether the code segment is the input vulnerability code.
[0045] Furthermore, by setting up a vulnerability resource database, each vulnerability in the vulnerability file is analyzed. If it is determined that there is a preset memory vulnerability that matches the vulnerability in the vulnerability file, it means that the vulnerability can be avoided. If it is determined that there is no preset memory vulnerability that matches the vulnerability in the vulnerability file, it means that the vulnerability cannot be avoided and is a high-risk vulnerability. The execution file containing the high-risk vulnerability is intercepted in time to reduce the chance of executing malicious files and realize real-time monitoring and interception of malicious files.
[0046] In particular, executable files containing high-risk vulnerabilities are intercepted, and executable files containing repairable vulnerabilities are repaired, so as to monitor and analyze the behavior of executable files, and intercept them in time when suspicious behavior is found, so as to limit and control the operation of executable files.
[0047] Furthermore, by setting strict security policies, that is, detecting specific functional types of execution files, historical execution files are all safe files. If it is determined that there is a historical execution file corresponding to the file type and transmission location in the historical database, it means that from the file type and transmission location, the type of the execution file is the same as the historical execution file. It is necessary to further determine the historical execution file that is the same as the execution file to ensure the effectiveness and accuracy of vulnerability detection.
[0048] Furthermore, by screening the selected files, historical execution files with a long execution time are deleted, the amount of calculation for content similarity is reduced, the real-time performance of screening calibration files is increased, and at the same time, the timeliness of calibration file selection is improved to ensure selection accuracy.
[0049] Furthermore, by determining the content similarity of historical execution files with the same features as the execution file, and selecting the selectable file with the highest similarity as the calibration file, the accuracy of the selected calibration file is guaranteed, thereby ensuring the effective implementation of the vulnerability test. A historical execution file is selected as the calibration file corresponding to the execution file to avoid detection logic disorder and ensure the stability of the detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 A schematic diagram of a vulnerability detection method according to an embodiment of the present invention;
[0051] Figure 2 A logic flow chart for determining whether an executable file is a vulnerable file according to an embodiment of the present invention;
[0052] Figure 3 A logic flow chart for selecting a calibration file corresponding to an execution file according to an embodiment of the present invention;
[0053] Figure 4 Schematic diagram of a vulnerability detection system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0054] In order to make the objects and advantages of the present invention more clearly understood, the present invention is further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0055] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.
[0056] It should be noted that, in the description of the present invention, terms such as "up", "down", "left", "right", "inside" and "outside" indicating directions or positional relationships are based on the directions or positional relationships shown in the drawings. This is merely for the convenience of description and does not indicate or imply that the device or element must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on the present invention.
[0057] In addition, it should be noted that in the description of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0058] See also Figure 1 As shown, it is a schematic diagram of the process of a vulnerability detection method according to an embodiment of the present invention. The present invention provides a vulnerability detection method, comprising:
[0059] Step S1, determining a number of executable files within a target detection range for active scanning and detection, and obtaining file type information, file path information, component code, and file transmission information corresponding to each of the executable files, wherein the file transmission information includes a file location start point and a file location end point;
[0060] Step S2, for any of the execution files, obtaining the corresponding file type information file and transmission information, and selecting a matching historical execution file in the historical database as a calibration file;
[0061] Step S3, obtaining the standard path information of the calibration file determined in step S2 and matching it with the current path information corresponding to the execution file to determine whether the currently detected execution file is a suspected vulnerability file;
[0062] Step S4, obtaining all suspected vulnerability files detected in the step S3, performing code matching on any of the suspected vulnerability files according to the standard code segment in the corresponding calibration file, determining whether to store the corresponding execution file in the historical database according to the code matching result, determining the difference code segment of the execution file, determining whether the corresponding suspected vulnerability file is a vulnerability file according to the character length of the difference code segment, performing vulnerability scanning on the vulnerability file, and classifying each vulnerability into a circumventable vulnerability and a non-circumventable vulnerability according to the scanning result;
[0063] Step S5, classifying the executable files into circumventable vulnerability files and non-circumventable vulnerability files according to the vulnerability types, storing the repairable vulnerability files in the first register, and storing the non-repairable vulnerability files in the second register.
[0064] By selecting historical execution files that match the execution file content in the historical database as calibration files and analyzing the path source of the execution file, the execution files of unknown origin are preliminarily determined to be suspected vulnerability files, and by performing code matching on the suspected vulnerability files, it is detected whether new code is entered. By performing vulnerability matching on the new code segments, the vulnerability level is determined, and high-risk vulnerabilities are intercepted in time to achieve real-time monitoring and interception of malicious files. By screening out execution files with new code for vulnerability matching, the calculation time of the overall execution file is reduced to increase the real-time performance of detection.
[0065] See also Figure 2 As shown, it is a logic flow chart of determining whether an executable file is a vulnerable file according to an embodiment of the present invention;
[0066] Specifically, in step S3, for the currently detected execution file and the corresponding calibration file, the file path information of the execution file is obtained and recorded as the current path information, the standard path information of the calibration file is obtained and matched with the current path information.
[0067] If the standard path information of the calibration file is consistent with the current path information corresponding to the execution file, it is determined that the currently detected execution file has no vulnerability. When the execution file completes the execution operation, the execution file is stored in the historical database, and a matching determination is performed between the next execution file and the corresponding calibration file;
[0068] If the standard path information of the calibration file is inconsistent with the current path information corresponding to the execution file, the currently detected execution file is determined to be a suspected vulnerability file, and the next execution file is continued to be matched with the corresponding calibration file.
[0069] By comparing the transmission paths of the execution file and the corresponding calibration file, the source of the execution file is detected. If it is determined that the standard path information of the calibration file is consistent with the current path information corresponding to the execution file, it means that the execution file and the calibration file have not only the same content but also the same transmission path. In this case, the execution file is determined to be safe and stored in the historical database to expand the historical database. If it is determined that the standard path information of the calibration file is inconsistent with the current path information corresponding to the execution file, the execution file may have been tampered with and further analysis is required.
[0070] Specifically, in step S4, all suspected vulnerability files detected in step S3 are obtained, and the corresponding code segments are matched and determined. For any of the suspected vulnerability files, its constituent codes are extracted, and the standard variable code segments in the constituent codes are deleted to obtain the code segments to be detected of the suspected vulnerability files, and the standard code segments of the calibration files are obtained. The code segments to be detected are matched with the standard code segments, and each unmatched difference code segment between the calibration file and the suspected vulnerability file is determined and marked as a suspected vulnerability code segment, until the matching determination of the code segment corresponding to the suspected vulnerability file is completed, and the suspected vulnerability file is determined.
[0071] If there is no suspected vulnerability code segment in the suspected vulnerability file, it is determined that the suspected vulnerability file does not have a vulnerability, and when the execution file completes the execution operation, the execution file is stored in the historical database, and the code segment corresponding to the next suspected vulnerability file is determined;
[0072] If there are suspected vulnerability code segments in the suspected vulnerability file, vulnerability detection and determination are performed on each suspected vulnerability code segment in the suspected vulnerability file to determine whether the suspected vulnerability file has a vulnerability.
[0073] The standard variable code segments in the code components of the suspected vulnerability files are irrelevant code segments, which generally include extra blank lines, spaces, and comment information;
[0074] By preprocessing the code, that is, deleting irrelevant code segments in the suspected vulnerability file, it is convenient to match the constituent code in the suspected vulnerability file with the standard code segments in the calibration file to extract the unmatched vulnerability code, avoid judging irrelevant code segments as vulnerability code, improve matching accuracy, and ensure effective vulnerability detection. If it is determined that there is no suspected vulnerability code segment in the suspected vulnerability file, the execution file is stored in the historical database to expand the historical database and improve the accuracy of the next execution file matching the calibration file. If it is determined that there is a suspected vulnerability code segment in the suspected vulnerability file, the character length of the suspected vulnerability code segment is further determined to determine whether the suspected vulnerability code segment is a vulnerability.
[0075] Specifically, if it is determined that there is a suspected vulnerability code segment in the suspected vulnerability file, the length of any suspected vulnerability code segment in the suspected vulnerability file is determined, the character length of the suspected vulnerability code segment is obtained and recorded as the real-time character length, the corresponding code segment in the calibration file corresponding to the suspected vulnerability file is obtained and recorded as the standard character length, and the real-time character length of the suspected vulnerability code segment is compared with the standard character length.
[0076] If the real-time character length is less than or equal to the standard character length, the suspected vulnerability code segment is determined to be normal, and the next suspected vulnerability code segment in the suspected vulnerability file is determined, until the length of the suspected vulnerability code segment in the suspected vulnerability file is determined, and the suspected vulnerability file is again subjected to the above-mentioned extraction of its constituent codes, and the corresponding code segment is matched and determined;
[0077] If the real-time character length is greater than or equal to the standard character length, the suspected vulnerability code segment is determined to be a vulnerability, and the currently detected executable file is a vulnerability file. Any vulnerability in the vulnerability file is obtained and matched with each preset memory vulnerability in the vulnerability resource database to classify the vulnerability.
[0078] The character length of the suspected vulnerability code segment is determined to determine whether there is any new code input. If the real-time character length is determined to be less than or equal to the standard character length, it means that the character length of the suspected vulnerability code segment is reduced, which may be caused by code loss, but it is not a malicious file. Therefore, it is determined that this is not a vulnerability. If the real-time character length is determined to be greater than or equal to the standard character length, it means that there is a new code segment input, and further vulnerability detection is required to accurately determine whether the code segment is the input vulnerability code.
[0079] Specifically, in step S4, when it is determined that the real-time character length is greater than or equal to the standard character length, the suspected vulnerability code segment is determined to be a vulnerability, and the currently detected executable file is determined to be a vulnerability file. For any of the vulnerability files, any vulnerability in the vulnerability file is obtained, and it is matched with each preset memory vulnerability in the vulnerability resource database.
[0080] If there is a preset memory vulnerability matching the vulnerability in the vulnerability resource database, determining that the vulnerability is an circumventable vulnerability;
[0081] If there is no preset memory vulnerability matching the vulnerability in the vulnerability resource database, the vulnerability is determined to be an unavoidable vulnerability.
[0082] By setting up a vulnerability resource database, each vulnerability in the vulnerability file is analyzed. If it is determined that there is a preset memory vulnerability that matches the vulnerability in the vulnerability file, it means that the vulnerability can be avoided. If it is determined that there is no preset memory vulnerability that matches the vulnerability in the vulnerability file, it means that the vulnerability cannot be avoided and is a high-risk vulnerability. In this way, the execution file containing the high-risk vulnerability is intercepted in time to reduce the chance of executing malicious files and realize real-time monitoring and interception of malicious files.
[0083] Specifically, for any vulnerable file,
[0084] If all vulnerabilities are circumventable vulnerabilities, the vulnerability file is determined to be a repairable vulnerability file;
[0085] If there is an unavoidable vulnerability, the vulnerability file is determined to be an unrepairable vulnerability file and is intercepted.
[0086] Intercept executable files with high-risk vulnerabilities and repair executable files with repairable vulnerabilities to monitor and analyze the behavior of executable files. When suspicious behavior is found, intercept it in time to limit and control the operation of executable files.
[0087] See also Figure 3 As shown, it is a logic flow chart of selecting a calibration file corresponding to an execution file according to an embodiment of the present invention;
[0088] Specifically, in step S2, the file type information and file transfer information of any execution file are obtained, and the file type information and file transfer information of the execution file are matched with the file types corresponding to each historical execution file in the historical database.
[0089] If there are historical execution files corresponding to the file type information and file transfer information of the execution file in the history database, the corresponding historical execution files are recorded as files to be selected, and the accumulated time difference is determined according to the standard time difference to screen the files to be selected, and selectable files are screened out;
[0090] If there is no historical execution file corresponding to the file type information and file transfer information of the execution file in the history database, the execution file is determined to be a vulnerable file.
[0091] The file type information includes the data structure and file format of the file. The same file type means that both the data structure and the file format are the same.
[0092] By setting strict security policies, that is, detecting specific functional types of executable files, historical executable files are all safe files. If it is determined that there is a historical executable file corresponding to this file type and transmission location in the historical database, it means that from the file type and transmission location, the type of the executable file is the same as the historical executable file. It is necessary to further determine the historical executable file that is the same as the executable file to ensure the effectiveness and accuracy of vulnerability detection.
[0093] Specifically, in step S2, a standard time difference value for selecting a file to be selected is set. When it is determined that there are historical execution files corresponding to the file type information and file transfer information of the execution file in the historical database, the corresponding historical execution files are recorded as files to be selected, and the execution time information corresponding to any of the files to be selected is obtained and recorded as the historical execution time for screening, and the current execution time of the execution file is obtained. The accumulated time difference is calculated based on the historical execution time of the file to be selected and the current execution time of the execution file, and the accumulated time difference is determined based on the standard time difference.
[0094] If the accumulated time difference is less than or equal to the standard time difference, the corresponding to-be-selected file is marked as a selectable file, the real-time similarity is calculated, and each real-time similarity is compared with the standard similarity to determine the calibration file corresponding to the execution file;
[0095] If the accumulated time difference is greater than the standard time difference, the corresponding file to be selected will be marked as an unselectable file and deleted, and the above-mentioned operation of obtaining the file type information and file transfer information of any execution file will be repeated to match the file type information and file transfer information of the execution file with the file types corresponding to each historical execution file in the historical database.
[0096] The standard time difference value set in this embodiment represents the time interval between the execution time of the currently detected execution file and the historical execution file, and can be set to 30 days or 3 months;
[0097] By screening the files to be selected, historical execution files with a long execution time are deleted, the amount of calculation for content similarity is reduced, the real-time performance of screening calibration files is increased, and at the same time, the timeliness of calibration file selection is improved to ensure the accuracy of selection.
[0098] Specifically, when it is determined that the cumulative time difference is less than or equal to the standard time difference, the corresponding file to be selected is recorded as a selectable file, the content similarity between the execution file and each selectable file is calculated respectively, and the selectable file with the highest content similarity is selected as the calibration file corresponding to the execution file.
[0099] In this embodiment, the content similarity between an executable file and an optional file is calculated by using a hash value verification method, by segmenting the codes of the executable file and the optional file, obtaining the code fragments of the executable file and the corresponding optional file after segmentation, calculating the hash value of each segment, and the ratio of the number of segments with the same hash value to the total number of segments, to obtain the content similarity between the executable file and the file to be selected;
[0100] By determining the content similarity of historical execution files with the same features as the execution file, and selecting the selectable file with the highest similarity as the calibration file, the accuracy of the selected calibration file is guaranteed, thereby ensuring the effective implementation of vulnerability testing. A historical execution file is selected as the calibration file corresponding to the execution file to avoid detection logic disorder and ensure detection stability.
[0101] See also Figure 4 As shown, it is a schematic diagram of a vulnerability detection system according to an embodiment of the present invention;
[0102] Specifically, the present invention provides a vulnerability detection system, which is applicable to the above-mentioned vulnerability detection method, comprising:
[0103] A history database for storing a number of historical execution files, wherein the historical execution files include file type information, file path information, component codes, and file transmission information, wherein the file transmission information includes a file location start point and a file location end point;
[0104] The detector is used to actively scan and detect several executable files within the target detection range, determine the files to be selected according to the file type information of the executable files and the historical executable files, and determine the selectable files and calibration files according to the content similarity between the executable files and each of the files to be selected;
[0105] A vulnerability resource database, used to store a number of preset memory vulnerabilities and the name, description, cause, impact range, level and repair method of each preset memory vulnerability;
[0106] A scanner is used to scan the vulnerable file, determine whether the vulnerable file is repairable according to the preset memory vulnerabilities and corresponding vulnerability repair methods in the vulnerability resource database, and intercept and process the unrepairable file;
[0107] The first register is used to store a repairable vulnerability file;
[0108] The second register is used to store the unrepairable vulnerability file;
[0109] An analyzer is connected to the detector, the scanner, the first register and the second register respectively; the analyzer is used to control the operation of the detector and the scanner, to determine whether each of the executable files is a vulnerable file based on the detection result of the detector, to store the files with repairable vulnerabilities in the first register, and to store the files with unrepairable vulnerabilities in the second register.
[0110] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.
[0111] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A vulnerability detection method, characterized in that: include, Step S1, determining a number of executable files within a target detection range for active scanning and detection, and obtaining file type information, file path information, component code, and file transmission information corresponding to each of the executable files, wherein the file transmission information includes a file location start point and a file location end point; Step S2, for any of the execution files, obtaining the corresponding file type information file and transmission information, and selecting a matching historical execution file in the historical database as a calibration file; Step S3, obtaining the standard path information of the calibration file determined in step S2 and matching it with the current path information corresponding to the execution file to determine whether the currently detected execution file is a suspected vulnerability file; Step S4, obtaining all suspected vulnerability files detected in the step S3, performing code matching on any of the suspected vulnerability files according to the standard code segment in the corresponding calibration file, determining whether to store the corresponding execution file in the historical database according to the code matching result, determining the difference code segment of the execution file, determining whether the corresponding suspected vulnerability file is a vulnerability file according to the character length of the difference code segment, performing vulnerability scanning on the vulnerability file, and classifying each vulnerability into a circumventable vulnerability and a non-circumventable vulnerability according to the scanning result; Wherein, in the step S4, all the suspected vulnerability files detected in the step S3 are obtained, and the corresponding code segments are matched and determined. For any of the suspected vulnerability files, its constituent codes are extracted, and the standard variable code segments in the constituent codes are deleted to obtain the code segments to be detected of the suspected vulnerability files, and the standard code segments of the calibration files are obtained, and the code segments to be detected are matched with the standard code segments, and each unmatched difference code segment between the calibration file and the suspected vulnerability file is determined and marked as a suspected vulnerability code segment, until the matching determination of the code segment corresponding to the suspected vulnerability file is completed, and the suspected vulnerability file is determined. If there is no suspected vulnerability code segment in the suspected vulnerability file, it is determined that the suspected vulnerability file does not have a vulnerability, and when the execution file completes the execution operation, the execution file is stored in the historical database, and the code segment corresponding to the next suspected vulnerability file is determined; If there is a suspected vulnerability code segment in the suspected vulnerability file, vulnerability detection and determination are performed on each suspected vulnerability code segment in the suspected vulnerability file to determine whether the suspected vulnerability file has a vulnerability; If it is determined that there is a suspected vulnerability code segment in the suspected vulnerability file, the length of any suspected vulnerability code segment in the suspected vulnerability file is determined, the character length of the suspected vulnerability code segment is obtained and recorded as the real-time character length, the corresponding code segment in the calibration file corresponding to the suspected vulnerability file is obtained and recorded as the standard character length, and the real-time character length of the suspected vulnerability code segment is compared with the standard character length. If the real-time character length is less than or equal to the standard character length, the suspected vulnerability code segment is determined to be normal, and the next suspected vulnerability code segment in the suspected vulnerability file is determined, until the length of the suspected vulnerability code segment in the suspected vulnerability file is determined, and the suspected vulnerability file is again subjected to the above-mentioned extraction of its constituent codes, and the corresponding code segment is matched and determined; If the real-time character length is greater than or equal to the standard character length, the suspected vulnerability code segment is determined to be a vulnerability, and the currently detected executable file is determined to be a vulnerability file. For any vulnerability file, obtain any vulnerability in the vulnerability file and match it with each preset memory vulnerability in the vulnerability resource database. If there is a preset memory vulnerability matching the vulnerability in the vulnerability resource database, determining that the vulnerability is an circumventable vulnerability; If there is no preset memory vulnerability matching the vulnerability in the vulnerability resource database, the vulnerability is determined to be an unavoidable vulnerability; Step S5, classifying the executable files into circumventable vulnerability files and non-circumventable vulnerability files according to the vulnerability types, storing the repairable vulnerability files in the first register, and storing the non-repairable vulnerability files in the second register.
2. The vulnerability detection method according to claim 1, characterized in that: In step S3, For the currently detected execution file and the corresponding calibration file, the file path information of the execution file is obtained and recorded as the current path information, the standard path information of the calibration file is obtained and matched with the current path information. If the standard path information of the calibration file is consistent with the current path information corresponding to the execution file, it is determined that the currently detected execution file has no vulnerability. When the execution file completes the execution operation, the execution file is stored in the historical database, and a matching determination is performed between the next execution file and the corresponding calibration file; If the standard path information of the calibration file is inconsistent with the current path information corresponding to the execution file, the currently detected execution file is determined to be a suspected vulnerability file, and the next execution file is continued to be matched with the corresponding calibration file.
3. The vulnerability detection method according to claim 1, characterized in that: The classification results of each vulnerability in each vulnerability file are obtained, and each vulnerability file is classified into a repairable vulnerability file and an unrepairable vulnerability file.
4. The vulnerability detection method according to claim 1, characterized in that: In the step S2, the file type information and file transfer information of any execution file are obtained, and the file type information and file transfer information of the execution file are matched with the file types corresponding to each historical execution file in the historical database. If there are historical execution files corresponding to the file type information and file transfer information of the execution file in the history database, the corresponding historical execution files are recorded as files to be selected, and the accumulated time difference is determined according to the standard time difference to screen the files to be selected, and selectable files are screened out; If there is no historical execution file corresponding to the file type information and file transfer information of the execution file in the history database, the execution file is determined to be a vulnerable file.
5. The vulnerability detection method according to claim 4, characterized in that: In the step S2, a standard time difference value for selecting a file to be selected is set. When it is determined that there are historical execution files corresponding to the file type information and file transfer information of the execution file in the historical database, the corresponding historical execution files are recorded as files to be selected, and the execution time information corresponding to any of the files to be selected is obtained and recorded as the historical execution time for screening, and the current execution time of the execution file is obtained. The accumulated time difference value is calculated based on the historical execution time of the file to be selected and the current execution time of the execution file, and the accumulated time difference is determined based on the standard time difference value. If the accumulated time difference is less than or equal to the standard time difference, the corresponding to-be-selected file is marked as a selectable file, the real-time similarity is calculated, and each real-time similarity is compared with the standard similarity to determine the calibration file corresponding to the execution file; If the accumulated time difference is greater than the standard time difference, the corresponding file to be selected will be marked as an unselectable file and deleted, and the above-mentioned operation of obtaining the file type information and file transfer information of any execution file will be repeated to match the file type information and file transfer information of the execution file with the file types corresponding to each historical execution file in the historical database.
6. The vulnerability detection method according to claim 5, characterized in that: When it is determined that the accumulated time difference is less than or equal to the standard time difference, the corresponding file to be selected is recorded as a selectable file, the content similarity between the execution file and each selectable file is calculated respectively, and the selectable file with the highest content similarity is selected as the calibration file corresponding to the execution file.
7. A vulnerability detection system, based on the vulnerability detection method according to any one of claims 1 to 6, characterized in that: include, A history database for storing a number of historical execution files, wherein the historical execution files include file type information, file path information, component codes, and file transmission information, wherein the file transmission information includes a file location start point and a file location end point; The detector is used to actively scan and detect several executable files within the target detection range, determine the files to be selected according to the file type information of the executable files and the historical executable files, and determine the selectable files and calibration files according to the content similarity between the executable files and each of the files to be selected; A vulnerability resource database, used to store a number of preset memory vulnerabilities and the name, description, cause, impact range, level and repair method of each preset memory vulnerability; A scanner is used to scan the vulnerable file, determine whether the vulnerable file is repairable according to the preset memory vulnerabilities and corresponding vulnerability repair methods in the vulnerability resource database, and intercept and process the unrepairable file; The first register is used to store a repairable vulnerability file; The second register is used to store the unrepairable vulnerability file; An analyzer is connected to the detector, the scanner, the first register and the second register respectively; the analyzer is used to control the operation of the detector and the scanner, to determine whether each of the executable files is a vulnerable file based on the detection result of the detector, to store the files with repairable vulnerabilities in the first register, and to store the files with unrepairable vulnerabilities in the second register.
Citation Information
Patent Citations
Vulnerability Detection Methods and Systems
CN114048488B
Special information service software vulnerability fixing system based on white lists
CN104573525A
Code detection system and code detection method
CN115795488A
Cited By
Software vulnerability intelligent detection and repair method oriented to network and information security
CN120180446A
A software vulnerability intelligent detection and repair method for network and information security
CN120180446B
