Crates.io | ioc_extract |
lib.rs | ioc_extract |
version | 0.4.8 |
source | src |
created_at | 2022-01-23 10:34:57.035224 |
updated_at | 2024-10-31 16:11:18.13403 |
description | Extract indicators like urls,domains,ip,emails,etc... from a given string |
homepage | https://github.com/marirs/ioc_extract-rs |
repository | https://github.com/marirs/ioc_extract-rs |
max_upload_size | |
id | 519595 |
size | 92,759 |
Extract indicators like urls,domains,ip,emails,etc... from a given string or a Text file.
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);
}
$ 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