The invention discloses a PHP application
vulnerability verification sample automatic generation method based on a large
language model and RAG, and the method comprises the following steps: 1, recognizing a frame, configuration and routing of a target application, and generating an entry candidate set; 2, extracting a reachable path from an entrance to a sensitive operation by utilizing
static analysis, and generating a structured path constraint
list; 3, integrating the entry set and the constraint
list into a prompt, retrieving an enhanced fragment from a
knowledge base based on the constraint
list, and driving a large
language model to generate a candidate request sequence; 4, executing the sequence, verifying
vulnerability triggering through a typed rule, and analyzing and confirming that a request is triggered by a legal entry in combination with a
call stack; and 5, when
verification fails, extracting diagnosis information as an increment constraint and feeding back the increment constraint to the generation step for iterative optimization until an effective sample is generated. According to the method, misjudgment is reduced through retrieval enhancement, entry constraint and
call stack proofreading, feedback iterative optimization is utilized, and the
automation efficiency and accuracy of PHP application
vulnerability verification sample generation are improved.