conf

package
v0.0.0-...-7ef1397 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Release = "Release" //正式运行模式
	Debug   = "Debug"   //开发模式
)
View Source
const (
	HighPerformance   = "High"
	NormalPerformance = "Normal"
)

Variables

View Source
var NoProxyByCmd bool

NoProxyByCmd 不使用proxy,由worker启动时命令行指定

View Source
var RunMode = Release

RunMode 运行模式:正式运行请使用Release模式,Debug模式只用于开发调试过程

View Source
var ServerDefaultConfigfile = "conf/server.yml"
View Source
var Socks5ForwardAddr string

Socks5ForwardAddr chrome浏览器的socks5代理地址转发地址,支持用户名和密码认证(默认chrome不支持带认证的socks5代理)

View Source
var WorkerConfigReloadMutex sync.Mutex // worker读配置文件同步锁
View Source
var WorkerDefaultConfigFile = "conf/worker.yml"
View Source
var WorkerPerformanceMode = NormalPerformance

WorkerPerformanceMode worker默认的性能模式为Normal

Functions

func GetAbsRootPath

func GetAbsRootPath() string

GetAbsRootPath 获取运行时系统的root绝对位置,解决调试时无法使用相对位置的困扰

func GetProxyConfig

func GetProxyConfig() string

GetProxyConfig 从配置文件中获取一个代理配置参数,多个代理则随机选取一个

func GetRootPath

func GetRootPath() string

GetRootPath 获取运行时系统的root位置,解决调试时无法使用相对位置的困扰

Types

type API

type API struct {
	SearchPageSize   int    `yaml:"searchPageSize"`
	SearchLimitCount int    `yaml:"searchLimitCount"`
	Fofa             APIKey `yaml:"fofa"`
	ICP              APIKey `yaml:"icp"`
	Quake            APIKey `yaml:"quake"`
	Hunter           APIKey `yaml:"hunter"`
}

type APIKey

type APIKey struct {
	Key string `yaml:"key"`
}

type Database

type Database struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	Dbname   string `yaml:"name"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

type Domainscan

type Domainscan struct {
	Resolver           string `yaml:"resolver"`
	Wordlist           string `yaml:"wordlist"`
	ProviderConfig     string `yaml:"providerConfig"`
	IsSubDomainFinder  bool   `yaml:"subfinder"`
	IsSubDomainBrute   bool   `yaml:"subdomainBrute"`
	IsSubdomainCrawler bool   `yaml:"subdomainCrawler"`
	IsIgnoreCDN        bool   `yaml:"ignoreCDN"`
	IsIgnoreOutofChina bool   `yaml:"ignoreOutofChina"`
	IsPortScan         bool   `yaml:"portscan"`
	IsWhois            bool   `yaml:"whois"`
	IsICP              bool   `yaml:"icp"`
}

type Fingerprint

type Fingerprint struct {
	IsHttpx          bool `yaml:"httpx"`
	IsScreenshot     bool `yaml:"screenshot"`
	IsFingerprintHub bool `yaml:"fingerprinthub"`
	IsIconHash       bool `yaml:"iconhash"`
	IsFingerprintx   bool `yaml:"fingerprintx"`
}

type Notify

type Notify struct {
	Token string `yaml:"token"`
}

type OnlineAPI

type OnlineAPI struct {
	IsFofa   bool `yaml:"fofa"`
	IsQuake  bool `yaml:"quake"`
	IsHunter bool `yaml:"hunter"`
}

type Pocscan

type Pocscan struct {
	Xray struct {
		PocPath string `yaml:"pocPath"`
	} `yaml:"xray"`
	Nuclei struct {
		PocPath string `yaml:"pocPath"`
	} `yaml:"nuclei"`
	Goby struct {
		AuthUser string   `yaml:"authUser"`
		AuthPass string   `yaml:"authPass"`
		API      []string `yaml:"api"`
	} `yaml:"goby"`
}

type Portscan

type Portscan struct {
	IsPing bool   `yaml:"ping"`
	Port   string `yaml:"port"`
	Rate   int    `yaml:"rate"`
	Tech   string `yaml:"tech"`
	Cmdbin string `yaml:"cmdbin"`
}

type Proxy

type Proxy struct {
	Host []string `yaml:"host"`
}

type RPC

type RPC struct {
	Host    string `yaml:"host"`
	Port    int    `yaml:"port"`
	AuthKey string `yaml:"authKey"`
}

type Rabbitmq

type Rabbitmq struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

type Server

type Server struct {
	Web      Web               `yaml:"web"`
	Rpc      RPC               `yaml:"rpc"`
	FileSync RPC               `yaml:"fileSync"`
	WebAPI   WebAPI            `yaml:"api"`
	Database Database          `yaml:"database"`
	Rabbitmq Rabbitmq          `yaml:"rabbitmq"`
	Task     Task              `yaml:"task"`
	Notify   map[string]Notify `yaml:"notify"`
	Wiki     Wiki              `yaml:"wiki"`
}

func GlobalServerConfig

func GlobalServerConfig() *Server

func (*Server) ReloadConfig

func (config *Server) ReloadConfig() error

ReloadConfig 从yaml文件中加载配置

func (*Server) WriteConfig

func (config *Server) WriteConfig() error

WriteConfig 写配置到yaml文件中

type Task

type Task struct {
	IpSliceNumber   int `yaml:"ipSliceNumber"`
	PortSliceNumber int `yaml:"portSliceNumber"`
}

type Web

type Web struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	WebFiles string `yaml:"webfiles"`
}

type WebAPI

type WebAPI struct {
	Host string `yaml:"host"`
	Port int    `yaml:"port"`
}

type Wiki

type Wiki struct {
	Feishu struct {
		AppId                  string `yaml:"appId"`
		AppSecret              string `yaml:"appSecret"`
		UserAccessRefreshToken string `yaml:"refreshToken"`
	} `yaml:"feishu"`
}

type Worker

type Worker struct {
	Rpc         RPC         `yaml:"rpc"`
	FileSync    RPC         `yaml:"fileSync"`
	Rabbitmq    Rabbitmq    `yaml:"rabbitmq"`
	API         API         `yaml:"api"`
	Portscan    Portscan    `yaml:"portscan"`
	Fingerprint Fingerprint `yaml:"fingerprint"`
	Domainscan  Domainscan  `yaml:"domainscan"`
	OnlineAPI   OnlineAPI   `yaml:"onlineapi"`
	Pocscan     Pocscan     `yaml:"pocscan"`
	Proxy       Proxy       `yaml:"proxy"`
}

func GlobalWorkerConfig

func GlobalWorkerConfig() *Worker

func (*Worker) ReloadConfig

func (config *Worker) ReloadConfig() error

ReloadConfig 从yaml文件中加载配置

func (*Worker) WriteConfig

func (config *Worker) WriteConfig() error

WriteConfig 写配置到yaml文件中

Jump to

Keyboard shortcuts

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