discovery

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

File: internal/discovery/adapter.go

internal/discovery/discover_dom.go

internal/discovery/engine.go

internal/discovery/interfaces.go

internal/discovery/passive.go

internal/discovery/scope.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicScopeManager

type BasicScopeManager struct {
	// contains filtered or unexported fields
}

BasicScopeManager implements the interfaces.ScopeManager interface. this defines the boundaries of the engagement. absolutely critical.

func NewBasicScopeManager

func NewBasicScopeManager(initialURL string, includeSubdomains bool) (*BasicScopeManager, error)

NewBasicScopeManager initializes a scope based on the initial target URL.

func (*BasicScopeManager) GetRootDomain

func (s *BasicScopeManager) GetRootDomain() string

GetRootDomain returns the eTLD+1 defining the scope.

func (*BasicScopeManager) IsInScope

func (s *BasicScopeManager) IsInScope(u *url.URL) bool

IsInScope checks if the URL belongs to the target domain or its subdomains (if configured).

type CrtCache

type CrtCache struct {
	RootDomain string    `json:"rootDomain"`
	Timestamp  time.Time `json:"timestamp"`
	Domains    []string  `json:"domains"`
}

CrtCache defines the structure for storing crt.sh results locally.

type CrtShEntry

type CrtShEntry struct {
	NameValue string `json:"name_value"`
}

CrtShEntry defines the structure for a single JSON entry from the crt.sh API.

type DOMTechnologyDiscoverer

type DOMTechnologyDiscoverer struct{}

DOMTechnologyDiscoverer uses the browser session context to identify technologies.

func NewDOMTechnologyDiscoverer

func NewDOMTechnologyDiscoverer() *DOMTechnologyDiscoverer

NewDOMTechnologyDiscoverer creates a new DOMTechnologyDiscoverer.

func (*DOMTechnologyDiscoverer) Discover

Discover concurrently checks for web technologies on the page for high performance.

type Discoverer

type Discoverer interface {
	Discover(ctx context.Context, session schemas.SessionContext) ([]Technology, error)
}

Discoverer defines the interface for technology discovery modules. we keep this interface generic and decoupled from the underlying browser implementation. It now operates on the canonical SessionContext interface.

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine orchestrates the discovery process (passive and active crawling).

func NewEngine

func NewEngine(
	cfg config.Interface,
	scope ScopeManager,
	kg schemas.KnowledgeGraphClient,
	browser schemas.BrowserInteractor,
	passive *PassiveRunner,
	logger *zap.Logger,
) *Engine

NewEngine creates a new Discovery Engine instance.

func (*Engine) Start

func (e *Engine) Start(ctx context.Context, initialTargets []string) (<-chan schemas.Task, error)

Start kicks off the reconnaissance process. FIX: This method now implements the schemas.DiscoveryEngine interface. It returns a channel that streams discovered tasks and blocks until initial seeding is done.

func (*Engine) Stop

func (e *Engine) Stop()

type HTTPClient

type HTTPClient interface {
	Get(ctx context.Context, url string) (body []byte, statusCode int, err error)
}

HTTPClient defines the interface for making HTTP GET requests. This allows for mocking the HTTP client in tests.

func NewHTTPClientAdapter

func NewHTTPClientAdapter(client *http.Client) HTTPClient

NewHTTPClientAdapter is the public constructor that accepts a standard http.Client. FIX: Changed the parameter type from *network.Client to *http.Client.

type PassiveRunner

type PassiveRunner struct {
	// contains filtered or unexported fields
}

PassiveRunner handles passive discovery techniques. These are designed to be less noisy and yield high value intelligence without directly engaging the target in an aggressive manner.

func NewPassiveRunner

func NewPassiveRunner(cfg config.Interface, client HTTPClient, scope ScopeManager, logger *zap.Logger) *PassiveRunner

NewPassiveRunner creates a new PassiveRunner. The signature is updated to use the local ScopeManager and HTTPClient interfaces.

func (*PassiveRunner) Run

func (p *PassiveRunner) Run(ctx context.Context, initialURL *url.URL) <-chan string

Run executes passive discovery methods and returns a channel of discovered URL strings.

type ScopeManager

type ScopeManager interface {
	IsInScope(u *url.URL) bool
	GetRootDomain() string
}

ScopeManager is an interface that defines the boundaries of the engagement.

type SitemapIndex

type SitemapIndex struct {
	XMLName  xml.Name     `xml:"sitemapindex"`
	Sitemaps []SitemapRef `xml:"sitemap"`
}

-- XML Structures for Sitemap parsing --

type SitemapRef

type SitemapRef struct {
	Loc string `xml:"loc"`
}

type Technology

type Technology struct {
	Name    string
	Version string
}

Technology represents a detected web technology. this relates more to fingerprinting than pure discovery, but it lives here for now.

type URLLoc

type URLLoc struct {
	Loc string `xml:"loc"`
}

type URLSet

type URLSet struct {
	XMLName xml.Name `xml:"urlset"`
	URLs    []URLLoc `xml:"url"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL