Documentation
¶
Index ¶
- Constants
- Variables
- func CheckHttpPrefix(check string) (checked string, err error)
- func CheckProtocol(host string, port string) (string, error)
- func CheckProtocolByIp(ip string) string
- func SaveToCsv(targetFingerRsts []DetectResult, outputFile string) error
- func SaveToExcel(targetFingerRsts []DetectResult, outputFile string) error
- func SaveToFile(DetectResult []DetectResult, output string) (err error)
- func SliceRmDuplication[T comparable](old []T) []T
- type DetectResult
- type DetectResultTdSafeType
- type FingerPrintsTdSafeType
- type FingerprintsType
- type MatcherType
- type RuleClient
- type RuleClientBuilder
- func (b *RuleClientBuilder) Build() (_ *RuleClient, err error)
- func (b *RuleClientBuilder) WithOutputFormat(format string) *RuleClientBuilder
- func (b *RuleClientBuilder) WithProxyURL(url string) *RuleClientBuilder
- func (b *RuleClientBuilder) WithRuleMode(ruleMode string) *RuleClientBuilder
- func (b *RuleClientBuilder) WithTimeout(t time.Duration) *RuleClientBuilder
Constants ¶
View Source
const ( Up = "up" Down = "down" )
Variables ¶
View Source
var ExeFs embed.FS
View Source
var FingerFilesMap = map[string][]string{
"full": {"Firewall.yaml,", "MailServer.yaml", "lowLevel.yaml", "fofa_fingerprints.yaml", "oaSystem.yaml", "other.yaml", "p1_fingerprints.yaml", "supply.yaml", "webApp.yaml"},
"redteam": {"Firewall.yaml,", "MailServer.yaml", "oaSystem.yaml", "webApp.yaml"},
}
Functions ¶
func CheckHttpPrefix ¶
func CheckProtocol ¶
CheckProtocol 检查给定主机和端口的协议类型(HTTP或HTTPS)
func CheckProtocolByIp ¶
func SaveToCsv ¶
func SaveToCsv(targetFingerRsts []DetectResult, outputFile string) error
func SaveToExcel ¶
func SaveToExcel(targetFingerRsts []DetectResult, outputFile string) error
func SaveToFile ¶
func SaveToFile(DetectResult []DetectResult, output string) (err error)
func SliceRmDuplication ¶
func SliceRmDuplication[T comparable](old []T) []T
切片去重 使用泛型来去除切片中的重复元素 go > 1.18
Types ¶
type DetectResult ¶
type DetectResult struct {
Host string `json:"host"`
OriginUrl string `json:"origin_target"`
OriginUrlStatusCode int `json:"origin_url_status_code"`
OriginWebTitle string `json:"web_title"` //Important
RedirectUrl string `json:"redirect_url"`
RedirectUrlStatusCode int `json:"redirect_url_status_code"`
RedirectWebTitle string `json:"redirect_web_title"`
ContentLength string `json:"content_length"`
SiteUp string `json:"site_up"`
FingerTag []string `json:"finger_tag"` //Important
LastUpdateTime string `json:"lastupdatetime"` //Important
}
type DetectResultTdSafeType ¶
type DetectResultTdSafeType struct {
// contains filtered or unexported fields
}
func (*DetectResultTdSafeType) AddElement ¶
func (s *DetectResultTdSafeType) AddElement(elem DetectResult)
func (*DetectResultTdSafeType) GetElements ¶
func (s *DetectResultTdSafeType) GetElements() []DetectResult
type FingerPrintsTdSafeType ¶
type FingerPrintsTdSafeType struct {
FingerSlice []FingerprintsType
// contains filtered or unexported fields
}
func (*FingerPrintsTdSafeType) AddElement ¶
func (s *FingerPrintsTdSafeType) AddElement(elem FingerprintsType)
func (*FingerPrintsTdSafeType) GetElements ¶
func (s *FingerPrintsTdSafeType) GetElements() []FingerprintsType
type FingerprintsType ¶
type MatcherType ¶
type MatcherType struct {
Location string `yaml:"location,omitempty"`
Path string `yaml:"path"`
Type string `yaml:"type,omitempty"`
Words []string `yaml:"words,omitempty"`
FaviconHash []string `yaml:"hash,omitempty"`
BodyHash string `yaml:"bodyHash,omitempty"`
Accuracy string `yaml:"accuracy"`
Condition string `yaml:"condition,omitempty"`
CaseInsensitive bool `yaml:"case-insensitive,omitempty"`
}
type RuleClient ¶
type RuleClient struct {
DefaultFingerPath string // 默认指纹库路径
P1FingerPrints FingerPrintsTdSafeType // P1finger指纹库
RuleMode string
ProxyUrl string // 可选 代理地址
ProxyClient *http.Client // http客户端 默认跟随重定向
ProxyNoRedirectCilent *http.Client // http客户端 默认禁止跟随重定向
OutputFormat string // 可选 输出格式
DetectRstTdSafe DetectResultTdSafeType
}
func (*RuleClient) Detect ¶
func (r *RuleClient) Detect(target string) (DetectRst DetectResult, err error)
func (*RuleClient) LoadFingersFromEXEFS ¶
func (r *RuleClient) LoadFingersFromEXEFS(fingerFiles []string) (err error)
func (*RuleClient) LoadFingersFromExEfs ¶
func (r *RuleClient) LoadFingersFromExEfs() (err error)
type RuleClientBuilder ¶
type RuleClientBuilder struct {
// contains filtered or unexported fields
}
func NewRuleClientBuilder ¶
func NewRuleClientBuilder() *RuleClientBuilder
func (*RuleClientBuilder) Build ¶
func (b *RuleClientBuilder) Build() (_ *RuleClient, err error)
func (*RuleClientBuilder) WithOutputFormat ¶
func (b *RuleClientBuilder) WithOutputFormat(format string) *RuleClientBuilder
func (*RuleClientBuilder) WithProxyURL ¶
func (b *RuleClientBuilder) WithProxyURL(url string) *RuleClientBuilder
func (*RuleClientBuilder) WithRuleMode ¶
func (b *RuleClientBuilder) WithRuleMode(ruleMode string) *RuleClientBuilder
func (*RuleClientBuilder) WithTimeout ¶
func (b *RuleClientBuilder) WithTimeout(t time.Duration) *RuleClientBuilder
Source Files
¶
Click to show internal directories.
Click to hide internal directories.