A vulnerability PoC intelligent countermeasure generation method and system

CN122993987APending Publication Date: 2026-10-27NARI INFORMATION & COMM TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610932923.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-26
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

其一,单轮生成方式对漏洞上下文依赖强,在仅有漏洞描述或补丁信息时,容易生成不可执行的PoC

Benefits of technology

[0038]本发明介绍的漏洞PoC智能对抗生成方法,通过将PoC生成任务拆解为攻击向量构造、导航路径生成和PoC组装三个子任务,实现失败根因的可解释定位,便于精确修正;通过可替换黑盒检测框架反馈驱动强化学习训练,使生成的PoC不仅能够触发漏洞,还能够兼顾协议合规性与对抗隐蔽性,降低其被检测框架拦截的概率,适用于更贴近真实攻防的测试任务;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122993987A_ABST
    Figure CN122993987A_ABST
Patent Text Reader

Abstract

The application discloses a vulnerability PoC intelligent countermeasure generation method and system, and belongs to the technical field of network security and artificial intelligence. The method comprises the following steps: obtaining input samples of a vulnerability PoC generation task; generating a baseline PoC corresponding to a target vulnerability based on the input samples; verifying the root cause of the baseline PoC that fails to be positioned and utilized through a dynamic sandbox, modifying and regenerating the PoC that succeeds in utilization, inputting the modified and regenerated PoC that succeeds in utilization and the baseline PoC that succeeds in utilization as indicated by the dynamic sandbox verification feedback into a replaceable black box detection framework to calculate a detection escape score, obtaining PoC samples that meet a preset attack target and PoC samples that do not meet the preset attack target; and then strengthening the baseline large language model through the PoC samples that do not meet the preset attack target to generate the PoC samples that meet the preset attack target, so that the vulnerability can be successfully triggered while the probability of being intercepted by the detection framework is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of interdisciplinary technology of network security and artificial intelligence, and in particular to a method and system for generating intelligent adversarial capabilities for vulnerability Proof-of-Concept (PoC). Background Technology

[0002] Proof of Concept (PoC) is a general term, a widely used technical term not limited to the security field. A vulnerability PoC is specifically designed to prove the existence and triggerability of a security vulnerability; it is a crucial tool in vulnerability reproduction, root cause analysis, patch verification, and security operations. Current methods of constructing vulnerability PoCs heavily rely on security researchers manually analyzing vulnerability descriptions, patch differences, program paths, and protocol details. This is not only costly but also often results in incomplete contextual information in the early stages of vulnerability disclosure, making it difficult to obtain an executable PoC in a timely manner.

[0003] With the increasing capabilities of large language models in code understanding, semantic reasoning, and program generation, it has become possible to automatically generate vulnerability PoCs using large language models. However, existing solutions still have at least the following shortcomings. First, single-round generation methods are highly dependent on the vulnerability context, and when only vulnerability descriptions or patch information are available, it is easy to generate non-executable PoCs. Second, after a vulnerability PoC generation fails, there is a lack of an explainable root cause localization mechanism, making it difficult to determine whether the failure stems from an incorrect attack payload, a flawed path reasoning, or an error in the assembly process. Third, even if the generated vulnerability PoC is functionally exploitable, it may not possess the stealth capabilities to evade detection systems, making the generated results unsuitable for more realistic attack and defense testing environments. Fourth, relying solely on supervised fine-tuning or cue engineering makes it difficult to steadily transform the dynamic feedback of the detection framework into a long-term, accumulative capability for optimizing generation strategies. Summary of the Invention

[0004] The purpose of this invention is to provide a method and system for intelligently generating PoC (Proof-of-Concept) attacks against vulnerabilities. By breaking down the PoC generation task into sub-tasks, the reasons for exploit failures can be identified for precise correction. Furthermore, a replaceable black-box detection framework assists in generating PoC samples that meet preset attack targets, thereby successfully triggering vulnerabilities while reducing the probability of being blocked by the detection framework. This invention is achieved through the following technical solutions.

[0005] In a first aspect, the present invention provides a method for intelligently generating vulnerability PoC (Proof-of-Concept) adversaries, comprising:

[0006] Obtain publicly available information about the target vulnerability and construct input samples for the PoC generation task based on the publicly available information;

[0007] Input samples are fed into a baseline large language model to generate a baseline Proof-of-Concept (PoC) for the target vulnerability.

[0008] Execute the baseline PoC in a dynamic sandbox environment to verify the vulnerability triggering capability, execution path reachability, and output results of the baseline PoC, and obtain dynamic sandbox verification feedback;

[0009] The dynamic sandbox verification feedback shows that the failed baseline PoC samples are decomposed into attack vector construction subtask, navigation path generation subtask and PoC assembly subtask, and the root cause of failure is located based on the output of each subtask.

[0010] To address the root cause of the failure to locate the vulnerability, contextual information is added to the public information. The added contextual information is then combined with the dynamic sandbox verification feedback for adaptive inference enhancement, driving the baseline large language model to regenerate or correct the PoC sample until a sample that successfully exploits the baseline PoC is obtained. The contextual information includes vulnerability contextual information and navigation contextual information.

[0011] The dynamic sandbox validation feedback shows that the successful baseline PoC samples and the regenerated or corrected baseline PoC samples are used to input the successful samples into the replaceable black box detection framework to calculate the detection escape score. Based on the detection escape score, PoC samples that meet the preset attack target and PoC samples that do not meet the preset attack target are obtained.

[0012] The dual-model reinforcement learning system is trained by using Proof-of-Concept (PoC) samples that do not meet the preset attack objectives to drive a proximal policy optimization algorithm, thereby strengthening the baseline large language model and generating PoC samples that meet the preset attack objectives.

[0013] In this invention, the purpose of generating a Proof-of-Concept (PoC) is to successfully trigger the vulnerability. However, even if the generated PoC successfully triggers the vulnerability, there is still a probability that it will be blocked by the detection framework, indicating that the quality of the generated PoC is not high and needs further optimization. The ultimate goal is to generate a PoC that can successfully trigger the vulnerability without being blocked by the detection framework. The PoC that is not blocked by the detection framework is the PoC sample that meets the preset attack target mentioned above. The adversarial aspect in the topic name is to reduce the probability of the PoC being blocked by the detection framework while maintaining its usability (successfully triggering the vulnerability), thus countering the detection framework.

[0014] Optionally, the dual-model reinforcement learning system includes a reference large language model with frozen parameters and a reference large language model with variable parameters; wherein, the reference large language model with frozen parameters is used to provide basic behavioral constraints for the baseline large language model, and the reference large language model with variable parameters is used to improve the ability of the baseline large language model to generate baseline PoC samples that meet the preset attack targets.

[0015] In this invention, the basic behavioral constraints provided are to prevent large models from generating PoCs that, after optimization and enhancement, have evasion capabilities (improved detection evasion scores) but lose the ability to trigger vulnerabilities or deviate from the semantics of the target vulnerabilities.

[0016] Optionally, the publicly available information includes at least vulnerability description information, and optionally includes one or more of patch information, vulnerability-related source code information, and public access entry information; the dynamic sandbox verification feedback includes vulnerability triggering status, target execution path arrival status, key constraint satisfaction status, output result matching status, and request records, running logs, and monitoring information related to the baseline PoC execution process.

[0017] Optionally, the attack vector construction subtask is used to identify vulnerability sources, sinks, vulnerable variables, data flow constraints, control flow constraints, and syntax constraints; the navigation path generation subtask is used to identify file navigation chains, function navigation chains, navigation code, path constraint code, and path constraint variables and values ​​from the public access entry point to the vulnerability triggering location; and the PoC assembly subtask is used to determine request parameters, request methods, request URLs, request headers, request bodies, and triggering order.

[0018] Optionally, supplementing the public information with contextual information for the root cause of the failure to locate the vulnerability can be done by supplementing vulnerability contextual information and navigation contextual information with public information at both the file-level and function-level granularity.

[0019] Optionally, the supplemented contextual information and dynamic sandbox verification feedback are adaptively enhanced through reasoning to regenerate or correct the PoC sample. This includes guiding the vulnerability PoC generation process through thought chain hints, context learning hints, and real-time feedback hints, driving the baseline large language model to regenerate or correct the vulnerability PoC. Among these, the real-time feedback hints include attack payload verification feedback hints and execution path verification feedback hints.

[0020] Optionally, the execution score for executing a PoC sample in a dynamic sandbox environment is calculated using the following formula:

[0021] ,

[0022] In the formula, This indicates the publicly available information about the target vulnerability that has been obtained. The baseline large language model and the enhanced large language model are based on publicly available information. The generated PoC sample, Indicates based on publicly available information Generated PoC samples Execution score, to The weight coefficients are non-negative and satisfy the following conditions: , This indicates whether the vulnerability trigger statement or preset verification phenomenon has been triggered. A value of 1 indicates the vulnerability has been triggered, and a value of 0 indicates it has not. Indicates the percentage of the target execution path reached. This indicates the proportion of key constraints satisfied. This indicates the degree of matching between the output result and the expected verification phenomenon. This represents the normalized Proof-of-Concept (PoC) quality score output by the baseline large language model reviewer.

[0023] Optionally, obtaining baseline PoC samples that meet the preset attack objectives and baseline PoC samples that do not meet the preset attack objectives based on the detection escape score includes: defining successfully utilized baseline PoC samples and successfully utilized samples of regenerated or corrected baseline PoC samples as successfully utilized PoC samples; calculating the detection escape score of the successfully utilized PoC samples; comparing the detection escape score with a preset threshold; classifying samples with detection escape scores higher than the threshold as PoC samples that meet the preset attack objectives; and classifying samples with detection escape scores lower than the threshold as baseline PoC samples that do not meet the preset attack objectives.

[0024] Optionally, the escape detection score is calculated using the following formula:

[0025] ,

[0026] ,

[0027] In the formula, This indicates the sequence number of the detection model or detection engine within the detection framework. This represents the total number of detection models or detection engines. This indicates the publicly available information about the target vulnerability that has been obtained. The baseline large language model is based on publicly available information. The generated PoC sample successfully utilized Indicates based on publicly available information Generated PoC samples that successfully utilized The escape detection score, For the first The non-attack category probability output by a detection model or detection engine. This is the normalized risk score representing the attack category probability or malicious confidence level output by the i-th detection model or detection engine.

[0028] In this invention, the non-attack category is used to indicate that the current PoC sample is determined not to belong to the target attack behavior.

[0029] Secondly, this invention introduces a vulnerability PoC intelligent adversarial generation system, comprising:

[0030] The information acquisition module is used to acquire publicly available information about the target vulnerability and construct input samples for the PoC generation task based on the publicly available information.

[0031] The baseline sample generation module is used to input the input samples into the baseline large language model and generate the baseline PoC corresponding to the target vulnerability;

[0032] The dynamic verification module is used to execute the baseline PoC in a dynamic sandbox environment to verify the vulnerability triggering capability, execution path reachability, and output results of the baseline PoC, and obtain dynamic sandbox verification feedback.

[0033] The failure analysis module is used to decompose the failed baseline PoC samples, as indicated by the dynamic sandbox verification feedback, into attack vector construction subtasks, navigation path generation subtasks, and PoC assembly subtasks, and to locate the root cause of failure based on the output of each subtask.

[0034] The context information enhancement module is used to supplement the public information with context information for the root cause of the failure to locate the problem, and to perform adaptive inference enhancement with the supplemented context information and dynamic sandbox verification feedback to drive the baseline large language model to regenerate or correct the PoC sample until a sample that successfully exploits the baseline PoC is obtained; the context information includes vulnerability context information and navigation context information.

[0035] The adversarial evaluation module is used to input the successful baseline PoC samples and the successfully generated or corrected baseline PoC samples into the detection framework to calculate the detection escape score. Based on the detection escape score, PoC samples that meet the preset attack target and PoC samples that do not meet the preset attack target are obtained.

[0036] The reinforcement learning module is used to train the dual-model reinforcement learning system by driving the proximal policy optimization algorithm with PoC samples that do not meet the preset attack targets, thereby strengthening the baseline large language model and generating PoC samples that meet the preset attack targets.

[0037] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0038] The intelligent adversarial generation method for vulnerability PoC introduced in this invention decomposes the PoC generation task into three sub-tasks: attack vector construction, navigation path generation, and PoC assembly. This enables the interpretable localization of the root cause of failure, facilitating precise correction. Through feedback-driven reinforcement learning training using a replaceable black-box detection framework, the generated PoC not only triggers vulnerabilities but also balances protocol compliance and adversarial stealth, reducing the probability of it being intercepted by the detection framework. This method is suitable for testing tasks that are closer to real-world attack and defense scenarios.

[0039] This invention balances stability and exploratory capabilities through a dual-model architecture that combines a reference large language model with frozen parameters and a reference large language model with variable parameters, thus avoiding generation distortion or functional degradation during reinforcement learning.

[0040] This invention incorporates detection escape score, PoC execution score, protocol compliance score, and semantic preservation score into the reward function, which differs from a single adversarial reward that only pursues detection escape. This invention can avoid generation distortion, protocol violation, or vulnerability semantic deviation during reinforcement learning.

[0041] This invention introduces a dual-granularity context supplementation mechanism at the file and function levels to reduce irrelevant noise while ensuring information sufficiency and improving generation accuracy in complex vulnerability scenarios. It also enhances the model's reasoning ability through the collaborative enhancement of thought chains, context learning, and real-time feedback, thereby improving the performance of large language models in multi-step constraint solving and complex execution chain analysis. Attached Figure Description

[0042] Figure 1 The diagram shown is a schematic flowchart of a vulnerability PoC intelligent adversarial generation method in one embodiment of the present invention. Detailed Implementation

[0043] The following description, in conjunction with the accompanying drawings and specific embodiments, provides further details. In this description, it should be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature.

[0044] Example 1

[0045] This embodiment introduces a method for intelligently generating PoC (Proof-of-Concept) vulnerabilities, including the following steps:

[0046] Obtain publicly available information about the target vulnerability and construct input samples for the PoC generation task based on the publicly available information;

[0047] Input samples are fed into a baseline large language model to generate a baseline Proof-of-Concept (PoC) for the target vulnerability.

[0048] Execute the baseline PoC in a dynamic sandbox environment to verify the vulnerability triggering capability, execution path reachability, and output results of the baseline PoC, and obtain dynamic sandbox verification feedback;

[0049] The dynamic sandbox verification feedback shows that the failed baseline PoC samples are decomposed into attack vector construction subtask, navigation path generation subtask and PoC assembly subtask, and the root cause of failure is located based on the output of each subtask.

[0050] To address the root cause of the failure to locate the vulnerability, contextual information is added to the public information. The added contextual information is then combined with the dynamic sandbox verification feedback for adaptive inference enhancement, driving the baseline large language model to regenerate or correct the PoC sample until a sample that successfully exploits the baseline PoC is obtained. The contextual information includes vulnerability contextual information and navigation contextual information.

[0051] The dynamic sandbox validation feedback shows that the successful baseline PoC samples and the regenerated or corrected baseline PoC samples are used to input the successful samples into the replaceable black box detection framework to calculate the detection escape score. Based on the detection escape score, PoC samples that meet the preset attack target and PoC samples that do not meet the preset attack target are obtained.

[0052] The dual-model reinforcement learning system is trained by using Proof-of-Concept (PoC) samples that do not meet the preset attack objectives to drive a proximal policy optimization algorithm, thereby strengthening the baseline large language model and generating PoC samples that meet the preset attack objectives.

[0053] Example 2

[0054] Based on Example 1, this example describes the specific implementation process of a smart adversarial generation method for vulnerability PoC, such as... Figure 1 As shown ( Figure 1 The PPO in this invention is the large language model, specifically including the following:

[0055] I. Specific Steps of the Method

[0056] S1: Obtain publicly available information about the target vulnerability and construct input samples for the PoC generation task based on the publicly available information.

[0057] In one specific embodiment of the present invention, the public information includes at least vulnerability description information, and optionally includes one or more of the following: patch information, vulnerability-related source code information, and public access entry information.

[0058] S2, input the input sample into the baseline large language model to generate the baseline PoC corresponding to the target vulnerability.

[0059] Baseline large language models specifically refer to large language models that have not undergone reinforcement learning to update their parameters.

[0060] S3 executes the baseline PoC in a dynamic sandbox environment to verify the vulnerability triggering capability, execution path reachability, and output results of the baseline PoC, and obtains dynamic sandbox verification feedback.

[0061] In one specific embodiment of the present invention, the dynamic sandbox verification feedback includes vulnerability triggering status, target execution path arrival status, key constraint satisfaction status, output result matching status, and request records, operation logs, and monitoring information related to the baseline PoC execution process.

[0062] The dynamic sandbox validation feedback is generated by a dynamic sandbox environment configured with execution monitoring, log collection, and constraint feedback components, and a large language model reviewer. The sandbox observes the vulnerability triggering capability, execution path arrival status, key constraint satisfaction, and output results of the PoC. The large language model reviewer performs a structured evaluation of the PoC's request element completeness, attack payload rationality, navigation path consistency, protocol compliance, and correction direction based on the baseline PoC and its execution records, generating a normalized PoC quality score. In this invention, both the baseline PoC generated by the baseline large language model and the PoC sample generated by the large language model after step S8 enhancement are used to calculate the execution score of the corresponding PoC sample using the following formula, which is used to generate the reward function of the dual-model reinforcement learning system.

[0063] In one specific embodiment of the present invention, the execution score calculation formula for the baseline PoC in the dynamic sandbox environment is as follows:

[0064] ,

[0065] In the formula, This indicates the publicly available information about the target vulnerability that has been obtained. The baseline large language model and the enhanced large language model are based on publicly available information. The generated PoC sample, Indicates based on publicly available information Generated PoC samples Execution score, to The weight coefficients are non-negative and satisfy the following conditions: , This indicates whether the vulnerability trigger statement or preset verification phenomenon has been triggered. A value of 1 indicates the vulnerability has been triggered, and a value of 0 indicates it has not. Indicates the percentage of the target execution path reached. This indicates the proportion of key constraints satisfied. This indicates the degree of matching between the output result and the expected verification phenomenon. This represents the normalized Proof-of-Concept (PoC) quality score output by the baseline large language model reviewer.

[0066] S4 decomposes the failed baseline PoC samples into attack vector construction subtasks, navigation path generation subtasks, and PoC assembly subtasks based on the dynamic sandbox verification feedback, and locates the root cause of failure based on the output of each subtask.

[0067] In one specific embodiment of the present invention, the attack vector construction subtask is used to identify vulnerability source points, sink points, vulnerable variables, data flow constraints, control flow constraints, and syntax constraints; the navigation path generation subtask is used to identify file navigation chains, function navigation chains, navigation code, path constraint code, and path constraint variables and values ​​from the public access entry point to the vulnerability triggering location; and the PoC assembly subtask is used to determine request parameters, request methods, request URLs, request headers, request bodies, and triggering order.

[0068] S5 supplements the public information with contextual information for the root cause of the failure to locate the vulnerability. The contextual information includes vulnerability contextual information and navigation contextual information.

[0069] In one specific embodiment of the present invention, supplementing the context information to the public information for the root cause of the location failure involves supplementing the vulnerability context information and navigation context information to the public information at both the file-level and function-level granularity.

[0070] S6 uses adaptive inference to enhance the supplemented contextual information and dynamic sandbox validation feedback, driving the baseline large language model to regenerate or correct PoC samples until samples that successfully utilize the baseline PoC are obtained.

[0071] In one specific embodiment of the present invention, adaptive reasoning enhancement includes guiding the vulnerability PoC generation process through thought chain hints, context learning hints, and real-time feedback hints, driving the baseline large language model to regenerate or correct the vulnerability PoC; wherein, the real-time feedback hints include attack payload verification feedback hints and execution path verification feedback hints.

[0072] In this invention, the dynamic sandbox verification feedback information in step S3 yields successfully exploited baseline PoC samples (capable of successfully triggering the vulnerability) and unexploited baseline PoC samples (unable to trigger the vulnerability). The unexploited baseline PoC samples are then processed through steps S4-S6 to identify the cause of failure and, through adaptive inference enhancement operations, regenerate successfully exploited baseline PoC samples using the baseline large language model; alternatively, the unexploited baseline PoC samples are corrected to obtain successfully exploited samples. Finally, the successfully exploited baseline PoC samples identified in step S3 and the successfully exploited samples generated through steps S4-S6 are input into step S7.

[0073] S7, the dynamic sandbox verification feedback indicates that the successful baseline PoC sample and the regenerated or corrected baseline PoC sample are input into the detection framework to calculate the detection escape score. Based on the detection escape score, PoC samples that meet the preset attack target and PoC samples that do not meet the preset attack target are obtained.

[0074] In one specific embodiment of the present invention, a successfully utilized baseline PoC sample and a successfully utilized baseline PoC sample obtained after regeneration or correction are defined as successfully utilized PoC samples. The detection escape score of the successfully utilized PoC sample is calculated, and the detection escape score is compared with a preset threshold. Samples with a detection escape score higher than the threshold are classified as PoC samples that meet the preset attack target, and samples with a detection escape score lower than the threshold are classified as baseline PoC samples that do not meet the preset attack target.

[0075] In this invention, the escape detection score preset threshold is preset based on the output distribution of the detection framework for non-attack samples, attack samples, and verified PoC samples, combined with the concealment requirements of the target scene and the effectiveness constraints of the PoC function.

[0076] In one specific embodiment of the present invention, the escape detection score is calculated using the following formula:

[0077] ,

[0078] ,

[0079] In the formula, This indicates the sequence number of the detection model or detection engine within the detection framework. This represents the total number of detection models or detection engines. This indicates the publicly available information about the target vulnerability that has been obtained. The baseline large language model is based on publicly available information. The generated PoC sample successfully utilized Indicates based on publicly available information Generated PoC samples that successfully utilized The escape detection score, For the first The non-attack category probability output by a detection model or detection engine. This is the normalized risk score representing the attack category probability or malicious confidence level output by the i-th detection model or detection engine.

[0080] In this invention, although a PoC sample that successfully triggers the vulnerability can be obtained through steps S3-S6, successful exploitation only indicates that the vulnerability can be triggered, but it does not necessarily mean that the PoC sample is of high quality and may still be intercepted by the detection framework. Only when the sample's detection escape score is higher than the threshold, that is, when it meets the preset attack target, does it mean that the PoC sample can deceive the detection framework and has stealth. Therefore, step S7 is needed to calculate the detection escape score of the successfully exploited PoC sample to determine whether the sample can meet the preset attack target.

[0081] S8 uses Proof-of-Concept (PoC) samples that do not meet the preset attack target to drive the near-end policy optimization algorithm to train the dual-model reinforcement learning system, thereby strengthening the baseline large language model and generating PoC samples that meet the preset attack target.

[0082] In one specific embodiment of the present invention, the dual-model reinforcement learning system includes a reference large language model with frozen parameters and a reference large language model with variable parameters. The reference large language model with frozen parameters provides basic behavioral constraints for the baseline large language model, while the reference large language model with variable parameters enhances the ability of the baseline large language model to generate baseline Proof-of-Concept (PoC) samples that meet preset attack targets. The reference large language model with variable parameters is... Figure 1 Trainable models in [the system].

[0083] In one specific embodiment of the present invention, the reward function calculation formula of the dual-model reinforcement learning system is as follows:

[0084] ,

[0085] In the formula, This represents the reward function of a dual-model reinforcement learning system. to The weight coefficients are non-negative and satisfy the following conditions: , KL penalty coefficient, This refers to the generation strategy of a trainable generative model given publicly available input information x. To freeze the generation strategy of the reference large language model under the input public information x, where strategy refers to the ability to generate baseline Proof-of-Concept (PoC) samples that meet the preset attack objectives, Indicates the compliance score of the agreement. The semantic preservation score is represented by D_KL, which is used to measure the trainable generative model. Reference large language model relative to frozen parameters The output strategy offset satisfies:

[0086] .

[0087] Agreement compliance score The result is calculated by the programmatic protocol parser after parsing the request method, target URL, request headers, request body, form fields, file fields, session fields, and token fields in the PoC sample, satisfying the following:

[0088] ,

[0089] in, This indicates whether the request method meets the target entry point requirements. A value of 1 indicates that the request method and the target entry point requirements match, and a value of 0 indicates that they do not match. Indicates the compliance of URL, route, or API format. Indicates the compliance level of the request header fields. Indicates the compliance level of request body, form, or document fields. Indicates the compliance of the session, token, or prior state. to The weight coefficients are non-negative and satisfy the following conditions: ;

[0090] The formula for calculating the semantic preservation score is as follows:

[0091] ,

[0092] In the formula, For steps S3 to S7, utilize the successful PoC. This indicates whether the vulnerability types are consistent; 1 indicates consistency, and 0 indicates inconsistency. This indicates whether the target entry point remains consistent; a value of 1 indicates consistency, and a value of 0 indicates inconsistency. This indicates the semantic consistency of key parameters, key file fields, or key payloads. Indicates the consistency of the order in which actions or requests are triggered. to The weight coefficients are non-negative and satisfy the following conditions: .

[0093] II. Examples

[0094] In one specific embodiment of the present invention, specific vulnerability identifiers are used to further illustrate the above steps:

[0095] In step S1, the publicly available information about the target vulnerability is recorded as a sample. The sample was derived from internal vulnerability announcements, patch difference records, and test environment configuration files. The structured fields are as follows: the vulnerability identifier is "DEMO-UP-2026-01," the vulnerability type is insufficient file upload validation, the disclosed text is "The management-side upload interface only validates the surface file type; attackers can construct special filenames to bypass validation and write test files to an accessible directory," the patch difference field is "Added extension whitelist and content signature dual validation in 'UploadValidator::checkType()'," the affected file fields are " / app / admin / UploadController.php," " / app / service / UploadService.php," and " / app / security / UploadValidator.php," the public entry point field is " / admin / content / import," the runtime environment field is "PHP 8.1 + Nginx 1.24 + MySQL 8.0 + Ubuntu 22.04," and the authorization field is "Limited to internal network testbed 10.10.20.15, test time window 2026-04-01 to 2026-04-30." In the preferred implementation, the navigation starting point " / admin / login", the session dependency field "SESSION_ID", and the expected verification phenomenon "a markup file 'proof_marker.txt' is generated in the isolated directory after uploading" are also recorded.

[0096] To facilitate subsequent processing, the publicly available information is normalized into a unified input representation:

[0097] = {

[0098] vuln_id: "DEMO-UP-2026-01",

[0099] vuln_type: "upload_bypass",

[0100] disclosure_level: "patch+code",

[0101] entry_url: " / admin / content / import",

[0102] login_url: " / admin / login",

[0103] affected_files: [

[0104] " / app / admin / UploadController.php",

[0105] " / app / service / UploadService.php",

[0106] " / app / security / UploadValidator.php"

[0107] ],

[0108] env: {

[0109] php: "8.1",

[0110] nginx: "1.24",

[0111] db: "mysql8.0",

[0112] host: "10.10.20.15"

[0113] },

[0114] expected_artifact: " / sandbox / output / proof_marker.txt",

[0115] auth_scope: "authorized_lab_only"

[0116] }

[0117] In step S2, the baseline large language model is read. And generate the first version of candidate PoC Since this embodiment emphasizes the method flow rather than the specific code used, only the anonymized results related to the protocol structure are retained. This includes one login request and one upload request. The login request uses "POST / admin / login", and the upload request uses "POST / admin / content / import". The request headers include "Content-Type: multipart / form-data" and "User-Agent: PoC-Agent / 0.1". The form fields include "module=content", "action=import", "file=<test file>", and "submit=1". At this point, the field names given by the large language model are still general inferences and do not yet accurately correspond to the actual interface requirements.

[0118] In step S3, the dynamic sandbox... Execution verification is performed. This sandbox consists of a login proxy, an HTTP recorder, a runtime instrumenter, a path tracer, a result judge, and a large language model reviewer. (Targeting...) The raw observation data obtained from the sandbox are as follows: The total number of HTTP requests was 2, with return status codes 200 and 302 respectively, resulting in no target marker file being generated; the theoretical number of nodes in the navigation chain was 6, with 3 actually reached: "LoginController::index", "AdminMiddleware::checkSession", and "UploadController::importAction"; there were 5 key constraints, 2 of which were satisfied, while the unsatisfied constraints included "incorrect real file field name", "missing anti-duplicate token", and "missing the post-upload write branch"; the response results showed an "invalid field name" log. The large language model reviewer provided a structured evaluation based on the PoC text and execution records: Request element completeness score 0.52, attack payload reasonableness score 0.61, navigation path consistency score 0.49, protocol compliance score 0.58, and a comprehensive normalized PoC quality score. The document also provides suggestions for improvement: "Prioritize checking file field names, session persistence fields, and write-back conditions after upload."

[0119] Based on the feedback, the fundamental component of the PoC execution score is extracted: vulnerability trigger flag. Path arrival ratio Key constraints satisfy the proportion Output matching degree Large model quality score If adopted , , , , Then we have:

[0120]

[0121] In step S4, instead of directly concluding with "execution failure," a three-phase failure analysis is initiated. Attack vector construction subtask. Output: Upload field candidates are "uploadFile", "importFile", and "archive"; the file is written to the target directory " / sandbox / output / "; after uploading, the access method is "no direct echo required, only file existence check"; navigation path generation subtask. Output: " / admin / login -> AdminMiddleware::checkSession -> / admin / content / import -> UploadController::importAction -> UploadService::saveTemp -> UploadValidator::checkType"; PoC assembly subtask Output: The request method is correct, but the actual file field name should be "importFile", and the upload request must include a nonce token and the session field "SESSION_ID". Comparison After feedback from the sandbox, it was determined that the primary root cause of the failure was the PoC assembly failure, and the secondary root cause was the incomplete generation of the navigation path. The reason was that although the upload request reached the controller entry point, the assembly field was incorrect, which caused the subsequent save logic not to be executed.

[0122] In step S5, the function-level and file-level contexts are supplemented for the above-mentioned root causes of failure. The function-level context adds the following information: "UploadController::importAction()" requires the form field name to be "importFile"; "NonceMiddleware::validate()" requires the presence of "X-Nonce" in the request header or the form field "nonce"; "UploadService::saveTemp()" only enters the write branch when the session variable "admin_role=editor". The file-level context adds the following information: the routing file " / config / admin_routes.php" records that " / admin / content / import" only accepts logged-in backend sessions; the template file " / templates / admin / import_form.tpl" maps the hidden field name "nonce_token" to the backend parameter "nonce"; the security component " / app / security / UploadValidator.php" records that "text-based test files are allowed in the isolated directory, but must undergo normalized filename processing". To control the context length, the system retains only 9 function fragments directly related to field names, session states, and branch conditions, totaling approximately 218 lines of code semantic summary.

[0123] In step S6, the supplemented context information and dynamic sandbox validation feedback are adaptively inferred to enhance the process, driving the baseline large language model to regenerate or correct PoC samples until samples successfully utilizing the baseline PoC are obtained. For example, the real-time feedback explicitly states: "The previous upload request field 'file' was not mapped to the backend real field 'importFile'; 'nonce' was not provided; the session role does not meet the 'editor' requirement; please keep the target entry unchanged and only correct the protocol fields and trigger order." Under this prompt, the large language model generates a second version of the candidate PoC. .and compared to, The changes include: changing the upload field to "importFile"; extracting "SESSION_ID" from the login response and backfilling it in the second request; adding a "nonce" field; and keeping the target URL and test file semantics unchanged. The model here does not change the vulnerability type, target entry point, or verification target; only the necessary protocol fields are modified.

[0124] Subsequently, the system executes step S3 again. Verification was performed. The sandbox output showed: the total number of HTTP requests remained at 2, with request return status codes of 200 and 200 respectively; the target marker file had been generated in the isolated directory; there were 6 theoretical navigation nodes, 5 were actually reached, and the only unreached node was "the page rendering function after upload"; 4 out of 5 key constraints were met, with the unmet constraint being "the filename extension expression after normalization is not completely consistent with the model prediction"; the output log showed "temp filesaved to isolated path". The large language model reviewer provided... The revised recommendation is "The vulnerability triggering capability is already in place, and the detection and evaluation phase can proceed." This leads to... Calculated according to the aforementioned weights:

[0125]

[0126] In step S7, the vulnerability-triggered verification will be performed. Input black-box detection framework. This framework contains three parallel detection models: a detection model based on message text features. Detection model based on statistical features of request fields And detection models based on sequence behavior features The weights of the three are respectively set as follows: for The attack-related scores output by the three models are as follows: Therefore, the escape detection score is:

[0127]

[0128] In one embodiment of the invention, the preset threshold for detecting the escape score is 0.55. This result indicates... Although it can trigger a vulnerability, it is still relatively easy for detection frameworks to identify. Meanwhile, programmatic protocol parsers... Perform parsing to obtain the request method compliance score. URL compliance Request header compliance Request for compliance Session state compliance .like to If all values ​​are 0.20, then:

[0129]

[0130] The semantic consistency evaluator will Compared with reference PoC Comparison, among which This is a stable version of a large language model with frozen parameters, generated under the same input and verified through sandbox triggering. The comparison result is: consistent vulnerability types. Consistent target entry point Consistency of key fields Triggering action consistency .like to If we take all values ​​as 0.25, then:

[0131]

[0132] In step S8, for Initiate reinforcement learning optimization. The reference large language model with frozen parameters is denoted as... The trainable generative model is denoted as The action space only allows modification of non-critical fields, including header order, boundary string representation, redundant parameter arrangement, comment text, and equivalent encoding form. Changes to " / admin / content / import", "importFile", "nonce", "SESSION_ID", and the semantics of the test file are not permitted. After the first round of PPO optimization, the trained model generates candidate PoCs. The candidate sample still maintains two requests, the same target entry point, and the same verification target, but rearranges the order of non-critical header fields, introduces equivalent boundary representation, removes redundant comments, and changes a non-essential parameter from a plaintext field to an equivalent encoded field.

[0133] Again Perform steps S3 and S7. The sandbox feedback is as follows: Large model scoring Therefore

[0134]

[0135] The protocol parser provides ,therefore

[0136]

[0137] The semantic consistency evaluator provides ,therefore

[0138]

[0139] Detection framework Output ,therefore

[0140]

[0141] In this embodiment, the reward function weights are taken as follows: KL penalty coefficient is taken If for The following is calculated based on the sequence probability ratio:

[0142]

[0143] The total reward is:

[0144]

[0145] In contrast, for those not optimized for adversarial capabilities... If its KL divergence is 0.12, then:

[0146]

[0147] Therefore, Without compromising vulnerability triggering capabilities, protocol compliance, and semantic preservation, the attack-related score output by the detection framework was significantly reduced, resulting in a lower total reward compared to... The improvement is approximately 21.3%. In this embodiment, when the reward improvement for three consecutive rounds of optimization is less than 0.01, or when the escape detection score is higher than 0.60 and the PoC execution score is not lower than 0.90, the system stops reinforcement learning iteration (0.90 is the preset threshold for the execution score).

[0148] In the above description, y1 represents a successful PoC sample, but it may not necessarily meet the preset attack target. If y1 meets the preset attack target (i.e., the detection escape score is higher than 0.55), then observe whether the PoC execution score is not lower than 0.9 (generally, the detection escape score is sufficient if it is higher than the preset threshold; alternatively, the execution score can be calculated for further optimization). When both are met, the process ends; otherwise, optimization continues. If y1 does not meet the preset attack target, optimization is necessary (if three consecutive rounds of optimization fail to meet the preset attack target, and the reward increase is less than 0.01, it indicates that further optimization will not significantly improve the capabilities of the large language model, and the process is terminated).

[0149] In this embodiment, the detection escape score of y1 is 0.138, which does not meet the preset attack target, so optimization is continued to obtain y2. The detection escape score of y2 is 0.51, which still does not meet the preset attack target, so optimization is continued until the detection escape score and execution score meet the preset threshold.

[0150] The final output of this embodiment is The escape detection score was 0.57, and the PoC execution score was 0.91. The optimization stopped because the reward increase was less than 0.01 for three consecutive rounds. Since subsequent calculations were repetitive, they are not included in the text.

[0151] Finally, output the final PoC sample. The verification report is also included. In this embodiment, the optimal sample obtained after the termination round satisfies the following: successful vulnerability triggering, target tag file generation, detection escape score of 0.57, PoC execution score of 0.91, protocol compliance score of 0.95, and semantic preservation score of 0.98. In addition to the PoC text itself, the output results also include the following structured records: input sample number "DEMO-UP-2026-01", three rounds of execution feedback, failure attribution records, context supplementation sources, detection framework score, reward function sub-items, PPO iteration count, and final termination reason. Therefore, this embodiment fully embodies the entire closed-loop process of this invention, from vulnerability public information access, PoC generation, sandbox verification, failure analysis, context enhancement, inference correction, detection evaluation, reinforcement learning optimization to final output.

[0152] Example 3

[0153] This embodiment introduces a vulnerability PoC intelligent adversarial generation system, including the following:

[0154] The information acquisition module is used to acquire publicly available information about the target vulnerability and construct input samples for the PoC generation task based on the publicly available information.

[0155] The baseline sample generation module is used to input the input samples into the baseline large language model and generate the baseline PoC corresponding to the target vulnerability;

[0156] The dynamic verification module is used to execute the baseline PoC in a dynamic sandbox environment to verify the vulnerability triggering capability, execution path reachability, and output results of the baseline PoC, and obtain dynamic sandbox verification feedback.

[0157] The failure analysis module is used to decompose the failed baseline PoC samples, as indicated by the dynamic sandbox verification feedback, into attack vector construction subtasks, navigation path generation subtasks, and PoC assembly subtasks, and to locate the root cause of failure based on the output of each subtask.

[0158] The context information enhancement module is used to supplement the public information with context information for the root cause of the failure to locate the problem, and to perform adaptive inference enhancement with the supplemented context information and dynamic sandbox verification feedback to drive the baseline large language model to regenerate or correct the PoC sample until a sample that successfully exploits the baseline PoC is obtained; the context information includes vulnerability context information and navigation context information.

[0159] The adversarial evaluation module is used to input the successful baseline PoC samples and the successfully generated or corrected baseline PoC samples into the detection framework to calculate the detection escape score. Based on the detection escape score, PoC samples that meet the preset attack target and PoC samples that do not meet the preset attack target are obtained.

[0160] The reinforcement learning module is used to train the dual-model reinforcement learning system by driving the proximal policy optimization algorithm with PoC samples that do not meet the preset attack targets, thereby strengthening the baseline large language model and generating PoC samples that meet the preset attack targets.

[0161] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.

Claims

1. A method for generating intelligent adversarial capabilities for vulnerability Proof-of-Concept (PoC), characterized in that, include: Obtain publicly available information about the target vulnerability and construct input samples for the PoC generation task based on the publicly available information; Input samples are fed into a baseline large language model to generate a baseline Proof-of-Concept (PoC) for the target vulnerability. Execute the baseline PoC in a dynamic sandbox environment to verify the vulnerability triggering capability, execution path reachability, and output results of the baseline PoC, and obtain dynamic sandbox verification feedback; The dynamic sandbox verification feedback shows that the failed baseline PoC samples are decomposed into attack vector construction subtask, navigation path generation subtask and PoC assembly subtask, and the root cause of failure is located based on the output of each subtask. To address the root cause of the failure to locate the vulnerability, contextual information is added to the public information. The added contextual information is then combined with the dynamic sandbox verification feedback for adaptive inference enhancement, driving the baseline large language model to regenerate or correct the PoC sample until a sample that successfully exploits the baseline PoC is obtained. The contextual information includes vulnerability contextual information and navigation contextual information. The dynamic sandbox validation feedback shows that the successful baseline PoC samples and the regenerated or corrected baseline PoC samples are used to input the successful samples into the replaceable black box detection framework to calculate the detection escape score. Based on the detection escape score, PoC samples that meet the preset attack target and PoC samples that do not meet the preset attack target are obtained. The dual-model reinforcement learning system is trained by using Proof-of-Concept (PoC) samples that do not meet the preset attack objectives to drive a proximal policy optimization algorithm, thereby strengthening the baseline large language model and generating PoC samples that meet the preset attack objectives.

2. The intelligent adversarial generation method for vulnerability PoC according to claim 1, characterized in that, The dual-model reinforcement learning system includes a reference large language model with frozen parameters and a reference large language model with variable parameters. The reference large language model with frozen parameters is used to provide basic behavioral constraints for the baseline large language model, while the reference large language model with variable parameters is used to improve the ability of the baseline large language model to generate baseline PoC samples that meet the preset attack targets.

3. The intelligent adversarial generation method for vulnerability PoC according to claim 1, characterized in that, The publicly available information includes at least a vulnerability description.

4. The intelligent adversarial generation method for vulnerability PoC according to claim 1, characterized in that, The attack vector construction subtask is used to identify vulnerability sources, sinks, vulnerable variables, data flow constraints, control flow constraints, and syntax constraints. The navigation path generation subtask is used to identify file navigation chains, function navigation chains, navigation code, path constraint code, and path constraint variables and values ​​from the public access entry point to the vulnerability trigger location. The PoC assembly subtask is used to determine request parameters, request methods, request URLs, request headers, request bodies, and triggering order.

5. The intelligent adversarial generation method for vulnerability PoC according to claim 1, characterized in that, To supplement the public information with contextual information for the root cause of the failure to locate the vulnerability, the vulnerability context information and navigation context information are supplemented to the public information at both the file-level and function-level granularity.

6. The intelligent adversarial generation method for vulnerability PoC according to claim 1, characterized in that, The supplemented contextual information and dynamic sandbox verification feedback are adaptively enhanced through reasoning to regenerate or correct PoC samples. This includes guiding the vulnerability PoC generation process through thought chain hints, context learning hints, and real-time feedback hints, driving the baseline large language model to regenerate or correct vulnerability PoCs. Among these, real-time feedback hints include attack payload verification feedback hints and execution path verification feedback hints.

7. The intelligent adversarial generation method for vulnerability PoC according to claim 1, characterized in that, The execution score for executing a PoC sample in a dynamic sandbox environment is calculated using the following formula: , In the formula, This indicates the publicly available information about the target vulnerability that has been obtained. The baseline large language model and the enhanced large language model are based on publicly available information. The generated PoC sample, Indicates based on publicly available information Generated PoC samples Execution score, to The weight coefficients are non-negative and satisfy the following conditions: , This indicates whether the vulnerability trigger statement or preset verification phenomenon has been triggered. A value of 1 indicates the vulnerability has been triggered, and a value of 0 indicates it has not. Indicates the percentage of the target execution path reached. This indicates the proportion of key constraints satisfied. This indicates the degree of matching between the output result and the expected verification phenomenon. This represents the normalized Proof-of-Concept (PoC) quality score output by the baseline large language model reviewer.

8. The intelligent adversarial generation method for vulnerability PoC according to claim 1, characterized in that, Obtaining baseline PoC samples that meet the preset attack objectives and baseline PoC samples that do not meet the preset attack objectives based on the detection escape score includes: defining successfully utilized baseline PoC samples and successfully utilized samples of regenerated or corrected baseline PoC samples as successfully utilized PoC samples; calculating the detection escape score of the successfully utilized PoC samples; comparing the detection escape score with a preset threshold; classifying samples with detection escape scores higher than the threshold as PoC samples that meet the preset attack objectives; and classifying samples with detection escape scores lower than the threshold as baseline PoC samples that do not meet the preset attack objectives.

9. The intelligent adversarial generation method for vulnerability PoC according to claim 8, characterized in that, The escape detection score is calculated using the following formula: , , In the formula, This indicates the sequence number of the detection model or detection engine within the detection framework. This represents the total number of detection models or detection engines. This indicates the publicly available information about the target vulnerability that has been obtained. The baseline large language model is based on publicly available information. The generated PoC sample successfully utilized Indicates based on publicly available information Generated PoC samples that successfully utilized The escape detection score, For the first The non-attack category probability output by a detection model or detection engine. This is the normalized risk score representing the attack category probability or malicious confidence level output by the i-th detection model or detection engine.

10. A vulnerability PoC intelligent adversarial generation system, characterized in that, The information acquisition module is used to acquire publicly available information about the target vulnerability and construct input samples for the PoC generation task based on the publicly available information. The baseline sample generation module is used to input the input samples into the baseline large language model and generate the baseline PoC corresponding to the target vulnerability; The dynamic verification module is used to execute the baseline PoC in a dynamic sandbox environment to verify the vulnerability triggering capability, execution path reachability, and output results of the baseline PoC, and obtain dynamic sandbox verification feedback. The failure analysis module is used to decompose the failed baseline PoC samples, as indicated by the dynamic sandbox verification feedback, into attack vector construction subtasks, navigation path generation subtasks, and PoC assembly subtasks, and to locate the root cause of failure based on the output of each subtask. The context information enhancement module is used to supplement the public information with context information for the root cause of the failure to locate the problem, and to perform adaptive inference enhancement with the supplemented context information and dynamic sandbox verification feedback to drive the baseline large language model to regenerate or correct the PoC sample until a sample that successfully exploits the baseline PoC is obtained; the context information includes vulnerability context information and navigation context information. The adversarial evaluation module is used to input the successful baseline PoC samples and the successfully generated or corrected baseline PoC samples into the detection framework to calculate the detection escape score. Based on the detection escape score, PoC samples that meet the preset attack target and PoC samples that do not meet the preset attack target are obtained. The reinforcement learning module is used to train the dual-model reinforcement learning system by driving the proximal policy optimization algorithm with PoC samples that do not meet the preset attack targets, thereby strengthening the baseline large language model and generating PoC samples that meet the preset attack targets.