WO2019148706A1 - web入侵检测方法、装置、计算机设备和存储介质 - Google Patents

web入侵检测方法、装置、计算机设备和存储介质 Download PDF

Info

Publication number
WO2019148706A1
WO2019148706A1 PCT/CN2018/088562 CN2018088562W WO2019148706A1 WO 2019148706 A1 WO2019148706 A1 WO 2019148706A1 CN 2018088562 W CN2018088562 W CN 2018088562W WO 2019148706 A1 WO2019148706 A1 WO 2019148706A1
Authority
WO
WIPO (PCT)
Prior art keywords
web
access request
intrusion
web intrusion
detection model
Prior art date
Application number
PCT/CN2018/088562
Other languages
English (en)
French (fr)
Inventor
谭杰
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019148706A1 publication Critical patent/WO2019148706A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1408Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic by monitoring network traffic
    • H04L63/1416Event detection, e.g. attack signature detection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic
    • H04L63/1458Denial of Service
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1408Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic by monitoring network traffic
    • H04L63/1425Traffic logging, e.g. anomaly detection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/16Implementing security features at a particular protocol layer
    • H04L63/168Implementing security features at a particular protocol layer above the transport layer

Definitions

  • the present application relates to a web intrusion detection method, apparatus, computer device and storage medium.
  • a web intrusion detection method, apparatus, computer device, and storage medium are provided.
  • a web intrusion detection method includes:
  • the web access request acquired again is detected according to the retrained web intrusion detection model.
  • a web intrusion detection device includes:
  • An access request obtaining module configured to obtain a web access request
  • An access request detection module configured to detect, according to the pre-trained web intrusion detection model, whether the web access request is a web intrusion access request
  • An intrusion request statistics module configured to count the number of detected web intrusion access requests
  • a model retraining module configured to retrain the web intrusion detection model according to the detected web intrusion access request when the number of the detected web intrusion access requests is greater than a preset number threshold;
  • the access request detection module is further configured to detect the re-acquired web access request according to the retrained web intrusion detection model.
  • a computer device comprising a memory and one or more processors having stored therein computer readable instructions, the computer readable instructions being executed by the one or more processors such that the one or more The processor implements the steps of the web intrusion detection method provided in any one of the embodiments of the present application.
  • One or more non-transitory computer readable storage media storing computer readable instructions, which when executed by one or more processors, cause the one or more processors to implement any of the present application. The steps of the web intrusion detection method provided in one embodiment.
  • FIG. 1 is an application scenario diagram of a web intrusion detection method according to one or more embodiments.
  • FIG. 2 is a flow diagram of a web intrusion detection method in accordance with one or more embodiments.
  • FIG. 3 is a flow diagram of the steps of training a web intrusion detection model in accordance with one or more embodiments.
  • FIG. 4 is a flow diagram of the steps of detecting a web access request in accordance with one or more embodiments.
  • FIG. 5 is a flow diagram of the steps of detecting a web access request using a retrained web intrusion access detection model in accordance with one or more embodiments.
  • FIG. 6 is a flow diagram of the steps of detecting based on an access path in accordance with one or more embodiments.
  • FIG. 7 is a block diagram of a web intrusion detection device in accordance with one or more embodiments.
  • Figure 8 is a block diagram of a web intrusion detection device in another embodiment.
  • FIG. 9 is a block diagram of an access request detection module in accordance with one or more embodiments.
  • FIG. 10 is an internal block diagram of a computer device in accordance with one or more embodiments.
  • Terminal 102 communicates with server 104 over a network over a network.
  • the terminal 102 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablets, and portable wearable devices, and the server 104 can be implemented with a stand-alone server or a server cluster composed of a plurality of servers.
  • a web intrusion detection method is provided, which is applied to the server in FIG. 1 as an example, and includes the following steps:
  • the terminal acquires web access information input by the user, generates a web access request according to the web access information, and sends the web access request to the server.
  • the server receives a web access request sent by the terminal.
  • the server can receive web access requests sent by multiple terminals.
  • the terminal acquires web access information input by the user, generates a web path query request according to the web access information, and sends the web path query request to the server.
  • the server extracts the web access information in the web path query request, queries the corresponding web path according to the web access information, and returns the queried web path to the terminal.
  • the terminal generates a web access request according to the web path returned by the server.
  • the web access information may be a website name.
  • the server inputs the web access request into the pre-trained web intrusion detection model to detect the web access request through the pre-trained web intrusion detection model, and obtain the pre-trained web intrusion.
  • the detection model is based on the output of the test results. If the detection result is a web intrusion access request, the server rejects the web access request; if the detection result is that the web access request is not a web intrusion access request, the server allows the web access request to access.
  • the server extracts a preset feature character in the web access request, constructs an access request feature vector corresponding to the web access request according to the extracted preset feature character, and inputs the access request feature vector into the pre-trained web intrusion.
  • the detection model is obtained, and the detection result output by the pre-trained web intrusion detection model is obtained.
  • the server performs statistics on the detection results of the pre-trained web intrusion detection model, and counts the number of web intrusion access requests detected by the pre-trained web intrusion detection model.
  • the number of web intrusion access requests currently detected by the pre-trained web intrusion detection model of the server statistics is n.
  • the server will be n+1, then n+1 is the number of web intrusion access requests detected by the pre-trained web intrusion detection model counted by the server.
  • the server compares the counted data with a preset number threshold, and if the counted quantity is greater than a preset number threshold, The web intrusion access request detected by the pre-trained web intrusion detection model is obtained, and the web intrusion detection model is retrained according to the obtained web intrusion access request.
  • the server after retraining the web intrusion detection model, the server replaces the pre-trained web intrusion detection model with the retrained web intrusion detection model, and uses the retrained web intrusion detection model to obtain the obtained web access. Request for testing.
  • the server again receives the web access request sent by the terminal.
  • the server extracts a preset feature character included in the web access request from the web access request acquired according to the preset feature character, and constructs the web access request according to the extracted preset feature character.
  • the access request feature vector is accessed, and the constructed access request feature vector is input into the retrained web intrusion detection model, and the reconstructed web intrusion detection model is used to process the constructed access request feature vector, and the retrained web intrusion detection model is processed.
  • the web access request is detected by the pre-trained web intrusion detection model.
  • the web intrusion detection is retrained according to the detected web intrusion access request.
  • the model replaces the pre-stored web intrusion detection model with the retrained web intrusion detection model, and detects the subsequent web access request through the retrained web intrusion detection model.
  • the web intrusion detection model can be automatically updated in time without manual setting of the detection method, and the detection speed of the web intrusion access request is improved, and the updated web intrusion detection model is used to improve the accuracy of detecting the web intrusion access request.
  • the method before S202, further includes the step of training a web intrusion detection model, and the step specifically includes the following:
  • the server acquires model sample data, which is data for training a web intrusion detection model.
  • the model sample data can be entered by the user in the terminal.
  • the terminal acquires model sample data input by the user, and sends the acquired model sample data to the server.
  • the server receives model sample data sent by the terminal.
  • the model sample data includes multiple web intrusion access requests.
  • S302 specifically includes the following: acquiring a model training instruction; calling a web intrusion access request generating program to generate a web intrusion access request in batch according to the model training instruction; and using the batch generated web intrusion access request as model sample data .
  • the terminal acquires a model training instruction triggered by the user in the model training page by the input device, and sends the model training instruction to the server.
  • a web intrusion access request generating program is installed in the server, and the web intrusion access request generating program is a program for automatically generating a web intrusion access request in batches.
  • the server invokes the web intrusion access request generating program, triggers the web intrusion access request generating program to generate a web intrusion access request in batches, obtains a batch generated web intrusion access request, and obtains the web intrusion access request as a model. sample.
  • the terminal acquires web intrusion access request generation rule information input by the detection personnel on the rule configuration page of the web intrusion access request generation program, and sends the rule information to the server according to the obtained web intrusion access request generation rule information.
  • the server configures the web intrusion access request generating program according to the received web intrusion access request generating program.
  • the server obtains the model training instruction
  • the server triggers the request generation instruction of the web intrusion access request generation program according to the model training instruction, so that the web intrusion access request generation program generates the web intrusion access request in batch according to the web intrusion access request generation rule information.
  • the server uses the batch generated web intrusion access request as model sample data.
  • the server reads each web intrusion access request in the model sample data, identifies a preset feature character included in the read web intrusion access request, and extracts a preset feature character recognized in each web intrusion access request. .
  • the access request feature vector corresponding to the web intrusion access request is constructed according to the extracted preset feature characters.
  • the server acquires a preset feature vector corresponding to the preset feature character, and the value in the preset feature vector respectively corresponds to each preset feature character.
  • the value corresponding to the extracted preset feature character in the preset feature vector is set to 1, in addition to the value corresponding to the extracted preset feature character.
  • the outer value is set to 0, and the access request feature vector corresponding to each intrusion access request is obtained.
  • the preset feature characters include
  • the value of the corresponding numerical position in the middle is set to 1, and the value of the numerical position that is not corresponding in the access request feature vector is set to 0.
  • the access request feature vector corresponding to the web intrusion access request is [1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1];
  • the included feature characters are
  • the access request feature vector corresponding to the web intrusion access request is [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0].
  • the server takes as input the access request feature vector corresponding to each web intrusion access request, determines the web intrusion access request as an output, trains the web intrusion detection model, and uses the trained web intrusion detection model as pre-trained. Web intrusion detection model storage.
  • the access request feature vector corresponding to each web intrusion access request is constructed according to the preset feature character, and the web intrusion detection model is trained according to the access request feature vector, thereby improving the web intrusion. Detect the accuracy of the model.
  • S202 specifically includes the step of detecting a web access request, and the step specifically includes the following:
  • the server is configured with a preset feature character library, and the preset feature character library stores preset feature characters uploaded by the terminal.
  • the server parses the obtained web access request, obtains the web access data through parsing, determines the preset feature characters included in the web access data according to the preset feature characters in the preset feature character library, and extracts the determined preset feature characters. .
  • the server acquires an access request feature vector in the preset feature character library, and sets a corresponding value in the acquired access request feature vector according to the extracted preset feature character, and the extracted preset feature character does not correspond to The value of the value is set to 0, and an access request feature vector corresponding to the obtained web access request is obtained.
  • S406 Input the constructed access request feature vector into the pre-trained web intrusion detection model to obtain a detection result.
  • the server when constructing the access request feature vector corresponding to the obtained web access request, the server inputs the constructed access request feature vector into the pre-selected trained web intrusion detection model, and accesses the construct through the pre-trained web intrusion detection model.
  • the feature vector is requested to be processed, and the detection result of the access request feature vector output constructed by the pre-trained web intrusion detection model is obtained.
  • the server obtains the detection result, if the detection result is 1, the web access request is determined to be a web intrusion access request; if the detection result is 0, it is determined that the web access request is not a web intrusion access request.
  • the web access request is detected by the pre-trained web intrusion detection model, no manual preset detection mode is needed, the degree of manual intervention is reduced, the detection time of detecting the web intrusion access request is shortened, and the detection web is improved.
  • the detection accuracy of intrusion access requests is improved.
  • the method further includes the step of detecting a web access request by using a retrained web intrusion access detection model, and the step specifically includes the following:
  • the server again receives the web access request sent by the terminal.
  • the server extracts the preset feature characters included in the web access request from the web access request acquired according to the preset feature character, and constructs the web access according to the extracted preset feature characters.
  • the corresponding access request feature vector is requested, and the constructed access request feature vector is input into the retrained web intrusion detection model, and the reconstructed web intrusion detection model is used to process the constructed access request feature vector to obtain a retrained web intrusion.
  • the detection model processes the detection result of the access request feature vector output constructed.
  • the server determines, according to the detection result, that the re-acquired web access request is a web intrusion access request, and denies access to the web access request acquired again.
  • the server extracts the terminal address in the web access request, and returns the access warning information according to the terminal address.
  • the data is queried according to the web access request acquired again.
  • the server detects that the re-acquired web access request is a web normal access request
  • the access path in the re-acquired web access request is extracted, and the corresponding data is first queried according to the access path, and the queried data is returned to the terminal.
  • the web access request is detected by using the retrained web intrusion detection model, and the web access request is directly detected by using the retrained web intrusion detection model to ensure timely detection. Update the web intrusion detection model to improve the accuracy of detecting web intrusion access requests.
  • S504 specifically includes a step of detecting according to an access path, and the step specifically includes the following:
  • the server parses the web access request acquired again, and extracts the access path in the web access request by parsing.
  • the extracted access path is /etc/passwd.
  • the server reads the preset feature characters in the preset feature character library, and matches the read preset feature characters with the characters in the extracted access path, and the matched preset feature characters are extracted.
  • the preset feature characters included in the access path are extracted, and the matched preset feature characters are extracted.
  • S604 specifically includes the following: performing character segmentation on the extracted access path to obtain a segmented character; and identifying a preset feature character in the segmented character according to a preset feature character in the preset feature character library; Extract the recognized preset feature characters.
  • the server performs lexical analysis on the extracted access path, and performs lexical analysis to segment the extracted access path to obtain a segmented character, and identifies whether there is a preset feature character in the preset feature character library in the segmented character, Query the recognized preset feature characters in the split character.
  • the extracted access path is "/etc/passwd"
  • the extracted access path is split to get “/,etc,/,passwd”
  • "/,etc,/,passwd” is the extracted access.
  • the split character corresponding to the path.
  • the server sets a value corresponding to the acquired preset character in the access request vector to 1, and a value that does not correspond to the obtained preset feature character is set to 0, and generates an access corresponding to the web access request acquired again.
  • Request feature vector
  • the server inputs the generated access request feature vector into the retrained web intrusion detection model, and the retrained web intrusion detection model calculates the input access request feature vector to obtain the detection result. If the detection result is 1, it indicates that the extracted access path is abnormal, and the server determines that the web access request is again obtained as a web intrusion access request; if the detection result is 0, it indicates that the extracted access path is normal, and the server determines that the web access is acquired again.
  • the request is a normal access request.
  • the access path is extracted from the web access request, the preset feature character in the access path is extracted, and the access request feature vector corresponding to the web access request acquired again is generated according to the extracted preset feature character, according to the retraining
  • the web intrusion detection model processes the access request feature vector to obtain the detection result of the access path, thereby obtaining whether the web access request is a web intrusion access request, thereby improving the detection efficiency of the web intrusion access request.
  • FIGS. 2-6 are sequentially displayed as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Except as explicitly stated herein, the execution of these steps is not strictly limited, and the steps may be performed in other orders. Moreover, at least some of the steps in FIGS. 2-6 may include a plurality of sub-steps or stages, which are not necessarily performed at the same time, but may be executed at different times, these sub-steps or stages The order of execution is not necessarily performed sequentially, but may be performed alternately or alternately with at least a portion of other steps or sub-steps or stages of other steps.
  • a web intrusion detection apparatus 700 including: an access request acquisition module 702, an access request detection module 704, an intrusion request statistics module 706, a model retraining module 708, and detection.
  • the model replaces module 710. among them:
  • the access request obtaining module 702 is configured to obtain a web access request.
  • the access request detection module 704 is configured to detect whether the web access request is a web intrusion access request according to the pre-trained web intrusion detection model.
  • the intrusion request statistics module 706 is configured to count the number of detected web intrusion access requests.
  • the model retraining module 708 is configured to retrain the web intrusion detection model according to the detected web intrusion access request when the number of detected web intrusion access requests is greater than a preset number threshold.
  • the detection model replacement module 710 is configured to replace the pre-trained web intrusion detection model with the retrained web intrusion detection model
  • the access request detection module 704 is further configured to detect the re-acquired web access request according to the retrained web intrusion detection model.
  • the web access request is detected by the pre-trained web intrusion detection model.
  • the web intrusion detection is retrained according to the detected web intrusion access request.
  • the model replaces the pre-stored web intrusion detection model with the retrained web intrusion detection model, and detects the subsequent web access request through the retrained web intrusion detection model.
  • the web intrusion detection model can be automatically updated in time without manual setting of the detection method, and the detection speed of the web intrusion access request is improved, and the updated web intrusion detection model is used to improve the accuracy of detecting the web intrusion access request.
  • the web intrusion detection apparatus 700 specifically includes the following: a sample data acquisition module 712, a feature character extraction module 714, a feature vector construction module 716, and a detection model training module 718.
  • the sample data obtaining module 712 is configured to acquire model sample data.
  • the feature character extraction module 714 is configured to extract, for each web intrusion access request in the model sample data, a preset feature character included in the web intrusion access request.
  • the feature vector construction module 716 is configured to construct an access request feature vector corresponding to the web intrusion access request according to the extracted preset feature characters.
  • the detection model training module 718 is configured to train the web intrusion detection model according to the access request feature vector corresponding to each web intrusion access request to obtain a pre-trained web intrusion detection model.
  • the access request feature vector corresponding to each web intrusion access request is constructed according to the preset feature character, and the web intrusion detection model is trained according to the access request feature vector, thereby improving the web intrusion. Detect the accuracy of the model.
  • the sample data obtaining module 712 is further configured to acquire a model training instruction; according to the model training instruction, the web intrusion access request generating program is invoked to generate a web intrusion access request in batches; and the batch generated web intrusion access request is used as a model sample. data.
  • the access request detection module 704 is further configured to: extract the included preset feature characters from the web access request according to the preset feature character library; and construct the access corresponding to the web access request according to the extracted preset feature characters.
  • the feature vector is requested; the constructed access request feature vector is input into the pre-trained web intrusion detection model for detection, and the detection result is obtained; and the web access request is determined to be a web intrusion access request according to the detection result.
  • the web access request is detected by the pre-trained web intrusion detection model, without manual preset detection mode, the degree of manual intervention is reduced, the detection time of detecting the web intrusion access request is shortened, and the detection web is improved.
  • the detection accuracy of intrusion access requests is improved.
  • the access request acquisition module 702 is further configured to retrieve the web access request again.
  • the access request detection module 704 is further configured to: detect, according to the retrained web intrusion detection model, the re-acquired web access request; and when detecting the re-acquired web access request as a web intrusion access request, reject the re-acquired web access request; When it is detected that the web access request acquired again is a web normal access request, the data is queried according to the web access request acquired again.
  • the web access request is detected by using the retrained web intrusion detection model, and the web access request is directly detected by using the retrained web intrusion detection model to ensure timely detection. Update the web intrusion detection model to improve the accuracy of detecting web intrusion access requests.
  • the access request detection module 704 includes the following: an access path extraction module 704a, a feature character acquisition module 704b, a feature vector generation module 704c, and a detection result obtaining module 704d.
  • the access path extraction module 704a is configured to extract an access path from the web access request acquired again.
  • the feature character obtaining module 704b is configured to acquire preset feature characters included in the extracted access path.
  • the feature vector generation module 704c generates an access request feature vector corresponding to the web access request acquired again according to the acquired preset feature character.
  • the detection result obtaining module 704d inputs the generated access request feature vector into the retrained web intrusion detection model to obtain the detection result.
  • the feature character obtaining module 704b is further configured to perform character segmentation on the extracted access path to obtain a segmented character; identify a preset feature character in the segmented character according to a preset feature character in the preset feature character library; and extract the recognized preset Character characters.
  • the access path is extracted from the web access request, the preset feature character in the access path is extracted, and the access request feature vector corresponding to the web access request acquired again is generated according to the extracted preset feature character, according to the retraining
  • the web intrusion detection model processes the access request feature vector to obtain the detection result of the access path, thereby obtaining whether the web access request is a web intrusion access request, thereby improving the detection efficiency of the web intrusion access request.
  • the various modules in the web intrusion detection device described above may be implemented in whole or in part by software, hardware, and combinations thereof. Each of the above modules may be embedded in or independent of the processor in the computer device, or may be stored in a memory in the computer device in a software form, so that the processor invokes the operations corresponding to the above modules.
  • a computer device which may be a server, and its internal structure diagram may be as shown in FIG.
  • the computer device includes a processor, memory, network interface, and database connected by a system bus.
  • the processor of the computer device is used to provide computing and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium, an internal memory.
  • the non-volatile storage medium stores an operating system, computer readable instructions, and a database.
  • the internal memory provides an environment for operation of an operating system and computer readable instructions in a non-volatile storage medium.
  • the database of the computer device is used to store preset feature characters.
  • the network interface of the computer device is used to communicate with an external terminal via a network connection.
  • the computer readable instructions are executed by a processor to implement a web intrusion detection method.
  • FIG. 10 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation of the computer device to which the solution of the present application is applied.
  • the specific computer device may It includes more or fewer components than those shown in the figures, or some components are combined, or have different component arrangements.
  • a computer device comprising a memory and one or more processors having stored therein computer readable instructions, the computer readable instructions being executed by one or more processors such that one or more processors implement any of the present application.
  • One or more non-transitory computer readable storage mediums storing computer readable instructions, when executed by one or more processors, cause one or more processors to be implemented in any one embodiment of the present application. The steps provided by the web intrusion detection method.
  • Non-volatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM is available in a variety of formats, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronization chain.
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • Synchlink DRAM SLDRAM
  • Memory Bus Radbus
  • RDRAM Direct RAM
  • DRAM Direct Memory Bus Dynamic RAM
  • RDRAM Memory Bus Dynamic RAM

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Computer And Data Communications (AREA)

Abstract

一种web入侵检测方法,包括:获取web访问请求;根据预先训练好的web入侵检测模型,检测所述web访问请求是否为web入侵访问请求;统计检测到的web入侵访问请求的数量;当所述检测到的web入侵访问请求的数量大于预设数量阈值时,根据所述检测到的web入侵访问请求重新训练web入侵检测模型;将所述预先训练好的web入侵检测模型替换为重新训练的web入侵检测模型。

Description

web入侵检测方法、装置、计算机设备和存储介质
本申请要求于2018年2月1日提交中国专利局,申请号为2018101029787,申请名称为“web入侵检测方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及一种web入侵检测方法、装置、计算机设备和存储介质。
背景技术
随着网络技术的发展,各种网络安全方面的问题也不断的凸显出来。一些网站容易受到web入侵,web入侵很容易导致网络信息的泄露。尤其是对于一些比较重要网络信息,若受到web入侵导致网络信息的泄露,容易造成不可预估的损失。
然而,发明人意识到,目前的对于web入侵也有一些网络安全方面的检测,这些检测一般都是通过人工预设检测方式来检测web访问请求是否为web入侵。因为网络技术的发展,web入侵的方式也在不断的变化,通过人工预设检测方式来检测,若人工不及时更新检测方式,容易造成检测方式滞后,不能准确检测到新的web入侵方式,从而降低了web入侵的检测准确率较低。
发明内容
根据本申请公开的各种实施例,提供一种web入侵检测方法、装置、计算机设备和存储介质。
一种web入侵检测方法包括:
获取web访问请求;
根据预先训练好的web入侵检测模型,检测所述web访问请求是否为web入侵访问请求;
统计检测到的web入侵访问请求的数量;
当所述检测到的web入侵访问请求的数量大于预设数量阈值时,根据所述检测到的web入侵访问请求重新训练web入侵检测模型;
将所述预先训练好的web入侵检测模型替换为重新训练的web入侵检测模型;及
根据所述重新训练的web入侵检测模型对再次获取到的web访问请求进行检测。
一种web入侵检测装置包括:
访问请求获取模块,用于获取web访问请求;
访问请求检测模块,用于根据预先训练好的web入侵检测模型,检测所述web访问 请求是否为web入侵访问请求;
入侵请求统计模块,用于统计检测到的web入侵访问请求的数量;
模型重新训练模块,用于当所述检测到的web入侵访问请求的数量大于预设数量阈值时,根据所述检测到的web入侵访问请求重新训练web入侵检测模型;
检测模型替换模块,用于将所述预先训练好的web入侵检测模型替换为重新训练的web入侵检测模型;及
所述访问请求检测模块还用于根据所述重新训练的web入侵检测模型对再次获取到的web访问请求进行检测。
一种计算机设备,包括存储器和一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器实现本申请任意一个实施例中提供的web入侵检测方法的步骤。
一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器实现本申请任意一个实施例中提供的web入侵检测方法的步骤。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为根据一个或多个实施例中web入侵检测方法的应用场景图。
图2为根据一个或多个实施例中web入侵检测方法的流程示意图。
图3为根据一个或多个实施例中训练web入侵检测模型的步骤的流程示意图。
图4为根据一个或多个实施例中检测web访问请求的步骤的流程示意图。
图5为根据一个或多个实施例中采用重新训练的web入侵访问检测模型检测web访问请求的步骤的流程示意图。
图6为根据一个或多个实施例中根据访问路径进行检测的步骤的流程示意图。
图7为根据一个或多个实施例中web入侵检测装置的框图。
图8为另一个实施例中web入侵检测装置的框图。
图9为根据一个或多个实施例中访问请求检测模块的框图。
图10为根据一个或多个实施例中计算机设备的内部框图。
具体实施方式
为了使本申请的技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请提供的web入侵检测方法,可以应用于如图1所示的应用环境中。终端102通过网络与服务器104通过网络进行通信。终端102可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备,服务器104可以用独立的服务器或者是多个服务器组成的服务器集群来实现。
在其中一个实施例中,如图2所示,提供了一种web入侵检测方法,以该方法应用于图1中的服务器为例进行说明,包括以下步骤:
S202,获取web访问请求。
具体地,终端获取用户输入的web访问信息,根据web访问信息生成web访问请求,将web访问请求发送至服务器。服务器接收终端发送的web访问请求。服务器可接收多个终端发送的web访问请求。
在其中一个实施例中,终端获取用户输入的web访问信息,根据web访问信息生成web路径查询请求,将web路径查询请求发送至服务器。服务器接收到web路径查询请求后,提取web路径查询请求中的web访问信息,根据web访问信息查询对应的web路径,将查询到的web路径返回至终端。终端根据服务器返回的web路径生成web访问请求。其中,web访问信息可以是网站名称。
S204,根据预先训练好的web入侵检测模型,检测web访问请求是否为web入侵访问请求。
具体地,服务器在接收到web访问请求后,将web访问请求输入预先训练好的web入侵检测模型,以通过预先训练好的web入侵检测模型对web访问请求进行检测,获取预先训练好的web入侵检测模型根据输出的检测结果。若检测结果为web入侵访问请求,则服务器拒绝该web访问请求;若检测结果为该web访问请求不是web入侵访问请求,则服务器允许该web访问请求进行访问。
在其中一个实施例中,服务器在web访问请求中提取预设特征字符,根据提取到的预设特征字符构建web访问请求对应的访问请求特征向量,将访问请求特征向量输入预先训练好的web入侵检测模型,获取预先训练好的web入侵检测模型输出的检测结果。
S206,统计检测到的web入侵访问请求的数量。
具体地,服务器对预先训练好的web入侵检测模型的检测结果进行统计,统计该预先训练好的web入侵检测模型检测到的web入侵访问请求的数量。
举例说明,服务器统计的预先训练好的web入侵检测模型当前检测到的web入侵访问请求数量为n,当预先训练好的web入侵检测模型再次检测到一个web访问请求为web入侵访问请求时,则服务器将n+1,则n+1为服务器统计到的预先训练好的web入侵检测 模型检测到的web入侵访问请求数量。
S208,当检测到的web入侵访问请求的数量大于预设数量阈值时,根据检测到的web入侵访问请求重新训练web入侵检测模型。
具体地,服务器在统计预先训练好的web入侵检测模型所检测到的web入侵访问请求的数量后,将统计到的数据与预设数量阈值进行比较,若统计到的数量大于预设数量阈值时,则获取预先训练好的web入侵检测模型所检测到的web入侵访问请求,根据获取到的web入侵访问请求重新训练web入侵检测模型。
S210,将预先训练好的web入侵检测模型替换为重新训练的web入侵检测模型。
具体地,服务器在重新训练web入侵检测模型后,将预先训练好的web入侵检测模型进行替换,替换为重新训练的web入侵检测模型,利用重新训练的web入侵检测模型对之后获取到的web访问请求进行检测。
S212,根据重新训练的web入侵检测模型对再次获取到的web访问请求进行检测。
具体地,服务器在将预先训练好的web入侵检测模型替换为重新训练的web入侵检测模型后,服务器再次接收终端发送的web访问请求。服务器再次获取web访问请求后,对根据预设特征字符从再次获取到的web访问请求提取该web访问请求中包括的预设特征字符,根据提取到的预设特征字符构建该web访问请求对应的访问请求特征向量,将构建的访问请求特征向量输入到重新训练的web入侵检测模型中,利用重新训练的web入侵检测模型对构建的访问请求特征向量进行处理,得到重新训练的web入侵检测模型处理构建的访问请求特征向量输出的检测结果。
本实施例中,通过预先训练好的web入侵检测模型对web访问请求进行检测,当检测到web入侵访问请求的数量大于预设数量阈值时,根据检测到的web入侵访问请求重新训练web入侵检测模型,将预存训练好的web入侵检测模型替换为重新训练的web入侵检测模型,通过重新训练的web入侵检测模型对后续的web访问请求进行检测。无需人工设置检测方式的操作步骤,即可自动及时更新web入侵检测模型,提高了web入侵访问请求的检测速度,利用更新后的web入侵检测模型提高了检测web入侵访问请求的准确性。
在其中一个实施例中,如图3所示,S202之前具体还包括训练web入侵检测模型的步骤,该步骤具体包括以下内容:
S302,获取模型样本数据。
具体地,服务器获取模型样本数据,模型样本数据为用于训练web入侵检测模型的数据。模型样本数据可以是用户在终端中输入的。终端获取用户输入的模型样本数据,将获取到的模型样本数据发送至服务器。服务器接收终端发送的模型样本数据。模型样本数据包括多个web入侵访问请求。
在其中一个实施例中,S302具体还包括以下内容:获取模型训练指令;根据模型训练指令,调用web入侵访问请求生成程序批量生成web入侵访问请求;以批量生成的web 入侵访问请求作为模型样本数据。
具体地,终端获取用户通过输入设备在模型训练页面中触发的模型训练指令,将模型训练指令发送至服务器。服务器中安装有web入侵访问请求生成程序,web入侵访问请求生成程序为自动批量生成web入侵访问请求的程序。服务器在接收到模型训练指令时,调用web入侵访问请求生成程序,触发web入侵访问请求生成程序批量生成web入侵访问请求,获取批量生成的web入侵访问请求,以获取到的web入侵访问请求作为模型样本数据。
在其中一个实施例中,终端获取检测人员在web入侵访问请求生成程序的规则配置页面输入的web入侵访问请求生成规则信息,根据获取到的web入侵访问请求生成规则信息发送至服务器。服务器根据接收到的web入侵访问请求生成程序对web入侵访问请求生成程序进行配置。服务器在获取到模型训练指令时,根据模型训练指令触发web入侵访问请求生成程序的请求生成指令,使的web入侵访问请求生成程序根据web入侵访问请求生成规则信息批量生成web入侵访问请求。服务器以批量生成的web入侵访问请求作为模型样本数据。
S304,对于模型样本数据中的每个web入侵访问请求,提取web入侵访问请求中包括的预设特征字符。
具体地,服务器读取模型样本数据中的每个web入侵访问请求,识别读取到的web入侵访问请求中包括的预设特征字符,提取每个web入侵访问请求中识别到的预设特征字符。
S306,根据提取到的预设特征字符构建web入侵访问请求对应的访问请求特征向量。
具体地,服务器获取预设特征字符对应的预设特征向量,该预设特征向量中的数值分别与每个预设特征字符对应。服务器提取到的每个入侵访问请求对应的预设特征字符后,将预设特征向量中与提取到的预设特征字符对应的数值置为1,除提取到的预设特征字符对应的数值之外的数值置为0,得到每个入侵访问请求对应的访问请求特征向量。
举例说明,预设特征字符包括|、;、&、$、>、<、`(反引号)、\、!、’、#和/,访问请求特征向量中的每个数值位置与不同的预设特征字符对应,对于在入侵访问请求中包括的预设特征字符,将包括的预设特征在访问请求特征向量中对应的数值位置的数值置为1,将包括的预设特征在访问请求特征向量中不对应的数值位置的数值置为0。
(1)假设web入侵访问请求中包括了所有的预设特征字符,则该web入侵访问请求对应的访问请求特征向量为[1,1,1,1,1,1,1,1,1,1,1,1];
(2)假设web入侵访问请求中包括了部分预设特征字符,则包括的特征字符为|、;和&,则该web入侵访问请求对应的访问请求特征向量为[1,1,1,0,0,0,0,0,0,0,0,0];
(3)假设web入侵访问请求没有包括任何预设特征字符,则该web入侵访问请求对应的访问请求特征向量为[0,0,0,0,0,0,0,0,0,0,0,0]。
S308,根据每个web入侵访问请求对应的访问请求特征向量训练web入侵检测模型,得到预先训练的web入侵检测模型。
具体地,服务器以每个web入侵访问请求对应的访问请求特征向量作为输入,以判定为web入侵访问请求作为输出,训练web入侵检测模型,将经过训练得到的web入侵检测模型作为预先训练好的web入侵检测模型存储。
本实施例中,在获取到批量的web入侵访问请求后,根据预设特征字符构建每个web入侵访问请求对应的访问请求特征向量,根据访问请求特征向量训练web入侵检测模型,提高了web入侵检测模型的准确性。
在其中一个实施例中,如图4所示,S202具体包括检测web访问请求的步骤,该步骤具体包括以下内容:
S402,根据预设特征字符库,从web访问请求中提取包括的预设特征字符。
具体地,服务器中设置有预设特征字符库,预设特征字符库中存储着终端上传的预设特征字符。服务器对获取到的web访问请求进行解析,通过解析得到web访问数据,根据预设特征字符库中的预设特征字符,确定web访问数据中包括的预设特征字符,提取确定的预设特征字符。
S404,根据提取到的预设特征字符构建web访问请求对应的访问请求特征向量。
具体地,服务器获取预设特征字符库中的访问请求特征向量,根据提取到的预设特征字符将获取到的访问请求特征向量中的对应的数值置1,提取到的预设特征字符不对应的数值置为0,得到与获取到的web访问请求对应的访问请求特征向量。
S406,将构建的访问请求特征向量输入预先训练好的web入侵检测模型进行检测,得到检测结果。
具体地,服务器在构建获取到的web访问请求对应的访问请求特征向量时,将构建的访问请求特征向量输入预选训练好的web入侵检测模型,通过预先训练好的web入侵检测模型对构建的访问请求特征向量进行处理,获取预先训练好的web入侵检测模型处理构建的访问请求特征向量输出的检测结果。
S408,根据检测结果确定web访问请求是否为web入侵访问请求。
具体地,服务器在获取到检测结果后,若检测结果为1,则确定web访问请求为web入侵访问请求;若检测结果为0,则确定web访问请求不是web入侵访问请求。
本实施例中,通过预先训练好的web入侵检测模型,对web访问请求进行检测,无需人工预设检测方式,减少了人工干预程度,缩短了检测web入侵访问请求的检测时间,提高了检测web入侵访问请求的检测准确率。
在其中一个实施例中,如图5所示,S210之后具体还包括采用重新训练的web入侵访问检测模型检测web访问请求的步骤,该步骤具体包括以下内容:
S502,再次获取web访问请求。
具体地,服务器在将预先训练好的web入侵检测模型替换为重新训练的web入侵检 测模型后,服务器再次接收终端发送的web访问请求。
S504,根据重新训练的web入侵检测模型对再次获取的web访问请求进行检测。
具体地,服务器再次获取web访问请求后,对根据预设特征字符从再次获取到的web访问请求提取该web访问请求中包括的预设特征字符,根据提取到的预设特征字符构建该web访问请求对应的访问请求特征向量,将构建的访问请求特征向量输入到重新训练的web入侵检测模型中,利用重新训练的web入侵检测模型对构建的访问请求特征向量进行处理,得到重新训练的web入侵检测模型处理构建的访问请求特征向量输出的检测结果。
S506,当检测到再次获取的web访问请求为web入侵访问请求时,拒绝再次获取的web访问请求。
具体地,服务器根据检测结果确定再次获取的web访问请求为web入侵访问请求时,拒接再次获取的web访问请求的访问。同时,服务器提取该web访问请求中的终端地址,根据终端地址返回访问预警信息。
在其中一个实施例中,当检测到再次获取的web访问请求为web正常访问请求时,根据再次获取的web访问请求查询数据。
具体地,服务器检测到再次获取的web访问请求为web正常访问请求时,提取再次获取的web访问请求中的访问路径,根据访问路径先查询相应的数据,将查询到的数据返回至终端。
本实施例中,在替换web入侵检测模型后,利用重新训练的web入侵检测模型检测web访问请求,无需人工更新检测方式,直接采用重新训练的web入侵检测模型对web访问请求进行检测,保证及时更新web入侵检测模型,提高了检测web入侵访问请求准确性。
如图6所示,在其中一个实施例中,S504具体包括根据访问路径进行检测的步骤,该步骤具体包括以下内容:
S602,从再次获取的web访问请求中提取访问路径。
具体地,服务器在再次获取到web访问请求后,对再次获取到的web访问请求进行解析,通过解析提取该web访问请求中的访问路径。例如,提取到的访问路径为/etc/passwd。
S604,获取提取到的访问路径中包括的预设特征字符。
具体地,服务器读取预设特征字符库中的预设特征字符,用读取到的预设特征字符与提取到的访问路径中的字符进行匹配,匹配的预设特征字符即为提取到的访问路径中包括的预设特征字符,提取匹配到的预设特征字符。
在其中一个实施例中,S604具体还包括以下内容:对提取到的访问路径进行字符分割,得到分割字符;根据预设特征字符库中的预设特征字符识别分割字符中的预设特征字符;提取识别到的预设特征字符。
具体地,服务器对提取到的访问路径进行词法分析,经过词法分析对提取到的访问路径进行分割,得到分割字符,在分割字符中识别是否存在预设特征字符库中的预设特征 字符,从分割字符中查询识别到的预设特征字符。
举例说明,提取到的访问路径为“/etc/passwd”,对提取到的访问路径进行分割得到“/,etc,/,passwd”,则“/,etc,/,passwd”为提取到的访问路径对应的分割字符。
S606,根据获取到的预设特征字符,生成再次获取的web访问请求对应的访问请求特征向量。
具体地,服务器将访问请求向量中的与获取到的预设字符对应的数值置为1,与获取到的预设特征字符不对应的数值置为0,生成再次获取的web访问请求对应的访问请求特征向量。
S608,将生成的访问请求特征向量输入重新训练的web入侵检测模型,获得检测结果。
具体地,服务器将生成的访问请求特征向量输入重新训练的web入侵检测模型,重新训练的web入侵检测模型对输入的访问请求特征向量进行计算,得到检测结果。若检测结果为1,表明提取到的访问路径异常,服务器判定再次获取到web访问请求为web入侵访问请求;若检测结果为0,表明提取到的访问路径正常,服务器判定再次获取到的web访问请求为正常访问请求。
本实施例中,从web访问请求中提取访问路径,提取访问路径中的预设特征字符,根据提取到的预设特征字符生成再次获取到的web访问请求对应的访问请求特征向量,根据重新训练的web入侵检测模型对访问请求特征向量处理,得到访问路径的检测结果,从而得到确定web访问请求是否为web入侵访问请求,从而提高了web入侵访问请求的检测效率。
应该理解的是,虽然图2-6的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2-6中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
在其中一个实施例中,如图7所示,提供了一种web入侵检测装置700,包括:访问请求获取模块702、访问请求检测模块704、入侵请求统计模块706、模型重新训练模块708和检测模型替换模块710。其中:
访问请求获取模块702,用于获取web访问请求。
访问请求检测模块704,用于根据预先训练好的web入侵检测模型,检测web访问请求是否为web入侵访问请求。
入侵请求统计模块706,用于统计检测到的web入侵访问请求的数量。
模型重新训练模块708,用于当检测到的web入侵访问请求的数量大于预设数量阈值时,根据检测到的web入侵访问请求重新训练web入侵检测模型。
检测模型替换模块710,用于将预先训练好的web入侵检测模型替换为重新训练的web入侵检测模型;
访问请求检测模块704还用于根据重新训练的web入侵检测模型对再次获取到的web访问请求进行检测。
本实施例中,通过预先训练好的web入侵检测模型对web访问请求进行检测,当检测到web入侵访问请求的数量大于预设数量阈值时,根据检测到的web入侵访问请求重新训练web入侵检测模型,将预存训练好的web入侵检测模型替换为重新训练的web入侵检测模型,通过重新训练的web入侵检测模型对后续的web访问请求进行检测。无需人工设置检测方式的操作步骤,即可自动及时更新web入侵检测模型,提高了web入侵访问请求的检测速度,利用更新后的web入侵检测模型提高了检测web入侵访问请求的准确性。
在其中一个实施例中,如图8所示,web入侵检测装置700具体还包括以下内容:样本数据获取模块712、特征字符提取模块714、特征向量构建模块716和检测模型训练模块718。
样本数据获取模块712,用于获取模型样本数据。
特征字符提取模块714,用于对于模型样本数据中的每个web入侵访问请求,提取web入侵访问请求中包括的预设特征字符。
特征向量构建模块716,用于根据提取到的预设特征字符构建web入侵访问请求对应的访问请求特征向量。
检测模型训练模块718,用于根据每个web入侵访问请求对应的访问请求特征向量训练web入侵检测模型,得到预先训练的web入侵检测模型。
本实施例中,在获取到批量的web入侵访问请求后,根据预设特征字符构建每个web入侵访问请求对应的访问请求特征向量,根据访问请求特征向量训练web入侵检测模型,提高了web入侵检测模型的准确性。
在其中一个实施例中,样本数据获取模块712还用于获取模型训练指令;根据模型训练指令,调用web入侵访问请求生成程序批量生成web入侵访问请求;以批量生成的web入侵访问请求作为模型样本数据。
在其中一个实施例中,访问请求检测模块704还用于根据预设特征字符库,从web访问请求中提取包括的预设特征字符;根据提取到的预设特征字符构建web访问请求对应的访问请求特征向量;将构建的访问请求特征向量输入预先训练好的web入侵检测模型进行检测,得到检测结果;根据检测结果确定web访问请求是否为web入侵访问请求。
本实施例中,通过预先训练好的web入侵检测模型,对web访问请求进行检测,无需人工预设检测方式,减少了人工干预程度,缩短了检测web入侵访问请求的检测时间, 提高了检测web入侵访问请求的检测准确率。
在其中一个实施例中,访问请求获取模块702还用于再次获取web访问请求。
访问请求检测模块704还用于根据重新训练的web入侵检测模型对再次获取的web访问请求进行检测;当检测到再次获取的web访问请求为web入侵访问请求时,拒绝再次获取的web访问请求;当检测到再次获取的web访问请求为web正常访问请求时,根据再次获取的web访问请求查询数据。
本实施例中,在替换web入侵检测模型后,利用重新训练的web入侵检测模型检测web访问请求,无需人工更新检测方式,直接采用重新训练的web入侵检测模型对web访问请求进行检测,保证及时更新web入侵检测模型,提高了检测web入侵访问请求准确性。
在其中一个实施例中,如图9所示,访问请求检测模块704包括以下内容:访问路径提取模块704a、特征字符获取模块704b、特征向量生成模块704c和检测结果获得模块704d。
访问路径提取模块704a,用于从再次获取的web访问请求中提取访问路径。
特征字符获取模块704b,用于获取提取到的访问路径中包括的预设特征字符。
特征向量生成模块704c,根据获取到的预设特征字符,生成再次获取的web访问请求对应的访问请求特征向量。
检测结果获得模块704d,将生成的访问请求特征向量输入重新训练的web入侵检测模型,获得检测结果。
特征字符获取模块704b还用于对提取到的访问路径进行字符分割,得到分割字符;根据预设特征字符库中的预设特征字符识别分割字符中的预设特征字符;提取识别到的预设特征字符。
本实施例中,从web访问请求中提取访问路径,提取访问路径中的预设特征字符,根据提取到的预设特征字符生成再次获取到的web访问请求对应的访问请求特征向量,根据重新训练的web入侵检测模型对访问请求特征向量处理,得到访问路径的检测结果,从而得到确定web访问请求是否为web入侵访问请求,从而提高了web入侵访问请求的检测效率。
关于web入侵检测装置的具体限定可以参见上文中对于web入侵检测方法的限定,在此不再赘述。上述web入侵检测装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在其中一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图10所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的 存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机可读指令和数据库。该内存储器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的数据库用于存储预设特征字符。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现一种web入侵检测方法。
本领域技术人员可以理解,图10中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
一种计算机设备,包括存储器和一个或多个处理器,存储器中储存有计算机可读指令,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器实现本申请任意一个实施例中提供的web入侵检测方法的步骤。
一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器实现本申请任意一个实施例中提供的web入侵检测方法的步骤。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (20)

  1. 一种web入侵检测方法,包括:
    获取web访问请求;
    根据预先训练好的web入侵检测模型,检测所述web访问请求是否为web入侵访问请求;
    统计检测到的web入侵访问请求的数量;
    当所述检测到的web入侵访问请求的数量大于预设数量阈值时,根据所述检测到的web入侵访问请求重新训练web入侵检测模型;
    将所述预先训练好的web入侵检测模型替换为重新训练的web入侵检测模型;及
    根据所述重新训练的web入侵检测模型对再次获取到的web访问请求进行检测。
  2. 根据权利要求1所述的方法,其特征在于,所述获取web访问请求之前,所述方法还包括:
    获取模型样本数据;
    对于所述模型样本数据中的每个web入侵访问请求,提取所述web入侵访问请求中包括的预设特征字符;
    根据提取到的预设特征字符构建所述web入侵访问请求对应的访问请求特征向量;及
    根据每个web入侵访问请求对应的访问请求特征向量训练web入侵检测模型,得到预先训练的web入侵检测模型。
  3. 根据权利要求2所述的方法,其特征在于,所述获取模型样本数据,包括:
    获取模型训练指令;
    根据所述模型训练指令,调用web入侵访问请求生成程序批量生成web入侵访问请求;及
    以批量生成的web入侵访问请求作为模型样本数据。
  4. 根据权利要求1所述的方法,其特征在于,所述根据预先训练好的web入侵检测模型,检测所述web访问请求是否为web入侵访问请求,包括:
    根据预设特征字符库,从所述web访问请求中提取包括的预设特征字符;
    根据提取到的预设特征字符构建所述web访问请求对应的访问请求特征向量;
    将构建的访问请求特征向量输入预先训练好的web入侵检测模型进行检测,得到检测结果;及
    根据检测结果确定所述web访问请求是否为web入侵访问请求。
  5. 根据权利要求1所述的方法,其特征在于,所述根据所述重新训练的web入侵检测模型对再次获取到的web访问请求进行检测之后,所述方法还包括:
    当检测到所述再次获取的web访问请求为web入侵访问请求时,拒绝所述再次获取的web访问请求;及
    当检测到所述再次获取的web访问请求为web正常访问请求时,根据所述再次获取 的web访问请求查询数据。
  6. 根据权利要求5所述的方法,其特征在于,所述根据所述重新训练的web入侵检测模型对再次获取的web访问请求进行检测,包括:
    从再次获取的web访问请求中提取访问路径;
    获取所述提取到的访问路径中包括的预设特征字符;
    根据获取到的预设特征字符,生成所述再次获取的web访问请求对应的访问请求特征向量;及
    将生成的访问请求特征向量输入所述重新训练的web入侵检测模型,获得检测结果。
  7. 根据权利要求6所述的方法,其特征在于,所述获取所述提取到的访问路径中包括的预设特征字符,包括:
    对提取到的访问路径进行字符分割,得到分割字符;
    根据预设特征字符库中的预设特征字符识别所述分割字符中的预设特征字符;及
    提取识别到的预设特征字符。
  8. 一种web入侵检测装置,包括:
    访问请求获取模块,用于获取web访问请求;
    访问请求检测模块,用于根据预先训练好的web入侵检测模型,检测所述web访问请求是否为web入侵访问请求;
    入侵请求统计模块,用于统计检测到的web入侵访问请求的数量;
    模型重新训练模块,用于当所述检测到的web入侵访问请求的数量大于预设数量阈值时,根据所述检测到的web入侵访问请求重新训练web入侵检测模型;
    检测模型替换模块,用于将所述预先训练好的web入侵检测模型替换为重新训练的web入侵检测模型;及
    所述访问请求检测模块还用于根据所述重新训练的web入侵检测模型对再次获取到的web访问请求进行检测。
  9. 一种计算机设备,包括存储器和一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
    获取web访问请求;
    根据预先训练好的web入侵检测模型,检测所述web访问请求是否为web入侵访问请求;
    统计检测到的web入侵访问请求的数量;
    当所述检测到的web入侵访问请求的数量大于预设数量阈值时,根据所述检测到的web入侵访问请求重新训练web入侵检测模型;
    将所述预先训练好的web入侵检测模型替换为重新训练的web入侵检测模型;及
    根据所述重新训练的web入侵检测模型对再次获取到的web访问请求进行检测。
  10. 根据权利要求9所述的计算机设备,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述获取web访问请求之前,还执行以下步骤:
    获取模型样本数据;
    对于所述模型样本数据中的每个web入侵访问请求,提取所述web入侵访问请求中包括的预设特征字符;
    根据提取到的预设特征字符构建所述web入侵访问请求对应的访问请求特征向量;及
    根据每个web入侵访问请求对应的访问请求特征向量训练web入侵检测模型,得到预先训练的web入侵检测模型。
  11. 根据权利要求10所述的计算机设备,其特征在于,所述获取模型样本数据,包括:
    获取模型训练指令;
    根据所述模型训练指令,调用web入侵访问请求生成程序批量生成web入侵访问请求;及
    以批量生成的web入侵访问请求作为模型样本数据。
  12. 根据权利要求9所述的计算机设备,其特征在于,所述根据预先训练好的web入侵检测模型,检测所述web访问请求是否为web入侵访问请求,包括:
    根据预设特征字符库,从所述web访问请求中提取包括的预设特征字符;
    根据提取到的预设特征字符构建所述web访问请求对应的访问请求特征向量;
    将构建的访问请求特征向量输入预先训练好的web入侵检测模型进行检测,得到检测结果;及
    根据检测结果确定所述web访问请求是否为web入侵访问请求。
  13. 根据权利要求9所述的计算机设备,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述根据所述重新训练的web入侵检测模型对再次获取到的web访问请求进行检测之后,还执行以下步骤:
    当检测到所述再次获取的web访问请求为web入侵访问请求时,拒绝所述再次获取的web访问请求;及
    当检测到所述再次获取的web访问请求为web正常访问请求时,根据所述再次获取的web访问请求查询数据。
  14. 根据权利要求13所述的计算机设备,其特征在于,所述根据所述重新训练的web入侵检测模型对再次获取的web访问请求进行检测,包括:
    从再次获取的web访问请求中提取访问路径;
    获取所述提取到的访问路径中包括的预设特征字符;
    根据获取到的预设特征字符,生成所述再次获取的web访问请求对应的访问请求特征向量;及
    将生成的访问请求特征向量输入所述重新训练的web入侵检测模型,获得检测结果。
  15. 一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
    获取web访问请求;
    根据预先训练好的web入侵检测模型,检测所述web访问请求是否为web入侵访问请求;
    统计检测到的web入侵访问请求的数量;
    当所述检测到的web入侵访问请求的数量大于预设数量阈值时,根据所述检测到的web入侵访问请求重新训练web入侵检测模型;
    将所述预先训练好的web入侵检测模型替换为重新训练的web入侵检测模型;及
    根据所述重新训练的web入侵检测模型对再次获取到的web访问请求进行检测。
  16. 根据权利要求15所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述获取web访问请求之前,还执行以下步骤:
    获取模型样本数据;
    对于所述模型样本数据中的每个web入侵访问请求,提取所述web入侵访问请求中包括的预设特征字符;
    根据提取到的预设特征字符构建所述web入侵访问请求对应的访问请求特征向量;及
    根据每个web入侵访问请求对应的访问请求特征向量训练web入侵检测模型,得到预先训练的web入侵检测模型。
  17. 根据权利要求16所述的存储介质,其特征在于,所述获取模型样本数据,包括:
    获取模型训练指令;
    根据所述模型训练指令,调用web入侵访问请求生成程序批量生成web入侵访问请求;及
    以批量生成的web入侵访问请求作为模型样本数据。
  18. 根据权利要求15所述的存储介质,其特征在于,所述根据预先训练好的web入侵检测模型,检测所述web访问请求是否为web入侵访问请求,包括:
    根据预设特征字符库,从所述web访问请求中提取包括的预设特征字符;
    根据提取到的预设特征字符构建所述web访问请求对应的访问请求特征向量;
    将构建的访问请求特征向量输入预先训练好的web入侵检测模型进行检测,得到检测结果;及
    根据检测结果确定所述web访问请求是否为web入侵访问请求。
  19. 根据权利要求15所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述根据所述重新训练的web入侵检测模型对再次获取到的web访问请求进行检测之后,还执行以下步骤:
    当检测到所述再次获取的web访问请求为web入侵访问请求时,拒绝所述再次获取的web访问请求;及
    当检测到所述再次获取的web访问请求为web正常访问请求时,根据所述再次获取的web访问请求查询数据。
  20. 根据权利要求19所述的存储介质,其特征在于,所述根据所述重新训练的web入侵检测模型对再次获取的web访问请求进行检测,包括:
    从再次获取的web访问请求中提取访问路径;
    获取所述提取到的访问路径中包括的预设特征字符;
    根据获取到的预设特征字符,生成所述再次获取的web访问请求对应的访问请求特征向量;及
    将生成的访问请求特征向量输入所述重新训练的web入侵检测模型,获得检测结果。
PCT/CN2018/088562 2018-02-01 2018-05-27 web入侵检测方法、装置、计算机设备和存储介质 WO2019148706A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810102978.7 2018-02-01
CN201810102978.7A CN108200087B (zh) 2018-02-01 2018-02-01 web入侵检测方法、装置、计算机设备和存储介质

Publications (1)

Publication Number Publication Date
WO2019148706A1 true WO2019148706A1 (zh) 2019-08-08

Family

ID=62591779

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/088562 WO2019148706A1 (zh) 2018-02-01 2018-05-27 web入侵检测方法、装置、计算机设备和存储介质

Country Status (2)

Country Link
CN (1) CN108200087B (zh)
WO (1) WO2019148706A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110266673B (zh) * 2019-06-11 2021-10-08 东方财富信息股份有限公司 基于大数据的安全策略优化处理方法和装置
CN110611675A (zh) * 2019-09-20 2019-12-24 哈尔滨安天科技集团股份有限公司 向量级检测规则生成方法、装置、电子设备及存储介质
CN111859069B (zh) * 2020-07-15 2021-10-15 北京市燃气集团有限责任公司 一种网络恶意爬虫识别方法、系统、终端及存储介质
CN112769853A (zh) * 2021-01-20 2021-05-07 付中野 一种互联网数据入侵检测方法及装置

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105554007A (zh) * 2015-12-25 2016-05-04 北京奇虎科技有限公司 一种web异常检测方法和装置
US20160226894A1 (en) * 2015-02-04 2016-08-04 Electronics And Telecommunications Research Institute System and method for detecting intrusion intelligently based on automatic detection of new attack type and update of attack type model

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105306463B (zh) * 2015-10-13 2018-04-13 电子科技大学 基于支持向量机的Modbus TCP入侵检测方法
CN107315954B (zh) * 2016-04-27 2020-06-12 腾讯科技(深圳)有限公司 一种文件类型识别方法及服务器

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160226894A1 (en) * 2015-02-04 2016-08-04 Electronics And Telecommunications Research Institute System and method for detecting intrusion intelligently based on automatic detection of new attack type and update of attack type model
CN105554007A (zh) * 2015-12-25 2016-05-04 北京奇虎科技有限公司 一种web异常检测方法和装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
YANG, WU ET AL.: "Research on a Dynamic Self-Learning Efficient Intrusion Detection Model", JOURNAL ON COMMUNICATIONS, vol. 28, no. 12, 25 December 2007 (2007-12-25), XP055630519 *

Also Published As

Publication number Publication date
CN108200087B (zh) 2020-05-12
CN108200087A (zh) 2018-06-22

Similar Documents

Publication Publication Date Title
WO2019153581A1 (zh) 异常接口检测方法、装置、计算机设备和存储介质
WO2019148706A1 (zh) web入侵检测方法、装置、计算机设备和存储介质
WO2022142613A1 (zh) 训练语料扩充方法及装置、意图识别模型训练方法及装置
WO2021174694A1 (zh) 基于数据中心的运维监控方法、装置、设备及存储介质
WO2021042914A1 (zh) 测试数据生成方法、装置、计算机设备和存储介质
WO2022227388A1 (zh) 日志异常检测模型训练方法、装置及设备
CN109783604B (zh) 基于少量样本的信息提取方法、装置和计算机设备
CN112270686B (zh) 图像分割模型训练、图像分割方法、装置及电子设备
WO2019148712A1 (zh) 钓鱼网站检测方法、装置、计算机设备和存储介质
WO2021043076A1 (zh) 网络发布数据处理方法、装置、计算机设备和存储介质
CN110489622B (zh) 对象信息的分享方法、装置、计算机设备和存储介质
WO2019200738A1 (zh) 数据特征提取的方法、装置、计算机设备和存储介质
CN112016318A (zh) 基于解释模型的分诊信息推荐方法、装置、设备及介质
WO2020034801A1 (zh) 医疗特征筛选方法、装置、计算机设备和存储介质
WO2019144548A1 (zh) 安全测试方法、装置、计算机设备和存储介质
CN113159737B (zh) Rpa业务处理方法、rpa管理平台、设备及介质
WO2019227576A1 (zh) 发票校验方法、装置、计算机设备及存储介质
WO2019153589A1 (zh) 消息数据处理方法、装置、计算机设备和存储介质
JP2020071845A (ja) 異常検知装置、異常検知方法および異常検知プログラム
WO2021012861A1 (zh) 数据查询耗时评估方法、装置、计算机设备和存储介质
WO2022022042A1 (zh) 监控数据上报方法、装置、计算机设备及存储介质
CN111125748A (zh) 越权查询的判断方法、装置、计算机设备和存储介质
WO2021114613A1 (zh) 基于人工智能的故障节点识别方法、装置、设备和介质
US20210272016A1 (en) Data processing system and method for acquiring data for training a machine learning model for use in monitoring the data processing system for anomalies
CN110503296B (zh) 测试方法、装置、计算机设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18904349

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 12/11/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18904349

Country of ref document: EP

Kind code of ref document: A1