Crate libinjectionrs

Crate libinjectionrs 

Source
Expand description

§API Guide

§For End Users

Most applications should use the high-level detection functions:

These functions handle all the complexity of testing multiple contexts and SQL dialects automatically, returning simple results.

§For Advanced Users and Debugging

For debugging, performance analysis, or advanced customization, you can access the lower-level APIs:

  • SqliState - Direct access to SQL parsing state and tokenization
  • XssDetector - Direct XSS detection with context control
  • Fingerprint - SQL injection fingerprint analysis

These APIs expose the internal parsing state, tokens, and folding mechanisms that power the detection logic. They are primarily intended for:

  • Debugging: Understanding why certain inputs are flagged
  • Performance: Avoiding repeated parsing for multiple checks
  • Research: Analyzing the tokenization and folding process
  • Testing: Validating behavior against the C reference implementation

Most applications should not use these lower-level APIs unless they have specific requirements that the high-level functions cannot meet.

Re-exports§

pub use sqli::SqliState;
pub use sqli::SqliFlags;
pub use sqli::Fingerprint;
pub use xss::XssDetector;
pub use xss::XssResult;

Modules§

sqli
xss

Structs§

DetectionResult
Result of an injection detection operation.
ParseError

Enums§

Error
InjectionType
The type of injection detected by libinjection.

Functions§

detect_sqli
Detects SQL injection in the given input using default flags.
detect_sqli_with_flags
Detects SQL injection in the given input with specific parsing flags.
detect_xss
Detects Cross-Site Scripting (XSS) in the given input.
version
Returns the version of the libinjection library.