utils

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 57 Imported by: 0

Documentation

Overview

credit vscan

Index

Constants

View Source
const (
	DefaultLLMProvider = "google"
	DefaultLLMModel    = "gemini-2.5-flash"
	DefaultLLMPrompt   = "" /* 370-byte string literal not displayed */
	DefaultLLMMaxChars = 128000
)
View Source
const (
	LLMProfileDir  = "output/config"
	LLMProfileFile = "llm_profiles.json.enc"
)
View Source
const (
	LevelInfo = iota
	LevelSuccess
	LevelFailed
	LevelWarning
	LevelError
	LevelFatal
	LevelDebug
)

Variables

View Source
var (
	Client           *http.Client
	ClientNoRedirect *http.Client
)
View Source
var ErrAlreadyLatest = errors.New("already at latest version")

Functions

func AddDataToTable added in v1.1.14

func AddDataToTable(table prettytable.Writer, data []string)

func AddStringToString

func AddStringToString(x string, seps []string, y string) []string

func ApiDeDuplicate added in v1.1.24

func ApiDeDuplicate(RootPath string, directory string)

func CheckFinger added in v1.1.8

func CheckFinger(finger string, title string, Url string, contentType string, location string, respBody []byte, statusCode int) []string

func CloneDefaultTransport added in v1.2.3

func CloneDefaultTransport() *http.Transport

CloneDefaultTransport returns a shallow clone of the default transport used by InitHttp/InitHttpClient.

func CloseLog added in v1.2.4

func CloseLog()

CloseLog closes the global log file.

func CollectHostErrorStats added in v1.2.1

func CollectHostErrorStats(reset bool) map[string]HostErrorStat

func ConfigInit added in v1.1.19

func ConfigInit()

func Debug

func Debug(format string, args ...interface{})

func DecodeData added in v1.1.19

func DecodeData(s string) ([]byte, error)

func DecodePattern added in v1.1.19

func DecodePattern(s string) ([]byte, error)

func Deduplicate added in v1.2.4

func Deduplicate[T comparable](slice []T) []T

Deduplicate returns a new slice with duplicate elements removed, preserving the original order.

func DefaultLLMProfilePath added in v1.2.4

func DefaultLLMProfilePath(baseDir string) string

func DirBrute

func DirBrute(baseUrl string, dir string) []string

func DisplayHeader

func DisplayHeader(Url string, Method string)

func Error

func Error(format string, args ...interface{})

func Errorf

func Errorf(format string, args ...interface{}) error

func ExportHTMLReport added in v1.2.3

func ExportHTMLReport(ctx context.Context, db *sql.DB, outputPath string, llmCfg *LLMConfig) error

func Failed

func Failed(format string, args ...interface{})

func Fatal

func Fatal(format string, args ...interface{})

func FilReadUrl added in v1.1.20

func FilReadUrl(filename string) []string

func FileReadLine added in v1.1.20

func FileReadLine(filename string) []string

func FileWrite added in v1.1.9

func FileWrite(filename string, format string, args ...interface{})

func FindFaviconURL

func FindFaviconURL(urlStr string) (string, error)

func FindFaviconURLFromHTML added in v1.2.2

func FindFaviconURLFromHTML(rootURL string, htmlBody string) (string, error)

FindFaviconURLFromHTML tries to extract favicon from provided HTML; does not issue new GET.

func FirstCharToUpper

func FirstCharToUpper(Name string) string

func GenerateWeakPassword

func GenerateWeakPassword() []string

func GetCurrentTime added in v1.1.26

func GetCurrentTime() string

func GetSpiderDB added in v1.2.2

func GetSpiderDB() *sql.DB

func GetStructCodeMap added in v1.1.19

func GetStructCodeMap() map[int][]byte

解析 nmap-service-probes 中匹配规则字符串,转换成 golang 中可以进行编译的字符串

  e.g.
	(1) pattern: \0\xffHi
		decoded: []byte{0, 255, 72, 105} 4len

	(2) pattern: \\0\\xffHI
		decoded: []byte{92, 0, 92, 120, 102, 102, 72, 105} 8len

	(3) pattern: \x2e\x2a\x3f\x2b\x7b\x7d\x28\x29\x5e\x24\x7c\x5c
		decodedStr: \.\*\?\+\{\}\(\)\^\$\|\\

func HalfCharToUpper

func HalfCharToUpper(Name string) string

func HighLight

func HighLight(data string, keywords []string, fingers []string, Url string)

func HttpGetServerHeader

func HttpGetServerHeader(Url string, NeedTitle bool, Method string) (string, string, string, error)

func IconDetect

func IconDetect(Url string) (string, string, string, error)

func IconDetectAuto added in v1.2.2

func IconDetectAuto(target string) (string, string, string, error)

IconDetectAuto accepts either a direct favicon URL or a page URL and extracts the rel=icon href.

func ImportantApiJudge added in v1.1.19

func ImportantApiJudge(ApiResult string, Url string)

func Info

func Info(format string, args ...interface{})

func InfoFile added in v1.2.1

func InfoFile(format string, args ...interface{})

InfoFile writes INFO lines to file only (no console), respecting loglevel.

func InitHttp

func InitHttp()

func InitHttpClient

func InitHttpClient(threadsNum int, downProxy string, timeout time.Duration) error

func InitLog added in v1.2.4

func InitLog(path string) error

InitLog opens the log file for writing. It should be called once at startup.

func InitSpiderDB added in v1.2.1

func InitSpiderDB(path string) (*sql.DB, error)

func IsJavaScriptPath added in v1.2.3

func IsJavaScriptPath(Path string) bool

func LastCharToUpper

func LastCharToUpper(Name string) string

func LogBeautify added in v1.1.8

func LogBeautify(levelText string, colorAttr color.Attribute, msg string, level int)

func MapToJson

func MapToJson(param map[string][]string) string

func MightBeChineseName

func MightBeChineseName(Name string) bool

func MightBeIdentityCard

func MightBeIdentityCard(IdentityCard string) bool

func MightBePhone

func MightBePhone(Phone string) bool

func Mmh3Hash32

func Mmh3Hash32(raw []byte) string

func Normalize

func Normalize(raw string, base string) string

func ParseJavaScriptUrl added in v1.2.3

func ParseJavaScriptUrl(Url string, RootPath string, doc string, directory string, apiCounter *int, db *sql.DB)

func ParsePortsString added in v1.2.3

func ParsePortsString(portsStr string) ([]int, error)

ParsePortsString exports port parser for reuse.

func PortScan added in v1.1.19

func PortScan(IpRange string, PortRange string)

func PrintFinger

func PrintFinger(Url string, Depth int)

func PrintTable added in v1.1.11

func PrintTable(Url string, key string, data []SensitiveData)

func QuickPortScan added in v1.2.3

func QuickPortScan(ip string, ports []int, workers int, dialTimeout time.Duration) []int

QuickPortScan scans a single IP for the given TCP ports, returning open ports.

func Quote

func Quote(x string) string

func RemoveDuplicateElement

func RemoveDuplicateElement(originals interface{}) (interface{}, error)

func RemoveDuplicatesString added in v1.1.20

func RemoveDuplicatesString(arr []string) []string

func ReplaceWithTable

func ReplaceWithTable(input string) string

func SaveAPIPaths added in v1.2.1

func SaveAPIPaths(db *sql.DB, rootURL, sourceURL string, paths []string, saveDir string) error

func SaveCDNHosts added in v1.2.1

func SaveCDNHosts(db *sql.DB, rootURL string, hosts []string) error

func SaveGraphDB added in v1.2.3

func SaveGraphDB(db *sql.DB, edges []GraphEdge) error

func SaveGraphJSON added in v1.2.3

func SaveGraphJSON(path string, edges []GraphEdge) error

func SaveLLMProfiles added in v1.2.4

func SaveLLMProfiles(path, secret string, profiles []LLMProfile) error

SaveLLMProfiles saves encrypted profiles; requires non-empty secret.

func SavePageSnapshot added in v1.2.2

func SavePageSnapshot(db *sql.DB, snap PageSnapshot) error

func SaveSensitiveHits added in v1.2.1

func SaveSensitiveHits(db *sql.DB, hits []SensitiveHit) error

func SaveService added in v1.2.1

func SaveService(category string, row []string)

SaveService stores scan result into unified services table.

func SaveSourceMaps added in v1.2.1

func SaveSourceMaps(db *sql.DB, hits []SourceMapHit) error

func SaveSpiderSummary added in v1.2.1

func SaveSpiderSummary(db *sql.DB, rec SpiderRecord) error

func ScanWithIpAndPort added in v1.1.19

func ScanWithIpAndPort(addr []ProtocolInfo)

func SecList added in v1.1.11

func SecList() string

func SelfUpdate added in v1.2.3

func SelfUpdate(ctx context.Context, opts SelfUpdateOptions) (string, error)

SelfUpdate downloads and atomically replaces the current executable. It returns the version that was checked/installed.

func SensitiveInfoCollect

func SensitiveInfoCollect(db *sql.DB, Url string, Content string, directory string)

func SetHeaders added in v1.1.27

func SetHeaders(req *http.Request)

func SetSpiderDB added in v1.2.1

func SetSpiderDB(db *sql.DB)

func ShowInfo

func ShowInfo()

func SimHash added in v1.1.8

func SimHash(input []byte) uint64

func Spider

func Spider(RootPath string, Url string, depth int, directory string, myMap mapset.Set, sourceMapSeen mapset.Set, apiCounter *int, db *sql.DB, cached *prefetchedPage) error

func StandBase64

func StandBase64(braw []byte) []byte

func StatusColorTransformer added in v1.2.1

func StatusColorTransformer(val interface{}) string

func StringListToInterfaceList

func StringListToInterfaceList(tmpList []string) []interface{}

func Success

func Success(format string, args ...interface{})

func TranslateToEnglish

func TranslateToEnglish(Name string) (string, string, string, string)

func UrlFilter added in v1.1.16

func UrlFilter(Url string) bool

func UrlFormated added in v1.1.19

func UrlFormated(lines []string) []string

func Warning

func Warning(format string, args ...interface{})

func WriteSimpleXLSX added in v1.2.1

func WriteSimpleXLSX(filename string, sheets []Worksheet) error

WriteSimpleXLSX writes a minimal XLSX with the provided worksheets.

func WriteToCsv added in v1.1.14

func WriteToCsv(filename string, data []string)

Types

type APICount added in v1.2.1

type APICount struct {
	Root string
	Cnt  int
}

func LoadAPICounts added in v1.2.1

func LoadAPICounts(db *sql.DB) ([]APICount, error)

type APIPathRow added in v1.2.3

type APIPathRow struct {
	RootURL   string `json:"root_url"`
	SourceURL string `json:"source_url"`
	Path      string `json:"path"`
	SaveDir   string `json:"save_dir"`
}

func LoadAPIPaths added in v1.2.3

func LoadAPIPaths(db *sql.DB) ([]APIPathRow, error)

type CDNHostRow added in v1.2.1

type CDNHostRow struct {
	Root string
	Host string
}

func LoadCDNHosts added in v1.2.1

func LoadCDNHosts(db *sql.DB) ([]CDNHostRow, error)

type Config added in v1.1.19

type Config struct {
	Rarity   int
	Routines int

	SendTimeout time.Duration
	ReadTimeout time.Duration

	NULLProbeOnly bool
	UseAllProbes  bool
	SSLAlwaysTry  bool
}

VScan 探测时的参数配置

type Details added in v1.1.19

type Details struct {
	ProbeName     string `json:"probe_name"`
	ProbeData     string `json:"probe_data"`
	MatchMatched  string `json:"match_matched"`
	IsSoftMatched bool   `json:"soft_matched"`
}

详细的结果数据(包含具体的 Probe 和匹配规则信息)

type Directive added in v1.1.19

type Directive struct {
	DirectiveName string
	Flag          string
	Delimiter     string
	DirectiveStr  string
}

type EntropyHit added in v1.2.1

type EntropyHit struct {
	SourceURL string  `json:"source_url"`
	Category  string  `json:"category"`
	Content   string  `json:"content"`
	Entropy   float64 `json:"entropy"`
	SaveDir   string  `json:"save_dir"`
}

func LoadEntropyHits added in v1.2.1

func LoadEntropyHits(db *sql.DB) ([]EntropyHit, error)

type ExistingLogger added in v1.2.4

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

ExistingLogger implements Logger interface using existing logging functions

func (*ExistingLogger) Debug added in v1.2.4

func (l *ExistingLogger) Debug(msg string, args ...interface{})

Debug logs a debug message

func (*ExistingLogger) Error added in v1.2.4

func (l *ExistingLogger) Error(msg string, args ...interface{})

Error logs an error message

func (*ExistingLogger) Fatal added in v1.2.4

func (l *ExistingLogger) Fatal(msg string, args ...interface{})

Fatal logs a fatal message and exits

func (*ExistingLogger) Info added in v1.2.4

func (l *ExistingLogger) Info(msg string, args ...interface{})

Info logs an info message

func (*ExistingLogger) SetLevel added in v1.2.4

func (l *ExistingLogger) SetLevel(level LogLevel)

SetLevel sets the minimum log level (no-op for compatibility)

func (*ExistingLogger) SetOutput added in v1.2.4

func (l *ExistingLogger) SetOutput(w io.Writer)

SetOutput sets the output destination (no-op for compatibility)

func (*ExistingLogger) Warning added in v1.2.4

func (l *ExistingLogger) Warning(msg string, args ...interface{})

Warning logs a warning message

func (*ExistingLogger) WithField added in v1.2.4

func (l *ExistingLogger) WithField(key string, value interface{}) Logger

WithField adds a field to the logger context

func (*ExistingLogger) WithFields added in v1.2.4

func (l *ExistingLogger) WithFields(fields map[string]interface{}) Logger

WithFields adds multiple fields to the logger context

type Extras added in v1.1.19

type Extras struct {
	VendorProduct   string `json:"vendor_product,omitempty"`
	Version         string `json:"version,omitempty"`
	Info            string `json:"info,omitempty"`
	Hostname        string `json:"hostname,omitempty"`
	OperatingSystem string `json:"operating_system,omitempty"`
	DeviceType      string `json:"device_type,omitempty"`
	CPE             string `json:"cpe,omitempty"`
}

对应 NMap versioninfo 信息

type FingerResult added in v1.2.2

type FingerResult struct {
	Finger      string
	Server      string
	Title       string
	ContentType string
	Location    string
	HeadersJSON string
	Body        []byte
	Status      int
	Err         error
}

func FingerScan added in v1.1.8

func FingerScan(url string, method string, followRedirect bool) FingerResult

type Fingerprint

type Fingerprint struct {
	Cms      string
	Method   string
	Location string
	Keyword  []string
}

type GraphCollector added in v1.2.3

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

func GetGraphCollector added in v1.2.3

func GetGraphCollector() *GraphCollector

func (*GraphCollector) AddEdge added in v1.2.3

func (g *GraphCollector) AddEdge(root, from, to string, depth int)

func (*GraphCollector) Reset added in v1.2.3

func (g *GraphCollector) Reset()

func (*GraphCollector) SetLimit added in v1.2.3

func (g *GraphCollector) SetLimit(n int)

func (*GraphCollector) Snapshot added in v1.2.3

func (g *GraphCollector) Snapshot() []GraphEdge

type GraphEdge added in v1.2.3

type GraphEdge struct {
	Root  string `json:"root"`
	From  string `json:"from"`
	To    string `json:"to"`
	Depth int    `json:"depth"`
}

func LoadGraphDB added in v1.2.3

func LoadGraphDB(db *sql.DB, limit int) ([]GraphEdge, error)

func LoadGraphJSON added in v1.2.3

func LoadGraphJSON(path string) ([]GraphEdge, error)

type HTMLReportData added in v1.2.3

type HTMLReportData struct {
	GeneratedAt   string
	Summary       []SpiderRecord
	APIs          []APIPathRow
	Sensitive     []SensitiveHit
	SourceMaps    []SourceMapHit
	Pages         []PageSnapshotMeta
	PageBodies    []PageSnapshotLite
	Scores        []ScoredRow
	CDNHosts      []CDNHostRow
	Graph         []GraphEdge
	ImportantAPIs []string
	LLMSummary    *LLMSummary
}

type HostErrorStat added in v1.2.1

type HostErrorStat struct {
	Count  int
	Sample string
}

type IpHash added in v1.1.23

type IpHash struct {
	Ip   string
	Hash uint64
}

type LLMConfig added in v1.2.4

type LLMConfig struct {
	Provider      string
	Model         string
	Prompt        string
	APIKey        string
	BaseURL       string
	MaxInputChars int
	MaxOutputTok  int
	DryRun        bool
}

type LLMProfile added in v1.2.4

type LLMProfile struct {
	Name     string `json:"name"`
	Provider string `json:"provider"`
	Model    string `json:"model"`
	APIKey   string `json:"api_key"`
	BaseURL  string `json:"base_url,omitempty"`
}

LLMProfile stores reusable provider/model/key.

func DeleteProfile added in v1.2.4

func DeleteProfile(list []LLMProfile, name string) []LLMProfile

func LoadLLMProfiles added in v1.2.4

func LoadLLMProfiles(path, secret string) ([]LLMProfile, error)

LoadLLMProfiles decrypts and loads profiles; requires non-empty secret.

func UpsertProfile added in v1.2.4

func UpsertProfile(list []LLMProfile, p LLMProfile) []LLMProfile

type LLMSummary added in v1.2.4

type LLMSummary struct {
	Enabled      bool   `json:"enabled"`
	Provider     string `json:"provider"`
	Model        string `json:"model"`
	Prompt       string `json:"prompt"`
	Output       string `json:"output"`
	Error        string `json:"error,omitempty"`
	InputPreview string `json:"input_preview,omitempty"`
	InputTotal   int    `json:"input_total"`
	InputLimit   int    `json:"input_limit,omitempty"`
	OutputLimit  int    `json:"output_limit,omitempty"`
	GeneratedAt  string `json:"generated_at,omitempty"`
	DryRun       bool   `json:"dry_run,omitempty"`
}

func SummarizeReport added in v1.2.4

func SummarizeReport(ctx context.Context, data HTMLReportData, cfg *LLMConfig) *LLMSummary

SummarizeReport builds a compact crawler context and sends it to the configured LLM. Failures are captured in the returned summary; they do not block report generation.

type LogLevel added in v1.2.4

type LogLevel int

LogLevel represents different log levels (for compatibility with Logger interface)

const (
	LogLevelDebug LogLevel = iota
	LogLevelInfo
	LogLevelWarning
	LogLevelError
	LogLevelFatal
)

type Logger added in v1.2.4

type Logger interface {
	Debug(msg string, args ...interface{})
	Info(msg string, args ...interface{})
	Warning(msg string, args ...interface{})
	Error(msg string, args ...interface{})
	Fatal(msg string, args ...interface{})

	SetLevel(level LogLevel)
	SetOutput(w io.Writer)
	WithField(key string, value interface{}) Logger
	WithFields(fields map[string]interface{}) Logger
}

Logger interface defines logging operations

func NewExistingLogger added in v1.2.4

func NewExistingLogger() Logger

NewExistingLogger creates a new logger that uses existing logging functions

type Match added in v1.1.19

type Match struct {
	IsSoft bool

	Service     string
	Pattern     string
	VersionInfo string

	PatternCompiled *regexp2.Regexp
}

nmap-service-probes 中每一条规则

func (*Match) MatchPattern added in v1.1.19

func (m *Match) MatchPattern(response []byte) bool

对获取到的 Banner 进行匹配

func (*Match) ParseVersionInfo added in v1.1.19

func (m *Match) ParseVersionInfo(response []byte) Extras

type Packjson

type Packjson struct {
	Fingerprint []Fingerprint
}

type PageSnapshot added in v1.2.2

type PageSnapshot struct {
	RootURL     string `json:"root_url"`
	URL         string `json:"url"`
	Status      int    `json:"status"`
	ContentType string `json:"content_type"`
	Headers     string `json:"headers"`
	Body        string `json:"body"`
	Length      int    `json:"length"`
}

type PageSnapshotLite added in v1.2.3

type PageSnapshotLite struct {
	RootURL     string `json:"root_url"`
	URL         string `json:"url"`
	Status      int    `json:"status"`
	ContentType string `json:"content_type"`
	Length      int    `json:"length"`
	Headers     string `json:"headers"`
	Snippet     string `json:"snippet"`
}

PageSnapshotLite includes a short body snippet and headers for drill-downs.

func LoadPageSnapshotLite added in v1.2.3

func LoadPageSnapshotLite(db *sql.DB) ([]PageSnapshotLite, error)

type PageSnapshotMeta added in v1.2.3

type PageSnapshotMeta struct {
	RootURL     string `json:"root_url"`
	URL         string `json:"url"`
	Status      int    `json:"status"`
	ContentType string `json:"content_type"`
	Length      int    `json:"length"`
}

func LoadPageSnapshotMeta added in v1.2.3

func LoadPageSnapshotMeta(db *sql.DB) ([]PageSnapshotMeta, error)

type Probe added in v1.1.19

type Probe struct {
	Name        string
	Data        string
	DecodedData []byte
	Protocol    string

	Ports    string
	SSLPorts string

	TotalWaitMS  int
	TCPWrappedMS int
	Rarity       int
	Fallback     string

	Matchs *[]Match
}

探针规则,包含该探针规则下的服务匹配条目和其他探测信息

func (*Probe) ContainsPort added in v1.1.19

func (p *Probe) ContainsPort(testPort int) bool

func (*Probe) ContainsSSLPort added in v1.1.19

func (p *Probe) ContainsSSLPort(testPort int) bool

type ProbesRarity added in v1.1.19

type ProbesRarity []Probe

ProbesRarity 用于使用 sort 对 Probe 对象按 Rarity 属性值进行排序

func (ProbesRarity) Len added in v1.1.19

func (ps ProbesRarity) Len() int

func (ProbesRarity) Less added in v1.1.19

func (ps ProbesRarity) Less(i, j int) bool

func (ProbesRarity) Swap added in v1.1.19

func (ps ProbesRarity) Swap(i, j int)

type ProtocolInfo added in v1.1.19

type ProtocolInfo struct {
	Ip   string
	Port int
}

type Result added in v1.1.19

type Result struct {
	Target
	Service `json:"service"`

	Timestamp int32  `json:"timestamp"`
	Error     string `json:"error"`
}

输出的结果数据

type ScoredRow added in v1.2.3

type ScoredRow struct {
	RootURL   string         `json:"root_url"`
	Score     int            `json:"score"`
	Status    int            `json:"status"`
	ApiCount  int            `json:"api_count"`
	Important int            `json:"important_api"`
	UrlCount  int            `json:"url_count"`
	CDNCount  int            `json:"cdn_count"`
	SaveDir   string         `json:"save_dir"`
	Reasons   []string       `json:"reasons"`
	RiskFlags []string       `json:"risk_flags"`
	DebugMeta map[string]any `json:"debug_meta"`
}

type SelfUpdateOptions added in v1.2.3

type SelfUpdateOptions struct {
	Owner          string
	Repo           string
	CurrentVersion string
	TargetVersion  string
	DownloadURL    string
	OS             string
	Arch           string
	DryRun         bool
	Force          bool
	SkipChecksum   bool
	HTTPClient     *http.Client
	UserAgent      string
	Token          string
}

type SensitiveCount added in v1.2.1

type SensitiveCount struct {
	Category string `json:"category"`
	Count    int    `json:"count"`
}

func LoadSensitiveCounts added in v1.2.1

func LoadSensitiveCounts(db *sql.DB) ([]SensitiveCount, error)

type SensitiveData added in v1.1.11

type SensitiveData struct {
	Content string
	Entropy float64
}

func DeduplicateByContent added in v1.1.11

func DeduplicateByContent(data []SensitiveData) []SensitiveData

type SensitiveHit added in v1.2.1

type SensitiveHit struct {
	SourceURL string  `json:"source_url"`
	Category  string  `json:"category"`
	Content   string  `json:"content"`
	Entropy   float64 `json:"entropy"`
	SaveDir   string  `json:"save_dir"`
}

func LoadSensitiveHits added in v1.2.1

func LoadSensitiveHits(db *sql.DB) ([]SensitiveHit, error)

type Service added in v1.1.19

type Service struct {
	Target

	Name        string `json:"name"`
	Protocol    string `json:"protocol"`
	Banner      string `json:"banner"`
	BannerBytes []byte `json:"banner_bytes"`

	Extras  `json:"extras"`
	Details `json:"details"`
}

获取的端口服务信息

type SourceMapHit added in v1.2.1

type SourceMapHit struct {
	RootURL string `json:"root_url"`
	JSURL   string `json:"js_url"`
	MapURL  string `json:"map_url"`
	Status  int    `json:"status"`
	Length  int    `json:"length"`
}

func LoadSourceMaps added in v1.2.3

func LoadSourceMaps(db *sql.DB) ([]SourceMapHit, error)

type SpiderRecord added in v1.2.1

type SpiderRecord struct {
	Url        string `json:"Url"`
	IconHash   string `json:"IconHash"`
	IconBase64 string `json:"IconBase64"`
	ApiCount   int    `json:"ApiCount"`
	UrlCount   int    `json:"UrlCount"`
	CDNCount   int    `json:"CDNCount"`
	CDNHosts   string `json:"CDNHosts"`
	SaveDir    string `json:"SaveDir"`
	Status     int    `json:"Status"`
}

func LoadSpiderSummaries added in v1.2.1

func LoadSpiderSummaries(db *sql.DB) ([]SpiderRecord, error)

type SpiderSummary added in v1.2.1

type SpiderSummary struct {
	URL         string
	Title       string
	Finger      string
	ContentType string
	Status      int
	Length      int
	Keyword     string
	SimHash     string
	IconHash    string
	IconBase64  string
	ApiCount    int
	UrlCount    int
	CDNCount    int
	CDNHosts    string
	SaveDir     string
	Err         error
}

func FingerSummary added in v1.2.1

func FingerSummary(Url string, Depth int, db *sql.DB) SpiderSummary

FingerSummary scans a target and returns a compact per-host summary while still writing detailed CSV files.

type Target added in v1.1.19

type Target struct {
	IP       string `json:"ip"`
	Port     int    `json:"port"`
	Protocol string `json:"protocol"`
}

待探测的目标端口

func (*Target) GetAddress added in v1.1.19

func (t *Target) GetAddress() string

type VScan added in v1.1.19

type VScan struct {
	Exclude string

	Probes []Probe

	ProbesMapKName map[string]Probe
}

func (*VScan) Explore added in v1.1.19

func (v *VScan) Explore(target Target, config *Config) (Result, error)

VScan 探测目标端口函数,返回探测结果和错误信息 1. probes ports contains port 2. probes sslports contains port 3. probes ports contains port use ssl try to

func (*VScan) Init added in v1.1.19

func (v *VScan) Init()

从文件中解析并加载 Probes 初始化 VScan 实例

type Worker added in v1.1.19

type Worker struct {
	In     chan Target
	Out    chan Result
	Config *Config
}

func (*Worker) Start added in v1.1.19

func (w *Worker) Start(v *VScan, wg *sync.WaitGroup)

type Worksheet added in v1.2.1

type Worksheet struct {
	Name string
	Rows [][]string
}

Jump to

Keyboard shortcuts

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