Honeypot generation method, device, electronic device and storage medium
By obtaining and automatically generating the page request and response information of the honeypot, and using crawler technology to build a honeypot that imitates the real site, the problem of insufficient camouflage of the honeypot is solved, and the emulation and defense efficiency of the honeypot are improved.
Patent Information
- Application Number
- CN202210527188.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-16
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-05-16
AI Technical Summary
Existing honeypot technology is difficult to improve camouflage and cannot effectively imitate real business sites, resulting in low attack identification and defense efficiency.
By obtaining the page request information and response information of the site to be imitated, crawler technology is used to automatically generate service functions, and a honeypot that imitates the site is built to improve the camouflage and automation of the honeypot.
It achieves efficient generation and improved camouflage of honeypots, can replicate the pages and interaction processes of sites to be imitated, and improves honeypot emulation and defense efficiency.
Smart Images

Figure CN114928484B
Abstract
Description
Technical Field
[0001] The present application relates to the field of network security technology, and in particular to a honeypot generation method, device, electronic device and storage medium. Background Art
[0002] Honeypot technology is essentially a technology that deceives attackers. By placing some hosts, network services or information as bait, the attackers are lured to attack them, so that the attack behavior can be captured and analyzed, the tools and methods used by the attackers can be understood, and the attack intentions and motives can be inferred. This allows the defenders to clearly understand the security threats they face and enhance the security protection capabilities of the actual system through technical and management means. In order to improve the camouflage of the honeypot and make the honeypot closer to the real business, the honeypot can be built by imitating business-related sites. Therefore, there is an urgent need for a honeypot generation solution that allows the generated honeypot to imitate business-related sites to improve the camouflage of the honeypot. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a honeypot generation method, device, electronic device and storage medium to solve the above technical problems.
[0004] The present application provides a method for generating a honeypot, the method comprising:
[0005] Obtaining page request information of the site to be copied and page response information corresponding to each of the page request information;
[0006] Generate a service function bound to each of the page request information according to each of the page request information and the corresponding page response information; the service function is used to return the page response information corresponding to the page request information bound to the service function when executed;
[0007] A honeypot corresponding to the to-be-emulated site is generated based on each of the page request information and the corresponding service functions.
[0008] In the above implementation process, a service function can be automatically generated according to the obtained page request information and the corresponding page response information. The service function is used to return the page response information corresponding to the page request information bound to the service function when executed, and generate a honeypot corresponding to the site to be imitated based on each service function. By automatically emulating the site, the automatic construction of the honeypot is realized, which improves the efficiency of honeypot generation. In addition, since the honeypot is generated based on the page request information of the site to be imitated and the page response information corresponding to each page request information, the generated honeypot can imitate the response of the site to be imitated, thereby improving the camouflage of the honeypot.
[0009] Furthermore, the page request information of the site to be copied and the page response information respectively corresponding to each of the page request information are: information obtained by performing page crawling on the site to be copied according to the first URL address of the site to be copied.
[0010] In the above implementation process, the page request information and the corresponding page response information of the site to be copied are automatically obtained through crawler technology, which improves the automation level of honeypot generation and further improves the efficiency of honeypot generation.
[0011] Furthermore, crawling the site to be copied according to the first URL address of the site to be copied includes:
[0012] Generate a page request message for opening the first URL address and send it to the server;
[0013] storing the page request information and the page response information returned by the server in response to the page request information, and extracting target page element data from the page response information;
[0014] The next step of dynamic crawler operation is performed according to the target page element data, and in the process of performing the next step of dynamic crawler operation, the crawled page request information and the corresponding page response information are associated and stored.
[0015] In the above implementation process, the page request information for opening the first URL address is automatically generated, so it is possible to simulate manually opening the site to be copied, further improving the automation level of the honeypot generation process.
[0016] Further, the target page element data includes at least one of page link element data and page button element data; the step of performing the next dynamic crawler operation according to the target page element data, and in the process of performing the next dynamic crawler operation, associating and storing the crawled page request information and the corresponding page response information, includes:
[0017] When the target page element data includes page link element data, extracting a second URL address from the page link element data, generating page request information for opening the second URL address and sending the page request information to the server, and storing the page request information and page response information returned by the server according to the page request information;
[0018] When the target page element data includes page button element data, page request information for triggering the corresponding page button element is generated and sent to the server, and the page request information and page response information returned by the server according to the page request information are stored.
[0019] In the above implementation process, by generating page request information to open the second URL address, or generating page request information to trigger the page button element to perform page crawling, the access trigger request of the site to be replicated can be automatically cloned, and the site to be replicated can be restored by establishing a corresponding relationship between the page request information and the page response information, so that the reconstructed honeypot has the page of the site to be replicated, and can replicate the interactive process on the site to be replicated, with high simulation.
[0020] Furthermore, the step of obtaining page request information of the site to be copied and page response information corresponding to each of the page request information includes:
[0021] Extracting page request information of the site to be copied and page response information respectively corresponding to each of the page request information from a database; the database stores page request information obtained by crawling the site to be copied and page response information respectively corresponding to each of the page request information;
[0022] The extracted page request information and the page response information respectively corresponding to each of the page request information are deduplicated.
[0023] In the above implementation process, the page request information and page response information are first deduplicated, and then the corresponding service function is generated according to the remaining page request information and the corresponding page response information after deduplication. This can avoid generating multiple duplicate service functions for the same page request information, improve the efficiency of honeypot generation, and reduce the demand for computing resources.
[0024] Further, the generating of service functions respectively bound to each of the page request information according to each of the page request information and the corresponding each of the page response information; the service function is used to return page response information corresponding to the page request information bound to the service function when executed, including:
[0025] When receiving a modification instruction for a certain page response information, modify the page response information;
[0026] A service function corresponding to the page request information is generated according to the modified page response information and the corresponding page request information; the service function is used to return the modified page response information corresponding to the page request information bound to the service function when executed.
[0027] In the above implementation process, the page response information can be modified to achieve the effect of customizing the honeypot data.
[0028] Furthermore, the generating of a honeypot corresponding to the to-be-emulated site based on each of the page request information and each of the corresponding service functions includes:
[0029] Generate a honeypot image corresponding to the site to be copied based on each of the page request information and the corresponding service functions;
[0030] The honeypot image is uploaded to the target address to obtain a honeypot accessible to visitors.
[0031] In the above implementation process, the honeypot image can be uploaded to the target address for visitors to access.
[0032] The embodiment of the present application also provides a honeypot generation device, including:
[0033] An acquisition module, used for acquiring page request information of the site to be copied and page response information respectively corresponding to each of the page request information;
[0034] A first generating module, configured to generate a service function bound to each of the page request information according to each of the page request information and the corresponding each of the page response information; the service function is configured to return the page response information corresponding to the bound page request information when executed;
[0035] The second generating module is used to generate a honeypot corresponding to the site to be imitated based on each of the service functions.
[0036] An embodiment of the present application further provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer program to implement any one of the above methods.
[0037] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by at least one processor, any one of the above methods is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 This is a flow chart of the honeypot generation method in Example 1 of the present application;
[0040] Figure 2This is a schematic diagram of the process of crawling pages of a site to be copied in the first embodiment of the present application;
[0041] Figure 3 This is a schematic diagram of the process of crawling pages of a site to be copied in the second embodiment of the present application;
[0042] Figure 4 This is a flow chart of the honeypot generation method in the second embodiment of the present application;
[0043] Figure 5 This is a schematic diagram of the structure of the honeypot generation device in the third embodiment of the present application;
[0044] Figure 6 This is a schematic diagram of the structure of the electronic device in the fourth embodiment of the present application. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0046] It should be noted that the descriptions involving "first", "second", etc. in the embodiments of the present invention are only for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0047] In the description of the present invention, it should be understood that the numerical labels before the steps do not indicate the order in which the steps are executed, but are only used to facilitate the description of the present invention and to distinguish each step, and therefore should not be understood as a limitation of the present invention.
[0048] Several embodiments will be provided below to specifically introduce the honeypot generation method, device, electronic device and storage medium.
[0049] Embodiment 1:
[0050] In order to improve the disguise of the honeypot and make the honeypot closer to the real business, the embodiment of the present application provides a honeypot generation method, and the honeypot generation method provided in the embodiment of the present application can be applied to an electronic device, and the electronic device can be a server, such as a cloud server, a network server, a database server, etc. The electronic device can also be a terminal, such as a personal computer, a laptop, a tablet computer, a mobile phone, etc.
[0051] See also Figure 1 As shown, the honeypot generation method provided in the embodiment of the present application may include the following steps:
[0052] S11: Obtaining page request information of the site to be cloned and page response information corresponding to each page request information.
[0053] S12: Generate service functions bound to each page request information according to each page request information and each corresponding page response information; the service function is used to return page response information corresponding to the page request information bound to the service function when executed.
[0054] S13: Generate a honeypot corresponding to the site to be imitated based on each page request information and each corresponding service function.
[0055] For better understanding, the above steps are described in detail below.
[0056] The site to be copied in step S11 can be a dynamic page site. Of course, in other embodiments, the site to be copied can also be a static page site. In practical applications, the site to be copied can be flexibly selected according to the demand for the honeypot.
[0057] It is understandable that the site to be copied can be monitored. When page request information for the site to be copied is monitored, the page request information is saved, and the page response information generated by the site to be copied based on the page request information is correspondingly saved. Specifically, the page request information and the corresponding page response information can be associated and saved in a database.
[0058] Exemplarily, the request response of the site to be copied in the actual application scenario may be monitored, that is, the monitored page request information may be sent by the client, and the user may send the page request information to the site to be copied through the client.
[0059] For example, the page request information and the page response information respectively corresponding to each page request information in the embodiment of the present application may also be information obtained by performing a page crawler on the site to be copied according to the first URL address of the site to be copied. The page request information may be automatically generated by a crawler server or other electronic device that executes the page crawler when performing a page crawler on the site to be copied.
[0060] After obtaining the page request information of the site to be copied and the page response information corresponding to each page request information, the crawler server can send the information to the electronic device that executes the honeypot generation method. Of course, after the crawler server crawls the site to be copied to obtain the page request information and the page response information corresponding to each page request information, the crawler server can also directly execute the above steps S12 and S13.
[0061] The following is a detailed introduction to the process of crawling information of the site to be copied.
[0062] The first URL address is the starting URL address of the crawler operation. In order to replicate the site to be copied, the information of all pages with the first URL address as the root page can be crawled, and the crawled information is stored in a database.
[0063] It should be noted that in addition to crawling the page request information and corresponding page response information of each page according to the first URL address, the crawler server can also crawl all element resource information in the page, and generate a honeypot based on the crawled information so that the honeypot can present the same page as the site to be imitated.
[0064] See also Figure 2 As shown, crawling the pages of the imitation site may include the following steps:
[0065] S21: Generate page request information for opening the first URL address and send it to the server.
[0066] S22: storing the page request information and the page response information returned by the server in response to the page request information, and extracting target page element data from the page response information.
[0067] S23: Perform the next dynamic crawler operation according to the target page element data, and in the process of performing the next dynamic crawler operation, associate and store the crawled page request information and the corresponding page response information.
[0068] The target page element data in the embodiment of the present application includes at least one of page link element data and page button element data, which is not limited in the embodiment of the present application.
[0069] For step S22, when the target page element data includes page link element data, the second URL address can be extracted from the page link element data, page request information for opening the second URL address is generated and sent to the server, and the page request information and page response information returned by the server according to the page request information are stored. When the target page element data includes page button element data, page request information for triggering the corresponding page button element can be generated and sent to the server, and the page request information and page response information returned by the server according to the page request information are stored.
[0070] In an embodiment of the present application, a page request information for opening the first URL address or the second URL address can be generated based on a headless browser and sent to a server. The headless browser can also generate page request information for triggering a corresponding page button element.
[0071] It can be understood that for the page response information crawled in step S23, if the page response information contains page link element data of the next-level page, the URL address can be extracted from the page link element data of the next-level page, and page request information for opening the URL address can be generated and sent to the server, and the page request information and the page response information returned by the server based on the page request information are stored; if the page response information contains page button element data of the next-level page, page request information for triggering the corresponding page button element in the next-level page can be generated and sent to the server, and the page request information and the page response information returned by the server based on the page request information can be stored.
[0072] In the embodiment of the present application, the pages related to the site to be copied can be completely cloned through a dynamic crawler, and the page can be accessed by simulating manual opening of the server, performing operations such as clicking page buttons, and saving page response information triggered during page loading. The page can be fully rendered, and the interactive requests and corresponding responses of the site to be copied can be completely simulated through service functions.
[0073] It is understood that in the embodiment of the present application, a crawler termination condition may be preset, and when the crawler termination condition is met, the crawler is stopped. The crawler termination condition may be that the number of crawled URLs reaches a preset number threshold. It is understood that when the crawler termination condition is met, subsequent deeper pages may no longer be crawled.
[0074] It should be noted that duplicate data may be crawled during the page crawling process, so before step S12, duplicate page request information in the page request information can be removed, and duplicate page response information in the corresponding page response information can be removed. This can avoid generating multiple duplicate service functions for the same page request information, improve the efficiency of honeypot generation, and reduce the demand for computing resources.
[0075] Exemplarily, in the above step S11, the page request information of the site to be copied and the page response information corresponding to each page request information can be extracted from the database; the database stores the page request information obtained by crawling the site to be copied and the page response information corresponding to each page request information; then the extracted page request information and the page response information corresponding to each page request information are deduplicated. In this way, in step S12, the corresponding service function can be generated according to the deduplicated page request information and the corresponding page response information.
[0076] In the above step S12, when a modification instruction for a certain page response information is received, the page response information can be modified, and then a corresponding service function bound to the page request information is generated based on the modified page response information and the corresponding page request information; the service function is used to return the modified page response information corresponding to the page request information bound to the service function when executed.
[0077] In the embodiment of the present application, the page response information is modified, including but not limited to at least one of the following modification methods:
[0078] Method 1: Modify the HTML static source data in the page response information.
[0079] Method 2: Modify the image data in the page response information.
[0080] Method 3: Modify the response code data in the page response information.
[0081] The data in method 3 mainly refers to data other than HTML data type, such as JSON and XML data.
[0082] It is understandable that, in step S13, a honeypot image corresponding to the site to be cloned may be generated based on each service function, and then the honeypot image may be uploaded to the target address to obtain a honeypot accessible to the visitor.
[0083] In the above step S12, the corresponding service function is automatically reconstructed by obtaining each page request information and the corresponding page response information, without the need for developers to write corresponding function codes for each page request information, which can improve the efficiency of honeypot construction.
[0084] Embodiment 2:
[0085] For better understanding, the embodiment of the present application introduces the honeypot generation method with reference to specific examples.
[0086] In order to crawl the pages of the site to be copied and obtain the page request information and corresponding page response information of the site to be copied, the page crawler server can be configured first. Specifically, the following information can be configured:
[0087] (1) The first URL address of the site to be copied, which is the starting address of the crawler.
[0088] (2) The address of the login page of the site to be cloned, the element selector address of the page login element, the element selector can be a CSS-selector or Xpath selector, including the page static element address of the account input box of the login page, the page static element address of the password input box, and the page static element address of the login button.
[0089] (3) Login credential information after successful login. Before configuring the crawler server, you can use the credential information to log in to the site to be copied, and then record the credential information in the form of a token or cookie after successful login. When configuring the crawler server, the credential information in the form of a token or cookie is configured in the crawler server as login credential information. The login credential information is used to carry the login credential information in the page request information when simulating the manual triggering of the site to be copied to crawl.
[0090] (4) Crawler termination condition: you can set the target URL number. When the number of crawled URLs reaches the target URL number, the crawler stops.
[0091] After completing the configuration of the crawler server, you can start the crawler server to crawl the pages of the site to be copied. For the crawler process, please refer to Figure 3 As shown, the following steps may be included:
[0092] S31: Control and launch a headless browser.
[0093] In the embodiment of the present application, the control of the headless browser can be implemented based on the API interface provided by Puppeteer, and the headless browser can simulate manual button clicks and site opening operations.
[0094] S32: Open a page corresponding to a URL address.
[0095] In step S32, a page corresponding to the first URL address preconfigured in the crawler server may be opened.
[0096] S33: asynchronously monitor the request response event in the page. When the page triggers the request response event, the URL address of the current request is stored in a preset URL address pool, and the page request information and the corresponding page response information are associated and stored.
[0097] The stored page request information may include at least one of the following fields:
[0098] Request URL, request method, request header, request resource type, and request data.
[0099] The requested resource type is the type of request initiated, such as image resources, html resources, etc.
[0100] The request data can be the data in the request body.
[0101] The stored page response information may include at least one of the following fields:
[0102] Response header, response page data.
[0103] S34: extracting page link element data and page button element data from the page response information.
[0104] S35: Extract the second URL address from the page link element data, and go to S32.
[0105] It should be noted that when step S35 turns to S32, the page corresponding to the second URL address should be opened.
[0106] S36: Generate page request information for triggering a corresponding page button element and send it to the server, and store the page request information and page response information returned by the server according to the page request information.
[0107] It should be noted that the generated page request information may carry login credential information to prove identity. In the embodiment of the present application, the login page of the site to be copied can also be accessed without carrying login credential information, and the page request information and corresponding page response information used to load the login page are saved. A honeypot is generated according to the page request information and the corresponding page response information used to load the login page, so that the honeypot can replicate the login page.
[0108] S37: Determine whether the number of crawled URLs reaches the preset target URL number. If yes, go to S38; if no, go to S32.
[0109] S38: End crawler.
[0110] After the crawler server obtains the page request information of the site to be imitated and the page response information corresponding to each page request information according to the crawler operation, the information can be stored in a database, or the information can be directly sent to the electronic device for the electronic device to generate a honeypot. The embodiment of the present application is explained by taking the example of the crawler server storing the crawled information in the database.
[0111] See also Figure 4 As shown, the process of generating a honeypot by an electronic device is as follows:
[0112] S41: extracting page request information and corresponding page response information stored in a database.
[0113] S42: De-duplicate the page request information and the corresponding page response information.
[0114] In the embodiment of the present application, deduplication can be performed according to a hash method. Specifically, a hash string can be generated according to the request URL, request method and request data in the page request information, and deduplication can be performed according to the hash string. If the hash strings corresponding to two page request information are the same, it means that the two page request information are the same. Therefore, for the page request information with the same hash string, the duplicate page request information and the corresponding duplicate page response information are deleted.
[0115] In an embodiment of the present application, the deduplicated page request information can be stored in a file format, and the deduplicated page response information can be stored in a corresponding file format to facilitate subsequent calls to generate service functions.
[0116] S43: Generate a service function bound to the page request information according to the deduplicated page request information and the corresponding page response information.
[0117] The service function is used to return page response information corresponding to the page request information bound to the service function when executed.
[0118] It can be understood that the page request information usually contains multiple types of request information. In step S43, the request URL, request method and request header in the page request information can be combined into a request URI, and then a WEB framework such as Fllask is used to generate a corresponding service function for each request URI, and the service function is bound to the corresponding URI. In this way, when the honeypot receives the page request information containing the request URI sent by the visitor, it can trigger the execution of the corresponding service function, thereby returning the corresponding page response information to the visitor.
[0119] S44: Obtain the login page information of the site to be copied.
[0120] In the embodiment of the present application, the login page information in the corresponding login page can be extracted according to the address of the login page of the site to be copied, and the target code can be inserted according to the login element information of the login configuration item in the crawler configuration item. The target code is used for logical monitoring of the user after filling in the account password and logging in on the page. The background determines whether the account password is the honeypot preset password. If it is correct, it will jump to the page after the successful login. If the login fails, a pop-up window of login failure will pop up.
[0121] S45: Generate a honeypot based on the login page information, the page request information and the corresponding service function.
[0122] It should be noted that in the process of generating a honeypot, the embodiment of the present application can modify the page response information of the generated honeypot. Specifically, an information modification module can be provided by the front end, and the specific content of the service function can be presented to the front end.
[0123] It can present all URL addresses obtained by the crawler, and can be divided into HTML type, IMAGE type, JSON type, XML type and other types according to data type.
[0124] The page request information bound to the service function can be presented in the form of original page request information, including the request URL, request method, request header, request resource type, and request data.
[0125] The page response information in the service function can be presented, and a corresponding modification module is provided for the user to modify the page response information.
[0126] For page response information, multiple presentation methods are provided according to different request types:
[0127] HTML type, the front end uses the iframe tag to embed page response information for preview, and can edit HTML static source code.
[0128] IMAGE type, the front end uses the img tag to embed the page response information for preview, and can be replaced by uploading pictures.
[0129] JSON, XML, and other types of response data can directly present the corresponding response code and can directly edit the corresponding response code.
[0130] After modifying the page response information, the modified page response information can be stored again, and subsequently a honeypot image similar to the site to be cloned can be regenerated based on step S43, and then the honeypot image is packaged as a site or containerized, and the packaged site is the final dynamic clone honeypot.
[0131] Embodiment three:
[0132] This application embodiment provides a honeypot generation device, see Figure 5 As shown, including:
[0133] The acquisition module 501 is used to acquire the page request information of the site to be copied and the page response information corresponding to each page request information;
[0134] The first generating module 502 is used to generate service functions respectively bound to each page request information according to each page request information and the corresponding page response information; the service function is used to return the page response information corresponding to the page request information bound to the service function when executed;
[0135] The second generating module 503 is used to generate a honeypot corresponding to the site to be imitated based on each page request information and each corresponding service function.
[0136] In an exemplary embodiment, the page request information of the site to be replicated and the page response information respectively corresponding to each page request information are: information obtained by performing page crawling on the site to be replicated according to the first URL address of the site to be replicated.
[0137] In an exemplary embodiment, the device also includes a crawler module, which is used to generate page request information for opening the first URL address and send it to the server; store the page request information and the page response information returned by the server for the page request information, and extract target page element data from the page response information; perform the next dynamic crawler operation according to the target page element data, and in the process of performing the next dynamic crawler operation, associate and store the crawled page request information and the corresponding page response information.
[0138] In an exemplary embodiment, the target page element data includes at least one of page link element data and page button element data; the crawler module is also used to extract a second URL address from the page link element data when the target page element data includes page link element data, generate page request information for opening the second URL address and send it to the server, store the page request information and page response information returned by the server based on the page request information; when the target page element data includes page button element data, generate page request information for triggering the corresponding page button element and send it to the server, store the page request information and page response information returned by the server based on the page request information.
[0139] In an exemplary embodiment, the acquisition module 501 is used to extract page request information of the site to be imitated and page response information corresponding to each page request information from a database; the database stores page request information obtained by crawling the site to be imitated and page response information corresponding to each page request information; and deduplicates the extracted page request information and page response information corresponding to each page request information.
[0140] In an exemplary embodiment, the first generation module 502 is also used to modify the page response information upon receiving a modification instruction for a certain page response information; generate a corresponding service function bound to the page request information based on the modified page response information and the corresponding page request information; the service function is used to return the modified page response information corresponding to the page request information bound to the service function when executed.
[0141] In an exemplary embodiment, the first generating module 502 is further used to modify the HTML static source code data in the page response information; or to modify the image data in the page response information; or to modify the response code data in the page response information.
[0142] In an exemplary embodiment, the second generation module 503 is used to generate a honeypot image corresponding to the site to be imitated based on each page request information and each corresponding service function; and upload the honeypot image to the target address to obtain a honeypot accessible to visitors.
[0143] It should be understood that, for the sake of brevity, some of the contents described in the first embodiment will not be repeated in this embodiment.
[0144] Embodiment 4:
[0145] Based on the same inventive concept, the present application embodiment provides an electronic device, see Figure 6 As shown, it includes a processor 601 and a memory 602, wherein the memory 602 stores a computer program, and the processor 601 executes the computer program to implement the steps of the method in the above-mentioned embodiment 1, which will not be repeated here.
[0146] Understandably, Figure 6 The structure shown is for illustration only, and the device may also include Figure 6 More or fewer components as shown, or with Figure 6 Different configurations are shown.
[0147] The processor 601 may be an integrated circuit chip with signal processing capabilities. The processor 601 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It may implement or execute various methods, steps, and logic block diagrams disclosed in the embodiments of the present application.
[0148] The memory 602 may include, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable read-only memory (EPROM), electrically erasable read-only memory (EEPROM), etc.
[0149] This embodiment also provides a computer-readable storage medium, such as a floppy disk, a CD, a hard disk, a flash memory, a USB flash drive, a secure digital (SD) card, a multimedia (MMC) card, etc., in which one or more programs for implementing the above steps are stored. These one or more programs can be executed by one or more processors to implement the steps of the methods in the above embodiments, which will not be repeated here.
[0150] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0151] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method.
[0152] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A honeypot generation method, characterized in that: The method comprises: Obtaining page request information of the site to be copied and page response information corresponding to each of the page request information; Generate service functions bound to each of the page request information according to each of the page request information and the corresponding page response information; the service function is used to return page response information corresponding to the page request information bound to the service function when executed; simulate the interactive request and corresponding response of the site to be imitated through the service function; Generate a honeypot corresponding to the site to be imitated based on each of the page request information and the corresponding service functions; Before obtaining the page request information of the site to be copied and the page response information respectively corresponding to each of the page request information, the method includes: asynchronously monitoring the site to be copied, and when the page request information for the site to be copied is detected, associating the page request information with the corresponding page response information and saving it in a database; The method of obtaining the page request information of the site to be copied and the page response information respectively corresponding to each of the page request information comprises: extracting the page request information of the site to be copied and the page response information respectively corresponding to each of the page request information from a database; storing the page request information obtained by crawling the site to be copied and the page response information respectively corresponding to each of the page request information in the database; and deduplicating the extracted page request information and the page response information respectively corresponding to each of the page request information.
2. The honeypot generation method according to claim 1, characterized in that: The page request information of the site to be copied and the page response information respectively corresponding to each of the page request information are: information obtained by performing page crawling on the site to be copied according to the first URL address of the site to be copied.
3. The honeypot generation method according to claim 2, characterized in that: The crawling of the site to be copied according to the first URL address of the site to be copied comprises: Generate a page request message for opening the first URL address and send it to the server; storing the page request information and the page response information returned by the server in response to the page request information, and extracting target page element data from the page response information; The next step of dynamic crawler operation is performed according to the target page element data, and in the process of performing the next step of dynamic crawler operation, the crawled page request information and the corresponding page response information are associated and stored.
4. The honeypot generation method according to claim 3, characterized in that: The target page element data includes at least one of page link element data and page button element data; the step of performing the next dynamic crawler operation according to the target page element data, and in the process of performing the next dynamic crawler operation, associating and storing the crawled page request information and the corresponding page response information, includes: When the target page element data includes page link element data, extracting a second URL address from the page link element data, generating page request information for opening the second URL address and sending the page request information to the server, and storing the page request information and page response information returned by the server according to the page request information; When the target page element data includes page button element data, page request information for triggering the corresponding page button element is generated and sent to the server, and the page request information and page response information returned by the server according to the page request information are stored.
5. The honeypot generation method according to any one of claims 1 to 4, characterized in that: generating a service function respectively bound to each of the page request information according to each of the page request information and the corresponding each of the page response information; The service function is used to return page response information corresponding to the page request information bound to the service function when executed, including: When receiving a modification instruction for a certain page response information, modify the page response information; A service function corresponding to the page request information is generated according to the modified page response information and the corresponding page request information; the service function is used to return the modified page response information corresponding to the page request information bound to the service function when executed.
6. The honeypot generation method according to any one of claims 1 to 4, characterized in that: The step of generating a honeypot corresponding to the to-be-emulated site based on each of the page request information and each of the corresponding service functions comprises: Generate a honeypot image corresponding to the site to be copied based on each of the page request information and the corresponding service functions; The honeypot image is uploaded to the target address to obtain a honeypot accessible to visitors.
7. A honeypot generating device, characterized in that: include: An acquisition module, used for acquiring page request information of the site to be copied and page response information respectively corresponding to each of the page request information; A first generating module, configured to generate a service function bound to each of the page request information according to each of the page request information and the corresponding each of the page response information; the service function is configured to return page response information corresponding to the page request information bound to the service function when executed; Simulating the interactive request and corresponding response of the site to be imitated by the service function; A second generating module, used for generating a honeypot corresponding to the site to be imitated based on each of the page request information and the corresponding service functions; Before obtaining the page request information of the site to be copied and the page response information respectively corresponding to each of the page request information, the method includes: asynchronously monitoring the site to be copied, and when the page request information for the site to be copied is detected, associating the page request information with the corresponding page response information and saving it in a database; The method of obtaining the page request information of the site to be copied and the page response information respectively corresponding to each of the page request information comprises: extracting the page request information of the site to be copied and the page response information respectively corresponding to each of the page request information from a database; storing the page request information obtained by crawling the site to be copied and the page response information respectively corresponding to each of the page request information in the database; and deduplicating the extracted page request information and the page response information respectively corresponding to each of the page request information.
8. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer program to implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by at least one processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Interactive selected web crawler establishment method and system based on page elements
CN107609150A
XSS (Cross Site Scripting) vulnerability detection method and device
CN108846286A
Crawler system based on HTTP proxy and implementation method thereof
CN112800309A
Network attack processing method and device
CN113676449A
Honeypot building method and application method
CN114024728A
