Struct ZipBomb
pub struct ZipBomb { /* private fields */ }
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§
§impl ZipBomb
impl ZipBomb
pub const fn new_static(filename: &'static str) -> ZipBomb
pub const fn new_static(filename: &'static str) -> ZipBomb
Create a new ZipBomb
with a static filename.
pub fn with_depth(self, depth: usize) -> ZipBomb
pub fn with_depth(self, depth: usize) -> ZipBomb
Overwrite the default depth of the bomb.
Default is used in case the value given is 0.
pub fn set_depth(&mut self, depth: usize) -> &mut ZipBomb
pub fn set_depth(&mut self, depth: usize) -> &mut ZipBomb
Overwrite the default depth of the bomb.
Default is used in case the value given is 0.
pub fn with_fanout(self, fanout: usize) -> ZipBomb
pub fn with_fanout(self, fanout: usize) -> ZipBomb
Overwrite the default fanout of the bomb.
Default is used in case the value given is 0.
pub fn set_fanout(&mut self, fanout: usize) -> &mut ZipBomb
pub fn set_fanout(&mut self, fanout: usize) -> &mut ZipBomb
Overwrite the default fanout of the bomb.
Default is used in case the value given is 0.
pub fn with_file_size(self, file_size: usize) -> ZipBomb
pub fn with_file_size(self, file_size: usize) -> ZipBomb
Overwrite the default file size of the leaf files of the bomb.
Default is used in case the value given is 0.
pub fn set_file_size(&mut self, file_size: usize) -> &mut ZipBomb
pub fn set_file_size(&mut self, file_size: usize) -> &mut ZipBomb
Overwrite the default file size of the leaf files of the bomb.
Default is used in case the value given is 0.
pub fn generate_body(&self) -> Body
pub fn generate_body(&self) -> Body
pub fn generate_response(&self) -> Response<Body>
pub fn generate_response(&self) -> Response<Body>
pub fn into_generate_body(self) -> Body
pub fn into_generate_body(self) -> Body
pub fn into_generate_response(self) -> Response<Body>
pub fn into_generate_response(self) -> Response<Body>
Trait Implementations§
§impl IntoResponse for ZipBomb
impl IntoResponse for ZipBomb
§fn into_response(self) -> Response<Body>
fn into_response(self) -> Response<Body>
Auto Trait Implementations§
impl Freeze for ZipBomb
impl RefUnwindSafe for ZipBomb
impl Send for ZipBomb
impl Sync for ZipBomb
impl Unpin for ZipBomb
impl UnwindSafe for ZipBomb
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§impl<B> BodyExtractExt for B
impl<B> BodyExtractExt for B
§async fn try_into_json<T>(self) -> Result<T, OpaqueError>where
T: DeserializeOwned + Send + 'static,
async fn try_into_json<T>(self) -> Result<T, OpaqueError>where
T: DeserializeOwned + Send + 'static,
§async fn try_into_string(self) -> Result<String, OpaqueError>
async fn try_into_string(self) -> Result<String, OpaqueError>
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,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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§impl<R> IntoEndpointService<()> for R
impl<R> IntoEndpointService<()> for R
§fn into_endpoint_service(
self,
) -> impl Service<Request<Body>, Response = Response<Body>, Error = Infallible>
fn into_endpoint_service( self, ) -> impl Service<Request<Body>, Response = Response<Body>, Error = Infallible>
rama_core::Service
.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy
that returns Action::Follow
only if self
and other
return
Action::Follow
. Read more