Documentation
¶
Index ¶
- Variables
- func BatchStoreDomains(domains []string, target string) error
- func CleanupOldProbeResults(daysToKeep int) (int64, error)
- func ClearAllDomains() error
- func ClearAllScanState() error
- func ClearScanState(target string) error
- func ClearTargetDomains(target string) error
- func Close()
- func GetActivityCount() int
- func GetAllDomainsForExport(target string) []string
- func GetAllKnownDomains(target string) []string
- func GetAllTargets() []string
- func GetDBPath() string
- func GetDBStatus() (working bool, err error)
- func GetDatabaseStats() (domainCount, probeCount, scanStateCount int, err error)
- func GetDomainsWithHistory(limit, offset int) ([]string, int)
- func GetKnownDomainsChunk(target string, limit, offset int) []string
- func GetLastProbeResult(domain string) (statusCode int, contentLength int64, title string, found bool)
- func GetNucleiScannedURLs() []string
- func GetNucleiStats() map[string]int
- func GetScanState(target string) (phase string, domainsProcessed int, lastDomain string, found bool)
- func GetTakeoverStats() map[string]int
- func InitDB() error
- func IsNewDomain(domain string) bool
- func IsNewDomainForTarget(domain, target string) bool
- func IsURLNucleiScanned(url string) bool
- func MarkURLNucleiScanned(url string) error
- func ResetDBState()
- func SaveScanState(target, phase string, domainsProcessed int, lastDomain string) error
- func StoreNucleiResult(...) error
- func StoreProbeResult(domain, url string, statusCode int, contentLength int64, ...) error
- func StoreTakeoverResult(domain, service, severity, description, cname, evidence string) error
- func UpdateNucleiStatus(id int, status string) error
- func UpdateTakeoverStatus(id int, status string) error
- type ActivityItem
- type ChangeEntry
- type DashboardStats
- type DomainInfo
- type ExportHost
- type HostInfo
- type NucleiResult
- type ProbeHistoryEntry
- type SearchResult
- type TakeoverResult
- type TargetStat
Constants ¶
This section is empty.
Variables ¶
var CustomDBPath string
CustomDBPath allows overriding the default database path
Functions ¶
func BatchStoreDomains ¶
BatchStoreDomains stores multiple domains in a single transaction (much faster)
func CleanupOldProbeResults ¶
CleanupOldProbeResults removes probe results older than the specified number of days Keeps the most recent probe for each domain for change detection
func ClearAllDomains ¶
func ClearAllDomains() error
ClearAllDomains deletes all domains and related probe results from the database
func ClearAllScanState ¶
func ClearAllScanState() error
ClearScanState clears all scan state records
func ClearScanState ¶
ClearScanState clears the scan state for a target
func ClearTargetDomains ¶
ClearTargetDomains deletes all domains and probe results for a specific target
func GetActivityCount ¶
func GetActivityCount() int
GetActivityCount returns total count of activity items
func GetAllDomainsForExport ¶
GetAllDomainsForExport returns all domains for export
func GetAllKnownDomains ¶
GetAllKnownDomains returns all known domains for a target
func GetDBStatus ¶
GetDBStatus returns whether the database is working and any error
func GetDatabaseStats ¶
GetDatabaseStats returns statistics about the database
func GetDomainsWithHistory ¶
GetDomainsWithHistory returns domains that have multiple probe entries (have been scanned more than once)
func GetKnownDomainsChunk ¶
GetKnownDomainsChunk returns a chunk of known domains for a target (for pagination)
func GetLastProbeResult ¶
func GetLastProbeResult(domain string) (statusCode int, contentLength int64, title string, found bool)
GetLastProbeResult retrieves the most recent probe result for a domain
func GetNucleiScannedURLs ¶
func GetNucleiScannedURLs() []string
GetNucleiScannedURLs returns all URLs that have been nuclei-scanned
func GetNucleiStats ¶
GetNucleiStats returns counts by severity
func GetScanState ¶
func GetScanState(target string) (phase string, domainsProcessed int, lastDomain string, found bool)
GetScanState retrieves the saved scan state for a target
func GetTakeoverStats ¶
GetTakeoverStats returns counts by severity
func IsNewDomain ¶
IsNewDomain checks if a domain has been seen before Uses INSERT OR IGNORE for better performance with concurrent access
func IsNewDomainForTarget ¶
IsNewDomainForTarget checks if a domain has been seen before and associates it with a target Uses INSERT OR IGNORE to avoid TOCTOU race conditions
func IsURLNucleiScanned ¶
IsURLNucleiScanned checks if a URL has been scanned with nuclei
func MarkURLNucleiScanned ¶
MarkURLNucleiScanned marks a URL as scanned
func ResetDBState ¶
func ResetDBState()
ResetDBState resets the database state for testing purposes This allows tests to reinitialize the database with a fresh connection
func SaveScanState ¶
SaveScanState saves the current scan progress
func StoreNucleiResult ¶
func StoreNucleiResult(domain, url, templateID, templateName, severity, matchedAt, extractedResults, description, reference string) error
StoreNucleiResult stores a nuclei finding
func StoreProbeResult ¶
func StoreProbeResult(domain, url string, statusCode int, contentLength int64, title, server, technologies string, responseTimeMs int64, probeError string) error
StoreProbeResult stores a probe result in the database Uses prepared statement pattern for better performance
func StoreTakeoverResult ¶
StoreTakeoverResult stores a subdomain takeover finding
func UpdateNucleiStatus ¶
UpdateNucleiStatus updates the status of a nuclei finding
func UpdateTakeoverStatus ¶
UpdateTakeoverStatus updates the status of a takeover finding
Types ¶
type ActivityItem ¶
type ActivityItem struct {
Type string `json:"type"`
Domain string `json:"domain"`
URL string `json:"url,omitempty"`
Target string `json:"target"`
StatusCode int `json:"status_code,omitempty"`
IsNew bool `json:"is_new"`
Timestamp time.Time `json:"timestamp"`
}
ActivityItem represents an activity feed item
func GetActivityFeed ¶
func GetActivityFeed(limit, offset int) []ActivityItem
GetActivityFeed returns a combined activity feed of domains and hosts
type ChangeEntry ¶
type ChangeEntry struct {
Domain string `json:"domain"`
URL string `json:"url"`
Target string `json:"target"`
ChangeType string `json:"change_type"` // "status", "content", "title", "new"
Severity string `json:"severity"` // "critical", "high", "medium", "low"
OldValue string `json:"old_value"`
NewValue string `json:"new_value"`
Description string `json:"description"`
Timestamp time.Time `json:"timestamp"`
}
ChangeEntry represents a detected change between probes
func GetRecentChangesFiltered ¶
func GetRecentChangesFiltered(target string, limit int) []ChangeEntry
GetRecentChangesFiltered returns recent changes with optional target filter
type DashboardStats ¶
DashboardStats holds overview statistics
func GetDashboardStats ¶
func GetDashboardStats() DashboardStats
GetDashboardStats returns statistics for the dashboard
type DomainInfo ¶
DomainInfo represents a domain for the web UI
func GetDomainsPage ¶
func GetDomainsPage(target string, limit, offset int) ([]DomainInfo, int)
GetDomainsPage returns paginated domains
func GetRecentDomains ¶
func GetRecentDomains(limit int) []DomainInfo
GetRecentDomains returns recently discovered domains
type ExportHost ¶
type ExportHost struct {
URL string `json:"url"`
StatusCode int `json:"status_code"`
ContentLength int `json:"content_length"`
Title string `json:"title"`
Target string `json:"target"`
Timestamp string `json:"timestamp"`
}
ExportHost represents a host for JSON export
func GetAllHostsForExport ¶
func GetAllHostsForExport(target string) []ExportHost
GetAllHostsForExport returns all hosts for JSON export
type HostInfo ¶
type HostInfo struct {
URL string
StatusCode int
ContentLength int
Title string
Target string
Timestamp time.Time
}
HostInfo represents a live host for the web UI
func GetHostsPage ¶
GetHostsPage returns paginated live hosts
func GetRecentHosts ¶
GetRecentHosts returns recently found live hosts
type NucleiResult ¶
type NucleiResult struct {
ID int `json:"id"`
Domain string `json:"domain"`
URL string `json:"url"`
TemplateID string `json:"template_id"`
TemplateName string `json:"template_name"`
Severity string `json:"severity"`
MatchedAt string `json:"matched_at"`
ExtractedResults string `json:"extracted_results"`
Description string `json:"description"`
Reference string `json:"reference"`
Status string `json:"status"`
Timestamp time.Time `json:"timestamp"`
}
NucleiResult represents a nuclei vulnerability finding
func GetNucleiResults ¶
func GetNucleiResults(status string, limit int) []NucleiResult
GetNucleiResults returns nuclei findings with optional status filter
type ProbeHistoryEntry ¶
type ProbeHistoryEntry struct {
URL string `json:"url"`
StatusCode int `json:"status_code"`
ContentLength int64 `json:"content_length"`
Title string `json:"title"`
Server string `json:"server"`
Technologies string `json:"technologies"`
ResponseTime int64 `json:"response_time_ms"`
Error string `json:"error"`
Timestamp time.Time `json:"timestamp"`
}
ProbeHistoryEntry represents a single probe result in history
func GetProbeHistory ¶
func GetProbeHistory(domain string, limit int) []ProbeHistoryEntry
GetProbeHistory returns the probe history for a specific domain
type SearchResult ¶
SearchResult represents a search result
func SearchDomains ¶
func SearchDomains(query string, limit int) []SearchResult
SearchDomains searches for domains matching a query
type TakeoverResult ¶
type TakeoverResult struct {
ID int `json:"id"`
Domain string `json:"domain"`
Service string `json:"service"`
Severity string `json:"severity"`
Description string `json:"description"`
CNAME string `json:"cname"`
Evidence string `json:"evidence"`
Status string `json:"status"` // open, confirmed, false_positive, fixed
Timestamp time.Time `json:"timestamp"`
}
TakeoverResult represents a subdomain takeover finding
func GetTakeoverResults ¶
func GetTakeoverResults(status string, limit int) []TakeoverResult
GetTakeoverResults returns all takeover findings
type TargetStat ¶
TargetStat represents target statistics
func GetTargetStats ¶
func GetTargetStats() []TargetStat
GetTargetStats returns statistics for each target