Network application vulnerability anomaly detection method and system, electronic equipment and storage medium

Through real-time monitoring and analysis of network traffic, combined with machine learning models for Web application vulnerability detection, it solves the problems of insufficient code coverage and high false alarm rate in traditional methods, achieves efficient and accurate vulnerability detection and early warning, and improves Web applications. level of security protection.

CN118555152AActive Publication Date: 2024-08-27JIANGXI GUANGTOU YOUXUAN INFORMATION TECH CO LTD

Patent Information

Application Number
CN202411028668.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-08-27
Estimated Expiration
2044-07-30

AI Technical Summary

Technical Problem

In practical applications, traditional web application vulnerability detection methods have problems such as insufficient code coverage, high false positive rate, inability to provide the specific location of the vulnerability, long testing process, difficulty in obtaining data sets, and limited model generalization capabilities.

Method used

By monitoring network traffic in real time, capturing and parsing data packets, conducting URL scanning and structured data processing, using machine learning models for anomaly detection and vulnerability identification, and combining dynamic behavior analysis engines and intelligent anomaly detection algorithms to achieve accurate vulnerability location and Report, build a real-time monitoring and response system, and regularly optimize the model.

Benefits of technology

It improves the efficiency and accuracy of vulnerability detection, provides detailed vulnerability location and repair suggestions, reduces the workload of developers, speeds up security updates, enhances the overall security of the system, and enables early warning before attacks occur. and identify unknown attack vectors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118555152A
    Figure CN118555152A
Patent Text Reader

Abstract

The invention relates to a network application vulnerability anomaly detection method and system, electronic equipment and a storage medium. The method comprises the steps of monitoring network traffic in real time, capturing a data packet entering and exiting a network application, analyzing the data packet and converting the data packet into structured data; performing website scanning on the structured data, and identifying a potential attack vector and an abnormal access mode; inputting the potential attack vector and the abnormal access mode into a machine learning model for anomaly detection and vulnerability recognition, and outputting a detection result; judging whether to trigger an alarm according to the login request in the detection result; and storing the detection result, and regularly analyzing the detection result to optimize the machine learning model. According to the method disclosed by the invention, efficient, accurate and real-time vulnerability anomaly detection can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of network application vulnerability detection, and in particular to a network application vulnerability anomaly detection method, system, electronic device, and storage medium. Background Art

[0002] Amidst the wave of digital transformation, web applications have become the primary channel for enterprise-user interaction, carrying critical business logic and sensitive data. However, the widespread use of web applications has also made them a prime target for cyberattacks. Vulnerabilities such as SQL injection, cross-site scripting (XSS), and cross-site request forgery (CSRF) are emerging, posing significant security risks to enterprises and users. Traditional security measures, such as firewalls, intrusion detection systems (IDS), and intrusion prevention systems (IPS), while able to mitigate external attacks to a certain extent, are insufficient to protect against vulnerabilities within web applications. With the rapid development of artificial intelligence (AI) and machine learning (ML) technologies, their application in cybersecurity has become a research hotspot. AI and ML can process and analyze large amounts of data, identifying patterns and anomalies, demonstrating great potential for web application vulnerability detection. However, the effective integration of these advanced technologies into web application security still faces challenges in data quality, model generalization, and real-time requirements.

[0003] Existing technical solutions for web application vulnerability detection primarily include static application security testing (SAST), dynamic application security testing (DAST), interactive application security testing (IAST), and machine learning-based vulnerability detection. However, these systems still suffer from practical challenges: insufficient code coverage and high false positive rates; inability to pinpoint vulnerability locations and time-consuming testing; difficulty acquiring datasets and limited model generalization capabilities. Therefore, an efficient, comprehensive, and automated solution is needed to protect web applications from security threats. Summary of the Invention

[0004] This paper proposes a network application vulnerability anomaly detection method to solve the following problems: Traditional web application vulnerability detection methods have insufficient code coverage, high false positive rate, inability to provide specific vulnerability locations, long testing process, difficulty in obtaining data sets, and limited model generalization ability.

[0005] According to one aspect of the present disclosure, a method for detecting anomalies in network application vulnerabilities is provided, comprising: S10, monitoring network traffic in real time, capturing data packets entering and leaving network applications, parsing the data packets and converting them into structured data; S20. Scan the structured data for URLs to identify potential attack vectors and abnormal access patterns. S30, inputting potential attack vectors and abnormal access patterns into the machine learning model to perform anomaly detection and vulnerability identification, and outputting detection results; S40, determining whether an alarm is triggered based on the login request in the detection result; S50: Store the detection results and analyze them regularly to optimize the machine learning model.

[0006] Preferably, the real-time monitoring of network traffic and the capture of data packets entering and leaving the network application are specifically: the network traffic obtained from the traffic platform is used as input, a sniffer tool is used to monitor the network traffic of a specified network interface in real time, and the Scapy library is used to realize data packet capture.

[0007] Preferably, parsing the data packet and converting it into structured data is as follows: Each captured data packet is analyzed through a callback function; wherein, in the callback function, it is determined whether the data packet contains IP header information; If IP header information is included, the source IP, destination IP, protocol type, source port number, and destination port number are extracted, and this information is converted into JSON format data and output as structured data.

[0008] Preferably, step S10 further includes: By collecting, de-duping and labeling structured data, we obtain page sample data. After introducing information entropy to remove interference factors in the page sample data, we use word2vec technology to preprocess the page sample data to obtain training data sets and test data sets. The training data sets are used to train the selected machine learning model. During the training process, the machine learning model parameters are adjusted using known traffic types. The trained machine learning model is evaluated using the test data sets. After the training is completed, the machine learning model is deployed to the network application entrance for anomaly detection and vulnerability identification.

[0009] Preferably, the structured data is scanned by URL to identify potential attack vectors and abnormal access patterns, specifically: a URL scanning algorithm is used to scan the structured data by URL, URLs are extracted from Hypertext Transfer Protocol requests and normalized, redundancy in the URLs is deleted to obtain normalized URLs, features are extracted from the normalized URLs to obtain URL features, and the URL features are classified using a trained machine learning model to determine whether they are malicious URLs in order to identify potential attack vectors and abnormal access patterns.

[0010] Preferably, potential attack vectors and abnormal access patterns are input into a machine learning model for anomaly detection and vulnerability identification, and the detection results are output, specifically: The management backend is detected from the page through a trained machine learning model, and the detected management backend is subjected to secondary verification. Through the secondary verification, behaviors that deviate from the normal pattern are detected, anomalies or vulnerabilities are identified, and the identification results are confirmed, and the detection results are output based on the identification results.

[0011] Preferably, determining whether to trigger an alarm based on the login request in the detection result specifically includes: Analyze the username and password information in the login request, set a password dictionary and a list of common weak passwords, and issue an alarm if the password appears in them; check whether there are weak passwords in the login interface. When weak passwords are found in the management background, determine the sensitivity threshold of anomaly detection based on historical data, and conduct real-time monitoring. Once abnormal behavior is detected or predefined rule conditions are met, an alarm information is immediately generated.

[0012] According to one aspect of the present disclosure, a network application vulnerability anomaly detection system is provided, comprising: The data packet parsing and conversion module monitors network traffic in real time, captures data packets entering and leaving network applications, parses the data packets and converts them into structured data; A URL scanning module performs URL scanning on the structured data to identify potential attack vectors and abnormal access patterns; The anomaly detection and vulnerability identification module inputs potential attack vectors and abnormal access patterns into the machine learning model for anomaly detection and vulnerability identification, and outputs the detection results; An alarm triggering module determines whether to trigger an alarm based on the login request in the detection result; The machine learning model optimization module stores the detection results and regularly analyzes them to optimize the machine learning model.

[0013] According to one aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the above-mentioned network application vulnerability anomaly detection method.

[0014] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the above-mentioned network application vulnerability anomaly detection method is implemented.

[0015] Compared with the prior art, the beneficial effects of the present disclosure are: 1) By integrating a dynamic behavior analysis engine and an intelligent anomaly detection algorithm, the present disclosure enables the system to not only improve the efficiency of vulnerability detection but also significantly enhance the accuracy of detection without affecting the normal operation of Web applications, thereby effectively protecting Web applications from attacks.

[0016] 2) This disclosure uses a precise vulnerability location and reporting mechanism. The vulnerability location algorithm can accurately map abnormal behavior to specific code locations, and the intelligent reporting system can automatically generate detailed remediation suggestions. The combination of the two not only reduces the workload of developers, but also speeds up the security updates of Web applications and enhances the overall security of the system.

[0017] 3) This disclosure integrates AI technology and machine learning to build a highly intelligent web application vulnerability detection system. This system not only monitors the dynamic behavior of web applications in real time but also automatically identifies and predicts potential security threats by learning from historical data and patterns. This enables the system to provide early warnings before attacks occur, significantly improving the security of web applications.

[0018] 4) This disclosure builds a real-time monitoring and response system that can automatically execute a series of response actions according to predefined response strategies when abnormal behavior or potential threats are detected. This greatly improves response efficiency, reduces human errors, and ensures that security incidents can be handled promptly and correctly.

[0019] 5) By constructing diverse datasets and applying data augmentation techniques, this paper trains more robust and generalizable models. These models are capable of identifying not only known attack patterns but also unknown attack vectors. Furthermore, the design of a model generalization performance evaluation framework ensures that the system can regularly evaluate and optimize model performance, ensuring that the system is always operating at its optimal state.

[0020] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.

[0021] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings herein are incorporated into and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and, together with the specification, are used to explain the technical solutions of the present disclosure.

[0023] Figure 1 A flowchart of a method for detecting anomalies in network application vulnerabilities is shown; Figure 2shows the machine learning model processing flow chart; Figure 3 Shows the XGBoost model calling flow chart; Figure 4 Shows the structural block diagram of the network application vulnerability anomaly detection system. DETAILED DESCRIPTION

[0024] Various exemplary embodiments, features, and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise indicated.

[0025] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0026] The term "and / or" herein simply describes an association relationship between associated objects, indicating that three relationships can exist. For example, "A and / or B" can represent the existence of three situations: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" herein refers to any combination of at least two of any one or more of a plurality of items. For example, "at least one of A, B, and C" can represent any one or more elements selected from the set consisting of A, B, and C.

[0027] In addition, numerous specific details are provided in the following detailed description to better illustrate the present disclosure. Those skilled in the art will appreciate that the present disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art are not described in detail in order to highlight the main points of the present disclosure.

[0028] It can be understood that the above-mentioned network application vulnerability anomaly detection method and system embodiments mentioned in this disclosure can be combined with each other to form combined embodiments without violating the principle logic. Due to space limitations, this disclosure will not go into details.

[0029] While traditional web application vulnerability detection methods can detect security vulnerabilities to a certain extent, they suffer from insufficient code coverage, high false positive rates, and an inability to provide specific vulnerability locations in real-world applications. Furthermore, the testing process is time-consuming and datasets are difficult to obtain. Furthermore, machine learning models require large amounts of labeled data for training, and their generalization capabilities cannot be guaranteed. To address these issues, a web application vulnerability anomaly detection method is proposed that achieves efficient, accurate, and real-time vulnerability anomaly detection.

[0030] Based on the above ideas, the present invention proposes a method for detecting anomalies in network application vulnerabilities. Figure 1 A flow chart showing a method for detecting anomalies in network application vulnerabilities is provided. The method comprises: S10, monitoring network traffic in real time, capturing data packets entering and leaving network applications, parsing the data packets and converting them into structured data; S20. Scan the structured data for URLs to identify potential attack vectors and abnormal access patterns. S30, inputting potential attack vectors and abnormal access patterns into the machine learning model to perform anomaly detection and vulnerability identification, and outputting detection results; S40, determining whether an alarm is triggered based on the login request in the detection result; S50: Store the detection results and analyze them regularly to optimize the machine learning model.

[0031] The specific steps are as follows: S10. Monitor network traffic in real time, capture data packets entering and leaving network applications, parse the data packets and convert them into structured data.

[0032] In the embodiments of the present disclosure and other possible embodiments, real-time monitoring of network traffic and capturing of data packets entering and leaving network applications are specifically performed by using network traffic obtained from a traffic platform as input, using a sniffer tool to monitor network traffic on a specified network interface in real time, and using the Python programming language in conjunction with the third-party Scapy library to implement packet capture and analysis. In the embodiments of the present disclosure, a configurable real-time monitoring platform is provided, which allows users to customize monitoring policies, including monitoring frequency, monitoring range, and alarm thresholds, based on different web applications and security requirements.

[0033] Furthermore, the Scapy library is used to capture network packets, and each captured packet is analyzed through the callback function capture_and_analyze_traffic. In the callback function, it first determines whether the packet contains IP header information. If it does, it extracts key information such as the source IP address, destination IP address, protocol type, source port number, and destination port number. This information is then converted into JSON format and output as structured data.

[0034] The details are as follows: from scapy.all import * import json def capture_and_analyze_traffic(packet): if IP in packet: #Extract IP header information src_ip = packet[IP].src dst_ip = packet[IP].dst # Determine the protocol type if TCP in packet: protocol = "TCP" src_port = packet[TCP].sport dst_port = packet[TCP].dport elif UDP in packet: protocol = "UDP" src_port = packet[UDP].sport dst_port = packet[UDP].dport else: protocol = "Other" src_port = None dst_port = None #Construct JSON format data data={ "src_ip": src_ip, "dst_ip": dst_ip, "protocol": protocol, "src_port": src_port, "dst_port": dst_port } #Print JSON format data print(json.dumps(data)) #Start capturing data packets of network applications sniff(prn=capture_and_analyze_traffic, count=10) In this embodiment, the original captured binary data packet is converted into a structured JSON data format, including information such as source IP, destination IP, port number, protocol type, and packet size. The data structuring formula is as follows: the data packet (p) is converted into JSON format, where (p={header, payload}) is parsed into ({IP_src, IP_dst, Port_src, Port_dst, Timestamp, Data}).

[0035] A classifier deployed at the network entry point analyzes the preprocessed data using a trained machine learning model, the same as the one used in step S30. This classifier distinguishes between normal, abnormal, and potentially malicious traffic. This process involves in-depth analysis of the packet content, such as parsing HTTP headers and payloads, to identify potential attacks such as SQL injection and cross-site scripting.

[0036] Specifically, a signature-based approach is used to identify the content of data packets and combined with a machine learning model for traffic classification.

[0037] C(f) =\text{arg max}c\sum{i=1}^n w_i\cdot\delta(f_i, S_{c,i}) Where (C(f)) is the traffic classification function, (f) is the feature set of a specific traffic, (S_{c,i}) is the signature database under category (c), (w_i) is the weight, and (\delta) is the matching function.

[0038] The specific process of deploying the classifier at the network application entry point is as follows: S101. Use the support vector machine (SVM) supervised learning algorithm to separate data points of different categories by constructing a separating hyperplane.

[0039] S102. Use Pandas to preprocess the captured network traffic data, including feature extraction, data cleaning, and normalization.

[0040] S103: Select appropriate features from the network traffic data, such as source IP, destination IP, port number, protocol type, etc. This can further help the classifier distinguish different types of traffic.

[0041] S104. Train the selected machine learning model using the training data set. During the training process, known traffic types (normal, abnormal, malicious, etc.) are used to adjust the parameters of the machine learning model so that it can correctly classify traffic data.

[0042] S105. Use the test dataset to evaluate the trained machine learning model and evaluate the performance indicators of the classifier, such as accuracy, recall rate, F1 score, etc.

[0043] S106. Deploy the trained machine learning model to the traffic classifier at the network application entry point to analyze and classify the traffic in real time.

[0044] S107. Regularly update and optimize machine learning models to adapt to the ever-changing network environment and threats. This may include using new training data and adjusting model parameters.

[0045] S20: Scan the structured data for URLs to identify potential attack vectors and abnormal access patterns.

[0046] In the embodiments of the present disclosure and other possible embodiments, URL scanning is performed on the structured data to identify potential attack vectors and abnormal access patterns. Specifically, an efficient URL scanning algorithm is developed, and the URL scanning algorithm is used to scan the structured data, extracting URLs from Hypertext Transfer Protocol requests and normalizing them; after removing redundancy in the URL, a normalized URL is obtained, such as session ID, tracking parameters, etc., and feature extraction is performed on the normalized URL to obtain URL features, such as domain name length, path depth, protocol used, whether it contains an IP address, etc.; the URL features are classified using a trained machine learning model to determine whether it is a malicious URL to identify potential attack vectors and abnormal access patterns. At the same time, matching queries can also be performed in conjunction with a known malicious URL database.

[0047] The formula of the URL scanning algorithm is: \text{Malicious}(url) =\sigma(\textbf{w}\cdot\phi(url)+b) Among them, (\sigma) is the sigmoid activation function, (\phi(url)) is the URL feature extraction function, (\textbf{w}) and (b) are model parameters.

[0048] S30. Input potential attack vectors and abnormal access patterns into the machine learning model for anomaly detection and vulnerability identification, and output the detection results.

[0049] In the embodiments of the present disclosure and other possible embodiments, multiple machine learning models are trained and deployed, including but not limited to deep learning and anomaly detection models, to improve the accuracy of vulnerability identification. A large number of page samples are collected, including various management backends and high-risk pages, to provide rich and diverse data support for model training. At the same time, the online model will be regularly updated to ensure that the model always maintains good discrimination capabilities, and a positive and negative feedback mechanism will be introduced to cooperate with AI model training, and targeted adjustments will be made based on the model's identification situation to further improve the model's accuracy.

[0050] The process of training and deploying multiple machine learning models is as follows: by collecting, cleaning, and labeling structured data to obtain page sample data, introducing information entropy to remove interference factors in the page sample data, and then using word2vec technology to preprocess the page sample data to obtain training and test data sets. The training data sets are used to train the selected machine learning models. During the training process, the machine learning model parameters are adjusted using known traffic types. The trained machine learning models are evaluated using the test data sets. After training, the machine learning models are deployed to the network application portal for anomaly detection and vulnerability identification. The machine learning models can adopt convolutional neural networks (CNNs), recurrent neural networks (RNNs), etc.

[0051] The processing flow of the machine learning model is as follows Figure 2 The specific steps are as follows: S301, data preprocessing: After a long period of data collection, de-duplication, and labeling, sufficient web page source code samples have been accumulated, but the source code of the page needs to be preprocessed before it can be converted into a form that is understandable and computable by the model. Information entropy is introduced to remove useless codes, symbols and other interference factors in the page, and then the page is segmented to remove all special symbols in the text, including Chinese and English punctuation marks, emoji expressions, special characters (such as emoticons), etc. Remove tag names in HTML, such as div, td, etc.; remove comments in HTML; split long English sentences, split long Chinese sentences, etc.; calculate the information entropy of text excluding tags, etc. Since web applications are generally simpler than ordinary user login pages, information entropy is introduced to remove relatively complex pages, such as false positives caused by the presence of login boxes in some news pages. The other steps are mainly to remove interfering text, and finally obtain a series of English words and Chinese terms. Next, we use word2vec technology to preprocess the page sample data. Word2vec reflects the relationship between words by calculating the distance between vectors. Word2vec converts text content into vectors composed of fixed-length numbers. These vectors with text features are used as input to the machine learning model. This process not only reduces the input dimension and saves computing overhead, but also increases semantic information, which is beneficial to the feature learning of subsequent models.

[0052] S302, Algorithm selection and model training: During the algorithm selection phase, multiple algorithm tests were conducted based on the applicable scenarios and sample characteristics of each algorithm, and XGBoost, which has the highest accuracy and efficiency, was finally selected as the core algorithm. XGBoost is an engineering implementation of GBDT. Parallel computing, approximate tree construction, effective processing of sparse data, and optimized memory usage make XGBoost more accurate and efficient. After word2vec preprocessing, the page words are converted into digital vectors and input into the XGBoost model. Python is combined with the deep learning frameworks TensorFlow and PyTorch to implement the training and deployment of the deep learning model. During the training process, the model parameters are adjusted by optimizing the loss function so that it can more accurately predict the compound risks that may be caused by a combination of vulnerabilities.

[0053] The specific process is as follows: Model training #Build a CNN model using TensorFlow import tensorflow as tf #Define CNN model model = tf.keras.Sequential([ tf.keras.layers.Embedding(input_dim=vocab_size, output_dim=embedding_dim, input_length=max_length), tf.keras.layers.Conv1D(128, 5, activation='relu'), tf.keras.layers.GlobalAveragePooling1D(), tf.keras.layers.Dense(64, activation='relu'), tf.keras.layers.Dense(1, activation='sigmoid') ]) # Compile the model model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy']) #Train model model.fit(train_data, train_labels, epochs=10, validation_data=(val_data, val_labels)) #Save model model.save('vulnerability_detection_model.h5') Model deployment #Load the model using TensorFlow loaded_model = tf.keras.models.load_model('vulnerability_detection_model.h5') def analyze_traffic(page_content): #Preprocess the page preprocessed_content=preprocess_page(page_content) #Use the loaded model to make predictions prediction = loaded_model.predict(preprocessed_content) if prediction>0.5: print("Vulnerability found!") else: print("The page is normal.") page_content = "..." analyze_traffic(page_content) Furthermore, graph neural networks (GNNs) are used to model system components, vulnerabilities, and attack paths to identify complex associations between vulnerabilities and potential attack chains. Through GNN analysis, the compound risks that may be caused by a combination of vulnerabilities can be predicted, thereby taking more accurate preventive measures in vulnerability management.

[0054] S303, deployment and tuning: A mature XGBoost model has the ability to recognize pages and can distinguish the management backend from a messy page. The management backend is detected from the page through a trained machine learning model. The detected management backend will undergo manual secondary verification, and the model learned from normal behavior will be used to detect behaviors that deviate from the normal pattern, effectively identify anomalies or vulnerabilities, and finally determine the recognition result, and output the detection result based on the recognition result. If the recognition result is correct, the detection result will be used to trigger an alarm, and the manually confirmed false detection part will be input into the feedback module for subsequent updates of the machine learning model. The XGBoost model calling process is as follows: Figure 3 shown.

[0055] For example, it can be implemented as the following code: \text{min}\frac{1}{2}|\textbf{w}|^2+C\sum\xi_i \text{subject to}(\textbf{w}\cdot\phi(x_i))\geq\rho-\xi_i, ;\xi_i\geq0 Among them, (\phi(x_i)) is the data point mapped to the high-dimensional space, (\textbf{w},\rho) are the model parameters, and (\xi_i) are the slack variables.

[0056] S40: Determine whether to trigger an alarm based on the login request in the detection result.

[0057] In the embodiments of the present disclosure and other possible embodiments, a real-time alarm system is constructed to ensure that the security team can respond to security incidents in a timely manner. The URL identified as a Web application will enter the alarm module. In addition to direct alarms, the alarm module is also responsible for weak password detection. Use Python programming language in combination with regular expressions and other technologies to implement weak password detection. Analyze the username and password information in the login request, set a password dictionary and a list of common weak passwords, and alarm when the password appears in them. In addition, the strength of the password is judged by setting password complexity requirements, such as password length, type of characters included, etc. The alarm module checks whether there is a weak password for the login interface. When a weak password is found in the management background, one is to attach the weak password to the alarm, and second is to perform targeted tiered operations.

[0058] Furthermore, a sensitivity threshold for anomaly detection is determined based on historical data and monitored in real time through a real-time monitoring system. Once abnormal behavior is detected or predefined rule conditions are met, an alert is immediately generated. This embodiment develops a threshold setting method based on statistical learning that can dynamically adjust the anomaly detection threshold based on historical data, improving detection accuracy and efficiency.

[0059] Alert information is sent to relevant security teams through multiple channels (email, SMS, system logs), and can trigger automatic response measures such as banning the attack source IP, suspending abnormal account operations, etc.

[0060] The implementation process can be as follows: import re #Define password dictionary and common weak password list password_dictionary=["password","123456","qwerty","abcdef"] weak_passwords=set(password_dictionary) #Define regular expression pattern to match username and password username_pattern = re.compile(r'username=(.*?)&') password_pattern = re.compile(r'password=(.*?)&') def check_weak_passwords(username, password): if password in weak_passwords: print(f"Weak password warning: Username '{username}' uses a weak password '{password}'") #Analyze the username and password information in the traffic def analyze_traffic(traffic): matches_username = username_pattern.findall(traffic) matches_password = password_pattern.findall(traffic) for username, password in zip(matches_username, matches_password): check_weak_passwords(username, password) #Simulation traffic analysis traffic="POST / login HTTP / 1.1\r\nHost: example.com\r\nContent-Type:application / x-www-form-urlencoded\r\nContent-Length: 28\r\n\r\nusername=admin&password=123456&\r\n" analyze_traffic(traffic) In this embodiment, a password dictionary and a list of common weak passwords are defined, and a regular expression pattern is set to match usernames and passwords. Then, the analyze_traffic function is used to analyze the username and password information in the traffic, and the check_weak_passwords function is called to detect whether there are weak passwords.

[0061] S50: Store the detection results and analyze them regularly to optimize the machine learning model.

[0062] In this embodiment, a large-capacity time series database is used to store all monitoring data to ensure data writing speed and query efficiency. The database is regularly maintained, including data cleaning, deduplication, and storage structure optimization to improve data processing efficiency.

[0063] The above results show that the network application vulnerability anomaly detection method designed in the embodiment of the present disclosure overcomes the problems of low efficiency and insufficient accuracy of traditional vulnerability detection methods, and can achieve efficient, accurate and real-time vulnerability anomaly detection.

[0064] As another aspect of the embodiment of the present disclosure, a network application vulnerability anomaly detection system 100 is also provided. Figure 4 Shown, including: Data packet parsing and conversion module 1 monitors network traffic in real time, captures data packets entering and leaving network applications, parses the data packets and converts them into structured data; URL scanning module 2, which performs URL scanning on the structured data to identify potential attack vectors and abnormal access patterns; Anomaly detection and vulnerability identification module 3, which inputs potential attack vectors and abnormal access patterns into the machine learning model to perform anomaly detection and vulnerability identification, and outputs the detection results; Alarm triggering module 4, judging whether to trigger an alarm according to the login request in the detection result; The machine learning model optimization module 5 stores the detection results and regularly analyzes them to optimize the machine learning model.

[0065] Based on the description of the above embodiments, it can be seen that the embodiments of the present disclosure can achieve the following technical effects: 1) By integrating a dynamic behavior analysis engine and an intelligent anomaly detection algorithm, the present disclosure enables the system to not only improve the efficiency of vulnerability detection but also significantly enhance the accuracy of detection without affecting the normal operation of Web applications, thereby effectively protecting Web applications from attacks.

[0066] 2) This disclosure uses a precise vulnerability location and reporting mechanism. The vulnerability location algorithm can accurately map abnormal behavior to specific code locations, and the intelligent reporting system can automatically generate detailed remediation suggestions. The combination of the two not only reduces the workload of developers, but also speeds up the security updates of Web applications and enhances the overall security of the system.

[0067] 3) This disclosure integrates AI technology and machine learning to build a highly intelligent web application vulnerability detection system. This system not only monitors the dynamic behavior of web applications in real time but also automatically identifies and predicts potential security threats by learning from historical data and patterns. This enables the system to provide early warnings before attacks occur, significantly improving the security of web applications.

[0068] 4) This disclosure builds a real-time monitoring and response system that can automatically execute a series of response actions according to predefined response strategies when abnormal behavior or potential threats are detected. This greatly improves response efficiency, reduces human errors, and ensures that security incidents can be handled promptly and correctly.

[0069] 5) By constructing diverse datasets and applying data augmentation techniques, this paper trains more robust and generalizable models. These models are capable of identifying not only known attack patterns but also unknown attack vectors. Furthermore, the design of a model generalization performance evaluation framework ensures that the system can regularly evaluate and optimize model performance, ensuring that the system is always operating at its optimal state.

[0070] The present disclosure also provides an electronic device comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to implement the aforementioned network application vulnerability anomaly detection method. The electronic device may be provided as a terminal, server, or other device.

[0071] The present disclosure also provides a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implements the aforementioned network application vulnerability anomaly detection method. The computer-readable storage medium may be a non-volatile computer-readable storage medium.

[0072] Those skilled in the art will understand that in the above-mentioned network application vulnerability anomaly detection method and system of the specific implementation method, the writing order of each step does not mean a strict execution order and constitutes any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0073] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and the part of the module, program segment or instruction contains one or more executable instructions for realizing the prescribed logical function. In some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the prescribed function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0074] While various embodiments of the present disclosure have been described above, the above descriptions are illustrative, non-exhaustive, and not intended to be limiting of the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, their practical applications, or technical improvements to existing technologies, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A network application vulnerability anomaly detection method, characterized in that: The steps include: S10, real-time monitoring of network traffic, capturing data packets entering and leaving network applications, parsing the data packets and converting them into structured data; S20, performing URL scanning on the structured data to identify potential attack vectors and abnormal access patterns; S30, inputting potential attack vectors and abnormal access patterns into the machine learning model for anomaly detection and vulnerability identification, and outputting detection results; S40, determining whether to trigger an alarm according to the login request in the detection result; S50: Store the detection results and analyze them regularly to optimize the machine learning model.

2. The method according to claim 1, characterized in that The real-time monitoring of network traffic and capturing of data packets entering and leaving network applications are specifically as follows: the network traffic obtained from the traffic platform is used as input, a sniffer tool is used to monitor the network traffic of a specified network interface in real time, and a Scapy library is used to realize data packet capture.

3. The method according to claim 2, characterized in that Parse the data packet and convert it into structured data, specifically: Each captured data packet is analyzed through a callback function; wherein, in the callback function, it is determined whether the data packet contains IP header information; If the IP header information is included, the source IP, destination IP, protocol type, source port number, and destination port number are extracted, and the information is converted into JSON format data and output as structured data.

4. The method according to claim 1, characterized in that: Step S10 also includes: By collecting, de-dusting and labeling structured data, we obtain page sample data. After introducing information entropy to remove interference factors in the page sample data, we use word2vec technology to preprocess the page sample data to obtain training data sets and test data sets. We use the training data sets to train the selected machine learning model, and use known traffic types to adjust the machine learning model parameters during the training process. We use the test data sets to evaluate the trained machine learning model. After the training is completed, we deploy the machine learning model to the network application entrance for anomaly detection and vulnerability identification.

5. The method according to claim 1, characterized in that Performing URL scanning on the structured data to identify potential attack vectors and abnormal access patterns, specifically: using a URL scanning algorithm to perform URL scanning on the structured data, extracting URLs from hypertext transfer protocol requests and normalizing them, deleting redundancy in the URLs to obtain normalized URLs, performing feature extraction on the normalized URLs to obtain URL features, using a trained machine learning model to classify the URL features, and determining whether they are malicious URLs to identify potential attack vectors and abnormal access patterns.

6. The method according to claim 4, characterized in that Potential attack vectors and abnormal access patterns are input into the machine learning model for anomaly detection and vulnerability identification, and the detection results are output, specifically: The management backend is detected from the page through the trained machine learning model, and the detected management backend is secondary verified. Through the secondary verification, behaviors that deviate from the normal mode are detected, anomalies or loopholes are identified, and the identification results are confirmed, and the detection results are output based on the identification results.

7. The method according to claim 6, characterized in that Determining whether to trigger an alarm according to the login request in the detection result specifically includes: Analyze the username and password information in the login request, set a password dictionary and a list of common weak passwords, and issue an alarm if the password appears in them; check whether there are weak passwords in the login interface. When weak passwords are found in the management background, determine the sensitivity threshold of anomaly detection based on historical data, and conduct real-time monitoring. Once abnormal behavior is detected or predefined rule conditions are met, an alarm message is immediately generated.

8. A network application vulnerability anomaly detection system, characterized in that: include: The data packet parsing and conversion module monitors network traffic in real time, captures data packets entering and leaving network applications, parses the data packets and converts them into structured data; A website scanning module performs website scanning on the structured data to identify potential attack vectors and abnormal access patterns; The anomaly detection and vulnerability identification module inputs potential attack vectors and abnormal access patterns into the machine learning model for anomaly detection and vulnerability identification, and outputs the detection results; An alarm triggering module determines whether to trigger an alarm according to the login request in the detection result; The machine learning model optimization module stores the detection results and regularly analyzes them to optimize the machine learning model.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the network application vulnerability anomaly detection method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the network application vulnerability anomaly detection method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method and system for network flow anomaly detection

    CN102821002A

  • Method and apparatus for detecting webpage redirection vulnerabilities

    CN104881605A

  • training method, a detection method and a system for a malicious webpage detection model

    CN109657470A

  • Intranet security risk identification method and device

    CN111669376A

  • Computer network security intrusion detection system

    CN112953966A

Cited By

  • Automatic RASP method and device based on flow classification and code analysis, equipment and medium

    CN119420521A

  • Analyzing and processing method for detecting application layer attack by using large model

    CN120692066A

  • Test script generation method and device, storage medium and terminal

    CN121418189A