analyzer

package
v0.0.0-...-6d09be2 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnalyzeDomain

func AnalyzeDomain(domain string, timeout time.Duration, profile string) *models.AnalysisResult

AnalyzeDomain performs a complete analysis of a domain

func OutputCSV

func OutputCSV(r *models.AnalysisResult)

OutputCSV outputs the result in CSV format

func OutputJSON

func OutputJSON(r *models.AnalysisResult)

OutputJSON outputs the result in JSON format

func OutputTable

func OutputTable(r *models.AnalysisResult)

OutputTable outputs the result in a formatted table

func ParseTimeRange

func ParseTimeRange(timeStr string) (time.Time, time.Time, error)

ParseTimeRange parses a time range string (e.g., "30d", "7d", "1h")

func SaveToDB

func SaveToDB(r *models.AnalysisResult)

SaveToDB saves the result to local database

Types

type BehavioralAnalyzer

type BehavioralAnalyzer struct {
	GamblingKeywords []string
	PaymentKeywords  []string
	RegexPatterns    map[string]*regexp.Regexp
}

BehavioralAnalyzer performs behavioral and semantic analysis

func NewBehavioralAnalyzer

func NewBehavioralAnalyzer() *BehavioralAnalyzer

NewBehavioralAnalyzer creates a new instance of BehavioralAnalyzer

func (*BehavioralAnalyzer) AnalyzeContent

func (b *BehavioralAnalyzer) AnalyzeContent(content string) []models.Signal

AnalyzeContent performs behavioral and semantic analysis on content

func (*BehavioralAnalyzer) AnalyzeDOMStructure

func (b *BehavioralAnalyzer) AnalyzeDOMStructure(html string) []models.Signal

AnalyzeDOMStructure analyzes the structure of the DOM for gambling patterns

func (*BehavioralAnalyzer) AnalyzePageSemantics

func (b *BehavioralAnalyzer) AnalyzePageSemantics(title, description, content string) []models.Signal

AnalyzePageSemantics analyzes the semantic meaning of page content

type ChangeRecord

type ChangeRecord struct {
	Timestamp time.Time
	OldScore  float64
	NewScore  float64
	Reason    string
	Signals   []models.Signal
}

ChangeRecord records a change in domain analysis

type Cluster

type Cluster struct {
	ID              string            `json:"cluster_id"`
	Confidence      float64           `json:"confidence"`
	Domains         []string          `json:"domains"`
	SharedSignals   []string          `json:"shared_signals"`
	FirstSeen       time.Time         `json:"first_seen"`
	LastSeen        time.Time         `json:"last_seen"`
	SharedResources map[string]string `json:"shared_resources"` // IPs, wallets, etc.
}

Cluster represents a group of related domains

type ClusterEngine

type ClusterEngine struct {
	Clusters map[string]*Cluster
}

ClusterEngine handles domain clustering and attribution

func NewClusterEngine

func NewClusterEngine() *ClusterEngine

NewClusterEngine creates a new clustering engine

func (*ClusterEngine) AddDomainToCluster

func (ce *ClusterEngine) AddDomainToCluster(domain string, analysis *models.AnalysisResult) string

AddDomainToCluster adds a domain to an appropriate cluster based on similarities

func (*ClusterEngine) FindClustersByResource

func (ce *ClusterEngine) FindClustersByResource(resourceType, resourceValue string) []*Cluster

FindClustersByResource finds clusters that share a specific resource

func (*ClusterEngine) GetAllClusters

func (ce *ClusterEngine) GetAllClusters() []*Cluster

GetAllClusters returns all clusters

func (*ClusterEngine) GetCluster

func (ce *ClusterEngine) GetCluster(clusterID string) (*Cluster, bool)

GetCluster retrieves a cluster by ID

func (*ClusterEngine) GetClusterForDomain

func (ce *ClusterEngine) GetClusterForDomain(domain string) (*Cluster, bool)

GetClusterForDomain finds the cluster for a specific domain

func (*ClusterEngine) GetClusterStatistics

func (ce *ClusterEngine) GetClusterStatistics() map[string]interface{}

GetClusterStatistics returns statistics about clustering

func (*ClusterEngine) GetClustersByConfidence

func (ce *ClusterEngine) GetClustersByConfidence() []*Cluster

GetClustersByConfidence returns clusters sorted by confidence

func (*ClusterEngine) MergeClusters

func (ce *ClusterEngine) MergeClusters(clusterID1, clusterID2 string) error

MergeClusters merges two clusters together

func (*ClusterEngine) UpdateClusterConfidence

func (ce *ClusterEngine) UpdateClusterConfidence(clusterID string)

UpdateClusterConfidence recalculates the confidence of a cluster

type DomainMonitor

type DomainMonitor struct {
	Domain     string
	LastResult *models.AnalysisResult
	Changes    []ChangeRecord
	Interval   time.Duration
	Active     bool
	StopChan   chan bool
}

DomainMonitor holds monitoring state for a single domain

type Exporter

type Exporter struct{}

Exporter handles data export functionality

func NewExporter

func NewExporter() *Exporter

NewExporter creates a new exporter instance

func (*Exporter) ExportCSV

func (e *Exporter) ExportCSV(results []*models.AnalysisResult, filename string) error

ExportCSV exports analysis results to CSV format

func (*Exporter) ExportJSON

func (e *Exporter) ExportJSON(results []*models.AnalysisResult, filename string) error

ExportJSON exports analysis results to JSON format

func (*Exporter) ExportSummary

func (e *Exporter) ExportSummary(results []*models.AnalysisResult, filename string) error

ExportSummary exports a summary of results

func (*Exporter) ExportToDatabase

func (e *Exporter) ExportToDatabase(results []*models.AnalysisResult, dbPath string) error

ExportToDatabase exports results to a database (placeholder)

func (*Exporter) FilterResultsByCDNProvider

func (e *Exporter) FilterResultsByCDNProvider(results []*models.AnalysisResult, provider string) []*models.AnalysisResult

FilterResultsByCDNProvider filters results by CDN provider

func (*Exporter) FilterResultsByJLIScore

func (e *Exporter) FilterResultsByJLIScore(results []*models.AnalysisResult, minScore, maxScore float64) []*models.AnalysisResult

FilterResultsByJLIScore filters results by JLI score range

func (*Exporter) FilterResultsByTime

func (e *Exporter) FilterResultsByTime(results []*models.AnalysisResult, startTime, endTime time.Time) []*models.AnalysisResult

FilterResultsByTime filters results by a time range

func (*Exporter) GenerateSummary

func (e *Exporter) GenerateSummary(results []*models.AnalysisResult) map[string]interface{}

GenerateSummary generates a summary of analysis results

type Monitor

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

Monitor tracks changes to domains over time

func NewMonitor

func NewMonitor() *Monitor

NewMonitor creates a new monitoring instance

func (*Monitor) AddDomain

func (m *Monitor) AddDomain(domain string, interval time.Duration) error

AddDomain adds a domain to monitoring

func (*Monitor) ExportChanges

func (m *Monitor) ExportChanges(domain, format, filename string) error

ExportChanges exports change records to file

func (*Monitor) GetAllMonitoredDomains

func (m *Monitor) GetAllMonitoredDomains() []string

GetAllMonitoredDomains returns all monitored domains

func (*Monitor) GetChanges

func (m *Monitor) GetChanges(domain string) ([]ChangeRecord, error)

GetChanges returns changes for a domain

func (*Monitor) GetDomainStatus

func (m *Monitor) GetDomainStatus(domain string) (*DomainMonitor, error)

GetDomainStatus returns the status of a monitored domain

func (*Monitor) PauseMonitoring

func (m *Monitor) PauseMonitoring(domain string) error

PauseMonitoring pauses monitoring for a domain

func (*Monitor) RemoveDomain

func (m *Monitor) RemoveDomain(domain string) error

RemoveDomain removes a domain from monitoring

func (*Monitor) ResumeMonitoring

func (m *Monitor) ResumeMonitoring(domain string) error

ResumeMonitoring resumes monitoring for a domain

func (*Monitor) StopAll

func (m *Monitor) StopAll()

StopAll stops all monitoring

Jump to

Keyboard shortcuts

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