Method, device and server for generating countermeasure software
By adding the features of benign samples to malignant samples and using genetic algorithms to generate adversarial software, the problems of low generation efficiency and high cost in existing technologies are solved, and the effect of efficiently generating adversarial software is achieved.
Patent Information
- Application Number
- CN202111632943.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-28
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2041-12-28
AI Technical Summary
In the existing technology, the efficiency of generating adversarial software is low and the cost is high. It is difficult to quickly generate high-quality adversarial samples, resulting in a low probability of detectors escaping the adversarial software.
Adopting the idea of genetic algorithm, the features of benign samples are added to malignant samples to generate adversarial samples, and the result samples that escape the detector are screened out through the prediction model. The iteration and hybridization operations of the genetic algorithm are used to improve the generation efficiency and generate adversarial software.
The efficiency of generating adversarial software is improved, the generation cost is reduced, and there is no need to understand the internal logic of the detector. The generated adversarial software can effectively evade the detection of the detector.
Smart Images

Figure CN114282182B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a method, device, and server for generating anti-virus software. Background Art
[0002] With the widespread adoption of the Android system, malicious software targeting the Android system has emerged in an endless stream. Machine learning-based detectors have been widely used to detect malicious software. However, detectors built using machine learning methods are highly susceptible to adversarial examples. For example, a detector may mistakenly classify a malicious adversarial example as benign. Therefore, incorporating adversarial examples into detector model training can better prevent malicious software from escaping and improve detection accuracy.
[0003] Currently, countermeasures are primarily generated by obfuscating the malicious software's code using Android code obfuscators. Countermeasures are created by repackaging the obfuscated malicious software's code. Common code obfuscation techniques include string encryption and Java reflection. Using these obfuscation techniques prevents detectors from extracting features specific to the countermeasure, thereby increasing the countermeasure's chances of escaping.
[0004] However, due to the internal security and operating mechanisms of Android, the escape probability of adversarial samples generated using code obfuscation is usually low, and there is a problem of low efficiency in generating adversarial software. Summary of the Invention
[0005] The present application provides a method, device and server for generating anti-counterfeiting software, so as to solve the problem of low efficiency in generating anti-counterfeiting software.
[0006] In a first aspect, the present application provides a method for generating anti-virus software, comprising:
[0007] Adding a feature of a benign sample in the target benign sample set to a malignant sample to obtain result samples, each of the result samples corresponding to one of the benign samples and one of the malignant samples;
[0008] Inputting the result samples into a prediction model for prediction, and determining a prediction value for each of the result samples, wherein the prediction value is used to indicate the probability that the result sample is a malignant sample;
[0009] According to the prediction value and the classification threshold of each of the result samples, determining the result sample whose prediction value is less than the classification threshold as an adversarial sample;
[0010] According to the source code of the malignant sample corresponding to each adversarial sample, the benign sample corresponding to the adversarial sample and a preset feature mapping table, adversarial software corresponding to each adversarial sample is generated.
[0011] In a second aspect, the present application provides a device for generating anti-software, comprising:
[0012] a processing module configured to add features of a benign sample in a target benign sample set to a malignant sample to obtain result samples, each of the result samples corresponding to one of the benign samples and one of the malignant samples; input the result samples into a prediction model for prediction, and determine a prediction value for each of the result samples, the prediction value being used to indicate a probability that the result sample is a malignant sample; and determine, based on the prediction value of each of the result samples and a classification threshold, that the result sample having a prediction value less than the classification threshold is an adversarial sample;
[0013] A generation module is used to generate adversarial software corresponding to each adversarial sample based on the source code of the malignant sample corresponding to each adversarial sample, the benign sample corresponding to the adversarial sample, and a preset feature mapping table.
[0014] In a third aspect, the present application provides a server, comprising: a memory and a processor;
[0015] The memory is used to store a computer program; the processor is used to execute the countermeasure software generation method in the first aspect and any possible design of the first aspect according to the computer program stored in the memory.
[0016] In a fourth aspect, the present application provides a readable storage medium, which stores a computer program. When at least one processor of a server executes the computer program, the server executes the adversarial software generation method in the first aspect and any possible design of the first aspect.
[0017] In a fifth aspect, the present application provides a computer program product, which includes a computer program. When at least one processor of a server executes the computer program, the server executes the adversarial software generation method in the first aspect and any possible design of the first aspect.
[0018] The adversarial software generation method provided by the present application obtains the characteristics of each benign sample in the target benign sample set; adds the benign sample to the malignant sample to obtain multiple result samples; inputs the result samples into the prediction model to obtain the predicted value of each result sample; the preset value is used to indicate the probability that the result sample is a malignant sample; the result samples with predicted values less than the classification threshold are screened and these result samples are used as adversarial samples; based on each adversarial sample, the benign sample and malignant sample that generate the adversarial sample are determined; the feature code corresponding to the feature of the benign sample is added to the source code of the malignant sample to obtain the adversarial code; the adversarial code is compiled and packaged to obtain the adversarial software means, thereby achieving the effect of improving the generation efficiency of adversarial samples. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the present application or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0020] Figure 1 A schematic diagram of a decompiled file;
[0021] Figure 2 A schematic diagram of the architecture of an anti-software generation device provided in one embodiment of the present application;
[0022] Figure 3 A schematic diagram of the workflow of an anti-software generation device provided in one embodiment of the present application;
[0023] Figure 4 A flowchart of a method for generating anti-software provided in one embodiment of the present application;
[0024] Figure 5 A schematic diagram of a workflow of a pre-processing unit provided in one embodiment of the present application;
[0025] Figure 6 A schematic diagram of a feature vector provided in one embodiment of the present application;
[0026] Figure 7 A schematic diagram of a workflow of an anti-software generation unit provided in one embodiment of the present application;
[0027] Figure 8 A flowchart of a method for generating anti-software provided in one embodiment of the present application;
[0028] Figure 9 A schematic diagram of the workflow of an adversarial sample generation unit provided in one embodiment of the present application;
[0029] Figure 10 A flowchart of a method for generating anti-software provided in one embodiment of the present application;
[0030] Figure 11 A schematic diagram of a workflow of a prediction model generation unit provided in one embodiment of the present application;
[0031] Figure 12 A schematic diagram of the structure of an anti-software generation device provided in one embodiment of the present application;
[0032] Figure 13 A schematic diagram of the hardware structure of a server provided in one embodiment of the present application. DETAILED DESCRIPTION
[0033] To make the objectives, technical solutions, and advantages of this application more clear, the technical solutions in this application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0034] The terms "first", "second", "third", "fourth", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate. It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this document, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Furthermore, as used herein, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context indicates otherwise.
[0035] Android is the most popular and common system for smartphones. In the Android system, if the code of a software or application wants to run, it must first be compiled and then packaged into a file that can be recognized by the Android system. This file format that can be recognized and run by the Android system is a dedicated application package (AndroidPackage, APK) file format. APK is essentially a compressed package. An APK folder usually contains compiled code files (.dex files), native resource files (assests), manifest files (AndroidManifest), etc. After decompiling the APK file, you can get the following: Figure 1 The folder shown in the figure includes the source code files obtained by decompiling the compiled code files (.dex files) in Smali.
[0036] With the widespread adoption of the Android system, malicious software targeting the Android system has emerged in an endless stream. Android malware often behaves indistinguishably from standard APKs. Methods for detecting Android malware are gaining increasing attention. Currently, machine learning-based detection methods demonstrate high accuracy. These methods typically analyze the APK's internal information, such as permissions, API calls, and sensitive strings. Based on this information, they construct feature models. They then use machine learning algorithms such as support vector machines (SVMs), random forests, and neural networks to train and construct classification models. Neural network algorithms are mathematical and computational models that mimic the structure and function of biological neural networks. Currently, neural network algorithms are widely used in the field of artificial intelligence. Neural network algorithms construct models consisting of a large number of interconnected nodes. Each node represents a specific output function, called an activation function. Each connection between two nodes has a corresponding weight. Neural network algorithms approximate patterns in data through the interaction between nodes and weights.
[0037] However, machine learning methods are highly susceptible to adversarial examples. Adversarial examples are a concept first proposed by Szegedy et al. in 2014. Adversarial examples are samples that can cause a classification model to misclassify an input sample without changing its nature. Adversarial examples typically create an error by adding perturbations to the input sample, ensuring that its nature remains unchanged. When an attacker generates adversarial examples by adding carefully crafted perturbations to a malicious APK file, the detector may mistakenly classify these malicious adversarial examples as benign, potentially exposing the Android system to attacks.
[0038] Currently, most related research focuses on improving detector performance, such as metrics like Precision, Recall, and ACC. These metrics are then used to evaluate algorithms or update parameters. While this approach is certainly a viable solution for improving detector detection capabilities, it is also possible to study the generation of malicious software from the opposite perspective, understand the principles by which malicious software evades detectors, and thereby better design models, which can significantly enhance the detection capabilities and robustness of detectors. For example, incorporating adversarial examples into detector model training can better prevent malicious software from escaping, improve detection accuracy, overcome the sample "blind spots" of the original training samples, enhance the detection capabilities and robustness of the detection model, and build detectors with even stronger detection capabilities.
[0039] In the above process, how to quickly generate a large number of high-quality adversarial examples is an urgent problem. Currently, common Android adversarial examples can be achieved by obfuscating the malicious software code using an Android code obfuscator. Code obfuscation is the act of converting a computer program's code into a functionally equivalent form that is difficult to read and understand. Common code obfuscation techniques include changing variable, function, and class names to meaningless names, string encryption, and Java reflection. Software compiled and packaged using obfuscated malicious code is called adversarial software. This adversarial software can prevent the detector from extracting features that are characteristic of the adversarial software, thereby increasing the adversarial software's chance of escaping. Furthermore, currently common Android adversarial example generation methods can also involve manual modification of the malicious software's code. This method first assumes the detector is a white-box. By mastering the detector's feature set and internal parameters, the programmer can identify the malicious features that have the greatest weight in influencing the detector's classification as malicious. The programmer can then modify these features to enable the modified adversarial examples to escape.
[0040] Currently, achieving effective attacks using Android code obfuscators requires human intervention. Due to the complex security and operational mechanisms within the Android system, code obfuscation can potentially cause the APK to fail to function properly. Consequently, this method suffers from low efficiency and high cost in generating adversarial samples. Directly modifying the malicious software's code, while effective, relies on mastering the detector's internal rules. Furthermore, feature modification often involves hiding malicious features. While numerous concealment techniques exist, they all require extensive source code modifications, resulting in high time costs and low generation efficiency.
[0041] To address the above issues, this application proposes a method for generating adversarial software. This application utilizes the principles of a genetic algorithm to generate a batch of benign samples. When a server adds features from these benign samples to a malicious sample, the malicious sample can evade detection by the detector. When the features from the benign sample are added to the malicious sample, the generated sample becomes an adversarial sample. This significantly improves the efficiency of generating adversarial samples. Each adversarial sample can be edited and packaged to generate adversarial software. This adversarial software can then be used to enhance the detector. The adversarial software generated by this application simply requires adding some invalid, no-return, and no-call code to the malicious code. The adversarial code generated using this method is simple and does not disrupt the internal operating mechanisms of the APK. This method significantly improves the efficiency of generating adversarial software while reducing its cost. Furthermore, as a heuristic algorithm, the genetic algorithm continuously eliminates individuals with poor fitness during the calculation process, retaining those with strong adaptability. Furthermore, through operations such as crossbreeding and mutation of the more adaptable individuals, the genetic algorithm generates individuals with even stronger adaptability, achieving a near-optimal solution. Compared to other algorithms, the genetic algorithm has fewer limitations and inherent parallelism and global search capabilities. During the search process, the search space can be adaptively optimized and the search direction adjusted. Therefore, benign samples generated using genetic algorithms have the advantages of fast iteration speed, large sample size, and good sample escape efficiency. Furthermore, the benign sample generation process does not require an understanding of the detector's internal logic.
[0042] The following specific embodiments are used to describe the technical solution of the present application in detail. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0043] Figure 2 The following is a schematic diagram of the architecture of an adversarial software generation system provided by an embodiment of the present application. As shown in the figure, in order to solve the problem of high cost and slow speed in generating Android adversarial samples, the adversarial software generation system of the present application may include four parts: an APK preprocessing unit, a prediction model generation unit, an adversarial attack unit, and an adversarial software generation unit. Among them, the APK preprocessing unit may include three parts: a decompiler, a feature extractor, and a feature mapper. Among them, the prediction model generation unit may include three parts: a prediction model constructor, a detector, and a prediction model fitter. Among them, the adversarial attack unit may include five parts: a malicious vector pool, a benign vector pool, a feature adder, a population optimizer, and a prediction classifier. Among them, the adversarial software generation unit may include three parts: a feature aligner, a code adder, and an APK packager.
[0044] The workflow of the adversarial software generation system can be as follows: Figure 3As shown. The server obtains multiple APKs. These APKs may include APKs of benign software and APKs of malicious software. The server extracts the features of all APKs through the APK preprocessing unit to obtain the feature vectors of the samples. The server divides these samples into benign samples and malignant samples based on the detection results of the detector on these APKs. The server can use the prediction model generation unit to generate a prediction model based on these benign samples and malignant samples. The server can use the adversarial attack unit to continuously iterate benign samples with better escape effects from benign samples to obtain a first benign sample set. The server can add the features of each benign sample in the first benign sample set to the malignant sample to obtain an adversarial sample that can escape in the prediction model. The server can generate an adversarial code based on comparing the adversarial sample with the benign sample and the malignant sample corresponding to the adversarial sample. The server can obtain the adversarial software by compiling and packaging the adversarial code.
[0045] In this application, the server is used as the execution entity to execute the anti-software generation method of the following embodiments. Specifically, the execution entity can be the server's hardware device, or a software application that implements the following embodiments in the server, or a computer-readable storage medium that has installed thereon the software application that implements the following embodiments, or the code that implements the software application that implements the following embodiments.
[0046] Figure 4 FIG. 1 shows a flow chart of a method for generating anti-software provided by an embodiment of the present application. Figure 4 As shown, with the server as the execution subject, the method of this embodiment may include the following steps:
[0047] S101. Add the features of a benign sample in the target benign sample set to a malignant sample to obtain result samples, where each result sample corresponds to a benign sample and a malignant sample.
[0048] In this embodiment, after obtaining a target benign sample set through hybridization, the server can obtain the features of each benign sample in the target benign sample set. The server can add the features of a benign sample to a malignant sample to obtain a result sample. This result sample corresponds to the benign sample and the malignant sample. Assuming that the target benign sample set includes N benign samples and the malignant sample pool includes M malignant samples, the server can combine the N benign samples with the M malignant samples in pairs to obtain N*M result samples, where N and M are positive integers.
[0049] Among them, the server can use Figure 2The feature adder of the anti-attack unit shown implements the process of adding the features of a benign sample to the malignant sample. The process may include performing an OR operation on the feature vector of the benign sample and the feature vector of the malignant sample to obtain the feature vector of the result sample. That is, when a certain dimension has a value of 1 in the feature vector of the benign sample and a value of 1 in the feature vector of the malignant sample, the value of the dimension in the result sample is 1. When a certain dimension has a value of 1 in the feature vector of the benign sample and a value of 0 in the feature vector of the malignant sample, the value of the dimension in the result sample is 1. When a certain dimension has a value of 0 in the feature vector of the benign sample and a value of 1 in the feature vector of the malignant sample, the value of the dimension in the result sample is 1. When a certain dimension has a value of 0 in the feature vector of the benign sample and a value of 0 in the feature vector of the malignant sample, the value of the dimension in the result sample is 1.
[0050] The benign samples and malignant samples are specifically feature vectors. The extraction process of the feature vector of the sample can be done by Figure 2 The APK pre-processing unit shown is completed. The specific process of the server completing the extraction of the feature vector of the sample can be as follows Figure 5 shown.
[0051] When the server obtains multiple APKs, it can use the decompiler to decompile these APKs. After decompiling each APK, the following Figure 1 The server can read the Smali code and AndroidManifest file in the decompiled folder of the APK. This file may include the source code of the APK.
[0052] A preset feature mapping table is stored in the server. Each feature in the preset feature mapping table corresponds to a feature code. The server can determine the dimension of each feature vector based on the preset feature mapping table. For example, when the preset feature mapping table includes 30 features, the dimension of the feature vector is 30. Or, when the preset feature mapping table includes 2000 features, the dimension of the feature vector is 2000. Each dimension in the feature vector can represent whether the feature code corresponding to a feature exists in the source code of the APK. When the feature code corresponding to the feature exists in the source code, the value of the dimension is 1. Otherwise, the value of the dimension is 0. For example, Figure 6As shown, when the APK source code includes the feature code android.hardware.telephony, the dimension value of the feature corresponding to this feature code is 1. To facilitate subsequent sample generation, the feature vector can be mapped to the low dimension of the feature vector. The relevant features in the Smali code will be mapped to the high dimension of the feature vector. The division between high and low dimensions can be determined based on the number of features in the AndroidManifest file and the Smali code.
[0053] The server can use a feature extractor to extract relevant feature codes from the Smali code and AndroidManifest file. When the APK source code includes a feature from the preset feature mapping table, the feature mapper can map the value of the dimension corresponding to the feature to 1. In this way, the server can obtain the feature vector corresponding to each APK. This feature vector consists of 0s and 1s.
[0054] The preset feature mapping table can be a list of feature codes generated by the user based on the source code of a large number of APKs. This list can include feature codes that appear in the source code of common benign software and feature codes that may appear in the source code of malicious software. Since a feature code may appear in both benign software and malicious code, the preset feature mapping table does not distinguish whether the feature code is benign or malicious.
[0055] S102: Input the result sample into the prediction model for prediction, and determine the prediction value of each result sample. The prediction value is used to indicate the probability that the result sample is a malignant sample.
[0056] In this embodiment, the server can input multiple result samples obtained by the operation into the prediction model. The prediction model can be used to predict the probability that the input sample is a malignant sample. The operation of using the prediction model to predict each result sample can be performed by Figure 2 The prediction classifier in the anti-attack unit shown is completed. The server can input the result sample into the prediction model. The prediction model can output a prediction value for each result sample. The prediction value is used to indicate the probability that the result sample is a malignant sample. The value range of the prediction value is (0, 1). The closer the prediction value of the result sample is to 1, the greater the probability that the preset model predicts that the result sample is a malignant sample. For example, when the prediction value of a result sample is 0.66, it means that the preset model predicts that the probability that the result sample is a malignant sample is 66%.
[0057] The prediction model can be a classification model generated by the server based on the detection results of the detector. Figure 2The prediction model generation unit shown is generated. The specific generation process of the prediction model can be as follows Figure 10 The embodiment shown is shown.
[0058] S103: According to the prediction value and classification threshold of each result sample, determine that the result sample whose prediction value is less than the classification threshold is an adversarial sample.
[0059] In this embodiment, a classification threshold is stored in the server. The classification threshold is used to distinguish between benign samples and malignant samples. The classification threshold can be determined based on experience. For example, the classification threshold can be 0.5. When the predicted value of a result sample is greater than or equal to the classification threshold, the result sample can be a malignant sample. Otherwise, when the predicted value of a result sample is less than the classification threshold, the result sample can be a benign sample. The server can determine the classification result of each result sample based on the predicted value of each result sample and the classification threshold. Since these result samples are all obtained by adding features to the malignant samples, these result samples are essentially malignant samples. When a result sample is classified as a malignant sample, it means that the classification of the result sample is correct. When a result sample is classified as a benign sample, it means that the classification of the result is incorrect, that is, the result sample has successfully escaped. These samples that have successfully escaped are called adversarial samples.
[0060] S104: Generate adversarial software corresponding to each adversarial sample based on the source code of the malicious sample corresponding to each adversarial sample, the benign sample corresponding to the adversarial sample, and a preset feature mapping table.
[0061] In this embodiment, the server can determine, based on each adversarial sample, the benign and malignant samples that generated the adversarial sample. The server can add feature code corresponding to the features of the benign sample to the source code of the malignant sample to generate adversarial code. The server can then compile and package the adversarial code to generate adversarial software.
[0062] In one example, the generation process of the adversarial software can be: Figure 2 The specific process of the server generating the anti-code can be as follows: Figure 6 This step may specifically include:
[0063] Step 1: Determine the feature code to be added based on the adversarial sample, the malicious sample corresponding to the adversarial sample, and the preset feature mapping table.
[0064] In this step, the server can determine the malignant sample that generates the adversarial sample based on the adversarial sample. The server can obtain the feature vector to be added by performing an XOR operation on the feature vector of the adversarial sample and the feature vector of the malignant sample. For example, when the value of a certain dimension in the feature vector of the result sample is 1 and the value in the feature vector of the malignant sample is 1, the value of the dimension in the feature vector to be added is 0. When the value of a certain dimension in the feature vector of the result sample is 1 and the value in the feature vector of the malignant sample is 0, the value of the dimension in the feature vector to be added is 1. When the value of a certain dimension in the feature vector of the result sample is 0 and the value in the feature vector of the malignant sample is 0, the value of the dimension in the feature vector to be added is 0. The server can determine the feature code corresponding to each dimension in the feature vector to be added based on the feature vector to be added and the preset feature mapping table. These codes are the feature codes to be added.
[0065] This process can be specifically Figure 2 The feature comparer of the anti-attack unit shown is completed. The feature comparer can use the XOR operation to subtract the feature vector of the result sample from the feature vector of the malicious sample to obtain the feature vector to be added. The code adder can determine the feature code to be added based on the feature vector to be added.
[0066] Step 2: Add the feature code to be added to the source code of the malicious sample corresponding to the adversarial sample to obtain the adversarial code.
[0067] In this step, the server can determine the source code of the malicious sample based on the malicious sample corresponding to the adversarial sample. The server can add these feature codes to be added to the source code to obtain the adversarial code. The process of adding the feature code can be specifically implemented by a code adder. The code adder can determine the type of the feature code to be added based on the feature vector to be added. When the feature code to be added is a manifest feature, the feature code can be added to the AndroidManifest file to generate XML code. When the code to be added is a source code feature, the feature code can be added to the Smali code to generate Smali code. The code adder can determine the type of the feature by judging the dimension of the feature code to be added. When the feature is in a low dimension, the feature code to be added is a manifest feature. When the feature is in a high dimension, the feature code to be added is a source code feature.
[0068] Step 3: Package the adversarial code to obtain the adversarial software.
[0069] In this step, the server can compile and package the anti-virus code to obtain the anti-virus software. The server can compile and package the anti-virus code using an APK packager.
[0070] The adversarial software generation method provided in the present application is that the server can obtain the features of each benign sample in the target benign sample set after hybridization to obtain the target benign sample set. The server can combine the benign samples and the malignant samples in pairs to obtain multiple result samples. The server can input the result samples into the prediction model to obtain the prediction value of each result sample. The preset value is used to indicate the probability that the result sample is a malignant sample. The server can screen the result samples whose prediction values are less than the classification threshold, and use these result samples as adversarial samples. The server can determine the benign samples and malignant samples that generate the adversarial sample based on each adversarial sample. The server can add the feature code corresponding to the feature of the benign sample to the source code of the malignant sample to obtain the adversarial code. The server can compile and package the adversarial code to obtain the adversarial software. In the present application, the generation of adversarial samples is achieved by adding the features of benign samples to malignant samples, which greatly improves the generation efficiency of the adversarial software.
[0071] Figure 8 A flowchart of a method for generating anti-software provided by an embodiment of the present application is shown. Figures 4 to 7 Based on the examples, Figure 8 As shown, with the server as the execution subject, the steps in this embodiment may correspond to the execution steps of the anti-attack unit. The method for calculating the target benign sample set in this embodiment may include the following steps:
[0072] S201: Add the features of each benign sample in a first benign sample set to a first preset number of malignant samples to obtain a first number of result samples corresponding to each benign sample.
[0073] In this embodiment, the server can obtain a benign sample from the first benign sample set, and add the features of the benign sample to a malignant sample to obtain a result sample. The number of samples in the first benign sample set can be N. The server can obtain all M malignant samples from the malignant sample pool. The server can add the features of each benign sample to each malignant sample to obtain N*M result samples. The specific adding method can be to perform an OR operation on the feature vector of the benign sample and the feature vector of the malignant sample. The specific implementation method is the same as Figure 4 The implementation of step S101 in the embodiment is similar and will not be repeated here in this embodiment.
[0074] It should be noted that, in the first cycle, the first benign sample set used by the server may include N benign samples randomly selected from the benign sample pool.
[0075] S202: Input the result sample into the prediction model for prediction, and determine that the result sample whose prediction value is less than the classification threshold is an adversarial sample.
[0076] In this embodiment, the server may input the plurality of result samples obtained by the operation into a prediction model. The prediction model may output a prediction value for each result sample. The prediction value is used to indicate the probability that the result sample is a malignant sample.
[0077] The server stores a classification threshold. The classification threshold can be determined based on experience. For example, the classification threshold can be 0.5. The server can filter out the result samples whose prediction values are less than the classification threshold from all the result samples and use these result samples as adversarial samples. Figure 4 The implementation of step S102 and step S103 in the embodiment is similar and will not be repeated here in this embodiment.
[0078] S203: Filter a second preset number of benign samples from the benign samples corresponding to the adversarial samples to form a second benign sample set.
[0079] In this embodiment, the server can obtain benign samples of these adversarial samples and form a third benign sample set from these benign samples. Since each benign sample in the first benign sample set needs to generate M result samples with M malignant samples, when an adversarial sample exists in the M result samples, it indicates that the benign sample may correspond to at least one adversarial sample. That is, one or more adversarial samples among these adversarial samples may correspond to the same benign sample. Therefore, assuming that L adversarial samples are screened and the third benign sample set includes K benign samples, K is a positive integer less than or equal to L, and L is a natural number. The server can screen a second preset number of benign samples from the K benign samples. The second preset number can be a positive integer less than or equal to K. Since the value of K may vary each time during the iteration process, and the second preset number is a fixed value, the second preset value is an empirical value, and the second preset value is less than or equal to the K value obtained in each iteration and close to the minimum value of K across multiple iterations.
[0080] In one example, the step of screening the second preset number of benign samples may include:
[0081] Step 1: Determine the benign difference of each adversarial sample based on the absolute value of the difference between the preset value of each adversarial sample and the preset value of the malignant sample corresponding to the adversarial sample.
[0082] In this step, the server may obtain the preset value calculated by the prediction model for each result sample in this loop. The server may also obtain the preset value calculated by the prediction model for each malignant sample before starting the loop. The server may determine the prediction value corresponding to each adversarial sample based on the adversarial sample. The server may also determine the prediction value corresponding to the malignant sample based on the malignant sample corresponding to the adversarial sample. The server may calculate the difference between the prediction value of an adversarial sample and the malignant sample corresponding to the adversarial sample. This difference is the benign difference of the adversarial sample.
[0083] Step 2: The benign samples corresponding to the adversarial samples are combined into a third benign sample set.
[0084] In this step, the server may group the benign samples corresponding to each adversarial sample into a third benign sample set.
[0085] Step 3: Calculate the mean of the benignness difference of at least one adversarial sample corresponding to each benign sample in the third benign sample set to obtain the benignification capability value of each benign sample in the third benign sample set.
[0086] In this step, the server can calculate a benign sample b according to the following formula: j The benignification capability value f(b j ).
[0087]
[0088] Among them, b j Indicates the jth benign sample in the third benign sample set. The jth benign sample may correspond to H j adversarial examples. ij Indicates that H j The i-th adversarial example among the adversarial examples. S(c ij ) indicates that the benign sample b j The predicted value of the ith adversarial sample. ij Indicates the malicious sample corresponding to the i-th adversarial sample. S(a ij ) represents the malignant sample a ij The predicted value of |S(a ij )-S(c ij )| is the benign sample b j The server can calculate the benign sample b j H j The mean of the good and bad. j The mean of the benign differences is the benign capability value f(b j ).
[0089] Step 4: Sort the benign samples according to the benignization capability values, and select a second preset number of benign samples according to the benignization capability values from large to small.
[0090] In this step, the server may sort the benign samples from large to small according to the benignification capability value of each benign sample, and select a second preset number of benign samples from large to small according to the sorting.
[0091] S204 : Using a hybridization algorithm to hybridize the benign samples in the second benign sample set to obtain a plurality of hybridized samples, which are benign samples.
[0092] In this embodiment, a hybridization algorithm is pre-stored in the server. The server can perform hybridization on a second preset number of benign samples. This hybridization algorithm may include sexual hybridization, where two benign samples are obtained and a crossover operator is used to calculate at least one hybridization sample. This hybridization algorithm may also include multi-parental recombination, where two or more hybridization samples are obtained and a crossover operator is used to calculate at least one hybridization sample. Crossover operators include single-point crossover, multi-point crossover, uniform crossover, discrete recombination, uniform recombination, linear recombination, and mixed crossover recombination. It should be noted that to ensure that the hybridized samples are benign samples, hybridization samples are generated solely through hybridization, and no mutation operation is performed on the hybridized samples. The server can hybridize a second preset number of benign samples from the second benign sample set to obtain a certain number of hybridization samples. Assume that the number of hybridization samples can be represented as 1. Then, 1 is a positive integer greater than or equal to the second preset number. Considering that the specific hybridization calculation process varies, in a single iteration, the server can randomly select one or more hybridization methods from a plurality of hybridization methods and perform hybridization on the benign samples from the second benign sample set. To ensure the number of hybrid samples, the server can limit the number of child individuals generated from the hybridization of each set of parent individuals. For example, the server can limit the number of hybrid samples generated by hybridizing two benign samples. Furthermore, the server can limit the total number of hybridization calculations. For example, the server can limit the number of hybridization calculations to 100. Once the number of hybridization calculations and the number of hybridization samples generated each time are determined, the server can use the second set of benign samples to generate a fixed number of hybridization samples in each cycle.
[0093] S205: Repeat the above steps until the number of cycles reaches a preset number of cycles, and then combine the multiple hybridization samples into a target benign sample set. Otherwise, select a third number of benign samples from the initial benign samples and combine them with the multiple hybridization samples to form a new first benign sample set.
[0094] In this embodiment, the server can obtain the current number of cycles. When the number of cycles is greater than or equal to the preset number of cycles, the server ends the cycle process and combines the multiple hybridization samples into a target benign sample set. The target benign sample set is output and used to generate the result sample.
[0095] Otherwise, when the number of cycles is less than the preset number of cycles, the server may select a third number of benign samples from the benign sample pool. The third number is determined based on the preset number of samples in the first benign sample set and the number of hybrid samples. After the server generates multiple hybrid samples, these hybrid samples constitute a new first benign sample set. Since the number of hybrid samples is less than the number of samples in the first benign sample set, the server needs to add a third number of benign samples to the first benign sample set. The third number of benign samples are benign samples that have not been used in the benign sample pool. The addition of the benign samples can improve the population diversity of the first benign sample set and improve the effectiveness of the hybridization results.
[0096] In the adversarial software generation method provided herein, a server may add the features of each benign sample in a first benign sample set to a first preset number of malignant samples, thereby obtaining a first number of result samples corresponding to each benign sample. The server may input the result samples into a prediction model for prediction, and determine that the result samples whose prediction values are less than a classification threshold are adversarial samples. The server may obtain benign samples corresponding to these adversarial samples and combine these benign samples into a third benign sample set. The server may select a second preset number of benign samples from the third benign sample set to form a second benign sample set. The server may use a hybridization algorithm to hybridize the benign samples in the second benign sample set to obtain multiple hybrid samples, which are benign samples. The server may obtain the current number of loops. When the number of loops is greater than or equal to the preset number of loops, the server terminates the loop process and combines the multiple hybrid samples into a target benign sample set. Otherwise, when the number of loops is less than the preset number of loops, the server may select a third number of benign samples from the benign sample pool and combine these with the multiple hybrid samples to form a new first benign sample set. In the present application, the iteration of benign samples is achieved through the iterative hybridization process, and a set of benign samples that are easier to escape are obtained by hybridization from the original benign samples.
[0097] The steps performed in the above embodiment are equivalent to Figure 2 The operation of the anti-attack unit shown in FIG. The steps executed by the anti-attack unit are the core steps in the anti-software generation method, which are mainly used to realize the generation of adversarial samples. The adversarial vector means a sample that can successfully escape the detector after adding the features of the benign sample to the malicious sample vector. The specific execution steps of the anti-attack unit can be as follows: Figure 9 shown.
[0098] The server can use malignant samples from the malignant sample pool as raw materials for generating result samples. The server can also use benign samples from the benign sample pool as a source of "genes" in the genetic algorithm. The server can randomly select a number of benign vectors from the benign sample pool to form a population. This population is referred to as the first benign sample set. The server can use a feature adder to add the features of each benign sample in the population to the malignant sample to obtain a result sample. The feature adder performs a logical OR operation on two benign samples. This operation logically adds the features of the benign sample to the malignant sample while maintaining the feature information of the malignant sample. The prediction model can predict the result samples and filter out those that have successfully escaped. These successfully escaped result samples are used as adversarial samples. The server can determine whether the maximum number of iterations of the genetic algorithm has been reached. If so, the server can output the adversarial sample and terminate the iteration. Otherwise, the server can retain the benign samples corresponding to these adversarial samples in the population and remove the other benign samples from the population. The server can calculate the benignification capability value of each benign sample in the population and select the top N benign samples with the largest benignification capability values. The server deletes all benign samples other than the top N benign samples from the population. The server can perform pairwise hybridization on the top N benign samples to obtain multiple hybrid samples. The population composed of these hybrid samples will replace the population composed of the top N benign samples. To maintain the diversity of the population, the server can select several unselected benign samples from the benign sample pool and add them to the population to keep the number of samples in the population stable. The server can repeat the above steps until the end.
[0099] Figure 10 A flowchart of a method for generating anti-software provided by an embodiment of the present application is shown. Figures 4 to 9 Based on the examples, Figure 10 As shown, with the server as the execution subject, the steps in this embodiment may correspond to the execution steps of the prediction model generation unit. The training of the calculation prediction module in this embodiment may include the following steps:
[0100] S301: Use a detector to classify multiple software and determine the category of each software, where the categories include malicious software and benign software.
[0101] In this embodiment, the server can use a detector to classify the software and determine the category of each software. The detector can be a pre-generated malicious software detector. The internal logic of the detector is not disclosed to the public. The software categories can include benign software and malicious software.
[0102] S302: Perform feature extraction on the decompiled software file to obtain a feature vector of a malicious sample corresponding to each malicious software and a feature vector of a benign sample corresponding to each benign software.
[0103] In this embodiment, the server can preprocess the software using the APK preprocessing unit to obtain a feature vector corresponding to each piece of software. The server can first decompile each piece of software using a decompiler. Subsequently, the server can use a feature extractor and feature mapper to determine the feature vector for each piece of software. The feature vector of malicious software represents a malicious sample, while the feature vector of benign software represents a benign sample.
[0104] S303: Input the feature vectors of the malignant sample and the feature vectors of the benign sample into a training model for training to obtain a prediction model, which is used to predict the probability that the sample input into the prediction model is a malignant sample.
[0105] In this embodiment, the server can use a prediction model fitter to fit a prediction model. The prediction model fitter can fit multiple prediction models. Different prediction models can be classification models constructed using different algorithms. For example, these prediction models may include a binary classification prediction model, a random forest prediction model, a neural network prediction model, etc. The server can train these prediction models using the malignant samples and benign samples obtained in the above steps. After the server trains multiple prediction models, the server can use the prediction model constructor to compare the performance of these prediction models. The server can select the prediction model whose prediction result is close to the detector as the prediction model to be used finally. This prediction model will be used to predict the probability of each input sample being a malignant sample.
[0106] The adversarial software generation method provided in the present application can use a detector to classify the software and determine the category of each software. The server can obtain the feature vector of the malignant sample corresponding to each malicious software and the feature vector of the benign sample corresponding to each benign software. The server can input the feature vector of the malignant sample and the feature vector of the benign sample into the training model for training to obtain a prediction model, which is used to predict the probability that the sample input into the prediction model is a malignant sample. In the present application, by generating the prediction model, the prediction value of the result sample is calculated during the adversarial sample generation process, thereby improving the classification efficiency, avoiding the process of compiling and packaging the adversarial sample when using the detector in the hybridization process, and improving the hybridization efficiency.
[0107] Based on the above embodiments, with the server as the execution subject, the process of the prediction model generation unit in this embodiment can be as follows: Figure 11As shown. The server can use the prediction model generation unit to generate an alternative detection model of the detector for the subsequent anti-attack unit to predict the category of each result sample. Among them, the constructor of the prediction model is used to define the architecture of the model. In this embodiment, the algorithm model of the prediction model adopts a neural network algorithm. The output of the model constructed using the neural network algorithm has a value range of (0, 1). The server can define the classification threshold as 0.5. When the predicted value of the input sample is greater than 0.5, the input sample can be a malicious sample. Otherwise, the input sample can be a benign sample. The detector is an Android static detector to be attacked. The server can use the detector to predict each APK and determine the category of each APK. Among them, malicious software can correspond to label 1. Benign software can correspond to label 0. The server can use the prediction model fitter to train the labeled samples to obtain a prediction model. When the server completes the training, the prediction model can be obtained.
[0108] Figure 12 FIG. 1 shows a schematic diagram of a structure of an anti-software generating device provided by an embodiment of the present application. Figure 12 As shown, the anti-software generation device 10 of this embodiment is used to implement the operations corresponding to the server in any of the above method embodiments. The anti-software generation device 10 of this embodiment includes:
[0109] Processing module 11 is configured to add the features of a benign sample from the target benign sample set to a malignant sample to obtain result samples, where each result sample corresponds to a benign sample and a malignant sample. The result samples are input into a prediction model for prediction, and a predicted value is determined for each result sample. The predicted value indicates the probability that the result sample is a malignant sample. Based on the predicted value of each result sample and a classification threshold, a result sample whose predicted value is less than the classification threshold is determined to be an adversarial sample.
[0110] The generation module 12 is configured to generate adversarial software corresponding to each adversarial sample based on the source code of the malicious sample corresponding to each adversarial sample, the benign sample corresponding to the adversarial sample, and a preset feature mapping table.
[0111] In one example, the preset feature mapping table includes a feature code corresponding to each feature in the benign sample.
[0112] In one example, the generation module 12 is specifically used to determine the feature code to be added based on the adversarial sample, the malicious sample corresponding to the adversarial sample, and a preset feature mapping table; add the feature code to be added to the source code of the malicious sample corresponding to the adversarial sample to obtain the adversarial code; and package the adversarial code to obtain the adversarial software.
[0113] In one example, the processing module 11 is also used to add the features of each benign sample in the first benign sample set to a first preset number of malignant samples to obtain a first number of result samples corresponding to each benign sample. The result samples are input into the prediction model for prediction, and the result samples whose prediction values are less than the classification threshold are determined to be adversarial samples. A second preset number of benign samples are screened from the benign samples corresponding to the adversarial samples to form a second benign sample set. The benign samples in the second benign sample set are hybridized using a hybridization algorithm to obtain a plurality of hybridized samples, which are benign samples. Repeat the above steps until the number of cycles reaches the preset number of cycles, and form the target benign sample set with the plurality of hybridized samples. Select a third number of benign samples from the initial benign samples, and form a new first benign sample set with the plurality of hybridized samples.
[0114] In one example, the processing module 11 is specifically configured to determine the benign difference of each adversarial sample based on the absolute value of the difference between a preset value of each adversarial sample and a preset value of a malignant sample corresponding to the adversarial sample. The benign samples corresponding to the adversarial sample are grouped into a third benign sample set. The mean of the benign difference of at least one adversarial sample corresponding to each benign sample in the third benign sample set is calculated to obtain a benignification capability value for each benign sample in the third benign sample set. The benign samples are sorted according to the benignification capability value, and a second preset number of benign samples are selected from the largest to the smallest benign capability value.
[0115] In one example, processing module 11 is further configured to use a detector to classify multiple software programs and determine the category of each software program, including malicious software and benign software. Feature extraction is performed on the decompiled software files to obtain a feature vector for a malicious sample corresponding to each piece of malicious software and a feature vector for a benign sample corresponding to each piece of benign software. The feature vectors for the malicious and benign samples are input into a training model for training to obtain a prediction model. The prediction model is configured to predict the probability that a sample input into the prediction model is a malicious sample.
[0116] The anti-software generation device 10 provided in the embodiment of the present application can execute the above method embodiment. Its specific implementation principles and technical effects can be found in the above method embodiment, and this embodiment will not be repeated here.
[0117] Figure 13 FIG1 shows a hardware structure diagram of a server provided in an embodiment of the present application. Figure 13 As shown, the server 20 is used to implement the operations corresponding to the server in any of the above method embodiments. The server 20 of this embodiment may include: a memory 21, a processor 22 and a communication interface 24.
[0118] The memory 21 is used to store computer programs. The processor 22 is used to execute the computer programs stored in the memory to implement the method for generating countermeasure software in the above embodiment. For details, please refer to the relevant description in the above method embodiment.
[0119] In one example, the memory 21 can be independent or integrated with the processor 22. When the memory 21 is a device independent of the processor 22, the server 20 can further include a bus 23. The bus 23 is used to connect the memory 21 and the processor 22.
[0120] The communication interface 24 may be connected to the processor 21 via the bus 23. The communication interface 24 may be used to obtain software and output countermeasure software.
[0121] The server provided in this embodiment can be used to execute the above-mentioned anti-software generation method. Its implementation method and technical effects are similar and will not be described in detail in this embodiment.
[0122] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, it is used to implement the methods provided in the various embodiments described above.
[0123] The present application also provides a computer program product, comprising a computer program stored in a computer-readable storage medium. At least one processor of a device can read the computer program from the computer-readable storage medium, and at least one processor executes the computer program so that the device implements the methods provided in the various embodiments described above.
[0124] An embodiment of the present application also provides a chip, which includes a memory and a processor, the memory is used to store computer programs, and the processor is used to call and run the computer programs from the memory, so that a device equipped with the chip executes the methods in various possible implementation modes as described above.
[0125] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules is only a logical function division. In actual implementation, there may be other division methods, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0126] Finally, it should be noted that the above embodiments are intended only to illustrate the technical solutions of this application and are not intended to limit them. Although this application has been described in detail with reference to the aforementioned embodiments, those skilled in the art will appreciate that they may modify the technical solutions described in the aforementioned embodiments or replace some or all of the technical features therein with equivalents. However, such modifications or replacements do not deviate from the essence of the corresponding technical solutions within the scope of the various embodiments of this application.
Claims
1. A method for generating an anti-software, characterized in that: The method comprises: Adding a feature of a benign sample in the target benign sample set to a malignant sample to obtain result samples, each of the result samples corresponding to one of the benign samples and one of the malignant samples; Inputting the result samples into a prediction model for prediction, and determining a prediction value for each of the result samples, wherein the prediction value is used to indicate the probability that the result sample is a malignant sample; According to the prediction value and the classification threshold of each of the result samples, determining the result sample whose prediction value is less than the classification threshold as an adversarial sample; Generate adversarial software corresponding to each adversarial sample according to the source code of the malicious sample corresponding to each adversarial sample, the benign sample corresponding to the adversarial sample, and a preset feature mapping table; Before adding a feature of a benign sample in the target benign sample set to a malignant sample, the method further includes: Adding the feature of each benign sample in the first benign sample set to a first preset number of malignant samples to obtain a first number of result samples corresponding to each benign sample; Inputting the result sample into a prediction model for prediction, and determining that the result sample whose prediction value is less than the classification threshold is an adversarial sample; Selecting a second preset number of benign samples from the benign samples corresponding to the adversarial samples to form a second benign sample set; hybridizing the benign samples in the second benign sample set using a hybridization algorithm to obtain a plurality of hybridized samples, wherein the hybridized samples are benign samples; Repeat the above steps until the number of cycles reaches a preset number of cycles, and then combine the plurality of hybrid samples into the target benign sample set; otherwise, select a third number of benign samples from the initial benign samples and combine them with the plurality of hybrid samples to form a new first benign sample set; The screening of a second preset number of benign samples from the benign samples corresponding to the adversarial samples includes: Determining a benign difference of each adversarial sample according to an absolute value of a difference between the predicted value of each adversarial sample and the predicted value of the malignant sample corresponding to the adversarial sample; The benign samples corresponding to the adversarial samples are combined into a third benign sample set; Calculating a mean of the benignness differences of at least one adversarial sample corresponding to each of the benign samples in the third benign sample set to obtain a benignification capability value of each of the benign samples in the third benign sample set; The benign samples are sorted according to the benignization capability values, and a second preset number of the benign samples are screened out according to the benignization capability values from large to small.
2. The method according to claim 1, characterized in that The preset feature mapping table includes a feature code corresponding to each feature in the benign sample.
3. The method according to claim 2, characterized in that Generating the adversarial software corresponding to each adversarial sample according to the source code of the malignant sample corresponding to each adversarial sample, the benign sample corresponding to the adversarial sample, and a preset feature mapping table includes: Determining a feature code to be added according to the adversarial sample, the malicious sample corresponding to the adversarial sample, and a preset feature mapping table; Adding the feature code to be added to the source code of the malicious sample corresponding to the adversarial sample to obtain an adversarial code; The confrontation code is packaged to obtain the confrontation software.
4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: Using a detector to classify a plurality of software, determining a category of each of the software, wherein the category includes malicious software and benign software; Performing feature extraction on the decompiled software file to obtain a feature vector of a malicious sample corresponding to each malicious software and a feature vector of a benign sample corresponding to each benign software; The feature vector of the malignant sample and the feature vector of the benign sample are input into a training model for training to obtain a prediction model, wherein the prediction model is used to predict the probability that the sample input into the prediction model is a malignant sample.
5. A device for generating anti-software, characterized in that: The device comprises: a processing module configured to add features of a benign sample in a target benign sample set to a malignant sample to obtain result samples, each of the result samples corresponding to one of the benign samples and one of the malignant samples; input the result samples into a prediction model for prediction, and determine a prediction value for each of the result samples, the prediction value being used to indicate a probability that the result sample is a malignant sample; and determine, based on the prediction value of each of the result samples and a classification threshold, that the result sample having a prediction value less than the classification threshold is an adversarial sample; A generation module, configured to generate adversarial code corresponding to each adversarial sample based on the source code of the malignant sample corresponding to each adversarial sample, the benign sample corresponding to the adversarial sample, and a preset feature mapping table, and package the code to obtain adversarial software; The processing module is further configured to add the feature of each benign sample in the first benign sample set to a first preset number of malignant samples before adding the feature of a benign sample in the target benign sample set to a malignant sample, to obtain a first number of result samples corresponding to each benign sample; Inputting the result sample into a prediction model for prediction, and determining that the result sample whose prediction value is less than the classification threshold is an adversarial sample; Selecting a second preset number of benign samples from the benign samples corresponding to the adversarial samples to form a second benign sample set; hybridizing the benign samples in the second benign sample set using a hybridization algorithm to obtain a plurality of hybridized samples, wherein the hybridized samples are benign samples; Repeat the above steps until the number of cycles reaches a preset number of cycles, and then combine the plurality of hybrid samples into the target benign sample set; otherwise, select a third number of benign samples from the initial benign samples and combine them with the plurality of hybrid samples to form a new first benign sample set; The processing module is further configured to determine a benign difference of each adversarial sample based on an absolute value of a difference between the predicted value of each adversarial sample and the predicted value of the malignant sample corresponding to the adversarial sample; The benign samples corresponding to the adversarial samples are combined into a third benign sample set; Calculating a mean of the benignness differences of at least one adversarial sample corresponding to each of the benign samples in the third benign sample set to obtain a benignification capability value of each of the benign samples in the third benign sample set; The benign samples are sorted according to the benignization capability values, and a second preset number of the benign samples are screened out according to the benignization capability values from large to small.
6. A server, characterized in that: The server includes: a memory and a processor; The memory is used to store a computer program; the processor is used to implement the method for generating countermeasure software according to any one of claims 1 to 4 according to the computer program stored in the memory.
7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, is used to implement the method for generating countermeasure software according to any one of claims 1 to 4.
8. A computer program product, characterized in that The computer program product includes a computer program, and when the computer program is executed by a processor, the method for generating countermeasure software according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Method for generating and detecting malignant adversarial sample based on jacobian matrix
CN112241532A