pub struct ZipBomb { /* private fields */ }compression only.Expand description
A minimal in-memory ZIP archive that acts as a decompression or resource exhaustion trap.
ZipBomb produces a small, valid ZIP archive that declares
an extremely large uncompressed file,
with no actual payload. When extracted, it causes naive clients or
bots to attempt writing or allocating gigabytes of disk or memory,
despite its tiny compressed size.
This is useful for:
- Honeypots
- Anti-bot traps
- Defensive deception systems
Implementations§
Source§impl ZipBomb
impl ZipBomb
Sourcepub fn with_depth(self, depth: usize) -> Self
pub fn with_depth(self, depth: usize) -> Self
Overwrite the default depth of the bomb.
Default is used in case the value given is 0.
Sourcepub fn set_depth(&mut self, depth: usize) -> &mut Self
pub fn set_depth(&mut self, depth: usize) -> &mut Self
Overwrite the default depth of the bomb.
Default is used in case the value given is 0.
Sourcepub fn with_fanout(self, fanout: usize) -> Self
pub fn with_fanout(self, fanout: usize) -> Self
Overwrite the default fanout of the bomb.
Default is used in case the value given is 0.
Sourcepub fn set_fanout(&mut self, fanout: usize) -> &mut Self
pub fn set_fanout(&mut self, fanout: usize) -> &mut Self
Overwrite the default fanout of the bomb.
Default is used in case the value given is 0.
Sourcepub fn with_file_size(self, file_size: usize) -> Self
pub fn with_file_size(self, file_size: usize) -> Self
Overwrite the default file size of the leaf files of the bomb.
Default is used in case the value given is 0.
Sourcepub fn set_file_size(&mut self, file_size: usize) -> &mut Self
pub fn set_file_size(&mut self, file_size: usize) -> &mut Self
Overwrite the default file size of the leaf files of the bomb.
Default is used in case the value given is 0.
Sourcepub fn generate_body(&self) -> Body
pub fn generate_body(&self) -> Body
Sourcepub fn generate_response(&self) -> Response
pub fn generate_response(&self) -> Response
Sourcepub fn into_generate_body(self) -> Body
pub fn into_generate_body(self) -> Body
Sourcepub fn into_generate_response(self) -> Response
pub fn into_generate_response(self) -> Response
Trait Implementations§
Source§impl IntoResponse for ZipBomb
impl IntoResponse for ZipBomb
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Auto Trait Implementations§
impl Freeze for ZipBomb
impl RefUnwindSafe for ZipBomb
impl Send for ZipBomb
impl Sync for ZipBomb
impl Unpin for ZipBomb
impl UnsafeUnpin for ZipBomb
impl UnwindSafe for ZipBomb
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<B> BodyExtractExt for B
impl<B> BodyExtractExt for B
Source§async fn try_into_json<T>(self) -> Result<T, Box<dyn Error + Sync + Send>>where
T: DeserializeOwned + Send + 'static,
async fn try_into_json<T>(self) -> Result<T, Box<dyn Error + Sync + Send>>where
T: DeserializeOwned + Send + 'static,
Source§async fn try_into_json_streaming<T>(
self,
) -> Result<T, Box<dyn Error + Sync + Send>>where
T: DeserializeOwned + Send + 'static,
async fn try_into_json_streaming<T>(
self,
) -> Result<T, Box<dyn Error + Sync + Send>>where
T: DeserializeOwned + Send + 'static,
Source§async fn try_into_string(self) -> Result<String, Box<dyn Error + Sync + Send>>
async fn try_into_string(self) -> Result<String, Box<dyn Error + Sync + Send>>
Source§async fn try_capture_json(
self,
selectors: impl IntoIterator<Item = JsonPath> + Send,
max_capture_bytes: usize,
) -> Result<Vec<OwnedCapturedValue>, Box<dyn Error + Sync + Send>>
async fn try_capture_json( self, selectors: impl IntoIterator<Item = JsonPath> + Send, max_capture_bytes: usize, ) -> Result<Vec<OwnedCapturedValue>, Box<dyn Error + Sync + Send>>
selectors while streaming over the body. Read moreSource§async fn try_into_json_with<T>(
self,
opts: CollectOptions,
) -> Result<T, CollectError>where
T: DeserializeOwned + Send + 'static,
async fn try_into_json_with<T>(
self,
opts: CollectOptions,
) -> Result<T, CollectError>where
T: DeserializeOwned + Send + 'static,
Source§async fn try_into_string_with(
self,
opts: CollectOptions,
) -> Result<String, CollectError>
async fn try_into_string_with( self, opts: CollectOptions, ) -> Result<String, CollectError>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moreSource§impl<O> IntoEndpointService<Response> for O
impl<O> IntoEndpointService<Response> for O
type Service = StaticOutput<O>
Source§fn into_endpoint_service(self) -> <O as IntoEndpointService<Response>>::Service
fn into_endpoint_service(self) -> <O as IntoEndpointService<Response>>::Service
rama_core::Service.Source§impl<O, State> IntoEndpointServiceWithState<Response, State> for O
impl<O, State> IntoEndpointServiceWithState<Response, State> for O
type Service = StaticOutput<O>
Source§fn into_endpoint_service_with_state(
self,
_state: State,
) -> <O as IntoEndpointServiceWithState<Response, State>>::Service
fn into_endpoint_service_with_state( self, _state: State, ) -> <O as IntoEndpointServiceWithState<Response, State>>::Service
rama_core::Service with state.