Skip to content

arvancloud/libinjection-rs

Folders and files

NameName
Last commit message
Last commit date
May 16, 2022
Oct 24, 2018
Oct 24, 2018
Feb 2, 2020
May 16, 2022
Oct 24, 2018
Oct 24, 2018
Oct 24, 2018
Feb 2, 2020
Oct 27, 2020

Repository files navigation

libinjection-rs

crates.io Documentation Build Status Crates.io

Rust bindings for libinjection.

How to use

  • Add libinjection to dependencies of Cargo.toml:
libinjection = "0.2"
  • Import crate:
extern crate libinjection;

use libinjection::{sqli, xss};

Examples

  • SQLi Detection:
let (is_sqli, fingerprint) = sqli("' OR '1'='1' --").unwrap();
assert!(is_sqli);
assert_eq!("s&sos", fingerprint);

Fingerprints: Please refer to fingerprints.txt.

  • XSS Detection:
let is_xss = xss("<script type='text/javascript'>alert('xss');</script>").unwrap();
assert!(is_xss);