Documentation
¶
Index ¶
- Variables
- func CheckPoc(req *http.Request, pocBody []byte, content Content) (bool, string)
- func Evaluate(env *cel.Env, expression string, params map[string]interface{}) (ref.Val, error)
- func Execute(addr string, pocBody []byte, content Content) (bool, string)
- func GetHeader(header map[string]string) (output string)
- func GetKhtxt(rules_txt string) []string
- func GetOneRule(ruletxt string) []string
- func InCollections(s1 []string, s2 string) bool
- func InitHttpClient(ThreadsNum int, DownProxy string, Timeout time.Duration) error
- func IsContain(items []string, item string) bool
- func MatchRuleOpt(rule []string, content Content) bool
- func MatchRules(rules RuleStruct, content Content) bool
- func NewEnv(c *CustomLib) (*cel.Env, error)
- func RandomStr(randSource *rand.Rand, letterBytes string, n int) string
- func SelectPoc(Pocs embed.FS, pocname string) []string
- func UrlTypeToString(u *UrlType) string
- type Content
- type CustomLib
- type Detail
- type KhIndex
- type Poc
- type Request
- func (*Request) Descriptor() ([]byte, []int)
- func (m *Request) GetBody() []byte
- func (m *Request) GetContentType() string
- func (m *Request) GetHeaders() map[string]string
- func (m *Request) GetMethod() string
- func (m *Request) GetUrl() *UrlType
- func (*Request) ProtoMessage()
- func (m *Request) Reset()
- func (m *Request) String() string
- func (m *Request) XXX_DiscardUnknown()
- func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Request) XXX_Merge(src proto.Message)
- func (m *Request) XXX_Size() int
- func (m *Request) XXX_Unmarshal(b []byte) error
- type Response
- func (*Response) Descriptor() ([]byte, []int)
- func (m *Response) GetBody() []byte
- func (m *Response) GetContentType() string
- func (m *Response) GetHeaders() map[string]string
- func (m *Response) GetStatus() int32
- func (m *Response) GetUrl() *UrlType
- func (*Response) ProtoMessage()
- func (m *Response) Reset()
- func (m *Response) String() string
- func (m *Response) XXX_DiscardUnknown()
- func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Response) XXX_Merge(src proto.Message)
- func (m *Response) XXX_Size() int
- func (m *Response) XXX_Unmarshal(b []byte) error
- type Reverse
- func (*Reverse) Descriptor() ([]byte, []int)
- func (m *Reverse) GetDomain() string
- func (m *Reverse) GetIp() string
- func (m *Reverse) GetIsDomainNameServer() bool
- func (m *Reverse) GetUrl() *UrlType
- func (*Reverse) ProtoMessage()
- func (m *Reverse) Reset()
- func (m *Reverse) String() string
- func (m *Reverse) XXX_DiscardUnknown()
- func (m *Reverse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Reverse) XXX_Merge(src proto.Message)
- func (m *Reverse) XXX_Size() int
- func (m *Reverse) XXX_Unmarshal(b []byte) error
- type RuleStruct
- type Rules
- type Task
- type UrlType
- func (*UrlType) Descriptor() ([]byte, []int)
- func (m *UrlType) GetDomain() string
- func (m *UrlType) GetFragment() string
- func (m *UrlType) GetHost() string
- func (m *UrlType) GetPath() string
- func (m *UrlType) GetPort() string
- func (m *UrlType) GetQuery() string
- func (m *UrlType) GetScheme() string
- func (*UrlType) ProtoMessage()
- func (m *UrlType) Reset()
- func (m *UrlType) String() string
- func (m *UrlType) XXX_DiscardUnknown()
- func (m *UrlType) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *UrlType) XXX_Merge(src proto.Message)
- func (m *UrlType) XXX_Size() int
- func (m *UrlType) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Client *http.Client ClientNoRedirect *http.Client )
Functions ¶
func InCollections ¶
func InitHttpClient ¶
func MatchRuleOpt ¶
func MatchRules ¶
func MatchRules(rules RuleStruct, content Content) bool
func UrlTypeToString ¶
Types ¶
type Content ¶
type CustomLib ¶
type CustomLib struct {
// contains filtered or unexported fields
}
func NewEnvOption ¶
func NewEnvOption() CustomLib
func (*CustomLib) CompileOptions ¶
声明环境中的变量类型和函数
func (*CustomLib) ProgramOptions ¶
func (c *CustomLib) ProgramOptions() []cel.ProgramOption
func (*CustomLib) UpdateCompileOptions ¶
type Poc ¶
type Poc struct { Name string `yaml:"name"` Set map[string]string `yaml:"set"` Sets map[string][]string `yaml:"sets"` Rules []Rules `yaml:"rules"` Groups map[string][]Rules `yaml:"groups"` Detail Detail `yaml:"detail"` Query string `yaml:"query"` }
func LoadPocbyPath ¶
type Request ¶
type Request struct { Url *UrlType `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"` Headers map[string]string `` /* 155-byte string literal not displayed */ ContentType string `protobuf:"bytes,4,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"` Body []byte `protobuf:"bytes,5,opt,name=body,proto3" json:"body,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Request) Descriptor ¶
func (*Request) GetContentType ¶
func (*Request) GetHeaders ¶
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) XXX_DiscardUnknown ¶
func (m *Request) XXX_DiscardUnknown()
func (*Request) XXX_Marshal ¶
func (*Request) XXX_Unmarshal ¶
type Response ¶
type Response struct { Url *UrlType `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` Headers map[string]string `` /* 155-byte string literal not displayed */ ContentType string `protobuf:"bytes,4,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"` Body []byte `protobuf:"bytes,5,opt,name=body,proto3" json:"body,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Response) Descriptor ¶
func (*Response) GetContentType ¶
func (*Response) GetHeaders ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) XXX_DiscardUnknown ¶
func (m *Response) XXX_DiscardUnknown()
func (*Response) XXX_Marshal ¶
func (*Response) XXX_Unmarshal ¶
type Reverse ¶
type Reverse struct { Url *UrlType `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` Ip string `protobuf:"bytes,3,opt,name=ip,proto3" json:"ip,omitempty"` IsDomainNameServer bool `protobuf:"varint,4,opt,name=is_domain_name_server,json=isDomainNameServer,proto3" json:"is_domain_name_server,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Reverse) Descriptor ¶
func (*Reverse) GetIsDomainNameServer ¶
func (*Reverse) ProtoMessage ¶
func (*Reverse) ProtoMessage()
func (*Reverse) XXX_DiscardUnknown ¶
func (m *Reverse) XXX_DiscardUnknown()
func (*Reverse) XXX_Marshal ¶
func (*Reverse) XXX_Unmarshal ¶
type RuleStruct ¶
type RuleStruct struct { Opt string Rules [][]string SubRule []RuleStruct }
func ParseRules ¶
func ParseRules(ruleTxt string) *RuleStruct
type UrlType ¶
type UrlType struct { Scheme string `protobuf:"bytes,1,opt,name=scheme,proto3" json:"scheme,omitempty"` Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` Host string `protobuf:"bytes,3,opt,name=host,proto3" json:"host,omitempty"` Port string `protobuf:"bytes,4,opt,name=port,proto3" json:"port,omitempty"` Path string `protobuf:"bytes,5,opt,name=path,proto3" json:"path,omitempty"` Query string `protobuf:"bytes,6,opt,name=query,proto3" json:"query,omitempty"` Fragment string `protobuf:"bytes,7,opt,name=fragment,proto3" json:"fragment,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*UrlType) Descriptor ¶
func (*UrlType) GetFragment ¶
func (*UrlType) ProtoMessage ¶
func (*UrlType) ProtoMessage()
func (*UrlType) XXX_DiscardUnknown ¶
func (m *UrlType) XXX_DiscardUnknown()
func (*UrlType) XXX_Marshal ¶
func (*UrlType) XXX_Unmarshal ¶
Click to show internal directories.
Click to hide internal directories.