How bebiksior/go-vhosts works
Main Executable & Entry Point
• Main.go as the entry point of the application where command‐line arguments are parsed and initial configurations are set up.
• This component instantiates the scanning process, incorporating CLI flags (target URL, wordlist, concurrency settings, etc.) from the README’s usage examples.
Core Scanner Package (pkg/scanner)
• Break this package into sub-components to capture its responsibilities:
a. Scanner Core (scanner.go): The heart of the scanning process that coordinates different tasks like iterating through wordlists and managing target requests.
b. Requester (requester.go): Manages HTTP requests to the specified target URL(s) with provisions for handling custom headers, User-Agent, proxy settings, etc.
c. Session Management (session.go): Potentially handles the lifecycle of a scanning session, maintaining state across multiple concurrent scans.
e. Utility Functions (utils.go): Provides helper functions and common utilities required by other modules.
f. Internal Hosts (internal_hosts.go): Likely contains definitions or logic regarding how virtual hosts are managed or discovered.
Architectural Patterns & Design Principles
• The separation of concerns: scanning, HTTP request handling, and output management are clearly divided.
• A modular design approach, where the “pkg/scanner” holds the logic for scanning independent of the CLI handling in main.go.