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.
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 ¶
func (d *DOMTechnologyDiscoverer) Discover(ctx context.Context, session schemas.SessionContext) ([]Technology, error)
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.
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.
type ScopeManager ¶
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 ¶
Technology represents a detected web technology. this relates more to fingerprinting than pure discovery, but it lives here for now.