store

package
v0.0.0-...-39989bf Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CustomDBPath string

CustomDBPath allows overriding the default database path

Functions

func BatchStoreDomains

func BatchStoreDomains(domains []string, target string) error

BatchStoreDomains stores multiple domains in a single transaction (much faster)

func CleanupOldProbeResults

func CleanupOldProbeResults(daysToKeep int) (int64, error)

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

func ClearScanState(target string) error

ClearScanState clears the scan state for a target

func ClearTargetDomains

func ClearTargetDomains(target string) error

ClearTargetDomains deletes all domains and probe results for a specific target

func Close

func Close()

Close closes the database connection

func GetActivityCount

func GetActivityCount() int

GetActivityCount returns total count of activity items

func GetAllDomainsForExport

func GetAllDomainsForExport(target string) []string

GetAllDomainsForExport returns all domains for export

func GetAllKnownDomains

func GetAllKnownDomains(target string) []string

GetAllKnownDomains returns all known domains for a target

func GetAllTargets

func GetAllTargets() []string

GetAllTargets returns all unique targets

func GetDBPath

func GetDBPath() string

GetDBPath returns the path to the SQLite database

func GetDBStatus

func GetDBStatus() (working bool, err error)

GetDBStatus returns whether the database is working and any error

func GetDatabaseStats

func GetDatabaseStats() (domainCount, probeCount, scanStateCount int, err error)

GetDatabaseStats returns statistics about the database

func GetDomainsWithHistory

func GetDomainsWithHistory(limit, offset int) ([]string, int)

GetDomainsWithHistory returns domains that have multiple probe entries (have been scanned more than once)

func GetKnownDomainsChunk

func GetKnownDomainsChunk(target string, limit, offset int) []string

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

func GetNucleiStats() map[string]int

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

func GetTakeoverStats() map[string]int

GetTakeoverStats returns counts by severity

func InitDB

func InitDB() error

InitDB initializes the SQLite database

func IsNewDomain

func IsNewDomain(domain string) bool

IsNewDomain checks if a domain has been seen before Uses INSERT OR IGNORE for better performance with concurrent access

func IsNewDomainForTarget

func IsNewDomainForTarget(domain, target string) bool

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

func IsURLNucleiScanned(url string) bool

IsURLNucleiScanned checks if a URL has been scanned with nuclei

func MarkURLNucleiScanned

func MarkURLNucleiScanned(url string) error

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

func SaveScanState(target, phase string, domainsProcessed int, lastDomain string) error

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

func StoreTakeoverResult(domain, service, severity, description, cname, evidence string) error

StoreTakeoverResult stores a subdomain takeover finding

func UpdateNucleiStatus

func UpdateNucleiStatus(id int, status string) error

UpdateNucleiStatus updates the status of a nuclei finding

func UpdateTakeoverStatus

func UpdateTakeoverStatus(id int, status string) error

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

type DashboardStats struct {
	TotalDomains int
	TotalHosts   int
	TotalTargets int
	TodayDomains int
}

DashboardStats holds overview statistics

func GetDashboardStats

func GetDashboardStats() DashboardStats

GetDashboardStats returns statistics for the dashboard

type DomainInfo

type DomainInfo struct {
	Domain    string
	Target    string
	Source    string
	CreatedAt time.Time
}

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

func GetHostsPage(target, statusFilter string, limit, offset int) ([]HostInfo, int)

GetHostsPage returns paginated live hosts

func GetRecentHosts

func GetRecentHosts(limit int) []HostInfo

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

type SearchResult struct {
	Domain string
	Target string
}

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

type TargetStat struct {
	Target      string
	DomainCount int
	HostCount   int
}

TargetStat represents target statistics

func GetTargetStats

func GetTargetStats() []TargetStat

GetTargetStats returns statistics for each target

Jump to

Keyboard shortcuts

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