#indicator #url #ioc #domains

ioc_extract

Extract indicators like urls,domains,ip,emails,etc... from a given string

19 releases

new 0.4.8 Oct 31, 2024
0.4.6 Jun 5, 2024
0.4.3 Mar 23, 2022

#50 in Email

Download history 5/week @ 2024-07-04 145/week @ 2024-07-25 21/week @ 2024-08-01 9/week @ 2024-09-19 4/week @ 2024-09-26 4/week @ 2024-10-03 57/week @ 2024-10-10 11/week @ 2024-10-17

78 downloads per month

Custom license

46KB
1K SLoC

IOC Extract

Linux x86_64 Linux Arm7 macOS Windows GitHub license

Extract indicators like urls,domains,ip,emails,etc... from a given string or a Text file.

Requirements

  • Rust 1.56+ (edition 2021)

Example

use ioc_extract::Artifacts;

fn main() {
    let x = "there are ips in this test\nexample.ini\n192.168.21.21 and ::ffff:127.0.0.1\nthe cidrs are:\n2001:0DB8:1234::/48 and \n10.0.0.0/8\n\n";
    let x = x.to_owned() + "check out https://www.google.com or www.google.com";
    let ioc = Artifacts::from_str(&x);
    println!("IOC's:\n{:#?}", ioc);
}

Running the Example

$ cargo r --example xtract
     Running `target/debug/examples/xtract`
IOC's:
Some(
    Indicators {
        urls: Some(
            [
                "https://www.google.com",
            ],
        ),
        domains: Some(
            [
                "www.google.com",
            ],
        ),
        emails: None,
        ip_address: Some(
            [
                "10.0.0.0/8",
                "192.168.21.21",
                "2001:0DB8:1234::/48",
                "::ffff:127.0.0.1",
            ],
        ),
        crypto: None,
        registry: None,
    },
)

LICENSE: MIT

Dependencies

~11–26MB
~428K SLoC