CN111444392B - Vulnerability library access method, device and equipment - Google Patents

Vulnerability library access method, device and equipment Download PDF

Info

Publication number
CN111444392B
CN111444392B CN202010223399.5A CN202010223399A CN111444392B CN 111444392 B CN111444392 B CN 111444392B CN 202010223399 A CN202010223399 A CN 202010223399A CN 111444392 B CN111444392 B CN 111444392B
Authority
CN
China
Prior art keywords
vulnerability
template
loopholes
type
array
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010223399.5A
Other languages
Chinese (zh)
Other versions
CN111444392A (en
Inventor
潘奂
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou DPTech Technologies Co Ltd
Original Assignee
Hangzhou DPTech Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou DPTech Technologies Co Ltd filed Critical Hangzhou DPTech Technologies Co Ltd
Priority to CN202010223399.5A priority Critical patent/CN111444392B/en
Publication of CN111444392A publication Critical patent/CN111444392A/en
Application granted granted Critical
Publication of CN111444392B publication Critical patent/CN111444392B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/80Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
    • G06F16/81Indexing, e.g. XML tags; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/80Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
    • G06F16/84Mapping; Conversion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • G06F21/577Assessing vulnerabilities and evaluating computer system security

Abstract

The application discloses a method, a device and equipment for accessing a vulnerability database, wherein the vulnerability database comprises a vulnerability table and a template table, the vulnerability table is used for storing vulnerabilities, the template table is used for storing templates, the templates are provided with corresponding arrays, indexes of the arrays are used for identifying vulnerabilities, and index values are used for indicating whether the corresponding vulnerabilities are in the templates, and the method comprises the following steps: responding to a preset access request carrying a template identifier, acquiring an array corresponding to the template with the template identifier from a template table, and acquiring a vulnerability in a vulnerability table; determining a first type of loopholes and a second type of loopholes in the loopholes table based on the index and the index value of the array; wherein the first type of vulnerability includes vulnerabilities in the template and the second type of vulnerability includes vulnerabilities other than the first type of vulnerability; and returning responses carrying the first type of loopholes and the second type of loopholes. The method and the device can improve the response efficiency of the user to the vulnerability database access, thereby improving the access experience of the user to the vulnerability database.

Description

Vulnerability library access method, device and equipment
Technical Field
The present invention relates to the field of data processing, and in particular, to a method, an apparatus, and a device for accessing a vulnerability database.
Background
With the development of computer and internet technologies, various devices and software layers are endless, and it is inevitable that vulnerabilities exist in the development of devices and software, so vulnerability scanning tasks for devices or software are increasing year by year.
The vulnerability database is a database for storing vulnerabilities of the existing type, and the vulnerability scanning is to scan the device or the software based on the vulnerabilities of the existing type in the vulnerability database, so as to determine whether the corresponding vulnerabilities exist in the device or the software. Since the magnitude of vulnerabilities stored in the vulnerability library is large and the vulnerabilities that may exist are different for different devices or software, it is clearly impractical to scan various devices or software based on all vulnerabilities in the vulnerability library. For this reason, before performing the vulnerability scanning, a vulnerability set is generally determined from a vulnerability library, so as to perform the vulnerability scanning based on the determined vulnerability set.
At present, in order to meet the requirements of users, templates containing vulnerability identifications are stored in a vulnerability database, and users can select corresponding templates in the vulnerability database according to the requirements and then perform vulnerability scanning based on vulnerabilities corresponding to the vulnerability identifications in the templates. Further, there is a need to display vulnerabilities in the selected template and other vulnerabilities in the vulnerability library to the user, so that the user can further select to add other vulnerabilities in the vulnerability library in a visual form based on the selected template to meet the requirement of vulnerability scanning.
However, the current solution to the above requirement is to determine vulnerabilities in the selected template by traversing all vulnerabilities in the vulnerability database multiple times, so as to display the vulnerabilities in the selected template and other vulnerabilities in the vulnerability database for the user. Specifically, for each vulnerability identification included in the selected template, all vulnerabilities in the vulnerability database need to be traversed once to determine the vulnerability corresponding to the vulnerability identification, and the vulnerability identification is marked as being in the selected template, so that the aim of displaying the vulnerabilities in the selected template and other vulnerabilities in the vulnerability database for the user is finally achieved.
Obviously, the operation of accessing the vulnerability database by the user is responded in a way of traversing all vulnerabilities in the vulnerability database for many times, so that the response efficiency of the vulnerability database can be influenced, and the access experience of the user to the vulnerability database is further influenced.
Disclosure of Invention
In view of the above, the present application provides a method, an apparatus, and a device for accessing a vulnerability database, which can improve the response efficiency of a user to the vulnerability database access, thereby improving the access experience of the user to the vulnerability database.
In order to achieve the above object, the present application provides a method for accessing a vulnerability database, where the vulnerability database includes a vulnerability table and a template table, the vulnerability table is used to store vulnerabilities, the template table is used to store templates, the templates have corresponding arrays, indexes of the arrays are used to identify vulnerabilities, and index values of the arrays are used to indicate whether the corresponding vulnerabilities are in the templates, and the method includes:
responding to a preset access request carrying a template identifier, acquiring an array corresponding to a template with the template identifier from the template table, and acquiring a vulnerability in the vulnerability table;
determining a first type of loopholes and a second type of loopholes in the loopholes table based on the index and the index value of the array; wherein the first type of vulnerability includes vulnerabilities in the template and the second type of vulnerability includes vulnerabilities other than the first type of vulnerability;
and returning responses carrying the first type of loopholes and the second type of loopholes.
In an optional implementation manner, the responding to the preset access request carrying the template identifier, acquiring the array corresponding to the template with the template identifier from the template table, and acquiring the vulnerability in the vulnerability table, includes:
responding to a preset access request carrying a template identifier, and determining whether an array corresponding to the template with the template identifier is stored in a cache;
if the array is stored in the cache, acquiring the array from the cache and acquiring the loopholes in the loophole table;
and if the array is not stored in the cache, acquiring the array corresponding to the template with the template identifier from the template table, and acquiring the loopholes in the loophole table.
In an alternative embodiment, after the returning of the response carrying the first type of vulnerability and the second type of vulnerability, the method further includes:
responding to a preset newly-added request carrying the vulnerability identification of the second type of vulnerability, and determining an index corresponding to the vulnerability identification in the array;
and setting an index value corresponding to the index as a first preset value, wherein the first preset value is used for indicating that the vulnerability corresponding to the index is in the template.
In an alternative embodiment, after the returning of the response carrying the first type of vulnerability and the second type of vulnerability, the method further includes:
responding to a preset deleting request carrying the vulnerability identification of the first type of vulnerability, and determining an index corresponding to the vulnerability identification in the array;
and setting an index value corresponding to the index as a second preset value, wherein the second preset value is used for indicating that the vulnerability corresponding to the index is not in the template.
In an optional implementation manner, the determining, based on the index and the index value of the array, a first type of loopholes and a second type of loopholes in the loopholes table; wherein the first type of vulnerability includes vulnerabilities in the template, the second type of vulnerability includes vulnerabilities other than the first type of vulnerability, comprising:
determining whether the loopholes identified by the corresponding indexes are in the template or not based on the index values of the array;
if the loopholes identified by the index are in the template, determining the loopholes identified by the index in the loophole table as first loopholes;
and determining the loopholes except the first loopholes in the loopholes table as second loopholes.
In a second aspect, the present application provides an access device for a vulnerability database, where the vulnerability database includes a vulnerability table and a template table, the vulnerability table is used to store a vulnerability, the template table is used to store a template, the template has a corresponding array, an index of the array is used to identify the vulnerability, and an index value of the array is used to indicate whether the corresponding vulnerability is in the template, and the device includes:
the acquisition module is used for responding to a preset access request carrying a template identifier, acquiring an array corresponding to the template with the template identifier from the template table, and acquiring a vulnerability in the vulnerability table;
the first determining module is used for determining first type loopholes and second type loopholes in the loopholes table based on the index and the index value of the array; wherein the first type of vulnerability includes vulnerabilities in the template and the second type of vulnerability includes vulnerabilities other than the first type of vulnerability;
and the return module is used for returning the responses carrying the first type of loopholes and the second type of loopholes.
In an alternative embodiment, the acquiring module includes:
the determining submodule is used for responding to a preset access request carrying a template identifier and determining whether an array corresponding to the template with the template identifier is stored in a cache;
the first acquisition submodule is used for acquiring the array from the cache when the array is stored in the cache and acquiring loopholes in the loophole table;
and the second acquisition sub-module is used for acquiring the array corresponding to the template with the template identifier from the template table and acquiring the loopholes in the loophole table when the array is not stored in the cache.
In an alternative embodiment, the apparatus further comprises:
the second determining module is used for responding to a preset newly-added request carrying the vulnerability identification of the second type of vulnerability and determining an index corresponding to the vulnerability identification in the array;
the setting module is used for setting the index value corresponding to the index as a first preset value, wherein the first preset value is used for indicating that the vulnerability corresponding to the index is in the template.
In a third aspect, the present application also provides a computer readable storage medium having instructions stored therein which, when run on a terminal device, cause the terminal device to perform a method as claimed in any one of the preceding claims.
In a fourth aspect, the present application also provides an apparatus comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the method of any one of the preceding claims when the computer program is executed.
In the vulnerability database access method provided by the embodiment of the invention, the response efficiency of the vulnerability database is improved by adjusting the storage mode of the template. Specifically, corresponding arrays are respectively set for each template in the vulnerability library, wherein indexes of the arrays corresponding to the templates are used for identifying vulnerabilities, and index values of the arrays are used for indicating whether the corresponding vulnerabilities are in the templates. Based on the indexes and index values in the array corresponding to the template, whether the loopholes corresponding to the indexes in the loophole table are in the template or not can be directly determined, the loophole library does not need to be traversed for multiple times, the response efficiency of the loophole library is improved, and the access experience of the user to the loophole library is further improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort to a person skilled in the art.
Fig. 1 is a flowchart of a method for accessing a vulnerability database according to an embodiment of the present application;
FIG. 2 is a flowchart of another method for accessing a vulnerability database according to an embodiment of the present application;
FIG. 3 is a flowchart of a method for accessing a vulnerability database according to an embodiment of the present application;
FIG. 4 is a flowchart of a method for accessing a vulnerability database according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an access device of a vulnerability database according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an access device of a vulnerability database according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
At present, templates containing vulnerability identifications are stored in a vulnerability database, for the vulnerability identifications contained in the templates, the corresponding vulnerabilities of each vulnerability identification in the vulnerability database are determined by traversing all vulnerabilities in the vulnerability database for multiple times, so that the vulnerabilities in the templates in the vulnerability database are distinguished from other vulnerabilities, and finally the vulnerabilities are displayed to a user in a distinguishing way, so that the user can know which vulnerabilities belong to the selected templates, and operations such as adding and deleting the vulnerabilities in the selected templates can be performed according to requirements, and finally the vulnerabilities for vulnerability scanning are obtained.
The method for accessing the vulnerability database is provided, and the response efficiency of the vulnerability database is improved by adjusting the storage mode of the template. Specifically, corresponding arrays are respectively set for each template in the vulnerability library, wherein indexes of the arrays corresponding to the templates are used for identifying vulnerabilities, and index values of the arrays are used for indicating whether the corresponding vulnerabilities are in the templates. Based on the indexes and index values in the array corresponding to the template, whether the loopholes corresponding to the indexes in the loophole table are in the template or not can be directly determined, the loophole library does not need to be traversed for multiple times, the response efficiency of the loophole library is improved, and the access experience of the user to the loophole library is further improved.
Based on the above, the embodiment of the application provides an access method of a vulnerability database, wherein the vulnerability database comprises a vulnerability table and a template table, the vulnerability table is used for storing vulnerabilities, the template table is used for storing templates, the templates are provided with corresponding arrays, indexes of the arrays are used for identifying vulnerabilities, and index values of the arrays are used for indicating whether the corresponding vulnerabilities are in the templates.
Referring to fig. 1, a flowchart of a method for accessing a vulnerability database according to an embodiment of the present application is provided, where the method includes:
s101: responding to a preset access request carrying a template identifier, acquiring an array corresponding to the template with the template identifier from the template table, and acquiring the loopholes in the loophole table.
In order to improve the response speed of the vulnerability database, in the embodiment of the present application, an array is set for each template in the template table, the vulnerabilities in the vulnerability database are identified by using the indexes of the array, and the index values of the array represent whether the vulnerabilities identified by the corresponding indexes are stored in the templates corresponding to the array.
Assuming that 10 vulnerabilities are included in the vulnerability table of the vulnerability library, in fact, vulnerabilities in the vulnerability table are typically on the order of hundreds of thousands, the above-mentioned "10" are merely examples, and do not constitute a limitation of scope for the embodiments of the present application. The template table of the vulnerability library comprises a template of 'camera related vulnerabilities', the array corresponding to the template is [0,1,1,0,0,0,0,1,1,1], and the assumption is that the vulnerability identified by the corresponding index is not in the template and the index value is 1, which indicates that the vulnerability identified by the corresponding index is in the template. Therefore, the template can be known from the array corresponding to the template, and the template comprises the 2 nd, 3 rd, 8 th, 9 th and 10 th loopholes in the loopholes table.
In the embodiment of the application, when a preset access request carrying a template identifier is received, an array corresponding to the template with the template identifier is obtained from a template table of a vulnerability library. The preset access request is used for accessing the vulnerability library to obtain vulnerabilities contained in a template corresponding to the template identifier carried by the preset access request and other vulnerabilities in the vulnerability library, and finally the vulnerabilities are displayed on a user interface in a distinguishing mode, so that a user can know the vulnerabilities for subsequent vulnerability scanning, and subsequent operations such as deleting, adding and the like are performed on the vulnerabilities contained in the template, so that the vulnerability scanning requirements of the user are met to the greatest extent.
In an alternative embodiment, the storage format of the array corresponding to each template in the template table of the vulnerability database may be json format. That is, the array corresponding to each template is converted into json format and stored in the template table of the vulnerability database. When a preset access request carrying a template identifier is received, an array in json format corresponding to the template identifier is obtained from a template table, and then the array in json format is converted into an array format for response of a subsequent vulnerability library.
In addition, since the response to the preset access request needs to include not only the loopholes in the template but also the loopholes not in the template, that is, the two loopholes are displayed on the user interface in a distinguishing way. Therefore, in the embodiment of the present application, when a preset access request carrying a template identifier is received, vulnerabilities in a vulnerability table are further required to be acquired, so as to determine vulnerabilities in the template in the vulnerability table and other vulnerabilities, which are differentially displayed in a user interface.
S102: determining a first type of loopholes and a second type of loopholes in the loopholes table based on the index and the index value of the array; wherein the first type of vulnerability includes vulnerabilities in the template and the second type of vulnerability includes vulnerabilities other than the first type of vulnerability.
In the embodiment of the present application, after obtaining an array corresponding to a template and vulnerabilities in a vulnerability table, it is determined whether each vulnerability in the vulnerability table is in the template based on an index and an index value of the array.
In an alternative embodiment, first, based on the index value of the array, it is determined whether the vulnerability identified by the corresponding index is in the template. And if the loopholes identified by the index are in the template, determining the loopholes identified by the index in the loophole table as first loopholes, and determining the loopholes except the first loopholes in the loophole table as second loopholes.
For example, taking a "camera related vulnerability" template with an array of [0,1,1,0,0,0,0,1,1,1] as an example, the array can determine that the 2 nd, 3, 8, 9 and 10 th vulnerabilities in the vulnerability table are in the template, and the 1 st, 4 th, 5 th, 6 th and 7 th vulnerabilities are not in the template, then the 2 nd, 3 rd, 8 th, 9 th and 10 th vulnerabilities in the vulnerability table can be determined to be the first type vulnerabilities, and the 1 st, 4 th, 5 th, 6 th and 7 th vulnerabilities are determined to be the second type vulnerabilities. Because whether all the loopholes in the loopholes table are in the template can be determined only through the array, multiple times of traversal on all the loopholes in the loopholes table is not needed, and the response efficiency of the loopholes library is improved.
S103: and returning responses carrying the first type of loopholes and the second type of loopholes.
In the embodiment of the application, after the first type of loopholes and the second type of loopholes in the loopholes table are determined, responses carrying the first type of loopholes and the second type of loopholes are returned, and the first type of loopholes and the second type of loopholes are displayed on the user interface in a distinguishing mode.
In the vulnerability database access method provided by the embodiment of the invention, the response efficiency of the vulnerability database is improved by adjusting the storage mode of the template. Specifically, corresponding arrays are respectively set for each template in the vulnerability library, wherein indexes of the arrays corresponding to the templates are used for identifying vulnerabilities, and index values of the arrays are used for indicating whether the corresponding vulnerabilities are in the templates. Based on the indexes and index values in the array corresponding to the template, whether the loopholes corresponding to the indexes in the loophole table are in the template or not can be directly determined, the loophole library does not need to be traversed for multiple times, the response efficiency of the loophole library is improved, and the access experience of the user to the loophole library is further improved.
Based on the above embodiment, further embodiments of the present application further provide an access method for a vulnerability library, after the user interface displays the vulnerabilities and other vulnerabilities included in the selected template, the user may further perform operations such as adding and deleting the vulnerabilities included in the selected template based on the vulnerability scanning requirement, so as to further satisfy the vulnerability scanning requirement of the user.
Referring to fig. 2, a flowchart of another method for accessing a vulnerability database according to an embodiment of the present application is provided, where the method includes:
s201: responding to a preset access request carrying a template identifier, acquiring an array corresponding to a template with the template identifier from the template table, and acquiring a vulnerability in the vulnerability table;
s202: determining a first type of loopholes and a second type of loopholes in the loopholes table based on the index and the index value of the array; wherein the first type of vulnerability includes vulnerabilities in the template and the second type of vulnerability includes vulnerabilities other than the first type of vulnerability.
S203: and returning responses carrying the first type of loopholes and the second type of loopholes.
S201 to S203 in the embodiment of the present application may be understood with reference to S101 to S103 in the above embodiment, and are not described herein.
S204: and responding to a preset newly-added request carrying the vulnerability identification of the second type of vulnerability, and determining an index corresponding to the vulnerability identification in the array.
In the embodiment of the application, based on the first type of loopholes and the second type of loopholes displayed on the user interface, the user can increase loopholes used for loophole scanning by selecting any one or more second type of loopholes, so that the loophole scanning requirements of the user are met. The preset new adding request is used for requesting to add the second type of loopholes to the template.
In practical application, when a preset new adding request carrying the vulnerability identification of the second type of vulnerability is received, firstly, an array corresponding to the selected template is obtained from a template table, then, the vulnerability needing to be added to the array is determined, and the corresponding index in the array is obtained.
For example, taking the "camera related loophole" template with the array of [0,1,1,0,0,0,0,1,1,1] as an example, assuming that the second type of loopholes carried in the preset new request, that is, the loopholes not in the selected template are the 1 st, 4 th and 5 th loopholes in the loophole table, the indexes of the loopholes in the array can be determined to be 0, 3 and 4 respectively.
S205: and setting an index value corresponding to the index as a first preset value, wherein the first preset value is used for indicating that the vulnerability corresponding to the index is in the template.
In this embodiment of the present application, the first preset value may be 1, and specifically, if the index value of the array corresponding to the template is 1, then the vulnerability corresponding to the index indicating the index value is in the template.
In practical application, after determining the index corresponding to the vulnerability identification carried in the preset new addition request, the index values corresponding to the index in the selected template are all set as the first preset value.
For example, the index values of the arrays [0,1,1,0,0,0,0,1,1,1] with the indexes of 0, 3 and 4 are all set to 1, so as to obtain an updated array [1,1,1,1,1,0,0,1,1,1], so as to complete the updating of the array, convert the array into json format, and store the json format in the template table of the vulnerability library.
In the embodiment of the application, the loopholes contained in the template can be increased by resetting the index value of the array corresponding to the template, so that the processing is simple, and the response speed of the loophole library is improved.
On the basis of the method for adding the operation to the loopholes contained in the selected template, a further embodiment of the application further provides a method for accessing the loophole library.
Referring to fig. 3, a flowchart of a method for accessing a vulnerability database according to an embodiment of the present application is provided, where the method includes:
s301: responding to a preset access request carrying a template identifier, acquiring an array corresponding to the template with the template identifier from the template table, and acquiring the loopholes in the loophole table.
S302: determining a first type of loopholes and a second type of loopholes in the loopholes table based on the index and the index value of the array; wherein the first type of vulnerability includes vulnerabilities in the template and the second type of vulnerability includes vulnerabilities other than the first type of vulnerability.
S303: and returning responses carrying the first type of loopholes and the second type of loopholes.
S301 to S303 in the embodiment of the present application may be understood with reference to S101 to S103 in the above embodiment, and are not described herein.
S304: and responding to a preset deleting request carrying the vulnerability identification of the first type of vulnerability, and determining an index corresponding to the vulnerability identification in the array.
In the embodiment of the invention, based on the first type of loopholes and the second type of loopholes displayed on the user interface, the user can delete the loopholes in the selected templates by selecting any one or more first type of loopholes, thereby meeting the loophole scanning requirements of the user and improving the processing efficiency of the loophole library. The preset deletion request is used for requesting to delete the first type of loopholes from the selected templates.
In practical application, when a preset deleting request carrying the vulnerability identification of the first type of vulnerability is received, firstly, determining an index corresponding to the vulnerability identification in the preset deleting request from an array corresponding to the selected template.
For example, taking the "camera related loophole" template with the array of [0,1,1,0,0,0,0,1,1,1] as an example, assuming that the loopholes in the first type carried in the preset deletion request are the 2 nd loopholes and the 3 rd loopholes in the loophole table respectively, the indexes of the loopholes in the array can be determined to be 1 and 2 respectively.
S305: and setting an index value corresponding to the index as a second preset value, wherein the second preset value is used for indicating that the vulnerability corresponding to the index is not in the template.
In this embodiment of the present application, the second preset value may be 0, and specifically, if the index value of the array corresponding to the template is 0, it indicates that the vulnerability corresponding to the index of the index value is not in the template.
In practical application, after determining the index corresponding to the vulnerability identification carried in the preset deletion request, the index values corresponding to the index in the selected template are set to be the second preset values.
For example, the index values of index 1 and index 2 in the array [0,1,1,0,0,0,0,1,1,1] in the above example are set to 0, so as to obtain an updated array [0,0,0,0,0,0,0,1,1,1], so as to complete the updating of the array, and the array is converted into json format and stored in the template table of the vulnerability library.
In the embodiment of the application, the loopholes contained in the template can be deleted by resetting the index value of the array corresponding to the template, so that the processing is simple, and the response speed of the loophole library is improved.
Based on the foregoing embodiment, further embodiments of the present application further provide a method for accessing a vulnerability database, referring to fig. 4, which is a flowchart of another method for accessing a vulnerability database provided in embodiments of the present application, where the method includes:
s401: and responding to a preset access request carrying a template identifier, and determining whether an array corresponding to the template with the template identifier is stored in a cache.
Because the mode of storing the array corresponding to the template in the template table of the vulnerability database generally needs to convert the array into json format in advance and then store the array, when the array corresponding to the template is processed each time, the json format of the selected template needs to be obtained from the vulnerability database first, then the json format is converted into the array format, and finally the processing is performed based on the template in the array format. If the template needs to be processed for many times, the operation needs to be completed every time, and obviously the operation is complex, so that the operation efficiency of the vulnerability database is easy to be reduced.
Therefore, the embodiment of the application stores the array of the selected template by using the cache, so that when the template is required to be processed, the array corresponding to the template is not required to be acquired from the vulnerability database for multiple times, but the array is directly acquired from the cache, and the problem of low access efficiency caused by multiple accesses to the vulnerability database is avoided.
In practical application, when a preset access request carrying a template identifier is received, firstly determining whether a template corresponding to the template identifier carried by the preset access request is stored in a cache, and if so, directly acquiring an array corresponding to the template from the cache. It is noted that the array corresponding to the template can be directly stored in the cache without being converted into json format.
S402: and if the array is stored in the cache, acquiring the array from the cache and acquiring the loopholes in the loophole table.
S403: and if the array is not stored in the cache, acquiring the array corresponding to the template with the template identifier from the template table, and acquiring the loopholes in the loophole table.
In practical application, if it is determined that the array is not stored in the cache, an array corresponding to the template with the template identifier can be obtained from the template table of the vulnerability library, and then the array is stored in the cache, so that the corresponding array can be directly obtained from the cache when the template is processed later.
S404: determining a first type of loopholes and a second type of loopholes in the loopholes table based on the index and the index value of the array; wherein the first type of vulnerability includes vulnerabilities in the template and the second type of vulnerability includes vulnerabilities other than the first type of vulnerability.
S405: and returning responses carrying the first type of loopholes and the second type of loopholes.
S404 and S405 in the embodiment of the present application may be understood with reference to S102 and S103 in the above embodiment, and are not described herein.
According to the method for accessing the vulnerability database, the array corresponding to each template in the vulnerability database is stored by utilizing the cache, so that when the templates are processed, the corresponding array can be directly obtained from the cache without accessing the vulnerability database for multiple times, and therefore the access efficiency of the vulnerability database can be improved.
Based on the above method embodiment, the present application further provides an access device for a vulnerability database, where the vulnerability database includes a vulnerability table and a template table, the vulnerability table is used to store vulnerabilities, the template table is used to store templates, the templates have corresponding arrays, indexes of the arrays are used to identify vulnerabilities, and index values of the arrays are used to indicate whether the corresponding vulnerabilities are in the templates.
Referring to fig. 5, a schematic structural diagram of an access device for a vulnerability database according to an embodiment of the present application is provided, where the device includes:
an obtaining module 501, configured to obtain, from the template table, an array corresponding to a template having a template identifier in response to a preset access request carrying the template identifier, and obtain a vulnerability in the vulnerability table;
a first determining module 502, configured to determine a first type of vulnerability and a second type of vulnerability in the vulnerability table based on the index and the index value of the array; wherein the first type of vulnerability includes vulnerabilities in the template and the second type of vulnerability includes vulnerabilities other than the first type of vulnerability;
and a returning module 503, configured to return a response carrying the first type of vulnerability and the second type of vulnerability.
In an alternative embodiment, the obtaining module 501 includes:
the determining submodule is used for responding to a preset access request carrying a template identifier and determining whether an array corresponding to the template with the template identifier is stored in a cache;
the first acquisition submodule is used for acquiring the array from the cache when the array is stored in the cache and acquiring loopholes in the loophole table;
and the second acquisition sub-module is used for acquiring the array corresponding to the template with the template identifier from the template table and acquiring the loopholes in the loophole table when the array is not stored in the cache.
In addition, the device further comprises:
the second determining module is used for responding to a preset newly-added request carrying the vulnerability identification of the second type of vulnerability and determining an index corresponding to the vulnerability identification in the array;
the setting module is used for setting the index value corresponding to the index as a first preset value, wherein the first preset value is used for indicating that the vulnerability corresponding to the index is in the template.
According to the vulnerability database access device, the response efficiency of the vulnerability database is improved by adjusting the storage mode of the template. Specifically, corresponding arrays are respectively set for each template in the vulnerability library, wherein indexes of the arrays corresponding to the templates are used for identifying vulnerabilities, and index values of the arrays are used for indicating whether the corresponding vulnerabilities are in the templates. Based on the indexes and index values in the array corresponding to the template, whether the loopholes corresponding to the indexes in the loophole table are in the template or not can be directly determined, the loophole library does not need to be traversed for multiple times, the response efficiency of the loophole library is improved, and the access experience of the user to the loophole library is further improved.
In addition, the embodiment of the application further provides an access device for the vulnerability database, which may include:
a processor 601, a memory 602, an input device 603 and an output device 604. The number of processors 601 in the access device of the vulnerability library may be one or more, one processor being exemplified in fig. 6. In some embodiments of the invention, the processor 601, memory 602, input device 603, and output device 604 may be connected by a bus or other means, with the bus connection being exemplified in FIG. 6.
The memory 602 may be used to store software programs and modules, and the processor 601 may execute various functional applications and data processing of the vulnerability library access device by running the software programs and modules stored in the memory 602. The memory 602 may primarily include a storage program area and a storage data area, wherein the storage program area may store an operating system, application programs required for at least one function, and the like. In addition, the memory 602 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. The input means 603 may be used to receive entered numeric or character information and to generate signal inputs related to user settings and function control of the access device of the vulnerability library.
In particular, in this embodiment, the processor 601 loads executable files corresponding to the processes of one or more application programs into the memory 602 according to the following instructions, and the processor 601 runs the application programs stored in the memory 602, so as to implement various functions in the above-mentioned vulnerability library access method.
In addition, the application also provides a computer readable storage medium, wherein the computer readable storage medium stores instructions, and when the instructions run on the terminal equipment, the terminal equipment is caused to execute the vulnerability library access method.
It is to be understood that for the device embodiments, reference is made to the description of the method embodiments for the relevant points, since they essentially correspond to the method embodiments. The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing describes in detail a method, an apparatus, and a device for accessing a vulnerability database provided by the embodiments of the present application, and specific examples are applied herein to illustrate principles and implementations of the present application, where the foregoing description of the embodiments is only for helping to understand the method and core ideas of the present application; meanwhile, as those skilled in the art will have modifications in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (8)

1. The method for accessing the vulnerability database is characterized in that the vulnerability database comprises a vulnerability table and a template table, the vulnerability table is used for storing vulnerabilities, the template table is used for storing templates, the templates are provided with corresponding arrays, indexes of the arrays are used for identifying vulnerabilities, and index values of the arrays are used for indicating whether the corresponding vulnerabilities are in the templates, and the method comprises the following steps:
responding to a preset access request carrying a template identifier, acquiring an array corresponding to a template with the template identifier from the template table, and acquiring a vulnerability in the vulnerability table;
determining a first type of loopholes and a second type of loopholes in the loopholes table based on the index and the index value of the array; wherein the first type of vulnerability includes vulnerabilities in the template and the second type of vulnerability includes vulnerabilities other than the first type of vulnerability;
returning responses carrying the first type of loopholes and the second type of loopholes;
after the response carrying the first type of loopholes and the second type of loopholes is returned, the method further comprises the following steps:
responding to a preset newly-added request carrying the vulnerability identification of the second type of vulnerability, and determining an index corresponding to the vulnerability identification in the array;
and setting an index value corresponding to the index as a first preset value, wherein the first preset value is used for indicating that the vulnerability corresponding to the index is in the template.
2. The method of claim 1, wherein the obtaining, in response to a preset access request carrying a template identifier, an array corresponding to a template having the template identifier from the template table, and obtaining a vulnerability in the vulnerability table, includes:
responding to a preset access request carrying a template identifier, and determining whether an array corresponding to the template with the template identifier is stored in a cache;
if the array is stored in the cache, acquiring the array from the cache and acquiring the loopholes in the loophole table;
and if the array is not stored in the cache, acquiring the array corresponding to the template with the template identifier from the template table, and acquiring the loopholes in the loophole table.
3. The method of claim 1, wherein after the returning the response carrying the first type of vulnerability and the second type of vulnerability, further comprising:
responding to a preset deleting request carrying the vulnerability identification of the first type of vulnerability, and determining an index corresponding to the vulnerability identification in the array;
and setting an index value corresponding to the index as a second preset value, wherein the second preset value is used for indicating that the vulnerability corresponding to the index is not in the template.
4. The method of claim 1, wherein the determining the first type of vulnerability and the second type of vulnerability in the vulnerability table is based on an index and an index value of the array; wherein the first type of vulnerability includes vulnerabilities in the template, the second type of vulnerability includes vulnerabilities other than the first type of vulnerability, comprising:
determining whether the loopholes identified by the corresponding indexes are in the template or not based on the index values of the array;
if the loopholes identified by the index are in the template, determining the loopholes identified by the index in the loophole table as first loopholes;
and determining the loopholes except the first loopholes in the loopholes table as second loopholes.
5. An access device for a vulnerability database, wherein the vulnerability database includes a vulnerability table and a template table, the vulnerability table is used for storing vulnerabilities, the template table is used for storing templates, the templates have corresponding arrays, indexes of the arrays are used for identifying vulnerabilities, and index values of the arrays are used for indicating whether the corresponding vulnerabilities are in the templates, the device includes:
the acquisition module is used for responding to a preset access request carrying a template identifier, acquiring an array corresponding to the template with the template identifier from the template table, and acquiring a vulnerability in the vulnerability table;
the first determining module is used for determining first type loopholes and second type loopholes in the loopholes table based on the index and the index value of the array; wherein the first type of vulnerability includes vulnerabilities in the template and the second type of vulnerability includes vulnerabilities other than the first type of vulnerability;
the return module is used for returning responses carrying the first type of loopholes and the second type of loopholes;
the apparatus further comprises:
the second determining module is used for responding to a preset newly-added request carrying the vulnerability identification of the second type of vulnerability and determining an index corresponding to the vulnerability identification in the array;
the setting module is used for setting the index value corresponding to the index as a first preset value, wherein the first preset value is used for indicating that the vulnerability corresponding to the index is in the template.
6. The apparatus of claim 5, wherein the acquisition module comprises:
the determining submodule is used for responding to a preset access request carrying a template identifier and determining whether an array corresponding to the template with the template identifier is stored in a cache;
the first acquisition submodule is used for acquiring the array from the cache when the array is stored in the cache and acquiring loopholes in the loophole table;
and the second acquisition sub-module is used for acquiring the array corresponding to the template with the template identifier from the template table and acquiring the loopholes in the loophole table when the array is not stored in the cache.
7. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein instructions, which when run on a terminal device, cause the terminal device to perform the method according to any of claims 1-4.
8. An apparatus, comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the method of any of claims 1-4 when the computer program is executed.
CN202010223399.5A 2020-03-26 2020-03-26 Vulnerability library access method, device and equipment Active CN111444392B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010223399.5A CN111444392B (en) 2020-03-26 2020-03-26 Vulnerability library access method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010223399.5A CN111444392B (en) 2020-03-26 2020-03-26 Vulnerability library access method, device and equipment

Publications (2)

Publication Number Publication Date
CN111444392A CN111444392A (en) 2020-07-24
CN111444392B true CN111444392B (en) 2023-04-25

Family

ID=71652538

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010223399.5A Active CN111444392B (en) 2020-03-26 2020-03-26 Vulnerability library access method, device and equipment

Country Status (1)

Country Link
CN (1) CN111444392B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111859399A (en) * 2020-07-29 2020-10-30 网宿科技股份有限公司 Vulnerability detection method and device based on oval

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103065095A (en) * 2013-01-29 2013-04-24 四川大学 WEB vulnerability scanning method and vulnerability scanner based on fingerprint recognition technology
CN104363236A (en) * 2014-11-21 2015-02-18 西安邮电大学 Automatic vulnerability validation method
CN106295347A (en) * 2015-05-28 2017-01-04 国家计算机网络与信息安全管理中心 For building the method and device of validating vulnerability environment
CN108011898A (en) * 2018-01-30 2018-05-08 上海壹账通金融科技有限公司 Leak detection method, device, computer equipment and storage medium
CN108537042A (en) * 2018-04-04 2018-09-14 上海有云信息技术有限公司 Self-defined plug-in unit generation method, device, equipment and storage medium
CN110431819A (en) * 2017-03-20 2019-11-08 浩瀚有限公司 Driver sweep based on the variation of network data available
CN110704847A (en) * 2019-09-27 2020-01-17 重庆紫光华山智安科技有限公司 Vulnerability scanning method and related device
CN110909361A (en) * 2019-11-08 2020-03-24 北京长亭未来科技有限公司 Vulnerability detection method and device and computer equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9811667B2 (en) * 2011-09-21 2017-11-07 Mcafee, Inc. System and method for grouping computer vulnerabilities
US9507946B2 (en) * 2015-04-07 2016-11-29 Bank Of America Corporation Program vulnerability identification

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103065095A (en) * 2013-01-29 2013-04-24 四川大学 WEB vulnerability scanning method and vulnerability scanner based on fingerprint recognition technology
CN104363236A (en) * 2014-11-21 2015-02-18 西安邮电大学 Automatic vulnerability validation method
CN106295347A (en) * 2015-05-28 2017-01-04 国家计算机网络与信息安全管理中心 For building the method and device of validating vulnerability environment
CN110431819A (en) * 2017-03-20 2019-11-08 浩瀚有限公司 Driver sweep based on the variation of network data available
CN108011898A (en) * 2018-01-30 2018-05-08 上海壹账通金融科技有限公司 Leak detection method, device, computer equipment and storage medium
CN108537042A (en) * 2018-04-04 2018-09-14 上海有云信息技术有限公司 Self-defined plug-in unit generation method, device, equipment and storage medium
CN110704847A (en) * 2019-09-27 2020-01-17 重庆紫光华山智安科技有限公司 Vulnerability scanning method and related device
CN110909361A (en) * 2019-11-08 2020-03-24 北京长亭未来科技有限公司 Vulnerability detection method and device and computer equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
段丹青 ; 陈松乔 ; 杨卫平 ; .漏洞扫描与入侵检测联动系统的研究.计算机应用研究.2007,(第07期),全文. *

Also Published As

Publication number Publication date
CN111444392A (en) 2020-07-24

Similar Documents

Publication Publication Date Title
CN109740122B (en) Method and device for converting thinking guide graph use case file
CN108008936B (en) Data processing method and device and electronic equipment
CN110634049B (en) Page display content processing method and device, electronic equipment and readable medium
CN114595343A (en) Map display method and device, storage medium and electronic equipment
CN111143359A (en) Query statement generation method and device
CN112882933A (en) Script recording method, device, equipment and storage medium
CN111444392B (en) Vulnerability library access method, device and equipment
US7373635B2 (en) System and method for efficient development of configurable software systems in a large software development community
CN114328632A (en) User data analysis method and device based on bitmap and computer equipment
CN113344514A (en) Item information display method and device, electronic equipment and readable medium
CN111522626A (en) Virtual machine list generation method and device and electronic equipment
CN112540820A (en) User interface updating method and device and electronic equipment
CN110223108B (en) Click through rate prediction method, device and equipment
CN110058855B (en) Method, device and equipment for updating interface and workflow of software
CN113655942A (en) Chart data display method and device
CN109542300B (en) Method and device for updating web directory, electronic equipment and storage medium
CN110569459A (en) statistical method and device for webpage information
CN113010587A (en) Data source configuration method, device, terminal, server and medium
CN110750569A (en) Data extraction method, device, equipment and storage medium
CN117573561B (en) Automatic test system, method, electronic equipment and storage medium
CN116166164A (en) Floating window page generation method and device, electronic equipment and storage medium
CN113010812B (en) Information acquisition method, device, electronic equipment and storage medium
CN109388791B (en) Dynamic diagram display method and device, computer equipment and storage medium
CN116340562A (en) Image labeling method and device, electronic equipment and storage medium
CN116107587A (en) Buried point method, device, equipment and medium applied to page

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant