Data scanning method, device, electronic device and storage medium for network target range
By using hash functions to process data point expectations and scanning results in the network range, the connectivity problem between scanning devices is solved, the reliability and accuracy of data scanning are improved, and the integrity of the scanning data is ensured.
Patent Information
- Application Number
- CN202410793210.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-06-19
AI Technical Summary
In the network shooting range, the complexity of the connection link between the scanning device and the network device makes it impossible to establish a stable real-time link channel, resulting in unreliable scanning data results.
By sending scanning tasks to scanning devices, we use pre-obtained target image data to perform vulnerability scanning, calculate expected hash vectors of data points and scan hash vectors, determine missing data for vulnerabilities, and perform data set clustering through hash functions to improve analysis. efficiency.
It improves the reliability and accuracy of data scanning in network shooting ranges, reduces the amount of calculated data for subsequent analysis and processing, avoids connectivity problems, and ensures the integrity of scanned data.
Smart Images

Figure CN118368148B
Abstract
Description
Technical Field
[0001] The present application relates to the field of network security technology, and in particular to a data scanning method, device, electronic device and storage medium for a network target range. Background Art
[0002] The Federal Cyber Range is a highly advanced environment for cybersecurity training and drills. It simulates the real-world network environment of federal member units, including complex topologies and various attack scenarios. Security professionals can conduct real-time monitoring and feedback in this environment to improve their skills in dealing with various network threats, while ensuring resource isolation so that operations of different teams do not interfere with each other. In addition, before the test activities, it is necessary to conduct all-round asset detection and vulnerability scanning of the virtual topology where the activities will be carried out, providing basic and complete asset data and vulnerability data for subsequent attack detection work.
[0003] In the related art, when data scanning is performed in a network range, a scanning device usually establishes a real-time connection channel with multiple network devices in the network, and then uses the connection channel to perform real-time scanning of the asset data and vulnerability data on multiple network devices, and then obtains the asset scanning results and vulnerability scanning results of multiple network devices in the network range from the scanning device. However, due to the complexity of the connection links between the various network devices in the network range, there is a connectivity problem that a stable real-time link channel cannot be established between the scanning device and the network device during the scanning process, resulting in unreliable scanning data results. Summary of the invention
[0004] The embodiments of the present application provide a data scanning method, device, electronic device and storage medium in a network target range, which can improve the reliability of data scanning in the network target range.
[0005] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a data scanning method for a network range, the method comprising:
[0006] Sending a scanning task to a scanning device, wherein the scanning task includes target image data, and the target image data is image data corresponding to at least one network device in a network target range;
[0007] Receive vulnerability scanning data obtained by the scanning device through a vulnerability scanning of the target image data, wherein the vulnerability scanning data includes at least one data point scanning result;
[0008] Acquire at least one data point expected result, calculate a data point expected hash vector of the data point expected result according to a first hash function, and obtain at least one data set according to the data point expected hash vector;
[0009] A data point scan hash vector corresponding to each data point scan result is calculated according to the first hash function, and in the data set, vulnerability missing data of the data point scan result is determined according to the data point scan hash vector and the data point expected hash vector.
[0010] In some embodiments, the data point expected result includes data item expected results corresponding to multiple data items, and obtaining at least one data set according to the data point expected hash vector includes:
[0011] Splitting the data point expected hash vector based on the number of the data items to obtain a data item expected vector corresponding to each of the data item expected results;
[0012] The expected hash value corresponding to each of the data item expected vectors is calculated using a second hash function, and the data item expected vectors are divided into corresponding data sets according to the expected hash values.
[0013] In some embodiments, the data point scanning result includes a data item scanning result corresponding to at least one of the data items, and in the data set, determining the vulnerability missing data of the data point scanning result according to the data point scanning hash vector and the data point expected hash vector includes:
[0014] Splitting the data point scanning results to obtain a data item scanning vector corresponding to each data item scanning result;
[0015] In each of the data sets, the similarity between each of the data item scan vectors and the data item expected vector is calculated one by one, and based on the similarity, the data item expected vector corresponding to the data item scan vector is determined to match;
[0016] The missing data is determined according to the unmatched data item expected vectors in each of the data sets, and the missing data includes at least one data item completion vector.
[0017] In some embodiments, after determining that the vulnerability is missing data, the method further includes:
[0018] Determine, according to the sorting position of the data item, a missing position corresponding to the missing data of the data item of the data point scanning result;
[0019] Selecting the data item completion vector according to the missing position as the missing data of the data item to complete the data point scanning result;
[0020] A data point supplement vector having a quantity consistent with the quantity difference between the expected result of the data point and the scan result of the data point is generated according to the data item completion vector and the sorting position of the data item.
[0021] In some embodiments, generating a data point supplement vector having a quantity consistent with a quantity difference between the data point expected result and the data point scan result according to the data item completion vector and the sorting position of the data item includes:
[0022] Combining the plurality of data item completion vectors according to the sorting positions to obtain a plurality of candidate completion vectors;
[0023] The candidate completion vector is matched with the expected hash vector of the data point, and according to the matching result, the data point supplement vector consistent with the quantity difference is selected from the expected hash vector of the data point.
[0024] In some embodiments, sending the scanning task to the scanning device includes:
[0025] Determine task information of the scanning task, and determine a target scanning device from a plurality of scanning devices based on the task information;
[0026] Determining a target calling interface based on device information of the target scanning device;
[0027] The scanning task is sent to the target scanning device using the target calling interface.
[0028] In some embodiments, the mirror data is multiple, and before sending the scanning task to the scanning device, the method further includes:
[0029] Determine at least one scanned image data and an image identifier corresponding to each scanned image data from the plurality of image data based on the scan task, wherein the image identifier is used to represent a scan state of the scanned image data within a preset time;
[0030] When the image identifier indicates that the scanned image data is data that has not been scanned recently or contains updated data recently, the scanned image data is used as the target image data.
[0031] In some embodiments, when the scanning task includes a resource scanning task, the method further includes:
[0032] Receiving resource scanning data obtained by the scanning device performing resource scanning on the target image data;
[0033] Perform missing analysis on the resource scanning data one by one to determine the resource missing data in the resource scanning data.
[0034] In some embodiments, performing missing analysis on the resource scanning data to determine the resource missing data in the resource scanning data includes:
[0035] Determine resource association information between resource data in the resource scanning data, and construct a resource association map based on the resource association information;
[0036] Determine the resource data circulation relationship based on the resource association graph, obtain the resource dependency relationship, and determine the data circulation anomaly information in the resource scan data according to the resource dependency relationship and the resource data circulation relationship;
[0037] Abnormal resource data is determined according to the data flow abnormality information, and the resource missing data corresponding to the abnormal resource data is determined based on the resource dependency relationship.
[0038] In some embodiments, performing missing analysis on the resource scanning data to determine the resource missing data in the resource scanning data includes:
[0039] Determining a resource type of the resource scanning task, and determining a plurality of reference data attributes of the resource type;
[0040] Determine the data attribute of each resource data in the resource scan data, and match the data attribute with the reference data attribute to obtain an attribute matching result;
[0041] Determine the missing data attribute from the plurality of reference data attributes according to the attribute matching result;
[0042] The resource missing data is determined according to the vulnerability missing data attribute.
[0043] In some embodiments, performing missing analysis on the resource scanning data to determine the resource missing data in the resource scanning data includes:
[0044] Acquire historical resource scanning data of the target image data, and determine high-frequency data from the historical resource scanning data;
[0045] When the high-frequency data does not exist in the resource scanning data, the high-frequency data is used as the resource missing data.
[0046] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application proposes a data scanning device for a network range, the device comprising:
[0047] A task sending module, used to send a scanning task to a scanning device, wherein the scanning task includes target image data, and the target image data is image data corresponding to at least one network device in a network target range;
[0048] A data receiving module, used to receive vulnerability scanning data obtained by the scanning device through vulnerability scanning of the target image data, wherein the vulnerability scanning data includes at least one data point scanning result;
[0049] A first calculation module, configured to obtain at least one data point expected result, calculate a data point expected hash vector of the data point expected result according to a first hash function, and obtain at least one data set according to the data point expected hash vector;
[0050] The second calculation module is used to calculate the data point scanning hash vector corresponding to each data point scanning result according to the first hash function, and determine the vulnerability missing data of the data point scanning result in the data set according to the data point scanning hash vector and the data point expected hash vector.
[0051] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, it implements the data scanning method of the network target range as described in the first aspect.
[0052] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a storage medium, which is a computer-readable storage medium, and the storage medium stores a computer program. When the computer program is executed by a processor, the data scanning method of the network target range described in the first aspect is implemented.
[0053] The data scanning method, device, electronic device and storage medium of a network target range proposed in the embodiments of the present application, the method comprises: first, sending a scanning task to a scanning device, the scanning task including target image data, the target image data being image data corresponding to at least one network device in the network target range; then, receiving vulnerability scanning data obtained by performing a vulnerability scan on the target image data by the scanning device, the vulnerability scanning data including at least one data point scanning result; next, obtaining at least one data point expected result, calculating a data point expected hash vector of the data point expected result according to a first hash function, and obtaining at least one data set according to the data point expected hash vector; finally, calculating a data point scanning hash vector corresponding to each data point scanning result according to the first hash function, and determining, in the data set, the vulnerability missing data of the data point scanning result according to the data point scanning hash vector and the data point expected hash vector. The embodiment of the present application utilizes pre-obtained target mirror data that matches the data of the network device to transform the connection problem between the scanning device and multiple network devices in the network target range into the connection problem between the scanning device and its own server, thereby avoiding the connectivity problems that may occur in the network target range, and utilizes the scanning device to connect to its own server and scan the target mirror data to improve the reliability of data scanning in the network target range; in addition, utilizing the data point expected hash vector obtained from the real-time data point scanning result and the data point scanning hash vector obtained from the pre-obtained data point expected result, the data point scanning results and the data point expected result mirror are clustered to reduce the amount of calculated data for subsequent analysis and processing, and further utilizing the data point expected hash vector and the data point scanning hash vector in each set to determine the vulnerability scanning data in the scanning data, thereby improving the accuracy and reliability of data scanning in the network target range.
[0054] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 It is a flow chart of a data scanning method for a network target range provided in one embodiment of the present application.
[0056] Figure 2 This is a flowchart of filtering image data provided by another embodiment of the present application.
[0057] Figure 3 This is a schematic diagram of a mirror identification container provided in yet another embodiment of the present application.
[0058] Figure 4 yes Figure 1 Flow chart of step 101 in FIG.
[0059] Figure 5 yes Figure 1 Flow chart of step 103 in FIG.
[0060] Figure 6 It is a flowchart of dividing data items in a data point expected result into corresponding data sets provided by another embodiment of the present application.
[0061] Figure 7 yes Figure 1 Flow chart of step 104 in FIG.
[0062] Figure 8 This is a flowchart for determining a supplementary vector of a data point provided by another embodiment of the present application.
[0063] Fig. 9 yes Figure 8 Flowchart of step 803 in FIG.
[0064] Fig.10 It is a schematic diagram of a flow chart of determining a supplementary vector of a data point provided by yet another embodiment of the present application.
[0065] Fig.11 This is a flowchart of obtaining and analyzing resource scanning data provided by another embodiment of the present application.
[0066] Fig.12 This is a flowchart of the first type of analyzing resource scanning data provided by another embodiment of the present application.
[0067] Fig.13 This is a flowchart of a second type of analyzing resource scanning data provided by another embodiment of the present application.
[0068] Fig.14 This is a flowchart of a third type of analyzing resource scanning data provided by another embodiment of the present application.
[0069] Fig.15 It is a flow chart of a data scanning method for a network target range provided in yet another embodiment of the present application.
[0070] Fig.16 It is a structural schematic diagram of a data scanning device for a network target range provided in one embodiment of the present application.
[0071] Fig.17 It is a schematic diagram of the hardware structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0072] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0073] It should be noted that although the functional modules are divided in the device schematic and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart.
[0074] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0075] First, some nouns involved in this application are analyzed:
[0076] A cyber range is an environment designed specifically for conducting cybersecurity drills and real-life simulations. It provides a secure virtual network environment that simulates real attack scenarios, allowing security experts and network administrators to train and practice network attack and defense. A cyber range typically includes a variety of virtual machines, containers, and network devices that can be used to simulate various network attacks, such as DDoS attacks, vulnerability exploits, malware propagation, etc. Security personnel can use the cyber range to conduct real-life drills, improve their ability to respond to cyber attacks, and test the effectiveness of their defense measures.
[0077] MinHash is a technique for quickly determining the similarity between two sets. It is often used for approximate similarity analysis of large-scale data sets, especially in search engines, recommendation systems, and data deduplication. MinHash takes advantage of the permutation invariance of sets and estimates the Jaccard similarity between sets by randomly permuting set elements and comparing their minimum hash values.
[0078] Locality Sensitive Hashing (LSH) is an algorithm for finding similar items or similar sets. It is very useful for searching similar items in large-scale data sets, especially in high-dimensional data spaces. The core idea of LSH is to map similar data to the same bucket in the hash space, so that potential similar item candidates can be generated by querying the bucket. In this way, even slight changes in the data can ensure that it is mapped to the same bucket, thereby improving the search efficiency. Specifically, LSH selects a suitable family of hash functions to make similar data more likely to collide in the hash space. This allows us to quickly narrow the search range and find potential similar items using fewer computing resources. The LSH algorithm is applicable to many fields, such as nearest neighbor search, similarity matching, deduplication, and recommendation systems.
[0079] Elasticsearch is an open source distributed search and analysis engine for storing, retrieving, and analyzing large-scale structured and unstructured data. When we say "write ES", we mean writing data to Elasticsearch for subsequent search, query, and analysis operations. Before writing ES, you need to connect to the Elasticsearch cluster and perform related write operations, such as creating indexes, specifying mappings, and preparing document data. Writing ES pushes data to Elasticsearch so that you can perform various operations on the data, such as full-text search and aggregation analysis, to extract useful information and insights.
[0080] The Federal Cyber Range is a highly advanced environment for cybersecurity training and drills. It simulates the real-world network environment of federal member units, including complex topologies and various attack scenarios. Security professionals can conduct real-time monitoring and feedback in this environment to improve their skills in dealing with various network threats, while ensuring resource isolation so that operations of different teams do not interfere with each other. In addition, before the test activities, it is necessary to conduct all-round asset detection and vulnerability scanning of the virtual topology where the activities will be carried out, providing basic and complete asset data and vulnerability data for subsequent attack detection work.
[0081] In the related art, when data scanning is performed in a network range, a scanning device usually establishes a real-time connection channel with multiple network devices in the network, and then uses the connection channel to perform real-time scanning of the asset data and vulnerability data on multiple network devices, and then obtains the asset scanning results and vulnerability scanning results of multiple network devices in the network range from the scanning device. However, due to the complexity of the connection links between the various network devices in the network range, there is a connectivity problem that a stable real-time link channel cannot be established between the scanning device and the network device during the scanning process, resulting in unreliable scanning data results.
[0082] In order to improve the reliability of data scanning in a network target range, an embodiment of the present application utilizes pre-obtained target mirror data that matches the data of the network device to transform the connection problem between the scanning device and multiple network devices in the network target range into a connection problem between the scanning device and its own server, thereby avoiding connectivity problems that may occur in the network target range, and utilizes the scanning device to connect to its own server and scan the target mirror data to improve the reliability of data scanning in the network target range; in addition, utilizing the data point expected hash vector obtained from the real-time data point scanning results and the data point scanning hash vector obtained from the pre-obtained data point expected results, the data point scanning results and the data point expected result mirrors are clustered to reduce the amount of computational data for subsequent analysis and processing, and further utilizing the data point expected hash vector and the data point scanning hash vector in each set to determine vulnerability scanning data in the scanning data, thereby improving the accuracy and reliability of data scanning in the network target range.
[0083] The following will further describe the data scanning method, device, electronic device and storage medium of the network range provided by the embodiments of the present application. The data scanning method of the network range provided by the embodiments of the present application can be applied to any network device or control server in the network range.
[0084] The following will describe in detail the data scanning method of the network range in the embodiment of the present application. Figure 1 , which is an optional flow chart of the data scanning method of the network target range provided in the embodiment of the present application, Figure 1 The method in the embodiment may include but is not limited to steps 101 to 104. Figure 1 The order of step 101 to step 104 is not specifically limited, and the order of steps can be adjusted or some steps can be reduced or added according to actual needs.
[0085] Step 101: Send a scanning task to a scanning device.
[0086] The following is a detailed description of step 101.
[0087] In some embodiments, in the network target range, after responding to the execution request of the scanning task, the target mirror data to be scanned will first be determined from the multiple mirror data stored in its own memory based on the scanning task, wherein each mirror data is mirror data corresponding to the data of any network device in the network target range. These mirror data are data information obtained from each network device when the own device can establish a connection with each network device, and are stored in the memory of the own device, and the data acquisition process of the mirror data does not need to be carried out in real time and stably, and even multiple data can be acquired to obtain complete mirror data, so there is no need to establish a stable communication link in real time at the time of data scanning, thereby improving the reliability of data scanning. The following will further describe how to determine the target mirror data.
[0088] Reference Figure 2 Before sending the scanning task to the scanning device, the data scanning method of the network target range also includes the following steps 201 to 202.
[0089] Step 201: determining at least one scanned image data and an image identifier corresponding to each scanned image data from a plurality of image data based on a scan task.
[0090] Step 202: When the image identifier indicates that the scanned image data is data that has not been scanned recently or contains updated data recently, the scanned image data is used as the target image data.
[0091] Steps 201 to 202 are described in detail below.
[0092] In some embodiments, in order to further improve the data scanning rate, a corresponding mirror identification is set for each mirror data in the own device. Figure 3 As shown, it is a schematic diagram of a mirror identification container provided by an embodiment of the present application, such as Figure 3 As shown, two containers (including a first container and a second container) are also set in the device itself, wherein the first container is used to store the image identifiers corresponding to the image data that has been scanned recently, and the second container is used to store the image identifiers corresponding to the image data that has not been scanned recently and has been updated recently. It can be understood that the recent period refers to the length of time within the preset time, and the preset time can be customized according to the user's needs, or it can be a fixed length of time (such as 6 hours, one day, one week, etc.).
[0093] In some embodiments, after responding to the scanning task, at least one scanning image data and an image identifier corresponding to each scanning image data are determined from the multiple image data stored in the internal memory based on the task information carried by the scanning task, and then based on the image identifier corresponding to the scanning image data, it is determined whether the scanning image data is data that has not been scanned recently or contains updated data recently. When the image identifier corresponding to the scanning image data indicates that the scanning image data is data that has not been scanned recently or contains updated data recently, the scanning image data is used as the target image data that needs to be scanned for this scanning task.
[0094] Through the above steps 201 to 202, the scanned image data is distinguished by using the image identifier, and the scanned image data that has not been scanned recently or contains updated data recently is used as the target image data to be scanned; and the scanning task of the scanned image data that has been scanned recently and is updated is not executed, and the recent scanned data is directly used as the scanning result of the scanned image data, thereby effectively improving the execution efficiency of the scanning task.
[0095] In some embodiments, after the target image data is determined based on the scanning task, it is necessary to call a suitable scanning device to perform a task scan on the target image data. The following will further describe how to call the scanning device to perform the task scan.
[0096] Reference Figure 4 , sending a scanning task to a scanning device, including the following steps 401 to 405.
[0097] Step 401: Determine task information of a scanning task, and determine a target scanning device from a plurality of scanning devices based on the task information.
[0098] Step 402: Determine a target calling interface based on the device information of the target scanning device.
[0099] Step 403: Send the scanning task to the target scanning device using the target calling interface.
[0100] Steps 401 to 403 are described in detail below.
[0101] In some embodiments, in a network target range, the scanning task includes at least one of a vulnerability scanning task and a resource scanning task, and there are scanning devices for implementing different scanning functions, such as vulnerability scanning devices, resource scanning devices, and all-purpose scanning devices. Therefore, after obtaining the scanning task, it is necessary to determine the scanning device that can execute the task information and is idle as the target scanning device based on the task information of the scanning task; after determining the target scanning device, the target call interface between the own device and the target scanning device is determined based on the device information between the own device and the target scanning device, such as serial port matching information; next, the scanning task is sent to the target scanning device using the target call interface, so that the target scanning device can establish a communication connection with the own device through the target call interface, and perform data scanning on the target image data in the own device.
[0102] In some embodiments, the scanning task sent to the target scanning device includes the image identification of the target image data, the image name, the account password of the network device corresponding to the target image data in the network target range, the IP address of the network device, and the operating system type.
[0103] In some embodiments, during the data scanning process of the target scanning device, the own device can also use the target call interface to send a scanning status request to the target scanning device to obtain scanning status information such as scanning progress information of the target scanning device during data scanning, so as to monitor the scanning process to ensure the orderly execution of multiple scanning tasks. The scanning status request sent includes an imageId list to be queried, and the imageId list is a set of identifiers containing multiple image objects. Each image object is assigned a unique imageId for identifying and referencing the image in the system.
[0104] Through the above steps 401 to 403, the task information of the scanning task is used to determine the appropriate scanning device, and the device information of the scanning device and the own device is used to determine the appropriate calling interface, thereby improving the reliability and stability of the task scanning during data scanning.
[0105] Step 102: Receive vulnerability scanning data obtained by a scanning device performing vulnerability scanning on target image data.
[0106] Step 102 is described in detail below.
[0107] In some embodiments, when the scanning task includes a vulnerability scanning task, and after the scanning device completes the vulnerability scanning of the target image data, the vulnerability scanning data obtained by the scanning device performing the vulnerability scanning of the target image data is received, so as to facilitate the subsequent analysis and processing of the vulnerability scanning data to obtain the scanning result corresponding to the vulnerability scanning task. It is understandable that in the process of performing the vulnerability scanning of the target image data, it is usually necessary to perform vulnerability scanning of different functions on multiple data items in the target image data, so the obtained vulnerability scanning data also includes the data point scanning result.
[0108] Step 103: Obtain at least one data point expected result, calculate a data point expected hash vector of the data point expected result according to the first hash function, and obtain at least one data set according to the data point expected hash vector.
[0109] Step 103 is described in detail below.
[0110] In some embodiments, in addition to obtaining vulnerability scanning data, due to the hardware limitation of the scanning device or the software limitation of the scanning program or even the instability of the scanning link established in real time, the obtained vulnerability scanning data may contain missing vulnerability data. In order to accurately determine the missing vulnerability data in the vulnerability scanning data, it is also necessary to obtain the vulnerability expected data composed of the expected results of multiple data points. It is understandable that the vulnerability expected data can be a complete and correct vulnerability scanning data in the historical scanning data of the target image data, or it can be the default data of the vulnerability scanning corresponding to the target image data.
[0111] After obtaining the vulnerability expected data, the data point expected hash vector of the expected result of each data point is calculated according to the first Hash function, so as to obtain at least one data set according to the data point expected vector. The following will first describe how to calculate the data point expected hash vector of the data point expected data according to the first Hash function.
[0112] In some embodiments, since each data point expected result is a scan expected result corresponding to each scan item in the target image data, each data point expected result includes multiple data items, such as vulnerability type, host information, vulnerability level, etc., that is, the data point expected result is a text information vector. Next, the text information of each item in the data point expected result is vectorized and converted into digital information to generate a data point expected vector corresponding to the data point expected result; next, the hash vector of the data point expected vector is calculated using the first hash function to obtain the data point expected hash vector.
[0113] In some embodiments, the first hash function may be MinHash, and the data point expected hash vector obtained by calculating the data point expected vector through MinHash is a signature matrix, and its specific calculation method is consistent with the conventional MinHash calculation method.
[0114] After obtaining the data point expected hash vector corresponding to each data point expected vector, multiple data items will be divided according to the data point expected hash vector to obtain multiple data sets, so as to facilitate the subsequent missing data of vulnerabilities in each data set, with a lower number of data calculations, thereby improving the efficiency of finding missing data of vulnerabilities. The following will further describe the process of obtaining data sets according to the data point expected hash vector.
[0115] Reference Figure 5 , obtaining at least one data set according to the expected hash vector of the data point, including the following steps 501 to 502.
[0116] Step 501: Split the data point expected hash vector based on the number of data items to obtain the data item expected vector corresponding to the expected result of each data item.
[0117] Step 502: Calculate the expected hash value corresponding to each data item expected vector using the second hash function, and divide the data item expected vector into corresponding data sets according to the expected hash value.
[0118] Steps 501 to 502 are described in detail below.
[0119] In some embodiments, the data point expected result includes data item expected results corresponding to multiple data items. After obtaining the data point expected hash vector, the data point expected hash vector will be split based on the number of data items in the data point expected result to obtain the data item expected vector corresponding to each data item expected result. Among them, when the first hash function is MinHash, that is, when the data point expected hash vector is a signature matrix, the data item expected vector corresponding to each data item expected result will be obtained based on each column element of the signature matrix. Next, the expected hash value corresponding to each data item expected vector is calculated using the second hash function, and then each data item expected vector is divided into the corresponding data set according to the numerical similarity between the expected hash values. It can be understood that the similarity of the data item expected vectors in the same data set is relatively high. In addition, the method of dividing the data set can be implemented by drawing on the local sensitive hashing algorithm.
[0120] Through the above steps 501 to 502, the expected vector of each data item is divided into corresponding data sets by utilizing the numerical similarity of the expected hash value corresponding to the expected result of each data item, so as to facilitate the subsequent missing data of vulnerabilities in each data set, thereby improving the efficiency of finding missing data of vulnerabilities with a lower number of data calculations.
[0121] Reference Figure 6 , is a flow chart of dividing the data items in the expected result of a data point into corresponding data sets provided by an embodiment of the present application. Figure 6 As shown, taking the expected results of two data points (i.e., expected data point A1 and expected data point A2) as an example, the expected data point A1 includes text information of three-dimensional data (i.e., [a1-1, a1-2, a1-3]), and the expected data point A2 includes text information of three-dimensional data (i.e., [a2-1, a2-2, a2-3]), firstly, each text information in the expected data point A1 and the expected data point A2 is vectorized to obtain the data point expected vector [A1-1, A1-2, A1-3] corresponding to the expected data point A1 and the data point expected vector [A2-1, A2-2 , A2-3], and then use the first hash function (i.e., MinHash) to calculate the data point expected hash vector [B1-1, B1-2, B1-3] corresponding to the data point expected vector [A1-1, A1-2, A1-3], and the data point expected hash vector [B2-1, B2-2, B2-3] corresponding to the data point expected vector [A2-1, A2-2, A2-3]; Next, the data point expected vectors [B1-1, B1-2, B1-3] and [B2-1, B2-2, B2-3] are split based on the number of data items of the data point expected results to obtain multiple data item expected vectors (such as Figure 6 [B1-1], [B1-2], [B1-3], [B2-1], [B2-2], [B2-3] in the figure), and calculate the hash value for each data item expected vector one by one to obtain the expected hash value corresponding to each data item expected vector (such as Figure 6 [H1-1], [H1-2], [H1-3], [H2-1], [H2-2], [H2-3] as shown), and finally, each expected hash value is divided into the corresponding data set according to the numerical similarity between the expected hash values, such as data set 1 includes [H2-1] and [H1-1], and data set 2 includes [H2-2], [H2-3], [H1-2] and [H1-3].
[0122] Step 104: Calculate the data point scan hash vector corresponding to each data point scan result according to the first hash function, and determine the vulnerability missing data of the data point scan result in the data set according to the data point scan hash vector and the data point expected hash vector.
[0123] Step 104 is described in detail below.
[0124] In some embodiments, after obtaining the vulnerability scan data, in order to determine whether there is missing vulnerability data in the vulnerability scan data, each data item in the vulnerability scan data needs to be divided into the data set obtained in the above steps for matching to determine the missing vulnerability data. Then, in each data set, the missing vulnerability data of the data point scan result is determined based on the data point scan hash vector and the data point expected hash vector. The following will further describe how to determine the missing vulnerability data of the data point scan result based on the data point scan hash vector and the data point expected hash vector in the data set.
[0125] Reference Figure 7 , in a data set, determining vulnerability missing data of a data point scanning result according to a data point scanning hash vector and a data point expected hash vector, including the following steps 701 to 703.
[0126] Step 701: Split the data point scanning result to obtain a data item scanning vector corresponding to each data item scanning result.
[0127] Step 702: In each data set, calculate the similarity between each data item scan vector and the data item expected vector one by one, and determine the data item expected vector that matches the data item scan vector based on the similarity.
[0128] Step 703: Determine the missing data based on the expected vector of unmatched data items in each data set.
[0129] Steps 701 to 703 are described in detail below.
[0130] In some embodiments, similar to the processing method of expected results of data points, each data point scanning result is vectorized to obtain a data point scanning vector corresponding to each data point scanning result, and then the data point scanning hash vector corresponding to each data point scanning vector is calculated using a first hash function. Next, the data point scanning hash vector is split into data item scanning vectors according to the number of data items of the data point scanning result, and a second hash function is used to calculate the scanning hash value of each data item scanning vector, and each scanning hash value is divided into a data set that exists in the expected hash value using the similarity between the scanning hash values.
[0131] Then, in each data set, the similarity between each data item scan vector and the data item expected vector is calculated one by one, so that the data item scan vector and the corresponding data item expected vector whose similarity is higher than the preset similarity threshold are used as the data item expected vector matched by the data item scan vector. The preset similarity threshold can be customized according to user requirements or can be a suitable empirical value obtained from historical matching data.
[0132] In addition, in each data set, the similarity between each data item scan vector and the data item expected vector can be calculated as cosine similarity, specifically, the inner product (or dot product) between the data item scan vector and the data item expected vector is calculated, and the modulus of the data item scan vector and the modulus of the data item expected vector are calculated at the same time. Then, the inner product is divided by the product of the two moduli to obtain the cosine similarity between the data item scan vector and the data item expected vector.
[0133] Next, after each data set is matched pairwise, the expected vectors of the unmatched data items in each data set are combined and determined as the missing vulnerability data in the vulnerability scanning data, and each unmatched data item expected vector is used as a data item completion vector.
[0134] Since the solution provided by this application is based on the scanning task in the network target range, and a major reason for obtaining the scanning data from the scanning task in the network target range is for the subsequent attack or defense by both players, it is necessary to ensure the integrity of the data. Therefore, in order to improve the integrity of the data scan, this application will also fill in the missing data after determining the vulnerability, as described below.
[0135] Reference Figure 8 After determining the missing data of the vulnerability, the data scanning method of the network target range also includes the following steps 801 to 803.
[0136] Step 801: Determine the missing position corresponding to the missing data of the data item in the data point scanning result according to the sorting position of the data item.
[0137] Step 802: Select a data item completion vector as the data item missing data according to the missing position to complete the data point scanning result.
[0138] Step 803: Generate a data point supplement vector that is consistent with the difference between the expected result of the data points and the result of the data point scan according to the data item completion vector and the sorting position of the data items.
[0139] Steps 801 to 803 are described in detail below.
[0140] In some embodiments, since the data point expected result and the data point scan result are the results obtained by the same scan item, the number of data items in the data point expected result and the data point scan result should be the same in principle and the sorting position of the data items should be the same. However, there may be a situation where a data item in a data point scan result is missing. Therefore, after further determining the matching corresponding data point expected result and data point scan result combination according to the above matching result, the data point scan result that is missing a data item is completed. Specifically, the missing position corresponding to the missing data of the data item of the data point scan result is determined according to the sorting position of the data item of the data point expected result, and then the data item completion vector with the sorting position consistent with the missing position is selected from multiple data item completion vectors according to the missing position as the missing data of the data item of the data point scan result, so as to complete the data point scan result, thereby completing the data point scan result.
[0141] In addition, there is a situation where the number of data points in the data point scanning results in the vulnerability scanning data does not match the number of data points in the data point expected results in the vulnerability expected data, that is, the number of data points in the data point expected results is 4, but the number of data points in the data point scanning results is 3. That is, during the data scanning process, there is a situation where a vulnerability scanning item is not scanned due to the hardware limitations of the scanning device itself or the software limitations of the scanning software or even the instability of the scanning link. Therefore, in an embodiment of the present application, a data point supplement vector consistent with the difference in the number of data point expected results and data point scanning results is generated according to the data item completion vector and the sorting position of the data item to complete the vulnerability scanning data. This will be described in further detail below.
[0142] Reference Fig. 9 , according to the data item completion vector and the sorting position of the data item, a data point supplement vector consistent with the difference in quantity between the expected result of the data point and the result of the data point scanning is generated, including the following steps 901 to 902.
[0143] Step 901: Combine multiple data item completion vectors according to sorting positions to obtain multiple candidate completion vectors.
[0144] Step 902: Match the candidate completion vector with the expected hash vector of the data point, and select the data point completion vector that is consistent with the quantity difference from the expected hash vector of the data point according to the matching result.
[0145] Steps 901 to 902 are described in detail below.
[0146] In some embodiments, based on the sorting position of the data items in the expected result of the data point, multiple existing data item completion vectors are traversed and combined to obtain multiple alternative completion vectors, and then the alternative completion vectors are matched with the expected hash vector of the data point one by one. Based on the matching result, the corresponding data point supplementary vector that is consistent with the quantity difference and the matching result characterizes that the alternative completion vector and the data point expected hash vector are consistent is selected from the expected hash vector of the data point, and the data point expected result corresponding to the data point supplementary vector is used to supplement the vulnerability scanning result.
[0147] In some embodiments, there is a situation where the matching result represents that the candidate completion vector and the expected hash vector of the data point are inconsistent, making it impossible to directly find a suitable data point completion vector. Therefore, in order to determine the appropriate data point completion vector, the following specific steps are performed: 1) cosine similarity between the candidate completion vector and the expected hash vector of the data point one by one; 2) selecting the data point completion vector with the highest cosine similarity and the same quantity difference from the multiple expected hash vectors of the data point according to the cosine similarity.
[0148] Reference Fig.10 , is a schematic diagram of a flow chart of determining a data point supplement vector provided in an embodiment of the present application. Fig.10 As shown, 4 data point expected results and 3 data point scan results are taken as an example, and the number of data point expected results is 3. First, through the above steps 103, 501 and 502, the expected hash value of each data item expected vector is used to divide each data item expected vector into a corresponding data set, and the scan hash value of each data item scan vector is used to divide each data item scan vector into a corresponding data set, as shown in FIG. Fig.10 The data sets 1, 2 and 3 shown in the figure are shown in the figure; then, the data item scan vectors and the data item expected vectors are matched one by one by using the similarity between the data item scan vectors and the data item expected vectors to determine the missing items of each data set (i.e., the unmatched data item expected vectors). After that, according to the sorting position, it can be determined that the scanned data point T2 lacks the data item with the sorting position of 3, and according to the other items (T2-1 and T2-2) of the scanned data point T2, they are all matched with the expected data points (S3-1 and S3-2). Therefore, S3-3 in the missing item is used as the missing data of the data item of the scanned data point T2 to complete the scanned data point T2; next, it is determined that the quantitative difference between the data point expected result and the data point scan result is 1, and all the missing items are combined based on the sorting position to obtain the data point supplement vector {S4-1, S4-2, S2-3} to supplement the data point scan result.
[0149] In some embodiments, if the quantitative difference between the expected result of the data point and the scan result of the data point is greater than 1, further processing is required to generate a data point supplementary vector. In this embodiment, the quantitative difference between the expected result of the data point and the scan result of the data point is 2, and there are six missing items (i.e., data item completion vectors), including {[S5-1], [S5-2], [S6-3], [S6-2], [S5-3], [S6-1]} as an example. First, based on the sorting position, all possible candidate completion vectors of these missing items are generated as {S5-1, S5-2, S6-3}, {S5-1, S5-2, S5-3}, etc. Next, the similarity between each candidate completion vector and each data point expected hash vector is calculated one by one, and then the data point expected data corresponding to the two data point expected hash vectors with the highest similarity are selected as the data point supplementary vector to supplement the data point scan result.
[0150] Through the above steps 701 to 702, steps 801 to 803, and steps 901 to 902, the similarity between the data item scan vector and the data item expected vector is used to accurately determine the missing vulnerability scan data in the vulnerability scan result; in addition, the data point scan result is supplemented by the sorting position of the data item and the data item completion vector, and a data point supplement vector is generated to supplement the vulnerability scan result, thereby effectively improving the reliability and integrity of the data scan.
[0151] The above steps describe the processing method for the data scanning method of the network range provided by this application when the scanning task is a vulnerability scanning task. However, the scanning data obtained by performing data scanning in the network range is usually the prerequisite benchmark information for subsequent security professionals to conduct experimental activities in the network range. Therefore, the scanning task should also include the scanning of the asset data of the network devices in the network range. Therefore, when the scanning task includes a resource scanning task, refer to Fig.11 The data scanning method of the network target range also includes the following steps 1101 to 1102.
[0152] Step 1101: receiving resource scanning data obtained by a scanning device performing resource scanning on target image data.
[0153] Step 1102: Perform missing data analysis on the resource scan data one by one to determine the resource missing data in the resource scan data.
[0154] Steps 1101 to 1102 are described in detail below.
[0155] In some embodiments, similar to the above-mentioned receiving of vulnerability scanning data, resource scanning data obtained by a scanning device performing resource scanning on target image data is received. It is understandable that the scanning device may be the same scanning device as the above-mentioned scanning device for performing vulnerability scanning (i.e., the device is a universal scanning device), or may be another scanning device different from the above-mentioned scanning device for performing vulnerability scanning, but both are scanning devices for performing data scanning on target image data.
[0156] After obtaining the resource scanning data, the missing data will be analyzed one by one to determine whether there is missing data in the resource scanning data. If there is, the missing data will be determined. The following will be analyzed based on three analysis methods.
[0157] Reference Fig.12 , performing missing analysis on the resource scanning data to determine the resource missing data in the resource scanning data, including the following steps 1201 to 1203.
[0158] Step 1201: Determine resource association information between resource data in resource scanning data, and construct a resource association map based on the resource association information.
[0159] Step 1202: Determine the resource data circulation relationship based on the resource association map, obtain the resource dependency relationship, and determine the data circulation anomaly information in the resource scan data according to the resource dependency relationship and the resource data circulation relationship.
[0160] Step 1203: Determine abnormal resource data according to the data flow abnormality information, and determine resource missing data corresponding to the abnormal resource data based on resource dependency.
[0161] Steps 1201 to 1203 are described in detail below.
[0162] In some embodiments, after acquiring the resource scanning data, the resource association information between the resource data in the resource scanning data will be determined, and the resource association information will be used to construct a resource association map, for example, through the IP network segment and the target scene information. The data correlation of various resource data in the resource scanning data and the connection mode between them can be determined through the resource association map. Next, while determining the connectivity relationship of the resource data based on the resource association map, the resource dependency relationship between various resource data will also be obtained. It is understandable that the resource dependency relationship can be predetermined based on the data type of the resource data itself, and the resource dependency relationship is usually a default relationship. It is understandable that the resource dependency relationship focuses more on describing the dependency relationship, reference relationship or functional dependency between resources, such as a network processor relies on data input from a network data acquisition tool or a network data input tool to perform data processing and analysis.
[0163] Next, based on resource dependencies and resource data flow relationships, data flow anomaly information in resource scanning data can be determined from the resource association map. For example, if an asset data that requires input data from other asset data to perform data operation outputs data without input data, the output data is identified as data flow anomaly data, and the asset data is identified as abnormal resource data. Based on the resource dependency relationship, the asset data corresponding to the input data of the abnormal resource data is identified as resource missing data.
[0164] Through the above steps 1201 to 1203, the resource data circulation relationship and resource dependency relationship determined by the resource association information of the resource scanning data are used to accurately determine the existing resource missing data from the perspective of data circulation, thereby improving the reliability and accuracy of the data scanning method of the network target range.
[0165] Reference Fig.13 , performing missing analysis on the resource scanning data to determine the resource missing data in the resource scanning data, including the following steps 1301 to 1303.
[0166] Step 1301: Determine the resource type of the resource scanning task, and determine multiple reference data attributes of the resource type.
[0167] Step 1302: Determine the data attribute of each resource data in the resource scan data, and match the data attribute with the reference data attribute to obtain an attribute matching result.
[0168] Step 1303: Determine the missing data attribute from the multiple reference data attributes according to the attribute matching result.
[0169] Step 1304: Determine the resource missing data according to the vulnerability missing data attribute.
[0170] Steps 1301 to 1304 are described in detail below.
[0171] In some embodiments, after obtaining the resource scanning data, the resource type that needs to be scanned in the resource scanning task will first be determined to determine the multiple reference data attributes corresponding to the resource type. It can be understood that these reference data attributes can be the asset default values of the network device, such as the asset status and asset configuration that each resource type should correspond to. Next, the data attributes corresponding to each resource data are determined from the resource scanning data, and then these data attributes are matched one by one with the reference data attributes to obtain the attribute matching result. Next, when the attribute matching result indicates that there is at least one reference data attribute that is not matched in the reference data attribute, these at least one reference data attribute that is not matched is used as the vulnerability missing data attribute, and the resource missing data of the resource scanning data is determined based on all the vulnerability missing data attributes.
[0172] Through the above steps 1301 to 1304, a one-to-one match is performed using the reference data attributes and the data attributes of the resource scanning data to determine at least one reference data attribute that has not been matched, so as to accurately determine the existing missing resource data, thereby improving the reliability and accuracy of the data scanning method of the network target range.
[0173] Reference Fig.14 , performing missing analysis on the resource scanning data to determine the resource missing data in the resource scanning data, including the following steps 1401 to 1402.
[0174] Step 1401: Obtain historical resource scanning data of target image data, and determine high-frequency data from the historical resource scanning data.
[0175] Step 1402: When high-frequency data does not exist in the resource scanning data, the high-frequency data is regarded as resource missing data.
[0176] Steps 1401 to 1402 are described in detail below.
[0177] In some embodiments, in addition to obtaining resource scanning data, multiple historical resource scanning data of the target image data are also obtained, and then high-frequency data with a high frequency of occurrence is determined from the resource data in these historical resource scanning data. Next, the resource scanning data is analyzed. When no high-frequency data appears in the resource scanning data, the high-frequency data is used as resource missing data.
[0178] Through the above steps 1401 to 1402, the high-frequency data of the historical resource scanning data is used to perform data missing analysis on the resource scanning data, so as to accurately determine the existing resource missing data, thereby improving the reliability and accuracy of the data scanning method of the network target range.
[0179] Reference Fig.15, is a flow chart of a data scanning method for a network target range provided by an embodiment of the present application. When the target device receives a scanning task, it will determine the target scanning device from multiple scanning devices based on the scanning task, and determine the target call interface based on the device parameters between the target scanning device and its own device, and call the target call interface; at the same time, it will obtain the image identifier of the scanned image data based on the scanning task, and determine the target image data to be scanned from the scanned image identifier based on the image identifier; next, the scanning task will be distributed to the target scanning device through the target call interface, so as to call the target device to scan the target image data through the target call interface, and after the scanning is completed, the scanning data will be received through the target call interface, and the scanning data will be analyzed and supplemented through the above steps 103 to 104, steps 701 to 703, and steps 1101 to 1102 to obtain complete scanning data.
[0180] In some embodiments, when the device itself performs a scanning task, the following operation steps are also performed.
[0181] 1) Initialize the image identifier ImageId->task identifier ScanJobId mapping table;
[0182] 2) Initialize the task identifier ScanJobId->task information ScanJob mapping table;
[0183] 3) Initialize the waiting queue for the scanning task;
[0184] 4) Initialize the scan task execution area map;
[0185] 5) Schedule scanning tasks every five minutes;
[0186] 5a) Prepare the image data required for task scheduling in the memory;
[0187] 5b) Round-robin all vulnerability scanning subtasks, for each vulnerability scanning subtask: request scanning progress, write ES, update the database, and finally update the memory;
[0188] 5c) Round-robin all resource detection subtasks. For each resource detection subtask: request scan progress, write to ES, update the database, and finally update the memory;
[0189] 5e) Poll the main task, find the completed scanning task and update it in the database;
[0190] 5f) Change the main task from Waiting -> Start; issue the subtask and update it to the Start state.
[0191] The data scanning method, device, electronic device and storage medium of the network target range proposed in the embodiment of the present application, the method first determines at least one scanned mirror data and the mirror identifier corresponding to each scanned mirror data from multiple mirror data based on the scanning task, and when the mirror identifier indicates that the scanned mirror data is data that has not been scanned recently or contains updated data recently, the scanned mirror data is used as the target mirror data; then, the task information of the scanning task is determined, and the target scanning device is determined from multiple scanning devices based on the task information, and the target call interface is determined based on the device information of the target scanning device, and the scanning task is sent to the target scanning device using the target call interface; then, the vulnerability scanning data obtained by the scanning device performing a vulnerability scan on the target mirror data; next, at least one data point expected result is obtained, and a data point expected hash vector of the data point expected result is calculated according to a first hash function, and the data point expected hash vector is split based on the number of data items to obtain a data item expected vector corresponding to each data item expected result, and an expected hash value corresponding to each data item expected vector is calculated using a second hash function, and the data item expected vector is divided into corresponding data sets according to the expected hash value; finally, according to the first hash function, Calculate the data point scan hash vector corresponding to each data point scan result, split the data point scan result in the data set, obtain the data item scan vector corresponding to each data item scan result, calculate the similarity between each data item scan vector and the data item expected vector in each data set, determine the data item expected vector corresponding to the data item scan vector based on the similarity, and determine the vulnerability missing data according to the unmatched data item expected vector in each data set; after determining the vulnerability missing data, determine the missing position corresponding to the data item missing data of the data point scan result according to the sorting position of the data item, select the data item completion vector as the data item missing data according to the missing position to complete the data point scan result, combine multiple data item completion vectors according to the sorting position to obtain multiple candidate completion vectors, match the candidate completion vectors with the data point expected hash vector, and select the data point supplement vector consistent with the quantity difference from the data point expected hash vector according to the matching result; in addition, when the scanning task includes a resource scanning task, receive the resource scanning data obtained by the scanning device performing resource scanning on the target mirror data, perform missing analysis on the resource scanning data one by one, and determine the resource missing data in the resource scanning data.
[0192] The embodiment of the present application utilizes image identification to distinguish scanned image data, and uses scanned image data that has not been scanned recently or contains updated data recently as the target image data to be scanned; and does not execute the scanning task of the scanned image data that has been scanned recently and is updated, and directly uses the recent scanned data as the scanning result of the scanned image data, thereby effectively improving the execution efficiency of the scanning task, and using the task information of the scanning task to determine the appropriate scanning device, and using the device information of the scanning device and its own device to determine the appropriate calling interface, thereby improving the reliability and stability of the task scanning in the data scanning; and, using the pre-obtained target image data that matches the data of the network device, the connection problem between the scanning device and multiple network devices in the network target range is converted into the connection problem between the scanning device and its own server, avoiding the connectivity problem that may occur in the network target range, and using the scanning device to connect to its own server and scan the target image data to improve the reliability of data scanning in the network target range; in addition, using the data point scanning obtained in real time The data point expected hash vector obtained by the result, and the data point scan hash vector obtained by the pre-obtained data point expected result, are used to cluster the data point scan results and the data point expected result mirror images, so as to reduce the amount of calculated data for subsequent analysis and processing, and further use the data point expected hash vector and the data point scan hash vector in each set to determine the vulnerability scan data in the scan data; at the same time, using the numerical similarity of the expected hash value corresponding to the expected result of each data item, each data item expected vector is divided into a corresponding data set, so as to facilitate the subsequent missing vulnerability data in each data set, with a lower number of data calculations, thereby improving the efficiency of finding missing vulnerability data; the similarity between the data item scan vector and the data item expected vector is also used to accurately determine the missing vulnerability scan data in the vulnerability scan result; in addition, the data point scan result is supplemented by the sorting position of the data item and the data item completion vector, and a data point supplement vector for supplementing the vulnerability scan result is generated, thereby effectively improving the accuracy, reliability and integrity of the data scan.
[0193] The present application also provides a network range data scanning device, which can implement the network range data scanning method described above. Fig.16 , the device 1600 comprises:
[0194] The task sending module 1610 is used to send a scanning task to a scanning device, where the scanning task includes target image data, and the target image data is image data corresponding to at least one network device in the network target range;
[0195] A data receiving module 1620 is used to receive vulnerability scanning data obtained by a scanning device performing vulnerability scanning on target image data, where the vulnerability scanning data includes at least one data point scanning result;
[0196] A first calculation module 1630 is used to obtain at least one data point expected result, calculate a data point expected hash vector of the data point expected result according to a first hash function, and obtain at least one data set according to the data point expected hash vector;
[0197] The second calculation module 1640 is used to calculate the data point scan hash vector corresponding to each data point scan result according to the first hash function, and determine the vulnerability missing data of the data point scan result in the data set according to the data point scan hash vector and the data point expected hash vector.
[0198] In some embodiments, the first calculation module 1630 is further configured to:
[0199] Splitting the data point expected hash vector based on the number of the data items to obtain a data item expected vector corresponding to each of the data item expected results;
[0200] The expected hash value corresponding to each of the data item expected vectors is calculated using a second hash function, and the data item expected vectors are divided into corresponding data sets according to the expected hash values.
[0201] In some embodiments, the second calculation module 1640 is further configured to:
[0202] Splitting the data point scanning results to obtain a data item scanning vector corresponding to each data item scanning result;
[0203] In each of the data sets, the similarity between each of the data item scan vectors and the data item expected vector is calculated one by one, and based on the similarity, the data item expected vector corresponding to the data item scan vector is determined to match;
[0204] The missing data is determined according to the unmatched data item expected vectors in each of the data sets, and the missing data includes at least one data item completion vector.
[0205] In some embodiments, the data scanning device 1600 of the network range further includes a vulnerability data completion module 1650, and the vulnerability data completion module 1650 is used to:
[0206] Determine, according to the sorting position of the data item, a missing position corresponding to the missing data of the data item of the data point scanning result;
[0207] Selecting the data item completion vector according to the missing position as the missing data of the data item to complete the data point scanning result;
[0208] A data point supplement vector having a quantity consistent with the quantity difference between the expected result of the data point and the scan result of the data point is generated according to the data item completion vector and the sorting position of the data item.
[0209] In some embodiments, the vulnerability data completion module 1650 is further configured to:
[0210] Combining the plurality of data item completion vectors according to the sorting positions to obtain a plurality of candidate completion vectors;
[0211] The candidate completion vector is matched with the expected hash vector of the data point, and according to the matching result, the data point supplement vector consistent with the quantity difference is selected from the expected hash vector of the data point.
[0212] In some embodiments, the task sending module 1610 is further used to:
[0213] Determine task information of the scanning task, and determine a target scanning device from a plurality of scanning devices based on the task information;
[0214] Determining a target calling interface based on device information of the target scanning device;
[0215] The scanning task is sent to the target scanning device using the target calling interface.
[0216] In some embodiments, the data scanning device 1600 of the network range further includes an image filtering module 1660, and the image filtering module 1660 is used to:
[0217] Determine at least one scanned image data and an image identifier corresponding to each scanned image data from the plurality of image data based on the scan task, wherein the image identifier is used to represent a scan state of the scanned image data within a preset time;
[0218] When the image identifier indicates that the scanned image data is data that has not been scanned recently or contains updated data recently, the scanned image data is used as the target image data.
[0219] In some embodiments, the data scanning device 1600 of the network range further includes a resource data analysis module 1670, and the resource data analysis module 1670 is used to:
[0220] Receiving resource scanning data obtained by the scanning device performing resource scanning on the target image data;
[0221] Perform missing analysis on the resource scanning data one by one to determine the resource missing data in the resource scanning data.
[0222] In some embodiments, the resource data analysis module 1670 is further configured to:
[0223] Determine resource association information between resource data in the resource scanning data, and construct a resource association map based on the resource association information;
[0224] Determine the resource data circulation relationship based on the resource association graph, obtain the resource dependency relationship, and determine the data circulation anomaly information in the resource scan data according to the resource dependency relationship and the resource data circulation relationship;
[0225] Abnormal resource data is determined according to the data flow abnormality information, and the resource missing data corresponding to the abnormal resource data is determined based on the resource dependency relationship.
[0226] In some embodiments, the resource data analysis module 1670 is further configured to:
[0227] Determining a resource type of the resource scanning task, and determining a plurality of reference data attributes of the resource type;
[0228] Determine the data attribute of each resource data in the resource scan data, and match the data attribute with the reference data attribute to obtain an attribute matching result;
[0229] Determine the missing data attribute from the plurality of reference data attributes according to the attribute matching result;
[0230] The resource missing data is determined according to the vulnerability missing data attribute.
[0231] In some embodiments, the resource data analysis module 1670 is further configured to:
[0232] Acquire historical resource scanning data of the target image data, and determine high-frequency data from the historical resource scanning data;
[0233] When the high-frequency data does not exist in the resource scanning data, the high-frequency data is used as the resource missing data.
[0234] In the above embodiments, the description of each embodiment has its own emphasis. For the part that is not described in detail in a certain embodiment, the specific implementation method of the data scanning device of the network target range is basically the same as the specific implementation method of the data scanning method of the above-mentioned network target range, and will not be repeated here.
[0235] In the embodiment of the present application, the data scanning device of the network target range uses the image identifier to distinguish the scanned image data, and uses the scanned image data that has not been scanned recently or contains updated data recently as the target image data to be scanned; and does not execute the scanning task of the scanned image data that has been scanned recently and is updated, and directly uses the recent scanned data as the scanning result of the scanned image data, thereby effectively improving the execution efficiency of the scanning task, and uses the task information of the scanning task to determine the appropriate scanning device, and uses the device information of the scanning device and its own device to determine the appropriate calling interface, thereby improving the reliability and stability of the task scanning in the data scanning; and, using the pre-obtained target image data that matches the data of the network device, the connection problem between the scanning device and multiple network devices in the network target range is converted into the connection problem between the scanning device and its own server, avoiding the connectivity problems that may occur in the network target range, and using the scanning device to connect to its own server and scan the target image data to improve the reliability of data scanning in the network target range; in addition, using the real-time obtained The data point expected hash vector obtained from the data point scanning result and the data point scanning hash vector obtained from the data point expected result obtained in advance are used to cluster the data point scanning results and the data point expected result mirror images to reduce the amount of calculated data for subsequent analysis and processing, and further determine the vulnerability scanning data in the scanned data using the data point expected hash vector and the data point scanning hash vector in each set; at the same time, each data item expected vector is divided into a corresponding data set using the numerical similarity of the expected hash value corresponding to the expected result of each data item, so as to facilitate the subsequent missing vulnerability data in each data set, thereby improving the efficiency of finding missing vulnerability data with a lower number of data calculations; the similarity between the data item scanning vector and the data item expected vector is also used to accurately determine the missing vulnerability scanning data in the vulnerability scanning result; in addition, the data point scanning result is supplemented by the sorting position of the data item and the data item completion vector, and a data point supplement vector for supplementing the vulnerability scanning result is generated, thereby effectively improving the accuracy, reliability and integrity of the data scanning.
[0236] The present application also provides an electronic device, including:
[0237] at least one memory;
[0238] at least one processor;
[0239] at least one program;
[0240] The program is stored in the memory, and the processor executes the at least one program to implement the data scanning method of the network range implemented in the present application. The electronic device can be any intelligent terminal including a mobile phone, a tablet computer, a personal digital assistant (PDA), a car computer, etc.
[0241] See also Fig.17 , Fig.17 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0242] The processor 1701 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0243] The memory 1702 can be implemented in the form of ROM (Read Only Memory), static storage device, dynamic storage device or RAM (Random Access Memory). The memory 1702 can store operating systems and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1702, and the processor 1701 calls and executes the data scanning method of the network range in the embodiments of this application;
[0244] Input / output interface 1703, used to implement information input and output;
[0245] Communication interface 1704, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0246] A bus 1705 that transmits information between various components of the device (e.g., the processor 1701, the memory 1702, the input / output interface 1703, and the communication interface 1704);
[0247] The processor 1701 , the memory 1702 , the input / output interface 1703 and the communication interface 1704 are connected to each other in communication within the device via the bus 1705 .
[0248] An embodiment of the present application also provides a storage medium, which is a computer-readable storage medium. The storage medium stores a computer program, and when the computer program is executed by a processor, the data scanning method of the network target range is implemented.
[0249] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0250] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0251] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0252] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0253] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0254] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0255] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0256] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0257] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0258] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0259] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0260] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A data scanning method for a network range, characterized in that: The method comprises: Sending a scanning task to a scanning device, wherein the scanning task includes target image data, and the target image data is image data corresponding to at least one network device in a network target range; Receive vulnerability scanning data obtained by the scanning device through a vulnerability scanning of the target image data, wherein the vulnerability scanning data includes at least one data point scanning result; Acquire at least one data point expected result, calculate a data point expected hash vector of the data point expected result according to a first hash function, and obtain at least one data set according to the data point expected hash vector; Calculate the data point scan hash vector corresponding to each of the data point scan results according to the first hash function, and determine the vulnerability missing data of the data point scan result in the data set according to the data point scan hash vector and the data point expected hash vector; The data point expected result includes data item expected results corresponding to multiple data items, and obtaining at least one data set according to the data point expected hash vector includes: Splitting the data point expected hash vector based on the number of the data items to obtain a data item expected vector corresponding to each of the data item expected results; Calculating the expected hash value corresponding to each of the expected vectors of the data items by using a second hash function, and dividing the expected vectors of the data items into corresponding data sets according to the expected hash values; The data point scanning result includes a data item scanning result corresponding to at least one of the data items, wherein in the data set, determining the vulnerability missing data of the data point scanning result according to the data point scanning hash vector and the data point expected hash vector includes: Splitting the data point scanning results to obtain a data item scanning vector corresponding to each data item scanning result; In each of the data sets, the similarity between each of the data item scan vectors and the data item expected vector is calculated one by one, and based on the similarity, the data item expected vector corresponding to the data item scan vector is determined to match; The missing data is determined according to the unmatched data item expected vectors in each of the data sets, and the missing data includes at least one data item completion vector.
2. The data scanning method of the network target range according to claim 1 is characterized in that: After determining that the vulnerability is missing data, the method further includes: Determine, according to the sorting position of the data item, a missing position corresponding to the missing data of the data item of the data point scanning result; Selecting the data item completion vector according to the missing position as the missing data of the data item to complete the data point scanning result; A data point supplement vector having a quantity consistent with the quantity difference between the expected result of the data point and the scan result of the data point is generated according to the data item completion vector and the sorting position of the data item.
3. The data scanning method of the network target range according to claim 2 is characterized in that: The step of generating a data point supplement vector having a quantity consistent with a quantity difference between the expected result of the data point and the scan result of the data point according to the data item completion vector and the sorting position of the data item comprises: Combining the plurality of data item completion vectors according to the sorting positions to obtain a plurality of candidate completion vectors; The candidate completion vector is matched with the expected hash vector of the data point, and according to the matching result, the data point supplement vector consistent with the quantity difference is selected from the expected hash vector of the data point.
4. The data scanning method of the network target range according to claim 1, characterized in that: The sending of the scanning task to the scanning device includes: Determine task information of the scanning task, and determine a target scanning device from a plurality of scanning devices based on the task information; Determining a target calling interface based on device information of the target scanning device; The scanning task is sent to the target scanning device using the target calling interface.
5. The data scanning method of the network target range according to claim 1 is characterized in that: The mirror data is multiple, and before sending the scanning task to the scanning device, the method further includes: Determine at least one scanned image data and an image identifier corresponding to each scanned image data from the plurality of image data based on the scan task, wherein the image identifier is used to represent a scan state of the scanned image data within a preset time; When the image identifier indicates that the scanned image data is data that has not been scanned recently or contains updated data recently, the scanned image data is used as the target image data.
6. The data scanning method of the network target range according to claim 1, characterized in that: When the scanning task includes a resource scanning task, the method further includes: Receiving resource scanning data obtained by the scanning device performing resource scanning on the target image data; Perform missing analysis on the resource scanning data one by one to determine the resource missing data in the resource scanning data.
7. The data scanning method of the network target range according to claim 6, characterized in that: The performing missing analysis on the resource scanning data to determine the resource missing data in the resource scanning data includes: Determine resource association information between resource data in the resource scanning data, and construct a resource association map based on the resource association information; Determine the resource data circulation relationship based on the resource association graph, obtain the resource dependency relationship, and determine the data circulation anomaly information in the resource scan data according to the resource dependency relationship and the resource data circulation relationship; Abnormal resource data is determined according to the data flow abnormality information, and the resource missing data corresponding to the abnormal resource data is determined based on the resource dependency relationship.
8. The data scanning method of the network target range according to claim 6, characterized in that: The performing missing analysis on the resource scanning data to determine the resource missing data in the resource scanning data includes: Determining a resource type of the resource scanning task, and determining a plurality of reference data attributes of the resource type; Determine the data attribute of each resource data in the resource scan data, and match the data attribute with the reference data attribute to obtain an attribute matching result; Determine the missing data attribute from the plurality of reference data attributes according to the attribute matching result; The resource missing data is determined according to the vulnerability missing data attribute.
9. The data scanning method of the network target range according to claim 6, characterized in that: The performing missing analysis on the resource scanning data to determine the resource missing data in the resource scanning data includes: Acquire historical resource scanning data of the target image data, and determine high-frequency data from the historical resource scanning data; When the high-frequency data does not exist in the resource scanning data, the high-frequency data is used as the resource missing data.
10. A data scanning device for a network range, characterized in that: The device comprises: A task sending module, used to send a scanning task to a scanning device, wherein the scanning task includes target image data, and the target image data is image data corresponding to at least one network device in a network target range; A data receiving module, used to receive vulnerability scanning data obtained by the scanning device through vulnerability scanning of the target image data, wherein the vulnerability scanning data includes at least one data point scanning result; A first calculation module, configured to obtain at least one data point expected result, calculate a data point expected hash vector of the data point expected result according to a first hash function, and obtain at least one data set according to the data point expected hash vector; A second calculation module is used to calculate the data point scan hash vector corresponding to each of the data point scan results according to the first hash function, and determine the vulnerability missing data of the data point scan result in the data set according to the data point scan hash vector and the data point expected hash vector; The data point expected result includes data item expected results corresponding to a plurality of data items, and obtaining at least one data set according to the data point expected hash vector includes: Splitting the data point expected hash vector based on the number of the data items to obtain a data item expected vector corresponding to each of the data item expected results; Calculating the expected hash value corresponding to each of the expected vectors of the data items by using a second hash function, and dividing the expected vectors of the data items into corresponding data sets according to the expected hash values; The data point scanning result includes a data item scanning result corresponding to at least one of the data items, wherein in the data set, determining the vulnerability missing data of the data point scanning result according to the data point scanning hash vector and the data point expected hash vector includes: Splitting the data point scanning results to obtain a data item scanning vector corresponding to each data item scanning result; In each of the data sets, the similarity between each of the data item scan vectors and the data item expected vector is calculated one by one, and based on the similarity, the data item expected vector corresponding to the data item scan vector is determined to match; The missing data is determined according to the unmatched data item expected vectors in each of the data sets, and the missing data includes at least one data item completion vector.
11. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the data scanning method for the network target range described in any one of claims 1 to 9 is implemented.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the data scanning method for the network target range described in any one of claims 1 to 9 is implemented.
