pub struct SecurityPayload {
pub payload: String,
pub category: SecurityCategory,
pub description: String,
pub high_risk: bool,
pub location: PayloadLocation,
pub header_name: Option<String>,
pub group_id: Option<String>,
pub inject_as_path: Option<bool>,
pub form_encoded_body: Option<String>,
}Expand description
A security testing payload
Fields§
§payload: StringThe payload string to inject
category: SecurityCategoryCategory of the payload
description: StringDescription of what this payload tests
high_risk: boolWhether this is considered a high-risk payload
location: PayloadLocationWhere to inject the payload (uri, header, body)
header_name: Option<String>Header name if location is Header (e.g., “User-Agent”, “Cookie”)
group_id: Option<String>Group ID for multi-part payloads that must be sent together in one request (e.g., CRS test cases with URI + headers + body parts)
inject_as_path: Option<bool>When true, URI payload replaces the request path instead of being appended as a query param.
Used for CRS tests where the attack IS the path (e.g., 942101: POST /1234%20OR%201=1).
form_encoded_body: Option<String>Raw form-encoded body string for sending as application/x-www-form-urlencoded.
Used for CRS tests that send form-encoded data (e.g., 942432: var=;;dd foo bar).
Implementations§
Source§impl SecurityPayload
impl SecurityPayload
Sourcepub fn new(
payload: String,
category: SecurityCategory,
description: String,
) -> Self
pub fn new( payload: String, category: SecurityCategory, description: String, ) -> Self
Create a new security payload
Sourcepub fn with_location(self, location: PayloadLocation) -> Self
pub fn with_location(self, location: PayloadLocation) -> Self
Set the injection location
Sourcepub fn with_header_name(self, name: String) -> Self
pub fn with_header_name(self, name: String) -> Self
Set header name for header payloads
Sourcepub fn with_group_id(self, group_id: String) -> Self
pub fn with_group_id(self, group_id: String) -> Self
Set group ID for multi-part payloads that must be sent together
Sourcepub fn with_inject_as_path(self) -> Self
pub fn with_inject_as_path(self) -> Self
Mark this URI payload as path injection (replaces path instead of query param)
Sourcepub fn with_form_encoded_body(self, raw: String) -> Self
pub fn with_form_encoded_body(self, raw: String) -> Self
Set raw form-encoded body for application/x-www-form-urlencoded delivery
Trait Implementations§
Source§impl Clone for SecurityPayload
impl Clone for SecurityPayload
Source§fn clone(&self) -> SecurityPayload
fn clone(&self) -> SecurityPayload
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SecurityPayload
impl Debug for SecurityPayload
Source§impl<'de> Deserialize<'de> for SecurityPayload
impl<'de> Deserialize<'de> for SecurityPayload
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>,
Auto Trait Implementations§
impl Freeze for SecurityPayload
impl RefUnwindSafe for SecurityPayload
impl Send for SecurityPayload
impl Sync for SecurityPayload
impl Unpin for SecurityPayload
impl UnsafeUnpin for SecurityPayload
impl UnwindSafe for SecurityPayload
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more