Skip to content

A Rust client for working with Interact.sh servers

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

pyroraptor07/interactsh-rs

Repository files navigation

Interactsh-rs

Documentation Crates.io License Downloads CI Tests

A Rust client library for getting interaction logs from Interactsh servers. See a basic example below; check out the examples or the client module in the API docs for more detailed use.

IMPORTANT NOTE: The 0.4 release will include some changes to the existing public API.

Update: Sorry, this isn't dead. The 0.4 release will take some time, but it will come out eventually.

Basic Use Example

use std::time::Duration;
use std::thread;
use interactsh_rs::prelude::*;

async fn run_client() {
    // Builds an unregistered client
    let client = ClientBuilder::default()
        .with_server("oast.pro".into())
        .parse_logs(true)
        .build()
        .unwrap();

    // Registers the client with the server and
    // returns a registered client
    let client = client.register().await.unwrap();
    let interaction_fqdn = client.get_interaction_fqdn();
    println!("INTERACTION URL: https://{}", interaction_fqdn);

    // Start a poll loop
    loop {
        thread::sleep(Duration::from_secs(5));

        let logs = match client.poll().await.unwrap() {
            Some(logs) => logs,
            None => continue,
        };

        // ...Do something with the returned logs...
    }

    // Once done, deregister the client
    client.deregister().await.unwrap();
}

About

A Rust client for working with Interact.sh servers

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages