#indicator #url #domains #ioc

ioc_extract

从给定字符串中提取像URL、域名、IP、电子邮件等指标

17个版本

0.4.6 2024年6月5日
0.4.5 2024年5月16日
0.4.3 2022年3月23日
0.4.2 2022年2月5日
0.1.6 2022年1月27日

#45 in 电子邮件

Download history 1/week @ 2024-04-19 2/week @ 2024-05-03 195/week @ 2024-05-10 89/week @ 2024-05-17 7/week @ 2024-05-24 130/week @ 2024-05-31 26/week @ 2024-06-07 3/week @ 2024-06-14 5/week @ 2024-07-05 151/week @ 2024-07-26 15/week @ 2024-08-02

每月166次下载

自定义许可

45KB
1K SLoC

IOC Extract

Linux x86_64 Linux Arm7 macOS Windows GitHub license

从给定字符串或文本文件中提取指标,如URL、域名、IP、电子邮件等。

需求

  • Rust 1.56+ (版本2021)

示例

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,
    },
)

许可证:MIT

依赖关系

~8–24MB
~388K SLoC