config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBurpMCPURL    = "http://127.0.0.1:9876/sse"
	DefaultBurpProxyAddr = "127.0.0.1:8080"
	DefaultMCPPort       = 9119
	DefaultProxyPort     = 8080
)

Variables

View Source
var Version = "dev"

Version is injected at build time via ldflags; defaults to "dev".

Functions

func DefaultPath

func DefaultPath() string

DefaultPath returns ~/.sectool/config.json.

func UserAgent

func UserAgent() string

Types

type Config

type Config struct {
	Version             string        `json:"version"`
	MCPPort             int           `json:"mcp_port"`
	ProxyPort           int           `json:"proxy_port"`
	BurpRequired        *bool         `json:"burp_required"`
	MaxBodyBytes        int           `json:"max_body_bytes"` // limits request/response body sizes
	IncludeSubdomains   *bool         `json:"include_subdomains"`
	AllowedDomains      []string      `json:"allowed_domains"`
	ExcludeDomains      []string      `json:"exclude_domains"`
	InteractshServerURL string        `json:"interactsh_server_url"` // empty = use default public servers
	Proxy               ProxyConfig   `json:"proxy"`
	Crawler             CrawlerConfig `json:"crawler"`
}

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a Config with default values.

func LoadOrCreatePath

func LoadOrCreatePath(path string) (*Config, error)

LoadOrCreatePath loads config from path, creating with defaults if missing. When the on-disk version differs from the running binary version, any missing fields are filled from defaults and the file is re-saved so that new configuration options are persisted for future runs.

func (*Config) IsDomainAllowed

func (c *Config) IsDomainAllowed(hostname string) (bool, string)

IsDomainAllowed checks whether a hostname is permitted by the domain scoping configuration. Returns true if allowed, or false with a reason string.

func (*Config) Save

func (c *Config) Save(path string) error

Save writes config to path, creating parent directory if needed.

type CrawlerConfig

type CrawlerConfig struct {
	DisallowedPaths []string `json:"disallowed_paths"`
	DelayMS         int      `json:"delay_ms"`
	Parallelism     int      `json:"parallelism"`
	MaxDepth        int      `json:"max_depth"`
	MaxRequests     int      `json:"max_requests"`
	ExtractForms    *bool    `json:"extract_forms"`
	SubmitForms     *bool    `json:"submit_forms"`
	Recon           *bool    `json:"recon"`
}

type ProxyConfig

type ProxyConfig struct {
	DialTimeoutSecs  int `json:"dial_timeout_secs"`
	ReadTimeoutSecs  int `json:"read_timeout_secs"`
	WriteTimeoutSecs int `json:"write_timeout_secs"`
}

Jump to

Keyboard shortcuts

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