Zero-trust security-oriented generative threat inference and verification method and electronic equipment

CN118944943APending Publication Date: 2024-11-12SHANGHAI JIAOTONG UNIV +1

Patent Information

Application Number
CN202411099389.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-12
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

Existing malicious code analysis technologies are difficult to deal with rapidly changing malicious code variants, and the analysis process requires a lot of manual intervention and is inefficient.

Method used

Adopt a generative threat inference and verification method for zero-trust security. By obtaining malicious code samples, extracting static and dynamic features, building a database, and using a large language model to perform multiple rounds of interactive analysis and verification, realizing threat type judgment and attack chain Analysis and scope of impact assessment.

Benefits of technology

It realizes automated complex security analysis tasks, improves the accuracy and efficiency of threat inference, and can conduct comprehensive analysis of complex attack chains, providing in-depth and explainable threat assessment results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118944943A_ABST
    Figure CN118944943A_ABST
Patent Text Reader

Abstract

The invention relates to a zero-trust security-oriented generative threat inference and verification method and electronic equipment, and the method comprises the following steps: S1, obtaining a malicious code sample, extracting static features and dynamic features from the malicious code sample through a plurality of feature extraction methods, and constructing a malicious code database; s2, based on the malicious code database, training a large language model by utilizing a prompt learning method in order to realize multi-classification of malicious codes; and S3, performing multi-round interactive analysis and verification on the target malicious code by utilizing the pre-trained large language model to obtain threat type judgment, attack continuous analysis and influence range evaluation information. Compared with the prior art, the method has the advantages that comprehensive and deep malicious code threat inference and verification are realized, and the threat inference accuracy is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network security technology, and in particular to a generative threat inference and verification method and electronic device for zero-trust security. Background Art

[0002] In the context of the rapid development of informatization today, network security has become one of the focuses of global attention. With the deepening of digital transformation, personal privacy and corporate secrets are facing new threats. The traditional security model based on border defense can no longer meet the current security needs. The zero-trust security model came into being, and the earliest prototype of zero-trust security originated from the Jericho Forum. Subsequently, the idea of ​​"never trust, always verify" was formally proposed, and the term "zero trust" was derived. At the same time, the concept of zero-trust architecture was also clarified, and the concept of de-bordering discussed at the Jericho Forum was improved. The zero-trust concept believes that all network traffic cannot be trusted, and strict security controls should be implemented on all requests to access any resources.

[0003] In a zero-trust security environment, malicious code detection and analysis become particularly important. However, existing malicious code analysis technologies have the following problems: (1) It is difficult to cope with rapidly changing malicious code variants; (2) The analysis process usually requires a lot of manual intervention and is inefficient.

[0004] In summary, there is currently a lack of a threat inference and verification method for malicious code to solve or partially solve the aforementioned problems. Summary of the invention

[0005] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a generative threat inference and verification method and electronic device for zero-trust security to solve or partially solve the problems.

[0006] The purpose of the present invention can be achieved by the following technical solutions:

[0007] In one aspect of the present invention, a generative threat inference and verification method for zero-trust security is provided, comprising the following steps:

[0008] Step S1, obtaining malicious code samples, extracting static features and dynamic features from the malicious code samples through multiple feature extraction methods, and building a malicious code database;

[0009] Step S2: Based on the malicious code database, a large language model is trained using a prompt learning method for the purpose of achieving multiple classification of malicious codes;

[0010] Step S3: Use the pre-trained large language model to perform multiple rounds of interactive analysis and verification on the target malicious code to obtain threat type judgment, attack chain analysis and impact range assessment information.

[0011] As a preferred technical solution, in step S1, the process of building a malicious code database includes the following steps:

[0012] Obtain multiple malicious code samples, and use the analysis service to classify the malicious code samples into multiple preset code types.

[0013] As a preferred technical solution, the code types include Trojans, backdoors, downloaders, worms, spyware, adware, droppers and viruses.

[0014] As a preferred technical solution, in step S1, the process of extracting static and dynamic features from the malicious code sample includes the following steps:

[0015] Perform automated malware analysis on malicious code samples, using bytecode analysis, API call sequence analysis, and control flow graph analysis to extract static and dynamic features.

[0016] As a preferred technical solution, in step S2, the process of training the large language model includes the following steps:

[0017] The malicious code database is used as prompt information to train the large language model, so that the large language model has a multi-classification capability for malicious codes.

[0018] As a preferred technical solution, the step S3 includes the following steps:

[0019] Obtain the target malicious code and extract the corresponding static and dynamic features, use the pre-trained large language model to perform multiple rounds of interactive analysis and verification, and obtain threat type judgment, attack chain analysis, and impact range assessment information.

[0020] As a preferred technical solution, in step S3, the following formula is used to implement multiple rounds of interactive analysis and verification:

[0021] S=M(s|E k ,p target ,h)

[0022] Among them, S represents the threat type judgment, attack chain analysis and impact range assessment information obtained through multiple rounds of interactive analysis and verification, k is the capacity of the malicious code dataset for training the large language model, and E k represents the sample set, p target represents a malicious code sample, and h represents the interaction history.

[0023] As a preferred technical solution, in the step S2, after training the large language model, the large language model is also evaluated in terms of accuracy, precision, recall and F1 score.

[0024] Another aspect of the present invention provides an electronic device, comprising: one or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the aforementioned generative threat inference and verification method for zero-trust security.

[0025] Another aspect of the present invention provides a computer-readable storage medium, comprising one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs include instructions for executing the aforementioned generative threat inference and verification method for zero-trust security.

[0026] Compared with the prior art, the present invention has at least one of the following beneficial effects:

[0027] (1) Realize comprehensive and in-depth malicious code threat inference and verification: The present invention adopts multiple feature extraction methods to obtain malicious code features, uses a large language model to perform threat inference and verification, and can automatically complete complex security analysis tasks.

[0028] (2) High accuracy of threat inference: By collecting a large number of malicious code samples and features, a database is built as prompt information for the large language model, thereby improving the accuracy of threat inference.

[0029] (3) The multi-round interactive analysis method can comprehensively analyze complex attack chains and provide more in-depth and explainable threat assessment results. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 Schematic diagram of a process of a generative threat inference and verification method for zero-trust security in an embodiment;

[0031] Figure 2 Schematic diagram of the comparative test in the embodiment. DETAILED DESCRIPTION

[0032] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0033] Example 1

[0034] In view of the problems existing in the above-mentioned prior art, this embodiment provides a generative threat inference and verification method for zero-trust security. Figure 1 The specific implementation process is shown. The user submits a malicious code sample or its features to be analyzed, and the system will perform feature extraction and threat inference verification on the sample. The overall process of this method mainly includes four steps:

[0035] S1: Collect malicious code samples and features, and establish a malicious code database. Collect and organize relevant malicious code samples, static features (bytecode, import address table, etc.) and dynamic features (API call relationship, control flow graph, etc.) in advance as a database. In the threat inference process, this information will be divided into training sets, validation sets, and test sets for prompt learning, as prompt information for the large language model to obtain threat inference capabilities in the future.

[0036] Specifically, this step obtains a large number of malicious code samples, and then first disassembles the malicious code through the dis library to obtain the bytecode of the malicious code, and uses the pefile library to obtain the import address table of the malicious code. Static analysis is used to obtain the control flow graph of the code, and the code is virtually executed in an isolated environment to obtain the API call sequence for the system function. Then VirusTotal is used to classify it into eight major malware families: Trojans, backdoors, downloaders, worms, spyware, adware, droppers, and viruses. This dataset can be used as a prompt learning dataset for large language models to make their learned threat inference capabilities more powerful.

[0037] S2: Build multiple feature extraction methods to extract static and dynamic features from malicious code. In the CuckooSandbox environment, multiple feature extraction methods are called, including but not limited to bytecode analysis, API call sequence analysis, control flow graph analysis, etc., to obtain comprehensive features of malicious code.

[0038] Specifically, this step extracts features from malicious codes by executing these malware samples in the Cuckoo Sandbox environment, and then integrating multiple static and dynamic feature extraction methods, including but not limited to bytecode analysis, API call sequence analysis, control flow graph analysis, etc.

[0039] S3: Use the collected malicious code database to prompt the large language model to generate a threat inference report. Sample set E generated using the database built in S1 k We adopt the method of manually designed prompt templates combined with multi-language round-trip translation data enhancement, use the pre-trained large model to score the prompt templates, find the optimal initial prompt template, and then use the prompt learning method to train the large language model BLOOM, so that the pre-trained BLOOM large model has the ability to classify malicious code in multiple ways.

[0040] Specifically, in this step, the user uses the constructed malicious code dataset as prompt information to perform prompt learning on the BLOOM (BigScience Large Open Science Open Access Multilingual Model) language model, so that the pre-trained BLOOM large model has multi-classification capabilities for malicious codes.

[0041] S4: The large language model uses the threat inference report to conduct multiple rounds of interactive analysis and verification of malicious code. In this step, the system will use the BLOOM model to conduct multiple rounds of interactive analysis, including threat type judgment, attack chain analysis, impact range assessment, etc. Each round of interaction will conduct in-depth discussions based on the previous analysis results, and finally give a comprehensive threat assessment result. The interactive analysis process can be expressed by the following formula:

[0042] S=M(s|E k ,p target ,h)

[0043] Where E k represents the sample set, p target Represents the target malicious code, and h represents the interaction history, which includes the questions and answers of the previous rounds of interactions. In this way, the system can conduct in-depth analysis of complex malicious code and provide more accurate and explainable threat assessment results. At the same time, the multi-round interaction method also makes the analysis process more flexible, and can conduct targeted in-depth discussions as needed. Finally, the system will summarize and sort all analysis results, and give priority to reminding users of threats with higher risk factors. The performance evaluation of the system is mainly measured by accuracy, precision, recall and F1 score.

[0044] The comparative experiment uses the API function call sequence of the existing malicious code to divide the training set and the test set in a ratio of 10:1. The test set is used to test the trained LSTM model, the BERT (a bidirectional pre-trained language model based on Transformer) and the BLOOM model after prompt learning in eight categories, and the accuracy, precision, recall and F1 score are obtained. The experimental flow chart is shown in the figure below. Figure 2 shown.

[0045] The experimental results are shown in Table 1. It is found that in the eight-classification task of malicious code, the performance of LSTM, a representative of classic deep learning methods, is far inferior to that of BERT and BLOOM. This is because LSTM itself has a huge gap with the other two models in terms of parameter quantity and model structure.

[0046] Table 1 Comparative experimental results

[0047]

[0048] According to Table 1, the accuracy of this embodiment in the malicious code classification task is significantly improved, from 48.17% of the traditional long short-term memory network (LSTM) method to 81.73%, showing a strong classification effect and generalization ability, while supporting interactive question-answering, improving user participation and detection transparency, and significantly enhancing network security protection capabilities. The present invention can automatically infer and verify the threat of malicious code, improve the efficiency and accuracy of security analysis, and ensure system security.

[0049] In the comparison between BERT, a representative of discriminative models, and BLOOM, a representative of generative models, BLOOM performed better than BERT in terms of accuracy, precision, recall and F1 score. This is because BLOOM is a large multilingual model with far more complex parameters and model architecture than BERT. It is better able to understand different complex patterns and semantics, and has learned the intrinsic connection between API function call sequences and malicious code categories.

[0050] The results of the comparative experiments prove that the BLOOM model design based on prompt learning has excellent performance in the malicious code classification task, and also proves the excellent threat inference ability of this method.

[0051] This embodiment adopts a prompt word subspace search algorithm based on bidirectional translation to search for the prompt template that is most suitable for the malicious code classification task in the semantic space. First, this embodiment empirically and artificially designs and generates a series of seed prompt templates. The pre-trained translation model on the WMT19 large corpus performs Chinese-German and Chinese-Russian round-trip translation to generate a large number of candidate template sentences, achieving the purpose of data enhancement and increasing the search range of the voice space. Then, the obtained prompt template candidate sentences are predicted on the test set using the original parameters of the pre-trained large model without training, so as to score the prompt template, so as to screen out the optimal initial prompt template suitable for this task, and find the initial semantic space position that is more suitable for this task. While significantly accelerating the convergence speed of the model, it also avoids the problem of falling into the local optimal solution to a certain extent, providing strong support for real-time detection of malicious code.

[0052] This embodiment adopts the technology of maintaining consistency of dialogue content by embedding multiple knowledge. By designing keywords, the model is prompted whether the current user requirement task is a sequence classification task or a sequence-to-sequence task. In this way, the model can not only infer the category of malicious code, but also generate some policy suggestions and additional knowledge according to the context of user input, thereby enhancing the model's ability to identify anti-reverse malicious code such as packed and obfuscated codes.

[0053] The generative threat inference and verification method for zero-trust security provided in this embodiment realizes the automated analysis and verification of malicious code by combining traditional feature extraction methods with advanced large language model technology. This method can not only improve the efficiency of security analysis, but also provide more comprehensive and reliable threat assessment results for zero-trust security environments.

[0054] This embodiment uses a large language model (LLM) represented by ChatGPT, a generative pre-trained model based on the Transformer architecture. This pre-trained model receives a text sequence as input and processes the position information of each input sequence through an attention mechanism, so that the model can better capture long-distance dependencies.

[0055] The model of this embodiment has powerful interactive capabilities and can conduct multiple rounds of dialogue with users to deeply understand needs and problems. In a zero-trust security environment, this capability provides new opportunities for malicious code detection and continuous verification. LLM interacts with the security system to obtain malicious code information in real time and conduct rapid analysis and judgment. It can also continuously optimize the analysis results based on user feedback and new evidence to achieve multiple rounds of threat inference and continuous verification. In addition, LLM can process large amounts of data and complex information, deeply analyze malicious code behavior patterns, discover potential threats and vulnerabilities, and provide more comprehensive and accurate protection for zero-trust security.

[0056] Example 2

[0057] Based on Example 1, this example provides a generative threat inference and verification system to implement the zero-trust security-oriented generative threat inference and verification method of Example 1. Specifically, the system front end is based on the Vue framework and the back end is based on the Django framework to ensure efficient integration of data processing, model application and dynamic behavior analysis.

[0058] The generative threat inference and verification system includes two main processes: feature extraction and threat inference verification. In the feature extraction stage, the system uses a variety of static and dynamic analysis methods to extract the features of malicious code. In the threat inference verification stage, the system uses pre-collected malicious code samples and features to build a knowledge base, prompting the learning of a pre-trained large language model to enable it to have the ability to infer threats, and then conducts multiple rounds of interactive analysis and verification to finally provide a comprehensive threat assessment result.

[0059] This system is capable of multiple rounds of threat inference and verification. Through multiple rounds of interaction with users, it continuously and deeply analyzes the characteristics and behaviors of malicious code, better fitting the concept of continuous authentication of zero-trust security. In each round of interaction, the system will further explore the potential threats of malicious code based on the information provided by the user and the analysis results of the previous rounds, ensuring a comprehensive understanding and accurate assessment of malicious code.

[0060] Example 3

[0061] An electronic device includes: one or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the generative threat inference and verification method for zero-trust security as described in Example 1.

[0062] Example 4

[0063] This embodiment provides a computer-readable storage medium, including one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs include instructions for executing the generative threat inference and verification method for zero-trust security as described in Example 1.

[0064] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A generative threat inference and verification method for zero-trust security, characterized in that: The steps include: Step S1, obtaining malicious code samples, extracting static features and dynamic features from the malicious code samples through multiple feature extraction methods, and building a malicious code database; Step S2: Based on the malicious code database, a large language model is trained using a prompt learning method for the purpose of achieving multiple classification of malicious codes; Step S3: Use the pre-trained large language model to perform multiple rounds of interactive analysis and verification on the target malicious code to obtain threat type judgment, attack chain analysis and impact range assessment information.

2. A generative threat inference and verification method for zero-trust security according to claim 1, characterized in that: In step S1, the process of building a malicious code database includes the following steps: Obtain multiple malicious code samples, and use the analysis service to classify the malicious code samples into multiple preset code types.

3. A generative threat inference and verification method for zero-trust security according to claim 2, characterized in that: The types of code described include Trojans, backdoors, downloaders, worms, spyware, adware, droppers, and viruses.

4. A generative threat inference and verification method for zero-trust security according to claim 1, characterized in that: In step S1, the process of extracting static and dynamic features from the malicious code sample includes the following steps: Perform automated malware analysis on malicious code samples, using bytecode analysis, API call sequence analysis, and control flow graph analysis to extract static and dynamic features.

5. A generative threat inference and verification method for zero-trust security according to claim 1, characterized in that: In step S2, the process of training the large language model includes the following steps: The malicious code database is used as prompt information to train the large language model, so that the large language model has a multi-classification capability for malicious codes.

6. A generative threat inference and verification method for zero-trust security according to claim 1, characterized in that: The step S3 comprises the following steps: Obtain the target malicious code and extract the corresponding static and dynamic features, use the pre-trained large language model to perform multiple rounds of interactive analysis and verification, and obtain threat type judgment, attack chain analysis, and impact range assessment information.

7. A generative threat inference and verification method for zero-trust security according to claim 6, characterized in that: In step S3, the following formula is used to implement multiple rounds of interactive analysis and verification: S=M(s|E k ,p target ,h) Among them, S represents the threat type judgment, attack chain analysis and impact range assessment information obtained through multiple rounds of interactive analysis and verification, k is the capacity of the malicious code dataset for training the large language model, and E k represents the sample set, p target represents a malicious code sample, and h represents the interaction history.

8. A generative threat inference and verification method for zero-trust security according to claim 1, characterized in that: In the step S2, after the large language model is trained, the large language model is also evaluated in terms of accuracy, precision, recall and F1 score.

9. An electronic device, characterized in that: include: One or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing a generative threat inference and verification method for zero-trust security as described in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that: It includes one or more programs for execution by one or more processors of an electronic device, and the one or more programs include instructions for executing a generative threat inference and verification method for zero-trust security as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Linux host malicious software detection method, system and device and medium

    CN117521068A

  • Threat intelligence identification method and device and storage medium

    CN118233178A

Cited By

  • Malicious software detection method and device based on large language model

    CN119783102A

  • Malicious code hiding attack identification method and device based on trusted node network

    CN121173596A