pub struct AstMctsAlgorithm { /* private fields */ }Expand description
A SearchAlgorithm that uses AST-MCTS over SQL/XSS payload fragments.
On each request_evaluations call, the algorithm:
- Picks the current best payload (from the seed or last bypass).
- Runs
mcts_searchwith an inline oracle to enumerate candidate rewrites. - Wraps each rewrite as a
Chromosomewith anast_mcts_payloadgene. - Returns up to
ncandidates for external oracle verification.
submit_evaluations updates the best-known payload whenever a bypass
(passed == true) is received.
Implementations§
Source§impl AstMctsAlgorithm
impl AstMctsAlgorithm
Sourcepub fn with_config(mcts_budget: u64, ucb1_c: f64) -> Self
pub fn with_config(mcts_budget: u64, ucb1_c: f64) -> Self
Create with explicit MCTS budget and UCB1 constant.
mcts_budget: oracle queries spent per round inside MCTS.ucb1_c: exploration constant;sqrt(2)is the AdvSQLi default.
Trait Implementations§
Source§impl Clone for AstMctsAlgorithm
impl Clone for AstMctsAlgorithm
Source§fn clone(&self) -> AstMctsAlgorithm
fn clone(&self) -> AstMctsAlgorithm
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AstMctsAlgorithm
impl Debug for AstMctsAlgorithm
Source§impl Default for AstMctsAlgorithm
impl Default for AstMctsAlgorithm
Source§impl<'de> Deserialize<'de> for AstMctsAlgorithm
impl<'de> Deserialize<'de> for AstMctsAlgorithm
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl SearchAlgorithm for AstMctsAlgorithm
impl SearchAlgorithm for AstMctsAlgorithm
Source§fn initialize(
&mut self,
population: Vec<Chromosome>,
gene_pool: &GenePool,
_rng: &mut StdRng,
)
fn initialize( &mut self, population: Vec<Chromosome>, gene_pool: &GenePool, _rng: &mut StdRng, )
Initialize the algorithm with a seed population.
Source§fn request_evaluations(
&mut self,
n: usize,
rng: &mut StdRng,
) -> Vec<EvalCandidate>
fn request_evaluations( &mut self, n: usize, rng: &mut StdRng, ) -> Vec<EvalCandidate>
Request up to
n candidates for parallel evaluation. Read moreSource§fn submit_evaluations(&mut self, results: Vec<(u64, OracleVerdict)>)
fn submit_evaluations(&mut self, results: Vec<(u64, OracleVerdict)>)
Submit evaluation results. Read more
Source§fn should_terminate(&self, stats: &SearchStats, budget: &Budget) -> bool
fn should_terminate(&self, stats: &SearchStats, budget: &Budget) -> bool
Check whether the algorithm thinks search should stop.
Source§fn best(&self) -> Option<&Chromosome>
fn best(&self) -> Option<&Chromosome>
Get the best chromosome found so far.
Source§fn checkpoint(&self) -> Result<Vec<u8>, EvolutionError>
fn checkpoint(&self) -> Result<Vec<u8>, EvolutionError>
Serialize internal state to bytes.
Source§fn restore(&mut self, bytes: &[u8]) -> Result<(), EvolutionError>
fn restore(&mut self, bytes: &[u8]) -> Result<(), EvolutionError>
Restore internal state from bytes.
Source§fn clone_box(&self) -> Box<dyn SearchAlgorithm>
fn clone_box(&self) -> Box<dyn SearchAlgorithm>
Deep-clone this algorithm into a fresh trait object. Read more
Source§fn population_snapshot(&self) -> Vec<Chromosome>
fn population_snapshot(&self) -> Vec<Chromosome>
Snapshot the algorithm’s current “live” chromosomes — the set
the engine is actively searching from. Read more
Auto Trait Implementations§
impl Freeze for AstMctsAlgorithm
impl RefUnwindSafe for AstMctsAlgorithm
impl Send for AstMctsAlgorithm
impl Sync for AstMctsAlgorithm
impl Unpin for AstMctsAlgorithm
impl UnsafeUnpin for AstMctsAlgorithm
impl UnwindSafe for AstMctsAlgorithm
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more