gqlprobe 1.0.0

Fast GraphQL security scanner - schema-aware introspection, injection, DoS, CSRF, auth bypass, SARIF
Documentation
//! Minimal gqlprobe library example.
//!
//! Run: `cargo run --example quick_scan -- https://api.example.com/graphql`

use gqlprobe::Scanner;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let url = std::env::args()
        .nth(1)
        .unwrap_or_else(|| "https://countries.trevorblades.com/graphql".to_string());

    eprintln!("Scanning {url} (authorized targets only)…");
    let scanner = Scanner::new(&url)?;
    let findings = scanner.scan().await?;

    if findings.is_empty() {
        println!("No issues reported.");
    } else {
        for f in &findings {
            println!("[{:?}] {} - {}", f.severity(), f.title(), f.detail());
        }
    }
    Ok(())
}