Method and device for processing interface path information, storage medium and electronic device
By analyzing the interface information of the target system and crawling the web keywords, and combining the similarity prediction model to generate the predicted interface path, the problem of failure to effectively discover and predict the exposure risk of system interface information in the existing technology is solved, and the risk of system interface information is improved API mining efficiency and network security.
Patent Information
- Application Number
- CN202411147534.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-08-20
AI Technical Summary
It is difficult for the prior art to effectively discover and predict the exposure risk of system interface information, especially for unknown APIs, the mining efficiency and accuracy rate are low.
By determining the interface information of the original application program interface in the target system, naming feature analysis and web keyword crawling are performed, and the similarity prediction model is used to determine the target keyword matching the original words in the interface information from the web keywords, and then Replace the original words in the interface path to generate a predicted interface path.
It improves the efficiency and accuracy of mining unknown APIs, can promptly discover risks in the target system and take preventive measures to improve network security and risk prevention and control capabilities.
Smart Images

Figure CN118656829B_ABST
Abstract
Description
Background Art
[0002] With the development of computer technology and network technology, network security has attracted more and more attention. Among them, whether the system interface information has exposure risks is one aspect of network security prevention.
[0003] In the related art, it is usually determined directly based on the system's public asset data whether there is a risk of interface information exposure. This method can usually only discover relatively superficial security risks.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of the present disclosure is to provide a method and device for processing interface path information, a storage medium and an electronic device, which can improve the efficiency and accuracy of mining unknown APIs.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0007] According to one aspect of the present disclosure, a method for processing interface path information is provided, comprising: determining interface information of an original application program interface in a target system; the interface information at least comprising an interface path; performing naming feature analysis on the interface information to obtain naming features including original words and their parts of speech in the interface information; crawling web pages based on the interface information to obtain web page keywords; performing similarity prediction based on the naming features and the web page keywords to determine target keywords that match the original words in the web page keywords; and replacing corresponding original words in the interface path with the target keywords to generate a predicted interface path for the target system.
[0008] In one embodiment of the present disclosure, the method for processing interface path information further includes: performing a new round of analysis and processing based on the predicted interface path and the interface information to obtain a new predicted interface path of the target system.
[0009] In one embodiment of the present disclosure, the interface information also includes: a request method; wherein, crawling web pages based on the interface information to obtain web page keywords includes: sending a request to a server through the interface path and the request method; receiving hypertext markup language HTML data returned by the server; and determining the web page keywords based on the HTML data.
[0010] In one embodiment of the present disclosure, the HTML data includes at least one of the following: document title data, document subject data at each level, and table header data.
[0011] In one embodiment of the present disclosure, determining the webpage keywords according to the HTML data includes: in response to the HTML data not being text in a designated language, processing the HTML data into text in a designated language; and determining the webpage keywords according to the text in the designated language.
[0012] In one embodiment of the present disclosure, similarity prediction is performed based on the naming features and the web page keywords, and a target keyword matching the original word is determined among the web page keywords, including: processing the naming features and the web page keywords through a trained word prediction model to predict the similarity between the original word and the web page keywords; and determining the target keyword matching the original word from the web page keywords according to the similarity.
[0013] In one embodiment of the present disclosure, the word prediction model is trained by the following method: obtaining a preset corpus, the preset corpus including computer business texts; pre-training a large language model based on the preset corpus to obtain an offline large language model; and online training the offline large language model based on the web page keywords to obtain the trained word prediction model.
[0014] In one embodiment of the present disclosure, the method for processing interface path information also includes: performing naming feature analysis on the interface path to determine the naming specifications of each path level in the interface path; wherein, using the target keyword to replace the corresponding original word in the interface path to generate a predicted interface path for the target system, including: processing the target keyword matched by the original word according to the naming specifications of the path level to which the original word belongs to obtain a word to be replaced; using the word to be replaced to replace the corresponding original word to generate a predicted interface path for the target system.
[0015] In one embodiment of the present disclosure, determining the interface information of the original application interface in the target system includes: determining the interface information of the original application interface based on the public asset data of the target system; wherein the public asset data includes at least one of the following: a search engine crawler configuration file, front-end source code data, application interface document data, and code file data.
[0016] According to another aspect of the present disclosure, there is provided a device for processing interface path information, comprising: a determination unit, for determining interface information of an original application program interface in a target system; the interface information at least comprising an interface path; an analysis unit, for performing naming feature analysis on the interface information, and obtaining naming features including original words and their parts of speech in the interface information; a crawling unit, for crawling web pages based on the interface information, and obtaining web page keywords; a prediction unit, for performing similarity prediction based on the naming features and the web page keywords, and determining target keywords that match the original words in the web page keywords; and a generation unit, for replacing corresponding original words in the interface path with the target keywords, and generating a predicted interface path for the target system.
[0017] In one embodiment of the present disclosure, the interface path information processing device further includes: an iteration unit, configured to perform a new round of analysis and processing based on the predicted interface path and the interface information to obtain a new predicted interface path of the target system.
[0018] In one embodiment of the present disclosure, the interface information also includes: a request method; wherein the crawling unit crawls web pages based on the interface information to obtain web page keywords, including: sending a request to the server through the interface path and the request method; receiving hypertext markup language HTML data returned by the server; and determining the web page keywords based on the HTML data.
[0019] In one embodiment of the present disclosure, the HTML data includes at least one of the following: document title data, document subject data at each level, and table header data.
[0020] In one embodiment of the present disclosure, the interface path information processing device further includes a translation unit. In response to the HTML data not being in a specified language, the translation unit is configured to process the HTML data into a specified language text; and determine the web page keywords according to the specified language text.
[0021] In one embodiment of the present disclosure, a prediction unit performs similarity prediction based on the naming features and the web page keywords, and determines a target keyword matching the original word from the web page keywords, including: processing the naming features and the web page keywords through a trained word prediction model, and predicting the similarity between the original word and the web page keywords; and determining a target keyword matching the original word from the web page keywords according to the similarity.
[0022] In one embodiment of the present disclosure, the interface path information processing device also includes a training unit, and the word prediction model is obtained by training the training unit through the following method: obtaining a preset corpus, wherein the preset corpus includes computer business texts; pre-training a large language model based on the preset corpus to obtain an offline large language model; and online training the offline large language model based on the web page keywords to obtain the trained word prediction model.
[0023] In one embodiment of the present disclosure, the analysis unit is also used to perform naming feature analysis on the interface path to determine the naming specifications of each path level in the interface path; wherein the generation unit uses the target keyword to replace the corresponding original word in the interface path to generate a predicted interface path for the target system, including: processing the target keyword matched by the original word according to the naming specifications of the path level to which the original word belongs to obtain a word to be replaced; and using the word to be replaced to replace the corresponding original word to generate a predicted interface path for the target system.
[0024] In one embodiment of the present disclosure, a determination unit determines interface information of an original application interface in a target system, including: determining the interface information of the original application interface based on public asset data of the target system; wherein the public asset data includes at least one of the following: a search engine crawler configuration file, front-end source code data, application interface document data, and code file data.
[0025] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned method for processing interface path information is implemented.
[0026] According to another aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the above-mentioned method for processing interface path information by executing the executable instructions.
[0027] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the computer program implements the above-mentioned method for processing interface path information.
[0028] The method for processing interface path information provided by the embodiment of the present disclosure can perform naming feature analysis and web page keyword crawling based on the original API interface information exposed by the target system, and select target keywords that match the original words in the interface information from the web page keywords, and then use the target keywords to replace the corresponding original words to generate a predicted interface path for the target system. It can be seen that this solution can be based on the development behavior pattern of the R&D team, fully and reasonably utilize the exposed surface API of the target system, and predict new API interface information with a strong correlation with the original path through reverse reasoning of the web page keywords crawled by the exposed surface API and the exposed surface API, thereby improving the efficiency and accuracy of mining unknown APIs, allowing users to promptly discover risks in the target system and take timely measures to prevent them, providing strong support for improving network security and risk prevention and control capabilities.
[0029] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0031] Figure 1 A schematic diagram showing an exemplary system architecture to which the method for processing interface path information according to an embodiment of the present disclosure can be applied.
[0032] Figure 2 A flowchart of a method for processing interface path information according to an embodiment of the present disclosure is shown.
[0033] Figure 3 A flow chart of obtaining web page keywords in a method for processing interface path information according to an embodiment of the present disclosure is shown.
[0034] Figure 4 A flow chart of obtaining web page keywords in a method for processing interface path information according to an embodiment of the present disclosure is shown.
[0035] Figure 5 A flowchart of similarity prediction in a method for processing interface path information according to an embodiment of the present disclosure is shown.
[0036] Figure 6 A flowchart of training a word prediction model in a method for processing interface path information according to an embodiment of the present disclosure is shown.
[0037] Figure 7 A block diagram of a device for processing interface path information according to an embodiment of the present disclosure is shown.
[0038] Figure 8 A structural block diagram of a computer device for processing interface path information in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0039] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0040] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0041] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present disclosure, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0042] Figure 1 A schematic diagram showing an exemplary system architecture to which the method for processing interface path information according to an embodiment of the present disclosure can be applied.
[0043] like Figure 1 As shown, the system architecture may include a server 101, a network 102, and a client 103. The network 102 is used to provide a medium for a communication link between the client 103 and the server 101. The network 102 may include various connection types, such as wired, wireless communication links, or optical fiber cables.
[0044] In an exemplary embodiment, the client 103 for data transmission with the server 101 may include, but is not limited to, electronic devices of types such as smart phones, desktop computers, tablet computers, laptop computers, smart speakers, digital assistants, AR (Augmented Reality) devices, VR (Virtual Reality) devices, and smart wearable devices. Optionally, the operating system running on the electronic device may include, but is not limited to, Android system, IOS system, Linux system, Windows system, and the like.
[0045] Server 101 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. In some practical applications, server 101 can also be a server of a network platform, which can be, for example, a trading platform, a live broadcast platform, a social platform, or a music platform, etc., which is not limited in the embodiments of the present disclosure. Among them, the server can be a single server or a cluster formed by multiple servers, and the present disclosure does not limit the specific architecture of the server.
[0046] In an exemplary embodiment, a user can operate on the client 103 and input the pre-acquired public asset data of the target system (such as front-end source code data, code file data, etc.) to the server 101 through the client 103. The server 101 can determine the interface information of the original application interface in the target system based on the public asset data of the target system, and then continue to execute the interface path information processing method provided by the present disclosure, and finally obtain the predicted interface path of the target system.
[0047] In an exemplary embodiment, the process of the server 101 for implementing the method for processing interface path information may be: the server 101 determines the interface information of the original application interface in the target system; the interface information includes at least the interface path; the server 101 performs a naming feature analysis on the interface information to obtain a naming feature containing the original word and its part of speech in the interface information; the server 101 crawls web pages based on the interface information to obtain web page keywords; the server 101 performs a similarity prediction based on the naming feature and the web page keywords, and determines a target keyword that matches the original word in the web page keywords; the server 101 uses the target keyword to replace the corresponding original word in the interface path to generate a predicted interface path for the target system.
[0048] In addition, it should be noted that Figure 1 What is shown is only one application environment of the method for processing interface path information provided by the present disclosure. Figure 1 The numbers of servers 101, networks 102 and clients 103 are merely illustrative, and any number of clients, networks and servers may be provided according to actual needs.
[0049] In order to enable ordinary persons in the art to better understand the technical solution of the present disclosure, each step of the method for processing interface path information in the exemplary embodiment of the present disclosure will be described in more detail below with reference to the accompanying drawings and embodiments.
[0050] Figure 2 A flowchart of a method for processing interface path information according to an embodiment of the present disclosure is shown. The method provided by the embodiment of the present disclosure can be performed as follows: Figure 1 The server 101 or the client 103 shown is executed, but the present disclosure is not limited to this.
[0051] In the following examples, the server 101 is used as the execution subject for illustration.
[0052] like Figure 2 As shown, the method for processing interface path information provided by the embodiment of the present disclosure may include the following steps.
[0053] Step S201, determining the interface information of the original application program interface in the target system; the interface information at least includes the interface path.
[0054] In this embodiment, the target system may be a system that needs to be analyzed, developed, designed, maintained, or optimized, such as an application running on a Web server that needs to be analyzed, a terminal application that is under development, and the like.
[0055] The original application program interface in the target system is at least one existing API (Application Programming Interface) in the target system. The interface information may be the interface information of at least one existing API in the target system, and the interface information may include, for example, the interface path (URL path part), request method (such as GET method, POST method), request parameters, etc.
[0056] In this embodiment, the interface path is a part of the URL (Uniform Resource Locator) used to specify access to a specific interface or resource (such as a specific API interface or service). It is usually located between the domain name (or IP address) and the query parameter, and can be composed of a series of path segments separated by slashes ( / ). The interface path can usually reflect the business logic and resource structure of the target system. Its design is usually clear and intuitive, and needs to follow certain naming specifications and conventions.
[0057] In some embodiments, determining the interface information of the original application interface in the target system includes: determining the interface information of the original application interface based on the public asset data of the target system; wherein the public asset data includes at least one of the following: search engine crawler configuration file, front-end source code data, application interface document data, and code file data.
[0058] In this embodiment, the search engine crawler configuration file can be robots.txt based on the robots protocol (crawler protocol), and robots.txt can be used to indicate whether the page is allowed to be crawled. The front-end source code data can be, for example, a packaged file containing codes such as HTML (Hyper Text Markup Language), CSS (Cascading Style Sheets), and JavaScript (a lightweight scripting language). The application interface document data can be Swagger document data. Swagger is a standardized and complete framework. Swagger defines a set of standard, language-independent interface descriptions, allowing developers to more easily understand and use Web services. The code file data can be JS (JavaScript) code, which is often used to interact with the back-end API.
[0059] Through this embodiment, the exposed surface API can be obtained from the asset data disclosed by the target system, which serves as the basis for the solution to finally obtain the predicted interface path.
[0060] Step S203: Perform naming feature analysis on the interface information to obtain naming features including original words and their parts of speech in the interface information.
[0061] In this embodiment, the interface information may be segmented to identify vocabulary (ie, original words) in the interface information, and the identified original words may be analyzed for part of speech to obtain part of speech information (eg, noun, verb) of each original word.
[0062] In an exemplary embodiment, naming feature analysis may be performed on various information in the interface information, such as the interface path, request method, request body, return body, parameter name, source code variable name, etc. Each obtained naming feature may be a naming feature of a certain type of interface information (such as interface path), which may include the original word, the part of speech of the original word, and the type of interface information to which the original word belongs.
[0063] In an exemplary embodiment, tools such as word segmentation and part-of-speech tagging in natural language processing (NLP) technology may be used to perform naming feature analysis.
[0064] Step S205: crawling web pages based on the interface information to obtain web page keywords.
[0065] In this embodiment, crawler technology can be used to crawl content from relevant web pages (such as documents, forums, blogs, etc.) of the target system based on the interface information, and extract web page keywords.
[0066] In Web development, users (such as R&D teams) will develop based on the business data and actual R&D experience provided by the target system. Therefore, when writing interface information, they will follow the same writing specifications (such as uniformly using RESTful specifications or some other form of fixed gerund combination), and the interface naming and interface parameters will be consistent with the type of data provided. For example, text related to the application scenario and business content semantics is used so that the interface path can intuitively reflect the web page content, allowing users to have a general understanding of the web page content only through the URL (i.e., the interface path); and the web page content corresponding to the interface information usually also needs to reflect its application scenario and business content. Therefore, the web page keywords obtained from the web page content are semantically correlated with the original words in the interface path, which provides data support for predicting interface information in this solution, and helps to predict the interface information that is not directly exposed and belongs to the target system more quickly and accurately.
[0067] In an exemplary embodiment, web page keywords may be determined based on the content in the web page corresponding to the document title, document themes at various levels (such as first-level and second-level titles), and table headers.
[0068] In an exemplary embodiment, the web page keywords need to be text in a specified language or English words.
[0069] Step S207: perform similarity prediction based on the naming feature and the webpage keywords, and determine a target keyword that matches the original word among the webpage keywords.
[0070] In this embodiment, the naming features and the webpage keywords can be processed by a trained word prediction model to predict the target keywords in the webpage keywords that match the original words. The word prediction model can be gradually trained based on a word vector model (such as a FastText model). The target keyword selected in this embodiment can be a webpage keyword that meets certain conditions in similarity with the original word.
[0071] In an exemplary embodiment, the number of target keywords matching the original word may be one or more.
[0072] Step S209: Use the target keyword to replace the corresponding original word in the interface path to generate a predicted interface path of the target system.
[0073] In this embodiment, a preset reorganization rule may be used for replacement, and the reorganization rule may indicate information such as the number of original words to be replaced.
[0074] For example, for an interface path such as " / home / user / create", if the original words are identified as "user" and "create", and the target keyword corresponding to "user" is "classes", then "classes" can be used to replace the position of "user" in the interface path to form a new interface path (i.e., predicted interface path) " / home / classes / create".
[0075] In an exemplary embodiment, other information in the interface information may also be replaced similarly to obtain other predicted information, such as the prediction request method, the prediction request body, and other information.
[0076] In an exemplary embodiment, after obtaining the predicted interface path and other predicted interface information, the user (such as the developer of the target system) can further verify whether other web pages in the target system can be successfully crawled based on the predicted interface path; if so, it means that the predicted interface path belongs to the target system, that is, it means that the API information that is not exposed and archived by the target system has been successfully mined, indicating that the exposed API in the target system is at risk of being mined. Based on this, it can help users to discover the risks and hidden dangers brought by the exposed API, and then take timely measures to eliminate the risks and improve the network security of the target system.
[0077] In an exemplary embodiment, the method for processing interface path information provided by the present disclosure can be applied to scenarios such as security penetration services, security attack and defense drills, and security operation management. This solution can collect API information and page text content of the exposed surface of the target system, mine out unarchived and non-public API path information, and then promptly discover API interfaces with data exposure risks and take measures to eliminate risks, thereby achieving the effect of improving the overall security protection capabilities of the network.
[0078] When applied to security penetration services, it can simulate the dictionary blasting and parameter fuzz testing techniques used by network attackers (such as hackers) in API mining. When applied to security attack and defense drills, it can simulate the API mining techniques used by network attackers when collecting information, thereby improving the efficiency of attack and defense drills. When applied to security operations management, it can simulate the API mining techniques used by network attackers to promptly discover exposure leakage risks and improve overall network security.
[0079] Through the disclosed embodiments, the original API interface information exposed by the target system can be used as a basis for naming feature analysis and web page keyword crawling, and target keywords that match the original words in the interface information can be selected from the web page keywords, and then the target keywords can be used to replace the corresponding original words to generate a predicted interface path for the target system. It can be seen that in this solution, the development behavior pattern of the R&D team can be used as a basis to fully and reasonably use the exposed surface API of the target system, and the web page keywords crawled by the exposed surface API and the exposed surface API reverse reasoning can be used to predict new API interface information that is highly correlated with the original path, thereby improving the efficiency and accuracy of mining unknown APIs, allowing users to promptly discover risks in the target system and take timely measures to prevent them, providing strong support for improving network security and risk prevention and control capabilities.
[0080] In some embodiments, the method for processing interface path information further includes: performing a new round of analysis and processing based on the predicted interface path and the interface information to obtain a new predicted interface path of the target system.
[0081] The method for processing interface path information can be an iterative and continuous optimization process. Other predicted interface information can be generated based on the interface information in a similar manner to the generation of the predicted interface path, such as the predicted request method, predicted request body, predicted return body, predicted parameter name, predicted source code variable name, etc. The predicted interface path and other predicted interface information can be used as the starting point for a new round of analysis and processing to further explore and predict new interface paths of the target system.
[0082] Through this embodiment, the method for processing interface path information can form a closed-loop iterative process, continuously mining and predicting new interface paths of the target system, thereby improving the mining efficiency and accuracy of the target system API and promoting the improvement of overall network security.
[0083] Figure 3 A flowchart of obtaining web page keywords in a method for processing interface path information according to an embodiment of the present disclosure is shown. Figure 3 As shown, in some embodiments, crawling web pages based on the interface information to obtain web page keywords may include the following steps.
[0084] Step S301: Send a request to the server through the interface path and the request method.
[0085] In this embodiment, the interface information further includes: request mode. In an exemplary embodiment, the request mode may include a request method, a request body, a return body, a parameter name, a source code variable name, and the like.
[0086] In this embodiment, a suitable HTTP request that meets the server requirements can be constructed and sent to the server according to the interface path and request method. Different request methods may correspond to different data processing logics and return results. Therefore, when crawling web pages based on interface information, accurately simulating these request methods can ensure that the accurate content of the target web page can be obtained.
[0087] Step S303: receiving the hypertext markup language HTML data returned by the server.
[0088] In some embodiments, the HTML data includes at least one of the following: document title data, document subject data at various levels, and table header data.
[0089] In this embodiment, after receiving a suitable request that meets the server requirements, the server will return a corresponding response. The response may include web page data in HTML format (ie, HTML data), which may include information such as the structure, content, and style of the web page.
[0090] In this embodiment, after receiving HTML data, it can be parsed to extract useful information. In this process, you can focus on specific parts in the HTML document, such as the document title ( <title> tags), document topics at all levels (through< / title> <h1>、< / h1> <h2>header data (such as the column headers defined by the tags in the table), etc.
[0091] Step S305: determining the webpage keywords according to the HTML data.
[0092] In this embodiment, the document title data, the subject data of each level of the document, and the specific content corresponding to the header data in the HTML data may be used as the webpage keywords.
[0093] like Figure 3 The embodiment shown can more accurately obtain the keywords and related information of the target webpage by combining the interface path, request method and HTML data parsing. This method not only improves the accuracy and efficiency of data collection, but also provides richer data support for subsequent interface path prediction and network security assessment.
[0094] Figure 4 A flowchart of obtaining web page keywords in a method for processing interface path information according to an embodiment of the present disclosure is shown. Figure 4 As shown, in the embodiment of the present disclosure, Figure 4 In the method for processing interface path information shown in FIG. Figure 3 Steps S301 and S303 in the method for processing interface path information are corresponding and will not be repeated here.
[0095] In the embodiment of the present disclosure, Figure 3 Based on the method of processing the interface path information shown, Figure 4 The method for processing the interface path information may further include the following steps.
[0096] Step S405: In response to the HTML data not being text in the designated language, the HTML data is processed into text in the designated language.
[0097] In some embodiments, the specified language text may be English.
[0098] Step S407: determining the webpage keywords according to the specified language text.
[0099] In this embodiment, a machine translation model (such as a neural network model seq2seq, etc.) or some open source translation libraries can be used to uniformly translate the page text into English. Among them, since the API interfaces in the relevant technology are all expressed in English, the web page keywords are ultimately retained only in English. In this way, the target keywords determined later can be directly applied to vocabulary replacement, which improves processing efficiency.
[0100] Figure 5 A flowchart of similarity prediction in a method for processing interface path information according to an embodiment of the present disclosure is shown. Figure 5 As shown, in some embodiments, performing similarity prediction based on the naming features and the web page keywords and determining a target keyword matching the original word among the web page keywords may include the following steps.
[0101] Step S501, processing the naming features and the webpage keywords through a trained word prediction model to predict the similarity between the original word and the webpage keywords.
[0102] In this embodiment, a word prediction model can be used to process the original word in the naming feature to obtain multiple similar words of the original word and the similarity between each similar word and the original word. If the obtained similar words include web page keywords, the similarity between the corresponding similar words and the original word can be used as the similarity between the web page keywords and the original word.
[0103] Among them, similarity can be used to characterize the degree of correlation between web page keywords and original words. The higher the degree of correlation, the more likely it is to be a valid API interface path after word replacement.
[0104] In an exemplary embodiment, the naming features and the web page keywords are processed by a trained word prediction model to predict the similarity between the original word and the web page keywords. The process may also be as follows: the original word and its part of speech in the naming features are processed by a trained word prediction model to obtain a first related word set of the original word; the web page keywords are processed by a trained word prediction model to obtain a second related word set of the web page keywords; and the similarity between the original word and the web page keywords is determined based on the first related word set and the second related word set.
[0105] A preset set similarity algorithm (such as Jaccard similarity algorithm, Dice similarity algorithm, etc.) may be used to determine the similarity between the first related word set and the second related word set as the similarity between the corresponding original word and the webpage keyword.
[0106] In an exemplary embodiment, the Jaccard similarity algorithm can be used to determine the similarity between the first set of related words and the second set of related words as the similarity between the corresponding original words and the webpage keywords. In the Jaccard similarity algorithm, the intersection of the first set of related words and the second set of related words can be determined, as well as the union of the first set of related words and the second set of related words; and then the ratio of the number of elements in the intersection to the number of elements in the union is determined as the similarity between the two sets.
[0107] In an exemplary embodiment, TF-IDF (Term Frequency-Inverse Document Frequency) or other text representation methods may be used to convert a word set into a vector, and then calculate the cosine similarity, and use the cosine similarity as the similarity between the first related word set and the second related word set.
[0108] Step S503: determining a target keyword matching the original word from the webpage keywords according to the similarity.
[0109] In this embodiment, one or more keywords with the highest similarity to the original word may be selected from the webpage keywords as target keywords according to the similarity.
[0110] You can set a similarity threshold or other selection strategies for screening. The similarity threshold can be set according to actual needs to balance the accuracy and quantity of target keywords. For example, you can select all keywords with a similarity higher than a certain threshold as candidate target keywords, and then further screen or sort them.
[0111] Through Figure 5 The illustrated embodiment can effectively determine the target keyword that matches the original word based on the similarity between the naming feature and the webpage keyword, thereby improving the accuracy and efficiency of the subsequent generation of the prediction interface path.
[0112] Figure 6 The flowchart of training a word prediction model in a method for processing interface path information according to an embodiment of the present disclosure is shown. Figure 6 As shown, in some embodiments, the training method of the word prediction model may include the following steps.
[0113] Step S601, obtaining a preset corpus, wherein the preset corpus includes computer business texts.
[0114] In this embodiment, the preset corpus can be a database containing a large amount of computer business texts. These texts may come from various sources, such as technical documents, forum discussions, software code comments, etc., which can constitute the basic data for model training. The selection and construction of the preset corpus is crucial to the quality of the model and can directly affect the type and range of language that the model can understand and generate.
[0115] Step S603: pre-training the large language model based on the preset corpus to obtain an offline large language model.
[0116] In this embodiment, the large language model can be, for example, a word vector FastText, which can process and understand complex patterns and structures in natural language. The purpose of pre-training is to allow the model to learn the basic laws and characteristics of language, such as the semantics of vocabulary, syntactic structure, contextual relationships, etc. By training on a large-scale corpus, the offline large language model can establish a deep understanding of natural language.
[0117] Step S605: Perform online training on the offline large language model based on the webpage keywords to obtain the trained word prediction model.
[0118] In this embodiment, after obtaining the offline large language model, the model can be further trained online based on web page keywords. Online training generally refers to further optimization and fine-tuning for specific tasks or data based on the model's certain language understanding capabilities. In this embodiment, web page keywords are input into the model as training data, and the model can learn and adjust based on these web page keywords to obtain the trained word prediction model.
[0119] Among them, after online training, the offline large language model is further optimized into a word prediction model. This model not only retains the language understanding ability of the original large language model in the computer field, but also performs special optimization for the processing of web page keywords. Therefore, it can more accurately predict the similarity between the original word and the web page keyword, and thus determine the target keyword that matches the original word in the web page keyword.
[0120] like Figure 6 The embodiment shown can combine the pre-training of the preset corpus and the online training of web page keywords, so that the final word prediction model can have the powerful language understanding ability of the large language model and obtain targeted optimization for specific tasks. This method not only improves the accuracy and generalization ability of the model, but also enables the model to better adapt to the needs in actual application scenarios.
[0121] In some embodiments, the method for processing interface path information also includes: performing naming feature analysis on the interface path to determine the naming specifications of each path level in the interface path; wherein, using the target keyword to replace the corresponding original word in the interface path to generate a predicted interface path for the target system, including: processing the target keyword matched by the original word according to the naming specifications of the path level to which the original word belongs to obtain a word to be replaced; using the word to be replaced to replace the corresponding original word to generate a predicted interface path for the target system.
[0122] In this embodiment, these naming conventions may involve multiple aspects such as the selection of word length, word combination (such as verb-noun combination, or noun-verb combination), capitalization rules, use of separators, etc. For example, some levels may use CamelCase, while other levels may use snake-case or kebab-case.
[0123] In this embodiment, after finding the target keyword that matches the original word, the target keyword can be processed according to the naming convention of the path level to which the original word belongs (such as character truncation, case conversion, addition or deletion of word separators, addition of special characters, etc.), so that the replaced vocabulary conforms to the naming convention of the level, thereby maintaining the consistency and readability of the interface path in naming and improving the prediction accuracy of the predicted interface path.
[0124] In an exemplary embodiment, similar naming standardization processing may also be performed on other interface information.
[0125] In an exemplary embodiment, the method for processing interface path information may include the following steps.
[0126] Step 1: Crawling basic information.
[0127] You can use mainstream methods to crawl API information, such as detecting robots.txt, detecting whether there is front-end source code leakage, detecting whether there is Swagger document leakage, crawling JS code file parsing, etc., to obtain the public API interface information of the target asset (such as API path, request body structure, return body structure, source code variable name, etc.).
[0128] Step 2: Naming feature analysis.
[0129] This step can classify, grade, and segment the information crawled in step 1.
[0130] For example, suppose there is an API path:
[0131] / home / gz / createuser;
[0132] / home / user / create;
[0133] According to the algorithm, these two paths can be parsed into two different feature data groups of path (path type). It can be seen that there are two words spliced in the third-level path of the first data group:
[0134] {raw: / home / gz / createuser,type:path,method:PUT,data:[[{gz,NOUN}],[{create,VERB},{user,NOUN}]]};
[0135] {raw: / home / user / create,type:path,method:POST,data:[[{home,NOUN}],[{user,NOUN}],[{create,VERB}]]};
[0136] Among them, similar methods can be used to perform naming feature analysis on request methods, request bodies, return parameters, and variable names.
[0137] Step 3: Core corpus processing.
[0138] The HTML core content can be crawled based on the original API path with the path category in the feature data group output in step 2.
[0139] Continuing with the above example, for the interface / home / gz / createuser, assuming that the text data of core elements such as title / h1 / h2 / h3 / th (i.e. web page keywords) can be crawled, there are:
[0140] Student information;
[0141] History class schedule;
[0142] Art class schedule arrangement;
[0143] Physical education timetable arrangement;
[0144] Editing operations;
[0145] Create an operation;
[0146] Delete operation;
[0147] You can use a machine translation (such as seq2seq) model to uniformly process these text data into English strings, because all API interfaces will be expressed in English, and the core corpus will eventually remain in English only:
[0148] Student Information;
[0149] Scheduling of history classes;
[0150] Scheduling of art classes;
[0151] Scheduling of physical education classes;
[0152] Edit Operations;
[0153] Create Operation;
[0154] Remove Operation;
[0155] Step 4: Related path prediction.
[0156] First, you can use the basic corpus for pre-training to generate an offline large language model (such as the word vector FastText). The basic corpus can be selected from a knowledge base related to the computer and industrial control fields. This is because the API interface is more likely to carry out operations such as addition, deletion, modification, and query.
[0157] After the offline model is ready, the core corpus output in step 3 is used for online learning to obtain a word prediction model. Then, the feature data set output in step 2 is used, and the verb / noun reverse query is used to reverse the words with verb and noun parts of speech from the lowest sub-path away from the root level, and use the word prediction model that has completed online learning to predict their similar words.
[0158] You can set the selection strategy, for example, you can set the similarity ratio to 0.8, the number of top-ranked records to 5, the number of valid gerund / noun levels to 1, and so on.
[0159] Based on these selection strategies, it can be determined that the prediction results for the noun user of feature data group 2 may be: Education; History; Classes; and the prediction results for the verb create of feature data group 2 may be: Edit. Moreover, these results can be uniformly converted to lowercase.
[0160] Finally, the prediction results can be backfilled to the same level position of the original feature data group through the data reorganizer to generate a new API prediction path. Then for the original API path / home / user / create, there may be related paths:
[0161] / home / history / create;
[0162] / home / education / create;
[0163] / home / classes / create;
[0164] / home / user / edit.
[0165] Afterwards, the new API prediction path can be used as the input of step 1 to continue iterative prediction. Similar processing can be performed on interface requests, return parameters, etc.
[0166] It should be noted that the above figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0167] Figure 7 FIG. 7 is a block diagram showing an interface path information processing device 700 according to an embodiment of the present disclosure; Figure 7 As shown, it includes: a determination unit 701, which is used to determine the interface information of the original application interface in the target system; the interface information at least includes an interface path; an analysis unit 702, which is used to perform naming feature analysis on the interface information, and obtain naming features containing the original words and their parts of speech in the interface information; a crawling unit 703, which is used to crawl web pages based on the interface information and obtain web page keywords; a prediction unit 704, which is used to perform similarity prediction based on the naming features and the web page keywords, and determine the target keywords that match the original words in the web page keywords; a generation unit 705, which is used to replace the corresponding original words in the interface path with the target keywords, and generate a predicted interface path for the target system.
[0168] Through the disclosed embodiments, the original API interface information exposed by the target system can be used as a basis for naming feature analysis and web page keyword crawling, and target keywords that match the original words in the interface information can be selected from the web page keywords, and then the target keywords can be used to replace the corresponding original words to generate a predicted interface path for the target system. It can be seen that in this solution, the development behavior pattern of the R&D team can be used as a basis to fully and reasonably use the exposed surface API of the target system, and the web page keywords crawled by the exposed surface API and the exposed surface API reverse reasoning can be used to predict new API interface information that is highly correlated with the original path, thereby improving the efficiency and accuracy of mining unknown APIs, allowing users to promptly discover risks in the target system and take timely measures to prevent them, providing strong support for improving network security and risk prevention and control capabilities.
[0169] In some embodiments, the interface path information processing device further includes: an iteration unit 706, configured to perform a new round of analysis and processing based on the predicted interface path and the interface information to obtain a new predicted interface path of the target system.
[0170] In some embodiments, the interface information also includes: a request method; wherein the crawling unit 703 crawls web pages based on the interface information to obtain web page keywords, including: sending a request to the server through the interface path and the request method; receiving hypertext markup language HTML data returned by the server; and determining the web page keywords based on the HTML data.
[0171] In some embodiments, the HTML data includes at least one of the following: document title data, document subject data at various levels, and table header data.
[0172] In some embodiments, the interface path information processing device further includes a translation unit 707. In response to the HTML data not being a designated language text, the translation unit 707 is configured to process the HTML data into a designated language text; and determine the web page keywords according to the designated language text.
[0173] In some embodiments, the prediction unit 704 performs similarity prediction based on the naming features and the web page keywords, and determines a target keyword that matches the original word from the web page keywords, including: processing the naming features and the web page keywords through a trained word prediction model, and predicting the similarity between the original word and the web page keywords; and determining a target keyword that matches the original word from the web page keywords based on the similarity.
[0174] In some embodiments, the interface path information processing device also includes a training unit 708, and the word prediction model is obtained by training the training unit 708 through the following method: obtaining a preset corpus, the preset corpus including computer business texts; pre-training a large language model based on the preset corpus to obtain an offline large language model; and online training the offline large language model based on the web page keywords to obtain the trained word prediction model.
[0175] In some embodiments, the analysis unit 702 is also used to perform naming feature analysis on the interface path to determine the naming conventions of each path level in the interface path; wherein the generation unit 705 uses the target keyword to replace the corresponding original word in the interface path to generate a predicted interface path for the target system, including: processing the target keyword matched by the original word according to the naming convention of the path level to which the original word belongs to obtain a word to be replaced; and using the word to be replaced to replace the corresponding original word to generate a predicted interface path for the target system.
[0176] In some embodiments, the determination unit 701 determines the interface information of the original application interface in the target system, including: determining the interface information of the original application interface based on the public asset data of the target system; wherein the public asset data includes at least one of the following: search engine crawler configuration file, front-end source code data, application interface document data, code file data.
[0177] Figure 7 For other contents of the embodiment, reference can be made to the other embodiments mentioned above.
[0178] Those skilled in the art will appreciate that various aspects of the present invention may be implemented as systems, methods or program products. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0179] Figure 8 The structure block diagram of a computer device for processing interface path information in an embodiment of the present disclosure is shown. It should be noted that the electronic device shown in the figure is only an example and should not bring any limitation to the function and scope of use of the embodiment of the present invention.
[0180] Refer to the following Figure 8 An electronic device 800 according to this embodiment of the present invention will be described. Figure 8 The electronic device 800 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0181] like Figure 8 As shown, the electronic device 800 is in the form of a general computing device. The components of the electronic device 800 may include but are not limited to: at least one processing unit 810, at least one storage unit 820, and a bus 830 connecting different system components (including the storage unit 820 and the processing unit 810).
[0182] The storage unit stores program codes, which can be executed by the processing unit 810, so that the processing unit 810 performs the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of this specification. For example, the processing unit 810 can perform the following steps: Figure 2 The method shown in .
[0183] The storage unit 820 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 8201 and / or a cache storage unit 8202 , and may further include a read-only storage unit (ROM) 8203 .
[0184] The storage unit 820 may also include a program / utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0185] Bus 830 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0186] The electronic device 800 can also communicate with one or more external devices 900 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), and can also communicate with one or more devices that enable users to interact with the electronic device 800, and / or communicate with any device that enables the electronic device 800 to communicate with one or more other computing devices (e.g., routers, modems, etc.). This communication can be carried out through an input / output (I / O) interface 850. In addition, the electronic device 800 can also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs) and / or public networks, such as the Internet) through a network adapter 860. As shown in the figure, the network adapter 860 communicates with other modules of the electronic device 800 through a bus 830. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0187] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present invention described in the above "Exemplary Method" section of the present specification.
[0188] The program product for implementing the above method according to the embodiment of the present invention may adopt a portable compact disk read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus, or device.
[0189] The program product may be any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0190] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0191] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0192] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0193] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0194] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0195] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0196] According to one aspect of the present disclosure, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in various optional implementations of the above-mentioned embodiments.
[0197] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.< / h2>
Claims
1. A method for processing interface path information, characterized in that: include: Determine interface information of the original application program interface in the target system; the interface information at least includes an interface path; Performing naming feature analysis on the interface information to obtain naming features including original words and their parts of speech in the interface information; Crawling web pages based on the interface information to obtain web page keywords; Perform similarity prediction based on the naming feature and the webpage keywords, and determine a target keyword that matches the original word among the webpage keywords; Using the target keyword to replace the corresponding original word in the interface path to generate a predicted interface path of the target system; Verify whether other web pages in the target system can be successfully crawled based on the predicted interface path; if so, determine that the predicted interface path belongs to the target system, determine that the target system has unexposed and unarchived API information, and determine that the exposed API in the target system is at risk of being mined, and take measures to eliminate the risk.
2. The method according to claim 1, characterized in that The method further comprises: A new round of analysis and processing is performed based on the predicted interface path and the interface information to obtain a new predicted interface path of the target system.
3. The method according to claim 1, characterized in that The interface information also includes: request mode; wherein crawling a web page based on the interface information to obtain web page keywords includes: Send a request to the server through the interface path and the request method; Receiving Hypertext Markup Language HTML data returned by the server; The webpage keywords are determined according to the HTML data.
4. The method according to claim 3, characterized in that The HTML data includes at least one of the following: document title data, document subject data at each level, and table header data.
5. The method according to claim 3, characterized in that: Determining the webpage keywords according to the HTML data includes: In response to the HTML data not being text in a designated language, processing the HTML data into text in a designated language; The webpage keywords are determined according to the specified language text.
6. The method according to claim 1, characterized in that Predicting similarity based on the naming feature and the webpage keyword, and determining a target keyword matching the original word from the webpage keywords, includes: Processing the naming features and the webpage keywords through a trained word prediction model to predict the similarity between the original word and the webpage keywords; A target keyword matching the original word is determined from the webpage keywords according to the similarity.
7. The method according to claim 6, characterized in that The word prediction model is trained by the following method: Acquire a preset corpus, wherein the preset corpus includes computer business texts; Pre-training the large language model based on the preset corpus to obtain an offline large language model; The offline large language model is trained online based on the webpage keywords to obtain the trained word prediction model.
8. The method according to claim 1, characterized in that The method further comprises: Performing a naming feature analysis on the interface path to determine a naming convention for each path level in the interface path; The step of replacing the corresponding original words in the interface path with the target keyword to generate the predicted interface path of the target system includes: According to the naming convention of the path level to which the original word belongs, the target keyword matched by the original word is processed to obtain the word to be replaced; The to-be-replaced word is used to replace the corresponding original word, and a predicted interface path of the target system is generated.
9. The method according to claim 1, characterized in that: Determine the interface information of the original application interface in the target system, including: The interface information of the original application program interface is determined based on the public asset data of the target system; wherein the public asset data includes at least one of the following: a search engine crawler configuration file, front-end source code data, application program interface document data, and code file data.
10. A device for processing interface path information, characterized in that: include: A determination unit, used to determine interface information of an original application program interface in a target system; The interface information at least includes an interface path; An analysis unit, configured to perform naming feature analysis on the interface information to obtain naming features including original words and their parts of speech in the interface information; A crawling unit, used to crawl web pages based on the interface information to obtain web page keywords; A prediction unit, configured to perform similarity prediction based on the naming feature and the webpage keywords, and determine a target keyword matching the original word among the webpage keywords; A generating unit, configured to replace the corresponding original words in the interface path with the target keyword to generate a predicted interface path of the target system; The device is also used to: verify whether other web pages in the target system can be successfully crawled based on the predicted interface path; if so, determine the predicted interface path as unexposed and unarchived API information in the target system, and determine the predicted interface path as a risk that can be mined, and take measures to eliminate the risk.
11. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method for processing interface path information according to any one of claims 1 to 9 is implemented.
12. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the method for processing interface path information as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Interface data exposure detection method based on dynamic tag
CN115618085A
HTTP log integration to web application testing
US20210092144A1
Utilizing a neural network model to determine risk associated with an application programming interface of a web application
US20210124628A1
Automatic generation of deceptive API endpoints
US20220109692A1
Phishing URL detection using transformers
WO2022187034A1
