How alexogden/reccedns works
Project Overview:
RecceDNS is a DNS enumeration and OSINT tool written in Rust designed to perform various DNS queries for discovering subdomains, IP addresses, and multiple DNS records. It also provides capabilities like DNSSEC checks, NXDOMAIN hijacking detection, and supports brute forcing subdomains using wordlists. The project is structured into modular components that deal with DNS logic, I/O operations (including CLI handling, JSON output, logging, etc.), networking, various operational modes for different enumeration tasks, and timing functionalities.
DNS Module
• Location: src/dns directory.
• Responsibilities: Handling DNS-specific logic such as protocol formatting, error handling, building custom/stub resolvers, query formatting, and resolver selection.
• Files to note: error.rs, format.rs, protocol.rs, resolver.rs, resolver_selector.rs.
I/O Module
• Location: src/io directory.
• Responsibilities: Manage CLI operations, interruptions, JSON output formatting, packet buffering, logging, and input validations.
• Files to note: cli.rs, interrupt.rs, json.rs, logger.rs, packet_buffer.rs, validation.rs, wordlist.rs.
Modes Module
• Location: src/modes directory.
• Responsibilities: Defines different enumeration and search strategies – such as basic enumeration, subdomain brute force, reverse IP search, certificate search, and TLD expansion.
• Files to note: basic_enumerator.rs, cert_search.rs, reverse_ip.rs, subdomain_enumerator.rs, tld_expander.rs.
• Representation: Show this as distinct “modes” that interface with both the DNS module and I/O module to execute specialized tasks. They are essentially the controllers that orchestrate the workflow based on user-selected modes.
Networking Module
• Location: src/network directory.
• Responsibilities: Abstraction of network checks and types, ensuring that DNS queries use either UDP or TCP appropriately, and perform network validations before starting querying.
Timing Module
• Location: src/timing directory.
• Responsibilities: Handle delays between queries, timing statistics, and perhaps throttling query rates to avoid overwhelming DNS servers.
• Files to note: delay.rs, stats.rs.
• Representation: Represent this as an ancillary module that interacts with the modes to enforce query delays and collect performance stats.
Main Application Entry Point
• Location: src/main.rs.
• Responsibilities: This is where the application is initialized, configurations are parsed (for example, via command-line arguments), and the appropriate mode is selected based on user input.
• Representation: Central “orchestration” element linking user calls to the proper modules (modes, DNS, I/O, network, and timing).
Interconnections and Data Flows:
• From the CLI input (I/O module), the main entry point parses arguments to determine which operational mode to run.
• The Modes module then uses the DNS module to perform DNS queries, guided by configuration options (such as protocol type - UDP/TCP, resolver selection).
• The Network module validates the DNS resolvers and connectivity before any queries are initiated.
• The Timing module enforces delays based on user configuration and collects query performance metrics.
Architectural Patterns and Design Principles:
• Modular Design: Each module (DNS, I/O, Modes, Network, Timing) handles a specific area of functionality ensuring separation of concerns.
• Command Pattern: The Modes module can be seen as a version of command pattern – each mode executes a specific command or set of instructions based on user argument.
• Asynchronous/Concurrent Processing: The use of threads for subdomain enumeration indicates parallel processing to speed up DNS queries.
• Configuration Driven: Command-line arguments deeply influence the flow (e.g., protocol selection, delay settings, multiple resolvers).
Technology Landscape:
• Rust programming language, Cargo as the build system and dependency manager.
• GitHub workflows (CI/CD configurations) signifying that testing, linting, and dependency auditing are integrated.
a. Start by mapping out the high-level components: Main Application, DNS Module, I/O Module, Modes, Network Utility, and Timing Module.
b. Use clear labels for each component (e.g., “DNS Resolver”, “CLI & Logging”, “Mode Selector”).
• Data flow from CLI (I/O) to Main to Modes.
• Interactions where each mode calls into the DNS functionalities.
• Network module’s involvement before queries are issued.
• Timing module’s role in delaying or scheduling queries.
Additional Specific Instructions:
• For full-stack or modular command-line tool such as RecceDNS, ensure that the separation between the user interaction layer (CLI, logging) and the operational logic (DNS resolution, enumeration modes) is clearly depicted.
• How the resolver selection logic (sequential or random from multiple resolvers) is managed within the DNS module.
• External inputs such as wordlists, command-line arguments, and JSON outputs for logging/exporting results.