CN114915446A - Intelligent network security detection method fusing priori knowledge - Google Patents

Intelligent network security detection method fusing priori knowledge Download PDF

Info

Publication number
CN114915446A
CN114915446A CN202210340432.1A CN202210340432A CN114915446A CN 114915446 A CN114915446 A CN 114915446A CN 202210340432 A CN202210340432 A CN 202210340432A CN 114915446 A CN114915446 A CN 114915446A
Authority
CN
China
Prior art keywords
vulnerability
environment
agent
tested
ontology
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202210340432.1A
Other languages
Chinese (zh)
Other versions
CN114915446B (en
Inventor
沈毅
薛鹏飞
李振汉
马慧敏
李倩玉
施凡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
National University of Defense Technology
Original Assignee
National University of Defense Technology
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 National University of Defense Technology filed Critical National University of Defense Technology
Priority to CN202210340432.1A priority Critical patent/CN114915446B/en
Publication of CN114915446A publication Critical patent/CN114915446A/en
Application granted granted Critical
Publication of CN114915446B publication Critical patent/CN114915446B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/02Knowledge representation; Symbolic representation
    • G06N5/022Knowledge engineering; Knowledge acquisition
    • 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/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1433Vulnerability analysis
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides an intelligent network security detection method fusing prior knowledge, which comprises the following steps: defining a characterization form of a vulnerability body, storing and extracting the vulnerability knowledge, and forming a vulnerability knowledge base; acquiring information from an environment to be measured; constructing a state information matrix; taking a state information matrix as an input of an agent and the vulnerability knowledge base; constructing an intelligent agent; determining a behavior strategy of an agent based on a state information matrix acquired by the environment to be tested and the potential vulnerability information acquired by the vulnerability knowledge base; and based on the behavior strategy of the intelligent agent, executing specific behaviors, calculating reward information by a reward module according to the execution result of the behaviors and the influence on the environment, feeding the reward information back to the intelligent agent, and guiding the intelligent agent to update the strategy. According to the scheme of the invention, the network security detection of the network environment is automatically realized, the efficiency of the network security detection is improved, and the problem that the automatic network security detection is difficult to apply in a complex environment is solved.

Description

一种融合先验知识的智能网络安全检测方法An Intelligent Network Security Detection Method Integrating Prior Knowledge

技术领域technical field

本发明涉及网络空间安全领域,尤其涉及一种融合先验知识的智能网络安全检测方法。The invention relates to the field of cyberspace security, in particular to an intelligent network security detection method integrating prior knowledge.

背景技术Background technique

定期进行安全测试是评估资产弹性和合规性,尤其是保密性、可用性和完整性的重要流程。网络安全检测(Penetration Testing)被广泛认为是通过识别和利用漏洞来评估数字资产安全性的最佳方法。安全专家在进行PT的过程中,面临了环境复杂、操作重复和相似的问题,PT任务自动化显然是一种节约人力和资源且高效的方法。早期的研究集中在通过优化规划阶段来改进PT系统,规划阶段被建模为攻击图或决策树问题,反映了连续决策的实践性质。尽管如此,由于方法的静态性质及其对计划阶段的限制,大多数工作都与漏洞评估有关,而不是PT。Regular security testing is an important process for assessing asset resilience and compliance, especially confidentiality, availability and integrity. Penetration Testing is widely regarded as the best way to assess the security of digital assets by identifying and exploiting vulnerabilities. In the process of PT, security experts are faced with complex environment, repetitive operations and similar problems. PT task automation is obviously an efficient method that saves manpower and resources. Early research focused on improving PT systems by optimizing the planning phase, which was modeled as an attack graph or decision tree problem, reflecting the practical nature of continuous decision-making. Nonetheless, due to the static nature of the method and its limitations on the planning phase, most of the work is related to vulnerability assessment rather than PT.

近年来,机器学习(Machine Learning,ML)为有效解决复杂问题开辟了新的途径。ML已经被证明,在某些情况下,它能够比人类更快、更准确地处理困难的问题。ML有三种类型:监督学习、无监督学习和强化学习。监督学习和无监督学习已经被用于入侵检测、恶意软件检测、隐私保护系统等。准备规模较大的数据集进行训练是制定安全解决方案的先决条件。然而,在网络安全检测这种实时、连续的环境中,很难预处理行为数据集,因此,有监督学习和无监督学习都不适合应用于解决自动化PT问题。强化学习(ReinforcementLearning,RL)是通过对环境的探索和经验的积累来学习的机器学习类型,RL的智能体可以在没有先验数据集的情况下自行适应实时、连续的环境。In recent years, Machine Learning (ML) has opened up new avenues for effectively solving complex problems. ML has been shown to handle difficult problems faster and more accurately than humans in some cases. There are three types of ML: supervised learning, unsupervised learning, and reinforcement learning. Supervised and unsupervised learning have been used in intrusion detection, malware detection, privacy-preserving systems, etc. Preparing a larger dataset for training is a prerequisite for developing a secure solution. However, in the real-time, continuous environment of network security detection, it is difficult to preprocess behavior datasets, so neither supervised nor unsupervised learning is suitable for solving automated PT problems. Reinforcement Learning (RL) is a type of machine learning that learns by exploring the environment and accumulating experience. RL agents can adapt themselves to real-time, continuous environments without prior datasets.

2013年,Sarraute等人建立了一种4AL分解算法,将一个大的网络按照网络结构分割成较小的网络,并通过部分可观测马尔可夫决策过程(Partially Observable MarkovDecision Processes,POMDP)逐个求解。2014年,Durkota等人提出了一种用于计算具有动作成本和故障概率攻击图的最优攻击策略的算法,将攻击图的最优路径规划问题转化为马尔可夫决策过程(Markov Decision Processes,MDP),生成最佳攻击策略以指导网络安全检测。2017年,Shmaryahu等人将PT建模为部分可观测的偶发问题,并设计了偶发规划树算法来规划攻击路径。同年,Alexander preschner将POMDP引入工业控制系统,试图自动验证工业控制系统的安全性。2018年,Ghanem和Chen将系统建模为POMDP,并使用外部POMDP求解器进行测试。2019年,周等人将PT描述为MDP过程,提出了一种基于网络信息增益的攻击规划(NIG-AP)算法。利用网络信息获取奖励,引导agent选择最佳响应动作,从入侵者的角度发现隐藏的攻击路径。2020年,Hu等人基于深度强化学习构建了一个自动化网络安全检测框架,自动化找到给定拓扑结构的最佳攻击路径。2021年,Zennaro等人将简单CTF题目形式化为网络安全检测问题,基于无模型的强化学习解决此类问题。In 2013, Sarraute et al. established a 4AL decomposition algorithm, which divided a large network into smaller networks according to the network structure, and solved them one by one through Partially Observable Markov Decision Processes (POMDP). In 2014, Durkota et al. proposed an algorithm for calculating the optimal attack strategy with action cost and failure probability attack graph, which transformed the optimal path planning problem of the attack graph into Markov Decision Processes (Markov Decision Processes, MDP) to generate the best attack strategy to guide network security detection. In 2017, Shmaryahu et al. modeled PT as a partially observable episodic problem and designed an episodic planning tree algorithm to plan attack paths. In the same year, Alexander preschner introduced POMDP into industrial control systems in an attempt to automatically verify the security of industrial control systems. In 2018, Ghanem and Chen modeled the system as a POMDP and tested it with an external POMDP solver. In 2019, Zhou et al. described PT as an MDP process and proposed an attack planning based on network information gain (NIG-AP) algorithm. Use network information to obtain rewards, guide the agent to choose the best response action, and discover the hidden attack path from the perspective of the intruder. In 2020, Hu et al. built an automated network security detection framework based on deep reinforcement learning to automatically find the best attack path for a given topology. In 2021, Zennaro et al. formalized the simple CTF problem as a network security detection problem, and solved such problems based on model-free reinforcement learning.

基于POMDP的研究结果证实了强化学习可以提高网络安全检测的准确性和可靠性的假设。然而由于网络安全检测环境中主机数量多,主机配置复杂,精确求解POMDP非常困难。基于MDP的强化学习原则上可以允许无模型学习,但实际上可能需要依赖某种形式的先验知识来解决问题。The POMDP-based findings confirm the hypothesis that reinforcement learning can improve the accuracy and reliability of cybersecurity detection. However, due to the large number of hosts in the network security detection environment and the complex host configuration, it is very difficult to accurately solve the POMDP. MDP-based reinforcement learning can in principle allow model-free learning, but in practice may need to rely on some form of prior knowledge to solve the problem.

发明内容SUMMARY OF THE INVENTION

为解决上述技术问题,本发明提出了一种融合先验知识的智能网络安全检测方法,用以解决现有技术中自动化网络安全检测方法效率不高,实用性不强,难以应用于真实大规模网络场景的技术问题。In order to solve the above technical problems, the present invention proposes an intelligent network security detection method integrating prior knowledge, which is used to solve the problem that the automatic network security detection method in the prior art is not efficient and practical, and is difficult to be applied to real large-scale applications. Technical issues for network scenarios.

根据本发明的第一方面,提供一种融合先验知识的智能网络安全检测方法,所述方法包括以下步骤:According to a first aspect of the present invention, an intelligent network security detection method incorporating prior knowledge is provided, the method comprising the following steps:

步骤S1:定义漏洞本体的表征形式,所述漏洞本体基于漏洞本体的概念、属性以及关系进行表征;基于获取的知识源及所述漏洞本体的表征形式,从所述获取的知识源中抽取漏洞知识;存储抽取到的所述漏洞知识,形成漏洞知识库;Step S1: define the representation form of the vulnerability ontology, the vulnerability ontology is characterized based on the concepts, attributes and relationships of the vulnerability ontology; based on the acquired knowledge source and the representation form of the vulnerability ontology, extract the vulnerability from the acquired knowledge source knowledge; store the extracted vulnerability knowledge to form a vulnerability knowledge base;

步骤S2:构建环境信息获取模块,所述环境信息获取模块用于从待测环境中获取以下基本信息:操作主机IP、操作系统、存活端口、服务信息,并将获取的所述基本信息按照类别编号存储;Step S2: Build an environmental information acquisition module, the environmental information acquisition module is used to acquire the following basic information from the environment to be tested: operating host IP, operating system, survival port, service information, and classify the acquired basic information according to categories number storage;

步骤S3:判断是否达到预设目标,若是,方法结束;若否,进入步骤S4;所述预设目标为实现对特定目标的网络安全检测;Step S3: judging whether the preset target is reached, if yes, the method ends; if not, go to step S4; the preset target is to achieve network security detection for a specific target;

步骤S4:基于所述环境信息获取模块,获取待测环境的基本信息;基于所述编号信息,获取待测环境的网络拓扑结构、主机权限和主机配置信息,并构建状态信息矩阵;将所述状态信息矩阵作为智能体和所述漏洞知识库的输入;Step S4: based on the environmental information acquisition module, acquire the basic information of the environment to be tested; based on the number information, acquire the network topology, host authority and host configuration information of the environment to be tested, and build a state information matrix; The state information matrix is used as the input of the agent and the vulnerability knowledge base;

步骤S5:构建智能体;基于所述环境状态信息矩阵和所述漏洞知识库获取的潜在漏洞信息,确定智能体的行为策略;Step S5: constructing an agent; based on the environment state information matrix and the potential vulnerability information obtained from the vulnerability knowledge base, determine the behavior strategy of the agent;

步骤S6:基于智能体的行为策略,执行具体行为,并将所述具体行为作用于所述待测环境,根据行为执行的结果及对环境的影响,由奖励模块计算奖励信息,反馈给智能体,指导智能体更新策略;进入步骤S3。Step S6: Execute specific behavior based on the behavior strategy of the agent, and apply the specific behavior to the environment to be tested. According to the result of the behavior execution and the impact on the environment, the reward module calculates the reward information and feeds it back to the agent. , guide the agent to update the strategy; go to step S3.

进一步地,所述漏洞本体基于漏洞本体的概念、属性以及关系进行表征,所述漏洞本体是指在硬件、软件、协议的具体实现或系统安全策略上存在的缺陷,所述漏洞本体的属性是指漏洞存在的潜在条件,所述漏洞本体的关系是指漏洞之间的交互作用关系,其中,所述漏洞本体的属性包括漏洞的利用方式、漏洞产生的效果和影响、是否存在漏洞利用、是否包含该漏洞的服务及包含该漏洞的服务对应的操作系统,所述关系包括交集关系,继承关系,属性关系。Further, the vulnerability ontology is characterized based on the concept, attributes and relationships of the vulnerability ontology, the vulnerability ontology refers to the defects existing in the specific implementation of hardware, software, protocols or system security policies, and the attributes of the vulnerability ontology are: Refers to the potential conditions for the existence of vulnerabilities, and the relationship of the vulnerability ontology refers to the interaction relationship between vulnerabilities, wherein the attributes of the vulnerability ontology include the exploiting method of the vulnerability, the effect and impact of the vulnerability, whether there is a vulnerability exploit, whether the vulnerability is exploited or not. The service containing the vulnerability and the operating system corresponding to the service containing the vulnerability, and the relationship includes an intersection relationship, an inheritance relationship, and an attribute relationship.

进一步地,所述步骤S2,其中:Further, in the step S2, wherein:

所述预设目标为实现对特定目标的网络安全检测,包括从某一起始主机出发,对网络环境中某台特定主机的网络安全检测和/或对单个主机的网络安全检测。The preset target is to realize network security detection of a specific target, including network security detection of a specific host in a network environment and/or network security detection of a single host starting from a starting host.

进一步地,待测环境状态信息矩阵定义如下:Further, the state information matrix of the environment to be tested is defined as follows:

Figure BDA0003578968470000041
Figure BDA0003578968470000041

其中hihj表示第i台待测主机与第j台待测主机之间的连接关系,用0表示待测主机之间不连通,1表示待测主机之间连通,hihi表示在待测主机i上获取到的权限级别,由于不同网络安全检测环境中的网络节点数量不同,因此将节点数量设置为一个定值,pk(hi)表示待测主机i上是否包含编号为k的属性,privilege(hi)表示智能体在待测主机i上的权限。Among them, h i h j represents the connection relationship between the i-th host to be tested and the j-th host to be tested, 0 means that the hosts to be tested are not connected, 1 means that the hosts to be tested are connected, and h i hi means For the permission level obtained on the host i to be tested, since the number of network nodes in different network security detection environments is different, the number of nodes is set to a fixed value, p k (h i ) indicates whether the host i to be tested contains a serial number is the attribute of k, and privilege(h i ) represents the authority of the agent on the host i to be tested.

根据本发明第二方面,提供一种融合先验知识的智能网络安全检测装置,所述装置包括:According to a second aspect of the present invention, an intelligent network security detection device incorporating prior knowledge is provided, the device comprising:

漏洞知识库构建模块:配置为定义漏洞本体的表征形式,所述漏洞本体基于漏洞本体的概念、属性以及关系进行表征;基于获取的知识源及所述漏洞本体的表征形式,从所述获取的知识源中抽取漏洞知识;存储抽取到的所述漏洞知识,形成漏洞知识库;Vulnerability knowledge base building module: configured to define the representation form of the vulnerability ontology, the vulnerability ontology is represented based on the concepts, attributes and relationships of the vulnerability ontology; based on the acquired knowledge source and the representation form of the vulnerability ontology, from the acquired Extracting vulnerability knowledge from the knowledge source; storing the extracted vulnerability knowledge to form a vulnerability knowledge base;

探测模块:配置为构建环境信息获取模块,所述环境信息获取模块用于从待测环境中获取以下基本信息:操作主机IP、操作系统、存活端口、服务信息,并将获取的所述基本信息按照类别编号存储;Detection module: configured to build an environmental information acquisition module, the environmental information acquisition module is used to acquire the following basic information from the environment to be tested: operating host IP, operating system, survival port, service information, and the acquired basic information Stored by category number;

判断模块:配置为判断是否达到预设目标,所述预设目标为实现对特定目标的网络安全检测;Judging module: configured to judge whether a preset target is reached, and the preset target is to realize network security detection for a specific target;

状态信息矩阵构建模块:配置为基于所述环境信息获取模块,获取待测环境的基本信息;基于所述编号信息,获取待测环境的网络拓扑结构、主机权限和主机配置信息,并构建状态信息矩阵;将所述状态信息矩阵作为智能体和所述漏洞知识库的输入;State information matrix building module: configured to obtain the basic information of the environment to be tested based on the environment information acquisition module; based on the number information, obtain the network topology, host authority and host configuration information of the environment to be tested, and construct the state information matrix; using the state information matrix as the input of the agent and the vulnerability knowledge base;

行为确定模块:配置为构建智能体;基于所述环境状态信息矩阵和所述漏洞知识库获取的潜在漏洞信息,确定智能体的行为策略;Behavior determination module: configured to construct an agent; based on the environment state information matrix and the potential vulnerability information obtained from the vulnerability knowledge base, determine the behavior strategy of the agent;

更新模块:配置为基于智能体的行为策略,执行具体行为,并将所述具体行为作用于所述待测环境,根据行为执行的结果及对环境的影响,由奖励模块计算奖励信息,反馈给智能体,指导智能体更新策略;触发判断模块。Update module: configured to be based on the behavior strategy of the agent, execute specific behavior, and apply the specific behavior to the environment to be tested. The agent guides the agent to update the strategy; triggers the judgment module.

根据本发明第三方面,提供一种融合先验知识的智能网络安全检测系统,包括:According to a third aspect of the present invention, an intelligent network security detection system integrating prior knowledge is provided, including:

处理器,用于执行多条指令;a processor for executing multiple instructions;

存储器,用于存储多条指令;memory for storing multiple instructions;

其中,所述多条指令,用于由所述存储器存储,并由所述处理器加载并执行如前所述的方法。Wherein, the plurality of instructions are used to be stored by the memory and loaded by the processor to execute the aforementioned method.

根据本发明第四方面,提供一种计算机可读存储介质,所述存储介质中存储有多条指令;所述多条指令,用于由处理器加载并执行如前所述的方法。According to a fourth aspect of the present invention, there is provided a computer-readable storage medium, wherein a plurality of instructions are stored in the storage medium; the plurality of instructions are used by a processor to load and execute the aforementioned method.

根据本发明的上述方案,该方法以实现自动化和智能化网络安全检测为目标,融合先验知识,基于知识图谱和强化学习提出了一种网络安全检测方法。该方法结合人工智能领域强化学习的相关技术和知识图谱构建自动化模型,实现智能化网络安全检测。本发明旨在解决网络环境复杂,漏洞种类和数量繁多,自动化网络安全检测难以实现的问题。本发明所述方法采用知识图谱和强化学习相结合的方法解决了上述问题,实现如下效果:(1)本发明基于知识图谱构建了一个漏洞知识库,便于管理和查询当前主机和网络中潜在的漏洞信息,同时为智能体分析可选的有效行为提供了便利;(2)本发明提出的方法改变了智能体的行为选择方式,将智能体从随机探索可用行为转变为从可用行为中选择最优行为,大大提升了智能体的学习效率;(3)利用所述方法可以实现对网络环境的自动化和智能化网络安全检测。According to the above solution of the present invention, the method aims at realizing automatic and intelligent network security detection, integrates prior knowledge, and proposes a network security detection method based on knowledge graph and reinforcement learning. The method combines the relevant technologies of reinforcement learning in the field of artificial intelligence and knowledge graphs to build an automatic model to realize intelligent network security detection. The invention aims to solve the problems that the network environment is complex, the types and numbers of loopholes are numerous, and the automatic network security detection is difficult to realize. The method of the present invention solves the above problems by combining knowledge graph and reinforcement learning, and achieves the following effects: (1) the present invention builds a vulnerability knowledge base based on the knowledge graph, which is convenient for managing and querying the current host and potential potential in the network. Vulnerability information, and at the same time provides convenience for the agent to analyze the optional effective behavior; (2) The method proposed in the present invention changes the behavior selection method of the agent, and transforms the agent from randomly exploring available behaviors to selecting the most available behaviors. (3) The method can realize automatic and intelligent network security detection of the network environment.

上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,并可依照说明书的内容予以实施,以下以本发明的较佳实施例并配合附图详细说明如后。The above description is only an overview of the technical solution of the present invention. In order to understand the technical means of the present invention more clearly, and implement it according to the content of the description, the preferred embodiments of the present invention are described in detail below with the accompanying drawings.

附图说明Description of drawings

构成本发明的一部分的附图用来提供对本发明的进一步理解,本发明提供如下附图进行说明。在附图中:The accompanying drawings, which form a part of this disclosure, are provided to provide a further understanding of the present disclosure, and the present disclosure is provided with the following figures to illustrate. In the attached image:

图1为本发明一个实施方式的融合先验知识的智能网络安全检测方法流程图;1 is a flowchart of an intelligent network security detection method integrating prior knowledge according to an embodiment of the present invention;

图2为本发明一个实施方式的融合先验知识的智能网络安全检测模型结构示意图;2 is a schematic structural diagram of an intelligent network security detection model integrating prior knowledge according to an embodiment of the present invention;

图3为本发明一个实施方式的漏洞知识库构建方式示意图;3 is a schematic diagram of a construction method of a vulnerability knowledge base according to an embodiment of the present invention;

图4为本发明一个实施方式的漏洞知识本体示意图;4 is a schematic diagram of a vulnerability knowledge ontology according to an embodiment of the present invention;

图5为本发明一个实施方式的智能体神经网络结构示意图;5 is a schematic structural diagram of an agent neural network according to an embodiment of the present invention;

图6为本发明一个实施方式的融合先验知识的智能网络安全检测装置结构示意图。FIG. 6 is a schematic structural diagram of an intelligent network security detection device integrating prior knowledge according to an embodiment of the present invention.

具体实施方式Detailed ways

为使本发明的目的、技术方案和优点更加清楚,下面将结合本发明具体实施例及相应的附图对本发明技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the specific embodiments of the present invention and the corresponding drawings. Obviously, the described embodiments are only some, but not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

首先结合图1-2说明为本发明一个实施方式的融合先验知识的智能网络安全检测方法流程图。如图1-2所示,所述方法包括以下步骤:First, a flowchart of an intelligent network security detection method integrating prior knowledge according to an embodiment of the present invention is described with reference to FIGS. 1-2 . As shown in Figure 1-2, the method includes the following steps:

步骤S1:定义漏洞本体的表征形式,所述漏洞本体基于漏洞本体的概念、属性以及关系进行表征;基于获取的知识源及所述漏洞本体的表征形式,从所述获取的知识源中抽取漏洞知识;存储抽取到的所述漏洞知识,形成漏洞知识库;Step S1: define the representation form of the vulnerability ontology, the vulnerability ontology is characterized based on the concepts, attributes and relationships of the vulnerability ontology; based on the acquired knowledge source and the representation form of the vulnerability ontology, extract the vulnerability from the acquired knowledge source knowledge; store the extracted vulnerability knowledge to form a vulnerability knowledge base;

步骤S2:构建环境信息获取模块,所述环境信息获取模块用于从待测环境中获取以下基本信息:操作主机IP、操作系统、存活端口、服务信息,并将获取的所述基本信息按照类别编号存储;Step S2: Build an environmental information acquisition module, the environmental information acquisition module is used to acquire the following basic information from the environment to be tested: operating host IP, operating system, survival port, service information, and classify the acquired basic information according to categories number storage;

步骤S3:判断是否达到预设目标,若是,方法结束;若否,进入步骤S4;所述预设目标为实现对特定目标的网络安全检测;Step S3: judging whether the preset target is reached, if yes, the method ends; if not, go to step S4; the preset target is to achieve network security detection for a specific target;

步骤S4:基于所述环境信息获取模块,获取待测环境的基本信息;基于所述编号信息,获取待测环境的网络拓扑结构、主机权限和主机配置信息,并构建状态信息矩阵;将所述状态信息矩阵作为智能体和所述漏洞知识库的输入;Step S4: based on the environmental information acquisition module, acquire the basic information of the environment to be tested; based on the number information, acquire the network topology, host authority and host configuration information of the environment to be tested, and build a state information matrix; The state information matrix is used as the input of the agent and the vulnerability knowledge base;

步骤S5:构建智能体;基于所述环境状态信息矩阵和所述漏洞知识库获取的潜在漏洞信息,确定智能体的行为策略;Step S5: constructing an agent; based on the environment state information matrix and the potential vulnerability information obtained from the vulnerability knowledge base, determine the behavior strategy of the agent;

步骤S6:基于智能体的行为策略,执行具体行为,并将所述具体行为作用于所述待测环境,根据行为执行的结果及对环境的影响,由奖励模块计算奖励信息,反馈给智能体,指导智能体更新策略;进入步骤S3。Step S6: Execute specific behavior based on the behavior strategy of the agent, and apply the specific behavior to the environment to be tested. According to the result of the behavior execution and the impact on the environment, the reward module calculates the reward information and feeds it back to the agent. , guide the agent to update the strategy; go to step S3.

由于网络安全检测是一个序贯决策问题,其任务分解开来就是根据当前状态判断应该采取的网络安全检测行为,因此可以将其建模为马尔可夫决策过程,基于强化学习的相关技术实现自动化网络安全检测。强化学习的智能体可以在训练的过程中积累经验,并与安全专家一样作出决策,然而这是以大量的训练为代价的,由于网络安全检测环境复杂,漏洞种类和数量过多,智能体难以实现快速有效的学习,因而此本发明在自动化模型中加入了漏洞知识库,引入漏洞知识库作为智能体的图书馆,智能体在获取状态之后,在先验知识库中查询可行的操作,并根据学习到的经验从可行行为中选择最终采取的行为,以提高学习的效率。Since network security detection is a sequential decision-making problem, its task is to determine the network security detection behavior that should be taken according to the current state. Therefore, it can be modeled as a Markov decision process, and the related technologies based on reinforcement learning can be implemented. Automated cybersecurity detection. Reinforcement learning agents can accumulate experience in the training process and make decisions like security experts. However, this comes at the cost of a lot of training. Due to the complex network security detection environment and the large number and types of vulnerabilities, it is difficult for agents to make decisions. To achieve fast and effective learning, the present invention adds a vulnerability knowledge base to the automation model, and introduces the vulnerability knowledge base as the library of the intelligent body. According to the learned experience, choose the final action from the feasible actions to improve the efficiency of learning.

本发明构建知识图谱存储漏洞相关信息,实现根据当前状态信息匹配可能存在的漏洞;实现基于强化学习的自动化网络安全检测方法,智能体从环境中获取到的状态信息先进行漏洞匹配,再从匹配到的行为中选择下一步动作。The invention constructs a knowledge graph to store vulnerability-related information, and realizes matching of possible vulnerabilities according to the current state information; realizes an automatic network security detection method based on reinforcement learning, and the state information obtained by the agent from the environment is firstly vulnerability matching, and then from the matching to select the next action.

所述步骤S1,其中:The step S1, wherein:

漏洞信息存在海量化,分散化,碎片化的特点,构建漏洞知识库的重要条件是收集漏洞信息。收集漏洞信息主要采取互联网查询和获取的方式,目前国际上比较知名的漏洞相关标准和规范有CVE(Common Vulnerabilities&Exposures)、CPE(Common platformenumeration)、CVSS(Common Vulnerability Scoring System)和CNNVD(China NationalVulnerability Database of Information Security)四种。其中CVE是目前国际上最具公信力的安全漏洞披露与发布单位;CPE是一种用于描述和识别企业计算资产中存在的应用程序,操作系统和硬件设备的标准化方法;CVSS是一个用来评测漏洞严重程度,并帮助确定应答紧急度和重要度的行业公开标准;CNNVD是国内权威的漏洞收录平台。从CVE、CPE、CVSS和CNNVD收集漏洞信息,对所述漏洞信息进行整合,将得到的信息作为知识源。Vulnerability information has the characteristics of mass, decentralization and fragmentation. An important condition for building a vulnerability knowledge base is to collect vulnerability information. Vulnerability information is mainly collected by means of Internet query and acquisition. Currently, the relatively well-known international vulnerability-related standards and specifications include CVE (Common Vulnerabilities & Exposures), CPE (Common platformenumeration), CVSS (Common Vulnerability Scoring System) and CNNVD (China National Vulnerability Database of Information Security) four. Among them, CVE is the most credible security vulnerability disclosure and release unit in the world; CPE is a standardized method for describing and identifying applications, operating systems and hardware devices existing in enterprise computing assets; CVSS is a method for evaluating Vulnerability severity, and help determine the industry's public standards for the urgency and importance of responses; CNNVD is an authoritative vulnerability recording platform in China. Collect vulnerability information from CVE, CPE, CVSS and CNNVD, integrate the vulnerability information, and use the obtained information as a knowledge source.

基于知识图谱定义漏洞本体的表征形式,所述漏洞本体基于漏洞本体的概念、属性以及关系进行表征,所述漏洞本体是指在硬件、软件、协议的具体实现或系统安全策略上存在的缺陷,所述漏洞本体的属性是指漏洞存在的潜在条件,所述漏洞本体的关系是指漏洞之间的交互作用关系,其中,所述漏洞本体的属性包括漏洞的利用方式、漏洞产生的效果和影响、是否存在漏洞利用、是否包含该漏洞的服务及包含该漏洞的服务对应的操作系统,所述关系包括交集关系,继承关系,属性关系。The representation form of the vulnerability ontology is defined based on the knowledge graph. The vulnerability ontology is characterized based on the concepts, attributes and relationships of the vulnerability ontology. The vulnerability ontology refers to the defects existing in the specific implementation of hardware, software, protocols or system security policies. The attribute of the vulnerability ontology refers to the potential conditions for the existence of the vulnerability, and the relationship of the vulnerability ontology refers to the interaction relationship between the vulnerabilities, wherein the attribute of the vulnerability ontology includes the exploiting method of the vulnerability, the effect and influence of the vulnerability. , whether there is a vulnerability exploit, whether the service contains the vulnerability, and the operating system corresponding to the service containing the vulnerability, and the relationship includes an intersection relationship, an inheritance relationship, and an attribute relationship.

本实施例中,定义的漏洞本体如图4所示。首先需要合理的表征漏洞信息,因此根据专家经验,对常见的操作系统,常用服务,和常见漏洞之间的关联构建了漏洞本体,能够更好地描述漏洞相关知识之间的关联,漏洞本体的结构如图4所示,其中编号为内在编号,该编号与环境状态信息中的编号一致,便于智能体根据输入的状态信息匹配进行漏洞。In this embodiment, the defined vulnerability ontology is shown in FIG. 4 . First of all, it is necessary to reasonably represent the vulnerability information. Therefore, according to expert experience, a vulnerability ontology is constructed for the association between common operating systems, common services, and common vulnerabilities, which can better describe the association between vulnerability-related knowledge. The structure is shown in Figure 4, where the number is the internal number, which is consistent with the number in the environmental state information, which is convenient for the agent to match the loopholes according to the input state information.

基于获取的知识源及所述漏洞本体的表征形式,从所述获取的知识源中抽取漏洞知识。本实施例中,知识源中的信息来源于不同的规范和标准,可能包含重复或结构不同的信息,因此采用命名实体识别技术对知识源中的信息进行提炼和清洗,再进行关系抽取,最终实现对漏洞信息的知识抽取。Based on the acquired knowledge source and the representation form of the vulnerability ontology, vulnerability knowledge is extracted from the acquired knowledge source. In this embodiment, the information in the knowledge source comes from different specifications and standards, and may contain information with duplicate or different structures. Therefore, the named entity recognition technology is used to extract and clean the information in the knowledge source, and then the relationship is extracted, and finally Realize knowledge extraction of vulnerability information.

存储抽取到所述漏洞知识,形成漏洞知识库,即选择重要程度大于预设阈值,并将所述与待测网络和待测主机状态相关的漏洞知识采用Neo4j存储到图数据库中,实现漏洞知识库的构建。Store and extract the vulnerability knowledge to form a vulnerability knowledge base, that is, select the importance degree greater than the preset threshold, and store the vulnerability knowledge related to the state of the network to be tested and the host to be tested in the graph database using Neo4j to realize the vulnerability knowledge Build the library.

安全专家在进行网络安全检测时,会根据扫描到的网络和主机状态信息,判断当前环境中可能存在的漏洞,并利用漏洞实现网络安全检测。在这个过程中,专家的判断基于自身知识的积累,因而缺乏专家经验是当前自动化网络安全检测面临的巨大挑战之一。因此,本发明构建一个类似于专家经验的先验知识库,收集漏洞信息,所述漏洞信息包含漏洞编号,漏洞等级,漏洞来源,利用漏洞可实现的功能等,通过命名实体识别技术抽取有用信息,对信息进行处理使其规范化,并构建知识推理模型,实现对漏洞信息的管理。When security experts conduct network security detection, they will judge the possible vulnerabilities in the current environment based on the scanned network and host status information, and use the vulnerabilities to realize network security detection. In this process, the judgment of experts is based on the accumulation of their own knowledge, so the lack of expert experience is one of the great challenges facing the current automated network security detection. Therefore, the present invention builds a prior knowledge base similar to expert experience, collects vulnerability information, the vulnerability information includes vulnerability number, vulnerability level, vulnerability source, functions that can be realized by exploiting the vulnerability, etc., and extracts useful information through named entity recognition technology , process the information to standardize it, and build a knowledge inference model to manage the vulnerability information.

所述步骤S3,其中:The step S3, wherein:

所述预设目标为实现对待测网络中特定目标的网络安全检测,包括从待测网络中的某一主机出发,对网络环境中某台特定主机的网络安全检测和/或对单个主机的网络安全检测。The preset target is to realize the network security detection of a specific target in the network to be tested, including starting from a certain host in the network to be tested, the network security detection of a specific host in the network environment and/or the network security detection of a single host. Security check.

所述步骤S4,其中:The step S4, wherein:

基于所述环境信息获取模块,获取待测环境的基本信息,并按照信息内容分类并编号,基于编号后的环境信息构建环境状态矩阵作为智能体的输入信息,环境状态矩阵应包含当前智能体探索到的网络拓扑结构、主机配置等信息。根据实际网络安全检测过程中专家从环境中扫描到的信息,将自动化网络安全检测模型的待测环境状态信息矩阵定义如下:Based on the environmental information acquisition module, the basic information of the environment to be tested is acquired, classified and numbered according to the information content, and an environmental state matrix is constructed based on the numbered environmental information as the input information of the agent. The environmental state matrix should include the current agent exploration. to the network topology, host configuration and other information. According to the information scanned by experts from the environment in the actual network security detection process, the state information matrix of the environment to be tested of the automated network security detection model is defined as follows:

Figure BDA0003578968470000091
Figure BDA0003578968470000091

其中hihj表示第i台待测主机与第j台待测主机之间的连接关系,用0表示待测主机之间不连通,1表示待测主机之间连通,hihi表示在待测主机i上获取到的权限级别,由于不同网络安全检测环境中的网络节点数量不同,因此将节点数量设置为一个定值,pk(hi)表示待测主机i上是否包含编号为k的属性,privilege(hi)表示智能体在待测主机i上的权限。Among them, h i h j represents the connection relationship between the i-th host to be tested and the j-th host to be tested, 0 means that the hosts to be tested are not connected, 1 means that the hosts to be tested are connected, and h i hi means For the permission level obtained on the host i to be tested, since the number of network nodes in different network security detection environments is different, the number of nodes is set to a fixed value, p k (h i ) indicates whether the host i to be tested contains a serial number is the attribute of k, and privilege(h i ) represents the authority of the agent on the host i to be tested.

以状态信息矩阵作为智能体和漏洞库的输入,状态矩阵作为智能体的输入是为智能体提供场景信息;状态信息矩阵作为漏洞库的输入进行待测环境潜在漏洞预测,为智能体提供更准确的行为空间。The state information matrix is used as the input of the agent and the vulnerability library. The state matrix is used as the input of the agent to provide scene information for the agent. behavior space.

所述步骤S5,其中:The step S5, wherein:

智能体基于漏洞先验知识库的输出,确定行为,行为即为智能体的输出,表示智能体针对当前环境做出的决策,所述智能体的输出包括待测网络中主机之间的连接行为和漏洞利用行为,所述主机之间的连接行为是指智能体在主机间进行横向移动的行为;所述漏洞利用是通过对输入状态的分析,将其与所述漏洞知识库中的漏洞信息进行匹配,判断待测网络环境中可能存在的漏洞,将可能存在的漏洞对应的漏洞利用和待测环境中发现的主机之间的连接行为组合起来,构成智能体能够选择的行为库,为了保证学习过程中模型的稳定性,将行为库的大小设置为定值,从给定的行为库中选择并执行动作,而不同于以往在所有的动作中任由智能体自由探索。The agent determines the behavior based on the output of the vulnerability prior knowledge base. The behavior is the output of the agent, which represents the decision made by the agent for the current environment. The output of the agent includes the connection behavior between the hosts in the network to be tested. and exploit behavior, the connection behavior between hosts refers to the behavior of the agent moving laterally between hosts; the exploit is to analyze the input state and compare it with the vulnerability information in the vulnerability knowledge base Match, determine the possible vulnerabilities in the network environment to be tested, and combine the exploits corresponding to the possible vulnerabilities with the connection behaviors between the hosts found in the environment to be tested to form a behavior library that the agent can choose. The stability of the model during the learning process is to set the size of the behavior library to a fixed value, and select and execute actions from the given behavior library, which is different from letting the agent freely explore all the actions in the past.

在基于强化学习的自动化网络安全检测模型中,智能体接收到的输入为从环境中获取到的状态信息,输出为智能体采取每个行为的概率。由于网络安全检测环境的复杂性,状态空间大小随网络规模和主机配置呈指数级增长,传统的表格型方法如Q-learning方法,对实现自动化网络安全检测而言并不适用,因此,本发明引入了深度强化学习技术,基于神经网络拟合Q函数,可以有效解决状态空间过大的问题。然而,由于引入了先验知识,智能体在不同状态下可采取的行为不同,导致输出节点数不一致。针对上述情况,需要重新设计强化学习算法,实现智能化决策。In an automatic network security detection model based on reinforcement learning, the input received by the agent is the state information obtained from the environment, and the output is the probability of the agent taking each action. Due to the complexity of the network security detection environment, the size of the state space increases exponentially with the network scale and host configuration. The traditional tabular methods such as the Q-learning method are not suitable for realizing automatic network security detection. Therefore, the present invention The deep reinforcement learning technology is introduced to fit the Q function based on the neural network, which can effectively solve the problem of too large state space. However, due to the introduction of prior knowledge, the agent can take different behaviors in different states, resulting in inconsistent number of output nodes. In view of the above situation, it is necessary to redesign the reinforcement learning algorithm to realize intelligent decision-making.

本发明提出的智能体更新Q值的神经网络结构如图5所示,所述神经网络模型包括三个卷积层,第三个卷积层与全连接层相连;由于状态矩阵中的值大多为0或1,且矩阵稀疏,因此没有使用池化层。将从待测环境中获取的环境状态矩阵作为第一个卷积层的输入,全连接层输出环境状态矩阵的特征。本实施例中,最大网络节点数设置为100,主机配置包括服务和端口等信息,数值设为100,因此输入矩阵规模为100*200。通过将接收到的状态信息与先验知识库进行匹配,选择排名前10的漏洞对应的漏洞利用构建智能体的行为空间,此外,除漏洞利用行为外,增加连接行为,表明从当前主机移动到其他主机的行为,因此设置智能体输出的行为空间大小为11。此外,卷积层的个数、每层卷积核的数目以及各层卷积核大小等超参数需要通过实验来确定。根据任务需求选择合适的输出层激活函数和损失函数。The neural network structure of the agent to update the Q value proposed by the present invention is shown in Figure 5. The neural network model includes three convolutional layers, and the third convolutional layer is connected to the fully connected layer; since the values in the state matrix are mostly is 0 or 1, and the matrix is sparse, so no pooling layer is used. The environment state matrix obtained from the environment to be tested is used as the input of the first convolutional layer, and the fully connected layer outputs the features of the environment state matrix. In this embodiment, the maximum number of network nodes is set to 100, the host configuration includes information such as services and ports, and the value is set to 100, so the scale of the input matrix is 100*200. By matching the received state information with the prior knowledge base, the exploits corresponding to the top 10 vulnerabilities are selected to construct the behavior space of the agent. In addition, in addition to the exploit behavior, the connection behavior is added, indicating that the move from the current host to The behavior of other hosts, so set the behavior space size of the agent output to 11. In addition, hyperparameters such as the number of convolutional layers, the number of convolutional kernels in each layer, and the size of convolutional kernels in each layer need to be determined through experiments. Choose the appropriate output layer activation function and loss function according to the task requirements.

所述步骤S6,其中:The step S6, wherein:

奖励是对智能体行为的反馈,对强化学习而言至关重要,决定了智能体学习方向和收敛速度,影响着智能体决策的正确性和有效性,本发明将奖励分为正向反馈和负向反馈两部分:智能体成功完成行为得到的正向奖励以及行为执行失败得到的负向奖励。智能体接收到奖励,根据奖励值调整神经网络参数,指导智能体更新策略,作出更准确的预测。重复步骤,直至满足步骤S3中的目标。Reward is the feedback on the behavior of the agent, which is very important for reinforcement learning, determines the learning direction and convergence speed of the agent, and affects the correctness and effectiveness of the agent's decision-making. The present invention divides the reward into positive feedback and There are two parts of negative feedback: the positive reward obtained by the agent successfully completing the behavior and the negative reward obtained by the failure of the behavior execution. The agent receives the reward, adjusts the neural network parameters according to the reward value, and guides the agent to update the strategy and make more accurate predictions. The steps are repeated until the objective in step S3 is met.

图6为本发明一个实施方式的融合先验知识的智能网络安全检测装置的结构示意图,如图6所示,所述装置包括:FIG. 6 is a schematic structural diagram of an intelligent network security detection device integrating prior knowledge according to an embodiment of the present invention. As shown in FIG. 6 , the device includes:

漏洞知识库构建模块:配置为定义漏洞本体的表征形式,所述漏洞本体基于漏洞本体的概念、属性以及关系进行表征;基于获取的知识源及所述漏洞本体的表征形式,从所述获取的知识源中抽取漏洞知识;存储抽取到的所述漏洞知识,形成漏洞知识库;Vulnerability knowledge base building module: configured to define the representation form of the vulnerability ontology, the vulnerability ontology is represented based on the concepts, attributes and relationships of the vulnerability ontology; based on the acquired knowledge source and the representation form of the vulnerability ontology, from the acquired Extracting vulnerability knowledge from the knowledge source; storing the extracted vulnerability knowledge to form a vulnerability knowledge base;

探测模块:配置为构建环境信息获取模块,所述环境信息获取模块用于从待测环境中获取以下基本信息:操作主机IP、操作系统、存活端口、服务信息,并将获取的所述基本信息按照类别编号存储;Detection module: configured to build an environmental information acquisition module, the environmental information acquisition module is used to acquire the following basic information from the environment to be tested: operating host IP, operating system, survival port, service information, and the acquired basic information Stored by category number;

判断模块:配置为判断是否达到预设目标,所述预设目标为实现对特定目标的网络安全检测;Judging module: configured to judge whether a preset target is reached, and the preset target is to realize network security detection for a specific target;

状态信息矩阵构建模块:配置为基于所述环境信息获取模块,获取待测环境的基本信息;基于所述编号信息,获取待测环境的网络拓扑结构、主机权限和主机配置信息,并构建状态信息矩阵;将所述状态信息矩阵作为智能体和所述漏洞知识库的输入;State information matrix building module: configured to obtain the basic information of the environment to be tested based on the environment information acquisition module; based on the number information, obtain the network topology, host authority and host configuration information of the environment to be tested, and construct the state information matrix; using the state information matrix as the input of the agent and the vulnerability knowledge base;

行为确定模块:配置为构建智能体;基于所述环境状态信息矩阵和所述漏洞知识库获取的潜在漏洞信息,确定智能体的行为策略;Behavior determination module: configured to construct an agent; based on the environment state information matrix and the potential vulnerability information obtained from the vulnerability knowledge base, determine the behavior strategy of the agent;

更新模块:配置为基于智能体的行为策略,执行具体行为,并将所述具体行为作用于所述待测环境,根据行为执行的结果及对环境的影响,由奖励模块计算奖励信息,反馈给智能体,指导智能体更新策略;触发判断模块。Update module: configured to be based on the behavior strategy of the agent, execute specific behavior, and apply the specific behavior to the environment to be tested. The agent guides the agent to update the strategy; triggers the judgment module.

本发明实施例进一步给出一种融合先验知识的智能网络安全检测系统,包括:The embodiment of the present invention further provides an intelligent network security detection system integrating prior knowledge, including:

处理器,用于执行多条指令;a processor for executing multiple instructions;

存储器,用于存储多条指令;memory for storing multiple instructions;

其中,所述多条指令,用于由所述存储器存储,并由所述处理器加载并执行如前所述的方法。Wherein, the plurality of instructions are used to be stored by the memory and loaded by the processor to execute the aforementioned method.

本发明实施例进一步给出一种计算机可读存储介质,所述存储介质中存储有多条指令;所述多条指令,用于由处理器加载并执行如前所述的方法。The embodiment of the present invention further provides a computer-readable storage medium, where a plurality of instructions are stored in the storage medium; the plurality of instructions are used for loading and executing the foregoing method by a processor.

需要说明的是,在不冲突的情况下,本发明中的实施例及实施例中的特征可以相互组合。It should be noted that the embodiments of the present invention and the features of the embodiments may be combined with each other under the condition of no conflict.

在本发明所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined. Either it can be integrated into another system, or some features can be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware, or may be implemented in the form of hardware plus software functional units.

上述以软件功能单元的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中。上述软件功能单元存储在一个存储介质中,包括若干指令用以使得一台计算机装置(可以是个人计算机,实体机服务器,或者网络云服务器等,需安装Windows或者Windows Server操作系统)执行本发明各个实施例所述方法的部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(RandomAccess Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The above-mentioned integrated units implemented in the form of software functional units can be stored in a computer-readable storage medium. The above-mentioned software functional units are stored in a storage medium, and include several instructions to make a computer device (which can be a personal computer, a physical machine server, or a network cloud server, etc., need to install Windows or Windows Server operating system) to execute each of the present invention. Some steps of the method described in the Examples. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes.

以上所述,仅是本发明的较佳实施例而已,并非对本发明作任何形式上的限制,依据本发明的技术实质对以上实施例所作的任何简单修改、等同变化与修饰,均仍属于本发明技术方案的范围内。The above are only preferred embodiments of the present invention, and do not limit the present invention in any form. Any simple modifications, equivalent changes and modifications made to the above embodiments according to the technical essence of the present invention still belong to the present invention. within the scope of the technical solution of the invention.

Claims (7)

1.一种融合先验知识的智能网络安全检测方法,其特征在于,所述方法包括以下步骤:1. an intelligent network security detection method integrating prior knowledge, is characterized in that, described method comprises the following steps: 步骤S1:定义漏洞本体的表征形式,所述漏洞本体基于漏洞本体的概念、属性以及关系进行表征;基于获取的知识源及所述漏洞本体的表征形式,从所述获取的知识源中抽取漏洞知识;存储抽取到的所述漏洞知识,形成漏洞知识库;Step S1: define the representation form of the vulnerability ontology, the vulnerability ontology is characterized based on the concepts, attributes and relationships of the vulnerability ontology; based on the acquired knowledge source and the representation form of the vulnerability ontology, extract the vulnerability from the acquired knowledge source knowledge; store the extracted vulnerability knowledge to form a vulnerability knowledge base; 步骤S2:构建环境信息获取模块,所述环境信息获取模块用于从待测环境中获取以下基本信息:操作主机IP、操作系统、存活端口、服务信息,并将获取的所述基本信息按照类别编号存储;Step S2: Build an environmental information acquisition module, the environmental information acquisition module is used to acquire the following basic information from the environment to be tested: operating host IP, operating system, survival port, service information, and classify the acquired basic information according to categories number storage; 步骤S3:判断是否达到预设目标,若是,方法结束;若否,进入步骤S4;所述预设目标为实现对特定目标的网络安全检测;Step S3: judging whether the preset target is reached, if yes, the method ends; if not, go to step S4; the preset target is to achieve network security detection for a specific target; 步骤S4:基于所述环境信息获取模块,获取待测环境的基本信息;基于所述编号信息,获取待测环境的网络拓扑结构、主机权限和主机配置信息,并构建状态信息矩阵;将所述状态信息矩阵作为智能体和所述漏洞知识库的输入;Step S4: based on the environmental information acquisition module, acquire the basic information of the environment to be tested; based on the number information, acquire the network topology, host authority and host configuration information of the environment to be tested, and build a state information matrix; The state information matrix is used as the input of the agent and the vulnerability knowledge base; 步骤S5:构建智能体;基于所述环境状态信息矩阵和所述漏洞知识库获取的潜在漏洞信息,确定智能体的行为策略;Step S5: constructing an agent; based on the environment state information matrix and the potential vulnerability information obtained from the vulnerability knowledge base, determine the behavior strategy of the agent; 步骤S6:基于智能体的行为策略,执行具体行为,并将所述具体行为作用于所述待测环境,根据行为执行的结果及对环境的影响,由奖励模块计算奖励信息,反馈给智能体,指导智能体更新策略;进入步骤S3。Step S6: Execute specific behavior based on the behavior strategy of the agent, and apply the specific behavior to the environment to be tested. According to the result of the behavior execution and the impact on the environment, the reward module calculates the reward information and feeds it back to the agent. , guide the agent to update the strategy; go to step S3. 2.如权利要求1所述的方法,其特征在于,所述漏洞本体基于漏洞本体的概念、属性以及关系进行表征,所述漏洞本体是指在硬件、软件、协议的具体实现或系统安全策略上存在的缺陷,所述漏洞本体的属性是指漏洞存在的潜在条件,所述漏洞本体的关系是指漏洞之间的交互作用关系,其中,所述漏洞本体的属性包括漏洞的利用方式、漏洞产生的效果和影响、是否存在漏洞利用、是否包含该漏洞的服务及包含该漏洞的服务对应的操作系统,所述关系包括交集关系,继承关系,属性关系。2. The method according to claim 1, wherein the vulnerability ontology is characterized based on the concept, attribute and relationship of the vulnerability ontology, and the vulnerability ontology refers to specific implementations of hardware, software, protocols or system security policies. The attributes of the vulnerability ontology refer to the potential conditions for the existence of the vulnerability, and the relationship of the vulnerability ontology refers to the interaction relationship between the vulnerabilities, wherein the attributes of the vulnerability ontology include the exploiting method of the vulnerability, the vulnerability The resulting effect and impact, whether there is a vulnerability exploit, whether the service contains the vulnerability, and the operating system corresponding to the service containing the vulnerability, the relationship includes an intersection relationship, an inheritance relationship, and an attribute relationship. 3.如权利要求2所述的方法,其特征在于,所述步骤S2,其中:3. The method of claim 2, wherein the step S2, wherein: 所述预设目标为实现对特定目标的网络安全检测,包括从某一起始主机出发,对网络环境中某台特定主机的网络安全检测和/或对单个主机的网络安全检测。The preset target is to realize network security detection of a specific target, including network security detection of a specific host in a network environment and/or network security detection of a single host starting from a starting host. 4.如权利要求3所述的方法,其特征在于,待测环境状态信息矩阵定义如下:4. The method of claim 3, wherein the environment state information matrix to be tested is defined as follows:
Figure FDA0003578968460000021
Figure FDA0003578968460000021
其中hihj表示第i台待测主机与第j台待测主机之间的连接关系,用0表示待测主机之间不连通,1表示待测主机之间连通,hihi表示在待测主机i上获取到的权限级别,由于不同网络安全检测环境中的网络节点数量不同,因此将节点数量设置为一个定值,pk(hi)表示待测主机i上是否包含编号为k的属性,privilege(hi)表示智能体在待测主机i上的权限。Among them, h i h j represents the connection relationship between the i-th host to be tested and the j-th host to be tested, 0 means that the hosts to be tested are not connected, 1 means that the hosts to be tested are connected, and h i hi means For the permission level obtained on the host i to be tested, since the number of network nodes in different network security detection environments is different, the number of nodes is set to a fixed value, p k (h i ) indicates whether the host i to be tested contains a serial number is the attribute of k, and privilege(h i ) represents the authority of the agent on the host i to be tested.
5.一种融合先验知识的智能网络安全检测装置,其特征在于,所述装置包括:5. An intelligent network security detection device incorporating prior knowledge, wherein the device comprises: 漏洞知识库构建模块:配置为定义漏洞本体的表征形式,所述漏洞本体基于漏洞本体的概念、属性以及关系进行表征;基于获取的知识源及所述漏洞本体的表征形式,从所述获取的知识源中抽取漏洞知识;存储抽取到的所述漏洞知识,形成漏洞知识库;Vulnerability knowledge base building module: configured to define the representation form of the vulnerability ontology, the vulnerability ontology is represented based on the concepts, attributes and relationships of the vulnerability ontology; based on the acquired knowledge source and the representation form of the vulnerability ontology, from the acquired Extracting vulnerability knowledge from the knowledge source; storing the extracted vulnerability knowledge to form a vulnerability knowledge base; 探测模块:配置为构建环境信息获取模块,所述环境信息获取模块用于从待测环境中获取以下基本信息:操作主机IP、操作系统、存活端口、服务信息,并将获取的所述基本信息按照类别编号存储;Detection module: configured to build an environmental information acquisition module, the environmental information acquisition module is used to acquire the following basic information from the environment to be tested: operating host IP, operating system, survival port, service information, and the acquired basic information Stored by category number; 判断模块:配置为判断是否达到预设目标,所述预设目标为实现对特定目标的网络安全检测;Judging module: configured to judge whether a preset target is reached, and the preset target is to realize network security detection for a specific target; 状态信息矩阵构建模块:配置为基于所述环境信息获取模块,获取待测环境的基本信息;基于所述编号信息,获取待测环境的网络拓扑结构、主机权限和主机配置信息,并构建状态信息矩阵;将所述状态信息矩阵作为智能体和所述漏洞知识库的输入;State information matrix building module: configured to obtain the basic information of the environment to be tested based on the environment information acquisition module; based on the number information, obtain the network topology, host authority and host configuration information of the environment to be tested, and construct the state information matrix; using the state information matrix as the input of the agent and the vulnerability knowledge base; 行为确定模块:配置为构建智能体;基于所述环境状态信息矩阵和所述漏洞知识库获取的潜在漏洞信息,确定智能体的行为策略;Behavior determination module: configured to construct an agent; based on the environment state information matrix and the potential vulnerability information obtained from the vulnerability knowledge base, determine the behavior strategy of the agent; 更新模块:配置为基于智能体的行为策略,执行具体行为,并将所述具体行为作用于所述待测环境,根据行为执行的结果及对环境的影响,由奖励模块计算奖励信息,反馈给智能体,指导智能体更新策略;触发判断模块。Update module: configured to be based on the behavior strategy of the agent, execute specific behavior, and apply the specific behavior to the environment to be tested. The agent guides the agent to update the strategy; triggers the judgment module. 6.一种融合先验知识的智能网络安全检测系统,其特征在于,包括:6. An intelligent network security detection system integrating prior knowledge is characterized in that, comprising: 处理器,用于执行多条指令;a processor for executing multiple instructions; 存储器,用于存储多条指令;memory for storing multiple instructions; 其中,所述多条指令,用于由所述存储器存储,并由所述处理器加载并执行如权利要求1-4之任一项所述方法。Wherein, the plurality of instructions are used to be stored by the memory and loaded by the processor to execute the method according to any one of claims 1-4. 7.一种计算机可读存储介质,其特征在于,所述存储介质中存储有多条指令;所述多条指令,用于由处理器加载并执行如权利要求1-4之任一项所述方法。7. A computer-readable storage medium, wherein a plurality of instructions are stored in the storage medium; the plurality of instructions are used to be loaded and executed by a processor as described in any one of claims 1-4. described method.
CN202210340432.1A 2022-04-02 2022-04-02 An Intelligent Network Security Detection Method Integrating Prior Knowledge Active CN114915446B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210340432.1A CN114915446B (en) 2022-04-02 2022-04-02 An Intelligent Network Security Detection Method Integrating Prior Knowledge

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210340432.1A CN114915446B (en) 2022-04-02 2022-04-02 An Intelligent Network Security Detection Method Integrating Prior Knowledge

Publications (2)

Publication Number Publication Date
CN114915446A true CN114915446A (en) 2022-08-16
CN114915446B CN114915446B (en) 2023-08-29

Family

ID=82763246

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210340432.1A Active CN114915446B (en) 2022-04-02 2022-04-02 An Intelligent Network Security Detection Method Integrating Prior Knowledge

Country Status (1)

Country Link
CN (1) CN114915446B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117097627A (en) * 2023-10-19 2023-11-21 中国人民解放军国防科技大学 Permeation test agent training and verification environment construction method and electronic equipment

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2983458A1 (en) * 2015-07-16 2017-01-19 Raymond CANFIELD Cyber security system and method using intelligent agents

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108933793A (en) * 2018-07-24 2018-12-04 中国人民解放军战略支援部队信息工程大学 The attack drawing generating method and its device of knowledge based map
CN111639344A (en) * 2020-07-31 2020-09-08 中国人民解放军国防科技大学 Vulnerability detection method and device based on neural network
CN113919485A (en) * 2021-10-19 2022-01-11 西安交通大学 Multi-agent reinforcement learning method and system based on dynamic hierarchical communication network

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108933793A (en) * 2018-07-24 2018-12-04 中国人民解放军战略支援部队信息工程大学 The attack drawing generating method and its device of knowledge based map
CN111639344A (en) * 2020-07-31 2020-09-08 中国人民解放军国防科技大学 Vulnerability detection method and device based on neural network
CN113919485A (en) * 2021-10-19 2022-01-11 西安交通大学 Multi-agent reinforcement learning method and system based on dynamic hierarchical communication network

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ANDREW M. SAXE: "A mathematical theory of semantic development in deep neural networks", PNAS *
LAURA VON RUEDEN: "Informed Machine Learning – A Taxonomy and Survey of Integrating Prior Knowledge into Learning Systems", IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117097627A (en) * 2023-10-19 2023-11-21 中国人民解放军国防科技大学 Permeation test agent training and verification environment construction method and electronic equipment
CN117097627B (en) * 2023-10-19 2023-12-22 中国人民解放军国防科技大学 Penetration testing agent training and verification environment construction method and electronic equipment

Also Published As

Publication number Publication date
CN114915446B (en) 2023-08-29

Similar Documents

Publication Publication Date Title
Kotenko et al. Systematic literature review of security event correlation methods
CN111523119B (en) Vulnerability detection method and device, electronic equipment and computer readable storage medium
Beitollahi et al. Application layer DDoS attack detection using cuckoo search algorithm-trained radial basis function
Kaiser et al. Attack hypotheses generation based on threat intelligence knowledge graph
Alghuried A model for anomalies detection in internet of things (IoT) using inverse weight clustering and decision tree
CN114915446B (en) An Intelligent Network Security Detection Method Integrating Prior Knowledge
CN112487208B (en) A network security data association analysis method, device, equipment and storage medium
CN114039837B (en) Alarm data processing method, device, system, equipment and storage medium
Gu Theoretical and empirical extensions of the dendritic cell algorithm
Maseer et al. Meta‐analysis and systematic review for anomaly network intrusion detection systems: Detection methods, dataset, validation methodology, and challenges
Zarai Recurrent neural networks & deep neural networks based on intrusion detection system
CN118473960A (en) A network node vulnerability assessment method and system based on graph attention network
Zhang et al. Knowledge graph and behavior portrait of intelligent attack against path planning
Dubey et al. Investigating the impact of feature reduction through information gain and correlation on the performance of error back propagation based IDS
CN118573455B (en) Deep learning-based power system network security prediction method and device
CN119449452A (en) A network threat deduction system and method based on Transformer and graph attention network model
CN119232465A (en) A method for detecting APT attacks based on traceability graph behavior information
CN119254507A (en) Cyberspace counter-mapping method, device, computer equipment and storage medium
CN118590274A (en) A method for detecting abnormal nodes in provenance graph based on honeypoint intelligence threshold adjustment
CN118101245A (en) Key threat information inference method and device based on meta heuristic algorithm
CN116545679A (en) Industrial situation security basic framework and network attack behavior feature analysis method
CN114465784A (en) A honeypot identification method and device for an industrial control system
Al-Ofeishat et al. Analysis and Comparison of Raw Network Packet Datasets Using Machine Learning Classification and Grey Wolf Optimization.
Li et al. On Testing and Evaluation of Artificial Intelligence Models
Liu et al. A context-aware clustering approach for assisting operators in classifying security alerts

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant