subscan 1.3.0

A subdomain enumeration tool leveraging diverse techniques, designed for advanced pentesting operations
Documentation
use std::collections::BTreeSet;

use async_trait::async_trait;
use enum_dispatch::enum_dispatch;

use crate::{
    enums::{content::Content, dispatchers::SubdomainExtractorDispatcher},
    extractors::{html::HTMLExtractor, json::JSONExtractor, regex::RegexExtractor},
    types::core::{Result, Subdomain},
};

/// Extractor trait definition to implement subdomain extractors
///
/// All subdomain extractors that implemented in the future must be compatible with this
/// trait. Basically it has single `extract` method like a `main` method. It should
/// extract subdomain addresses and return them from given [`String`] content
#[async_trait]
#[enum_dispatch]
pub trait SubdomainExtractorInterface: Send + Sync {
    /// Generic extract method, it should extract subdomain addresses
    /// from given [`Content`]
    async fn extract(&self, content: Content, domain: &str) -> Result<BTreeSet<Subdomain>>;
}