Web fingerprint detection method and related equipment
Using web crawlers and machine learning models to identify component information of Web sites solves the problems of low accuracy and poor scalability in existing technologies, enables efficient security detection of Web sites, and improves security.
Patent Information
- Application Number
- CN202111681406.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2041-12-31
AI Technical Summary
The existing Web component type detection system has low accuracy, poor scalability, incomplete detection, and low detection efficiency. It is difficult to effectively identify the component information of the Web site, resulting in insufficient security.
Use a web crawler to crawl multiple web page source codes from the target site, obtain key information of the static file path, obtain response message header information through predefined HTTP requests, and use the Web fingerprint library and machine learning model to identify the CMS type and Web server type. , and detect host port fingerprints through network connection side scanning tools.
It achieves comprehensive, accurate and efficient detection of target site component information, improves identification accuracy and scalability, can effectively prevent attacks from Web component and host service vulnerabilities, and improves the security of Web sites.
Smart Images

Figure CN114528457B
Abstract
Description
Technical Field
[0001] The present application relates to Web (World Wide Web) security technology, and in particular to a Web fingerprint detection method and related equipment. Background Art
[0002] With the rapid development of Internet technology, the number of Web sites has increased dramatically, and the application scenarios of Web sites have become increasingly diverse. Web applications are widely used in areas closely related to people's lives, such as social networks, banking services, online shopping, Web mail, blogs, etc. While Web applications bring great convenience to our lives, the security issues of Web sites are always a threat to our lives and property safety. A large number of open source components are widely used in building Web sites, but these open source components themselves may also have various vulnerabilities and defects that are easily exploited by attackers.
[0003] At present, most Web attacks exploit known vulnerabilities in Web components and further obtain high-level permissions and important data of the server through attack methods. The security of a Web site is closely related to whether the components used by the site have vulnerabilities. Therefore, Web fingerprinting is an important step in information collection before conducting security testing on the target site. Accurately identifying the Web component information of the target site can improve the efficiency of security testing and is of great help in formulating penetration detection strategies. However, the relevant Web component type detection system has technical problems such as low accuracy, poor scalability, incomplete detection, and low detection efficiency. Summary of the invention
[0004] In view of this, the purpose of this application is to propose a Web fingerprint detection method and related equipment.
[0005] Based on the above objectives, the first aspect of the present application provides a Web fingerprint detection method, including:
[0006] Using a web crawler to crawl the web page source codes of multiple web pages from a target site, and obtaining key information of static file paths based on the web page source codes;
[0007] The web crawler sends a predefined HTTP request to the host server of the target site to obtain header information of a response message of the host server;
[0008] By matching the key information with a Web fingerprint library, the content management system (CMS) type of the target site is identified;
[0009] Based on the header information, predict the type of the Web server of the target site using a trained machine learning model;
[0010] The host port fingerprint of the target site is detected by scanning the open port of the host server and the service corresponding to the open port using a network connection terminal scanning tool.
[0011] The second aspect of the present application proposes a Web fingerprint detection device, comprising:
[0012] The crawling module is configured to: crawl the source codes of multiple web pages from the target site using a web crawler, and obtain key information of the static file path based on the source codes; obtain the header information of the response message of the host server by sending a predefined HTTP request to the host server of the target site through the web crawler;
[0013] The Web fingerprint detection module is configured to: identify the CMS type of the target site by matching the key information with the Web fingerprint library; predict the Web server type of the target site based on the header information using a trained machine learning model; and detect the host port fingerprint of the target site by scanning the open ports of the host server and the services corresponding to the open ports using a network connection terminal scanning tool.
[0014] The third aspect of the present application proposes an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the method provided in the first aspect of the present application when executing the computer program.
[0015] From the above description, it can be seen that the Web fingerprint detection method and related equipment provided by the present application use a web crawler to crawl the web page source code of multiple web pages from the target site, and obtain the key information of the static file path based on the web page source code. Crawling multiple web page source codes has a higher recognition accuracy rate than crawling a single web page source code. By sending a predefined HTTP request to the host server of the target site by the web crawler, the header information of the response message of the host server is obtained, and the header information of the response message is used for identification. Even if the Server field of the response message is modified or deleted, it can still be accurately identified. Compared with the identification method based on fixed rules, it has higher accuracy and better scalability. By matching key information with the Web fingerprint library, the CMS type of the target site is identified; based on the header information, the trained machine learning model is used to predict the Web server type of the target site; by using the network connection end scanning tool to scan the open ports of the host server and the services corresponding to the open ports, the host port fingerprint of the target site is detected; the Web server identification, CMS system identification, host information detection and other functions are integrated into one, solving the technical problems of low accuracy, poor scalability, incomplete detection, and low detection efficiency in related technologies, and realizing comprehensive, accurate and efficient detection of the component information of the target site. According to the detection results, attacks on Web components and host service vulnerabilities can be effectively prevented to maintain the security of Web sites. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0017] Figure 1 A flowchart of a Web fingerprint detection method provided in an embodiment of the present application;
[0018] Figure 2 This is a flowchart of step 400 of the Web fingerprint detection method according to an embodiment of the present application;
[0019] Figure 3 This is a flow chart of Web server type detection in an embodiment of the present application;
[0020] Figure 4 This is a flowchart of step 500 of the Web fingerprint detection method according to an embodiment of the present application;
[0021] Figure 5 This is a host port fingerprint detection flow chart of an embodiment of the present application;
[0022] Figure 6 This is an information crawling flow chart of the crawling module of an embodiment of the present application;
[0023] Figure 7 A schematic diagram of web page relationships in an embodiment of the present application;
[0024] Figure 8 A flowchart of step 100 of the Web fingerprint detection method according to an embodiment of the present application;
[0025] Fig. 9 This is a CMS system type detection flow chart of an embodiment of the present application;
[0026] Fig.10 This is a flowchart of step 200 of the Web fingerprint detection method according to an embodiment of the present application;
[0027] Fig.11 A block diagram of a Web fingerprint detection device provided in an embodiment of the present application;
[0028] Fig.12 This is a flowchart of the execution process of the Web fingerprint detection module of the embodiment of the present application;
[0029] Fig.13 This is a flow chart of the detection process of an embodiment of the present application;
[0030] Fig.14 A schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0031] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0032] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be understood by people with ordinary skills in the field to which the present application belongs. "Include" or "comprising" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
[0033] In some embodiments, Figure 1 As shown, a Web fingerprint detection method includes:
[0034] Step 100: crawl the web page source codes of multiple web pages from the target site using a web crawler, and obtain key information of the static file path based on the web page source codes.
[0035] In this step, crawling multiple web page source codes has a higher recognition accuracy than crawling a single web page source code.
[0036] Step 200, the web crawler sends a predefined HTTP request to the host server of the target site to obtain the header information of the response message of the host server.
[0037] In this step, the header information of the response message includes the relative position information of important fields and the content information of important fields. After the characteristics of the header information are normalized, the situation in which the Server field is modified or deleted can still be accurately identified.
[0038] Step 300, identifying the content management system (CMS) type of the target site by matching key information with a Web fingerprint library.
[0039] In this step, the identification of the CMS system is mainly based on the keyword information of the web page source code and the path information of the static resource file. In the related art, Wappalyzer and Whatweb detection tools are often used to identify the CMS system. They mainly crawl the source code of a single page, analyze the comments and keyword information in the source code, and perform regular matching with the Web fingerprint library. If the developer hides or modifies the keyword information, this method cannot be used for identification. The related art can also choose to obtain the static file path in multiple tags in the source code of a single response page, and match the static file path with the Web fingerprint library to identify the CMS system in the Web application component. However, this method has high requirements for the completeness of the Web fingerprint library and low universality. It can be seen that the existing CMS system identification is mainly based on a single web page source code keyword and the full path of the static resource file. These two types of parties have low recognition accuracy and high requirements for the completeness of the Web fingerprint library. The method provided in the present application obtains the source codes of multiple web pages of the target site through a crawler, extracts the key static paths of static files from them, and finally matches them through a Web fingerprint library. It can accurately identify the CMS system and use a crawler to crawl the source code information of multiple web pages. Compared with the traditional recognition based on the source code information of a single web page, the accuracy is higher.
[0040] Step 400, based on the header information, use the trained machine learning model to predict the Web server type of the target site.
[0041] In this step, the identification of Web server components is mainly based on the response information of the server, including abnormal pages, response codes, message header contents, etc. In the related art, an abnormal HTTP request is constructed to access resources that do not exist on the server, and the type of Web server is determined based on the response code, the response message header content, and the abnormal page body content. This detection method is not applicable to the situation where the Server field is hidden in the response message header and the abnormal page is redirected. By constructing a variety of deformed HTTP requests, the response status code is used as a feature to use the naive Bayes algorithm classification model to determine the type of Web server. This method requires sending multiple HTTP requests to the server, resulting in relatively low recognition efficiency. By analyzing the order of a large number of response message header fields and summarizing fixed rules for identifying Web server types, this method has a high false alarm rate, and this method only identifies the three mainstream Web servers of Apache, IIS, and Nginx, which is complex to implement and has poor scalability. The method provided in the present application utilizes a trained machine learning model to extract information from the response message header, including the relative position information of important fields and the content information of important fields, and normalizes the features of the relative position information of important fields and the content information of important fields, and then uses a random forest algorithm to train a prediction model, thereby being able to accurately identify the type of Web server. It can still accurately identify the situation where the Server field is modified or deleted. Compared with the traditional identification method based on fixed rules, it has higher accuracy and better scalability.
[0042] Step 500, by using a network connection terminal scanning tool to scan the open ports of the host server and the services corresponding to the open ports, the host port fingerprint of the target site is detected.
[0043] In this step, optionally, the host service scan is mainly based on the Nmap scanning tool and the Zmap scanning tool, both of which obtain basic information of the target host through IP address detection, but the Zmap scanning tool has an incomparable advantage in scanning speed, and the Nmap scanning tool has unique advantages in scanning accuracy and comprehensiveness.
[0044] Among them, the functions of Web server identification, CMS system identification, and host information detection are integrated into one, solving the technical problems of low accuracy, poor scalability, incomplete detection, and low detection efficiency in related technologies, and realizing comprehensive, accurate, and efficient detection of component information of the target site. According to the detection results, it can effectively prevent attacks on Web components and host service vulnerabilities and maintain the security of Web sites.
[0045] In some embodiments, Figure 2 and Figure 3Based on the header information, the trained machine learning model is used to predict the target site's web server type, including:
[0046] Step 410: pre-process the header information.
[0047] In this step, the header information of the response message is normalized according to the response rules, and the text vector in the header information is converted into a digital vector, which provides a basis for the subsequent use of the machine learning model to predict the type of Web server through the random forest algorithm.
[0048] Step 420, based on the preprocessed header information, use the machine learning model to predict the type of the Web server through the random forest algorithm.
[0049] In this step, based on the digital vector in the header information obtained after preprocessing, the trained machine learning model is used to perform the random forest algorithm on the header information to obtain the classification result, and then predict the type of Web server. The random forest algorithm has the following advantages:
[0050] 1. For a variety of input variables, high-accuracy classification results can be obtained, which is conducive to improving the accuracy of Web server type identification.
[0051] 2. It can handle a large number of input variables. It has a smaller requirement for the number of input variables and has higher scalability.
[0052] 3. It can evaluate the importance of variables when deciding categories. It can be used to improve the accuracy of prediction results.
[0053] 4. When building the forest, an unbiased estimate of the generalized error can be generated internally, which is beneficial to improving the accuracy of Web server type identification.
[0054] 5. It can estimate the missing data, and if a large part of the data is missing, it can still maintain accuracy. It can effectively avoid the problem of incomplete input variables caused by problems in other steps, which is conducive to improving the accuracy of Web server type identification.
[0055] 6. The learning process is very fast, which is helpful to improve the efficiency of Web server type identification.
[0056] In some embodiments, Figure 4 and Figure 5 As shown in the figure, by using the network connection end scanning tool to scan the open ports of the host server and the services corresponding to the open ports, the host port fingerprint of the target site is detected, including:
[0057] Step 510: Generate a detection report by scanning the open ports and the services corresponding to the open ports using the scanning tool Nmap.
[0058] In this step, Nmap parameters are pre-set and Nmap is integrated into the detection system through inter-process calls. When it is necessary to scan open ports and services corresponding to open ports, the scanning tool Nmap is called to scan by generating an execution command to obtain a detection report.
[0059] Optionally, to meet the requirements of the method of this embodiment for automated scanning of the host server's open ports, running services, and operating systems, the Nmap parameters are set to: nmap-sS-sV-O-T5 ip, and integrated into the detection system through an inter-process call.
[0060] Step 520: parse the detection report to obtain the host port fingerprint.
[0061] In this step, the detection report is parsed, key information is filtered and formatted to obtain the host port fingerprint.
[0062] In some embodiments, Figure 6 As shown, using a web crawler to crawl the web page source codes of multiple web pages from a target site includes: using a web crawler to crawl the web page source codes from the target site using a breadth-first strategy.
[0063] Among them, according to the task information to be tested in the set crawler task queue, the number of user threads, crawler depth, and execution time parameters are set; a connection pool is generated from the proxy pool and the User-Agent pool, and a link is selected from the connection pool. Optionally, the link can be a socket link. Then a breadth-first strategy is adopted to crawl the web page source code from the target site. Among them, breadth-first, also called width-first, means that in the crawling process, after completing the current level of search, the next level of search is performed. The design and implementation of this algorithm are relatively simple. The use of a breadth-first search method can cover as many web pages as possible, which is conducive to the acquisition of multiple web page source codes by the method of this embodiment. In crawlers, it is generally believed that there is a high probability that web pages within a certain link distance from the initial URL have a topic relevance. The crawling process is to directly insert the link found on the newly downloaded web page into the end of the URL queue to be crawled, which means that the web crawler will first crawl all the web pages on the start page, and then select one of the connected web pages to continue crawling all the web pages linked in this web page. Reference Figure 7 , taking the web page relationship in the figure as an example, the breadth-first crawling order is: ABCDEFGHI. Optionally, the breadth-first search can be combined with the web page filtering technology, first crawling the web page with the breadth-first strategy, and then filtering out the irrelevant web pages.
[0064] Optionally, a breadth-first traversal strategy may be used to obtain pages with a response code of 2xx.
[0065] In some embodiments, Figure 8 and Fig. 9 As shown, the key information for obtaining the static file path based on the web page source code includes:
[0066] Step 110, parse the predetermined tags from the web page source code.
[0067] In this step, optionally, the predetermined tag may also be an HTML tag.
[0068] Step 120: extract static file path information from the predetermined tag using a regular expression.
[0069] In this step, static file path information is extracted from predetermined tags using regular expressions by means of element screening.
[0070] Step 130, saving the static file path information as the target text, and performing denoising processing on the target text.
[0071] In this step, the filtered static file path information is saved as the target text, and irrelevant character strings in the target text are removed through a filtering network to achieve denoising of the target text.
[0072] Step 140, performing text slicing processing on the target text after the denoising process to extract key information.
[0073] In this step, the target file after denoising is sliced into multiple slices, and key information of the static file path is found and extracted from the multiple slices, providing a detection basis for step 300.
[0074] In some embodiments, Fig.10 and Figure 6 As shown, by sending a predefined HTTP request to the host server of the target site by the web crawler, the header information of the response message of the host server is obtained, including:
[0075] Step 210: The web crawler sends an HTTP request to the host server.
[0076] In this step, a custom HTTP request is constructed according to the parameter information of the task to be tested in the crawler task queue, and then the web crawler sends the custom HTTP request to the host server.
[0077] Step 220: Obtain the response message of the host server to the HTTP request.
[0078] In this step, the host server receives the HTTP request and returns a response message.
[0079] Step 230: extract the relative position information of the first predetermined field and the content information of the second predetermined field from the header of the response message as header information.
[0080] The HTTP request includes “GET / 404page.html HTTP / 1.1 / r / n / r / n”.
[0081] The first predetermined fields include a “Date” field, a “Server” field, a “Content-Type” field, a “Content-Length” field, a “Connection” field, and an “Expires” field.
[0082] The second predetermined field includes a "Content-Length" field and an "X-Power-By" field.
[0083] In some embodiments, the Web fingerprint detection method provided by the embodiments of the present application further includes: writing the CMS type, Web server type and host port fingerprint as the detection result of the Web fingerprint of the target site into the remote dictionary service (Redis) queue.
[0084] Among them, the Redis List data structure is used as a message queue to complete data transmission and reduce the coupling in the system. Since Redis is an in-memory database, data access is performed in memory, which improves the efficiency of data transmission between modules.
[0085] It should be noted that the method of the embodiment of the present application can be performed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present application, and the multiple devices will interact with each other to complete the described method.
[0086] It should be noted that the above describes some embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0087] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides a Web fingerprint detection device.
[0088] refer to Fig.11 , the Web fingerprint detection device may include:
[0089] The crawling module 10 is configured to: use a web crawler to crawl the web page source code of multiple web pages from the target site, and obtain key information of the static file path based on the web page source code; by sending a predefined HTTP request to the host server of the target site through the web crawler, obtain the header information of the response message of the host server.
[0090] Among them, the crawling process of the web crawler is: adopt the breadth-first strategy to collect as much static file path information as possible, download the page source code according to the seed URL, and then extract the static file path and URL link, use regular matching to filter the external site links, and then add the local site URL to the seed URL queue to continue to repeat the above process until the preset threshold number of static file paths is obtained.
[0091] Furthermore, in order to improve the crawling efficiency of the web crawler, three parameter settings are provided externally: number of threads, crawler depth, and maximum execution time. In order to deal with the anti-crawling strategy of the target website, the access IP, access frequency, and access browser type should be set according to the response of the target host server, and the pages that failed to be obtained should be discarded to improve the overall efficiency of the system.
[0092] The Web fingerprint detection module 20 is configured to: identify the CMS type of the target site by matching key information with the Web fingerprint library; predict the Web server type of the target site based on the header information using a trained machine learning model; and detect the host port fingerprint of the target site by scanning the open ports of the host server and the services corresponding to the open ports using a network connection end scanning tool.
[0093] The system storage module 30 is configured to store user data, crawling information and scanning result data.
[0094] Among them, the system storage module 30 uses two storage management methods, namely the relational database MySQL and the memory database Redis. The List data structure of Redis is used as a message queue to complete the data transfer between modules and reduce the coupling between modules in the system. In addition, since Redis is a memory database, the access to data is operated in the memory, which improves the efficiency of data transfer between modules. The data stored in Redis mainly includes the basic information of the main task, the intermediate data of the crawler, the creation information of the detection subtask, and the detection report information. MySQL is used to store the data persistently, and the stored data includes user information, login information, Web fingerprint information, task information, and detection report information.
[0095] The task scheduling module 40 is configured to: schedule the crawling module 10 to execute, schedule the Web fingerprint detection module 20 to execute, and schedule the storage module to execute.
[0096] Among them, the task scheduling module 40 mainly manages and schedules each module in a unified manner, decouples the entire system, realizes the design concept of high cohesion and low coupling of the entire system, and improves the reusability and scalability of the program module. The core functions of this system are completed by the coordination and cooperation of the crawling module 10, the Web fingerprint detection module 20, and the system data storage module 03, and it is necessary to schedule and manage the execution logic and data transmission between each module. For the management of the execution logic between each module, this system uses the Quartz task scheduling framework, which can not only schedule tasks, but also reduce the complexity of business logic and improve the system fault tolerance. In addition, Redis is mainly used as a message queue to decouple the entire system, using the producer-consumer model, and the modules are not directly called, but communicated through the message queue. The intermediate data between the modules mainly includes the basic information of the detection task, the intermediate data collected by the crawler, and the detection results.
[0097] The user interaction module 50 is configured to: manage users, manage detection tasks and display detection results.
[0098] Among them, the user interaction module 50 is used to provide various interactive functions for users on the front-end interface, mainly including user management, detection task management, and detection result display functions.
[0099] The Web fingerprint detection module 20 is the core module of the system, including a CMS system type detection submodule, a host port information detection submodule and a Web server type detection submodule. Fig.12 As shown, the specific execution process of the Web fingerprint detection module 20 is as follows:
[0100] (1) The CMS system type detection submodule extracts static path key information from the Redis intermediate data queue, and then matches it in the Web fingerprint library to identify the CMS system of the target site.
[0101] (2) The host port information detection submodule extracts the seed URL and IP address from the Redis intermediate data queue, calls Nmap for detection, and identifies the port fingerprint of the host server.
[0102] (3) The Web server type detection submodule extracts the message response header information from the Redis intermediate data queue, performs data preprocessing, and uses the random forest detection model to identify the Web server type.
[0103] (4) Integrate the detection results of (1)-(3) and write them into the Redis result queue.
[0104] (5) Write the data to be recovered in the Redis result queue into the database.
[0105] In some embodiments, based on the above modules, the Web fingerprint detection method is summarized as follows: the crawling module 10 is responsible for collecting information of the target site, including key information of the static file path and header information of the response message, and pre-processing the acquired information as input of the Web fingerprint detection module 20; the task scheduling module 40 is responsible for coordinating the execution order of other modules, mainly including crawler task execution, fingerprint detection task execution, and result storage task; the system storage module 30 is responsible for storing user data and data or results generated during the execution of other modules; the user interaction module 50 provides users with various interactive functions on the front-end interface, mainly including user management, detection task management, detection result display and other functions; the Web fingerprint detection module 20 is a specific implementation of Web component detection technology, mainly including Web server component type detection, CMS system type detection, and host port fingerprint detection.
[0106] In order to better implement the present invention, further, the goal of the crawling module 10 is to obtain the key information of the static file path of the target website and the text information of the response message header, and provide analysis data for the Web fingerprint detection module 20. In order to collect as much static file path information as possible, the crawling module 10 adopts a breadth-first strategy. For the module for obtaining key information of the static file path, in order to improve the efficiency of the crawler and obtain as much static file path information as possible in a short time, three parameters, namely the number of threads, the crawler depth and the maximum execution time, are provided, and the user can set them according to their own needs.
[0107] In order to better implement the present invention, further, the task scheduling module 40 is responsible for coordinating the execution of the three core modules of the crawling module 10, the Web fingerprint detection module 20 and the system storage module 30, and scheduling and managing the execution logic and data transmission between the modules.
[0108] In order to better implement the present invention, further, the system storage module 30 is responsible for storing user data and data or results generated during the execution of other modules, including basic parameter information of the task, website static file path information and text information of the response message header obtained by the crawling module 10, result information executed by the Web fingerprint detection module 20, user information, etc.
[0109] In order to better implement the present invention, further, the user interaction module 50 provides users with various interactive functions in the front-end interface, implements a user management function for dividing user operation permissions according to user roles; implements a task management function for creating, deleting, pausing, starting and other operations of tasks; and implements a Web fingerprint function for system administrator users to add Web fingerprints to the Web fingerprint library.
[0110] In some embodiments, Fig.13 As shown, a detection process is used as an example to explain the process. The process is as follows:
[0111] (1) The user configures the relevant parameters of the scan, including the URL or IP address of the target site, the number of crawler threads, the task limit, the maximum scanning time, etc., at the front end of the Web fingerprint detection device through the user interaction module 50. The scan result can be used to create a task according to the parameters set by the user, and the parameter information of the task is stored in the system storage module 30, and the task is marked as to be detected, thereby obtaining the task to be detected.
[0112] (2) The task scheduling module 40 monitors the tasks to be tested in the database, serializes the basic information of the tasks and stores them in the crawler task queue, and hands the queue of tasks to be tested to the crawler module 10 for processing.
[0113] (3) The crawling module 10 takes out the task information from the tasks to be checked in the crawler task queue, collects the target site information, and then pre-processes the collected information, stores the processed data in the intermediate data queue, and dequeues and stores the intermediate data in the redis queue of the system storage module 30.
[0114] (4) After the task scheduling module 40 detects that the system storage module 30 stores the data in the intermediate data queue, it schedules the system storage module 30 to store the pre-processed data in the database of the system storage module 30 and sends the detection task queue to the Web fingerprint detection module 20 .
[0115] (5) The Web fingerprint detection module 20 regularly monitors the detection task queue. When there is a task to be detected, the CMS system type detection submodule, the host port information detection submodule and the Web server type detection submodule are called to detect the CMS system type, the host port fingerprint and the Web server category respectively, and the detection result data is stored in the detection result queue.
[0116] (6) After detecting the task information in the detection result queue, the task scheduling module 40 stores the detection result in the system storage module 30 and sets the status of the task in the system storage module 30 to be completed.
[0117] (7) The user uses the user interaction module 50 through the front-end interface to query the test results from the database of the system storage module 30 and display them on the Web interface.
[0118] For the convenience of description, the above device is described in terms of functions divided into various modules. Of course, when implementing the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0119] The device of the above embodiment is used to implement the corresponding Web fingerprint detection method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0120] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the Web fingerprint detection method described in any of the above-mentioned embodiments is implemented.
[0121] Fig.14 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.
[0122] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0123] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0124] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0125] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0126] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0127] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0128] The electronic device of the above embodiment is used to implement the corresponding Web fingerprint detection method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0129] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application further provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the Web fingerprint detection method described in any of the above embodiments.
[0130] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0131] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the Web fingerprint detection method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0132] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.
[0133] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.
[0134] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0135] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of the present application.
Claims
1. A Web fingerprint detection method, It is characterized in that include: Using a web crawler to crawl the source code of multiple web pages from a target site, and obtaining key information of static file paths based on the source code; Wherein, crawling the source codes of multiple web pages from the target site using a web crawler includes: crawling the source codes from the target site using the web crawler and adopting a breadth-first strategy; The method of obtaining the key information of the static file path based on the source code includes: parsing a predetermined tag from the source code; extracting the static file path information from the predetermined tag using a regular expression; saving the static file path information as a target text and performing a denoising process on the target text; performing a text slicing process on the denoised target text to extract the key information; The web crawler sends a predefined HTTP request to the host server of the target site to obtain header information of a response message of the host server; By matching the key information with a Web fingerprint library, the content management system (CMS) type of the target site is identified; Based on the header information, predict the type of the Web server of the target site using a trained machine learning model; The host port fingerprint of the target site is detected by scanning the open port of the host server and the service corresponding to the open port using a network connection terminal scanning tool.
2. The method according to claim 1, in, The method of predicting the type of the Web server of the target site based on the header information by using a trained machine learning model includes: Preprocessing the header information; Based on the preprocessed header information, the Web server type is predicted using the machine learning model through a random forest algorithm.
3. The method according to claim 1, in, The method of detecting the host port fingerprint of the target site by scanning the open port of the host server and the service corresponding to the open port using a network connection terminal scanning tool includes: Generate a detection report by scanning the open port and the service corresponding to the open port using the scanning tool Nmap; The detection report is parsed to obtain the host port fingerprint.
4. The method according to claim 1, in, The step of sending a predefined HTTP request to the host server of the target site by the web crawler to obtain header information of a response message of the host server includes: The web crawler sends the HTTP request to the host server; Obtaining a response message from the host server to the HTTP request; The relative position information of the first predetermined field and the content information of the second predetermined field are extracted from the header of the response message as the header information.
5. The method according to claim 4, in, The HTTP request includes "GET / 404page.html HTTP / 1.1 / r / n / r / n"; The first predetermined fields include a "Date" field, a "Server" field, a "Content-Type" field, a "Content-Length" field, a "Connection" field, and an "Expires" field; The second predetermined field includes a "Content-Length" field and an "X-Power-By" field.
6. The method according to any one of claims 1 to 5, further comprising: include: The CMS type, the Web server type and the host port fingerprint are written into a remote dictionary service Redis queue as a detection result of the Web fingerprint of the target site.
7. A Web fingerprint detection device, include: The crawling module is configured to: crawl the source codes of multiple web pages from the target site using a web crawler, and obtain key information of the static file path based on the source codes; The web crawler sends a predefined HTTP request to the host server of the target site to obtain header information of a response message of the host server; Wherein, crawling the source codes of multiple web pages from the target site using a web crawler includes: crawling the source codes from the target site using the web crawler and adopting a breadth-first strategy; The method of obtaining the key information of the static file path based on the source code includes: parsing a predetermined tag from the source code; extracting the static file path information from the predetermined tag using a regular expression; saving the static file path information as a target text and performing a denoising process on the target text; performing a text slicing process on the denoised target text to extract the key information; The Web fingerprint detection module is configured to: identify the CMS type of the target site by matching the key information with the Web fingerprint library; predict the Web server type of the target site based on the header information using a trained machine learning model; and detect the host port fingerprint of the target site by scanning the open ports of the host server and the services corresponding to the open ports using a network connection terminal scanning tool.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executed by the processor, in, The processor implements the method according to any one of claims 1 to 6 when executing the computer program.
