lib

package
v0.0.0-...-0fd6658 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Client           *http.Client
	ClientNoRedirect *http.Client
)
View Source
var (
	CheckContent = "" /* 152-byte string literal not displayed */
	Content, _   = base64.StdEncoding.DecodeString(CheckContent)
)

Functions

func AES_CBC_Encrypt

func AES_CBC_Encrypt(shirokey string) string

AES CBC加密后的payload

func AES_GCM_Encrypt

func AES_GCM_Encrypt(shirokey string) string

AES GCM 加密后的payload shiro 1.4.2版本更换为了AES-GCM加密方式

func CheckInfoPoc

func CheckInfoPoc(infostr string) string

func CheckMultiPoc

func CheckMultiPoc(req *http.Request, pocs []*Poc, workers int)

func Combo

func Combo(input ListMap) (output [][]string)

func Evaluate

func Evaluate(env *cel.Env, expression string, params map[string]interface{}) (ref.Val, error)

func GetHeader

func GetHeader(header map[string]string) (output string)

func GetShrioCookie

func GetShrioCookie(key, mode string) string

func InitHttpClient

func InitHttpClient(ThreadsNum int, DownProxy string, Timeout time.Duration) error

func Inithttp

func Inithttp()

func MakeData

func MakeData(base [][]string, nextData []string) (output [][]string)

func NewEnv

func NewEnv(c *CustomLib) (*cel.Env, error)

func Padding

func Padding(plainText []byte, blockSize int) []byte

func RandomStr

func RandomStr(randSource *rand.Rand, letterBytes string, n int) string

func SelectPoc

func SelectPoc(Pocs embed.FS, pocname string) []string

func UrlTypeToString

func UrlTypeToString(u *UrlType) string

Types

type CustomLib

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

func NewEnvOption

func NewEnvOption() CustomLib

func (*CustomLib) CompileOptions

func (c *CustomLib) CompileOptions() []cel.EnvOption

声明环境中的变量类型和函数

func (*CustomLib) ProgramOptions

func (c *CustomLib) ProgramOptions() []cel.ProgramOption

func (*CustomLib) UpdateCompileOptions

func (c *CustomLib) UpdateCompileOptions(args StrMap)

type Detail

type Detail struct {
	Author      string   `yaml:"author"`
	Links       []string `yaml:"links"`
	Description string   `yaml:"description"`
	Version     string   `yaml:"version"`
}

type ListItem

type ListItem struct {
	Key   string
	Value []string
}

type ListMap

type ListMap []ListItem

func (*ListMap) UnmarshalYAML

func (r *ListMap) UnmarshalYAML(unmarshal func(interface{}) error) error

type MapSlice

type MapSlice = yaml.MapSlice

type Poc

type Poc struct {
	Name   string  `yaml:"name"`
	Set    StrMap  `yaml:"set"`
	Sets   ListMap `yaml:"sets"`
	Rules  []Rules `yaml:"rules"`
	Groups RuleMap `yaml:"groups"`
	Detail Detail  `yaml:"detail"`
}

func LoadMultiPoc

func LoadMultiPoc(Pocs embed.FS, pocname string) []*Poc

func LoadPoc

func LoadPoc(fileName string, Pocs embed.FS) (*Poc, error)

func LoadPocbyPath

func LoadPocbyPath(fileName string) (*Poc, error)

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"`
	// contains filtered or unexported fields
}

func ParseRequest

func ParseRequest(oReq *http.Request) (*Request, error)

func (*Request) Descriptor deprecated

func (*Request) Descriptor() ([]byte, []int)

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetBody

func (x *Request) GetBody() []byte

func (*Request) GetContentType

func (x *Request) GetContentType() string

func (*Request) GetHeaders

func (x *Request) GetHeaders() map[string]string

func (*Request) GetMethod

func (x *Request) GetMethod() string

func (*Request) GetUrl

func (x *Request) GetUrl() *UrlType

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

func (x *Request) ProtoReflect() protoreflect.Message

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

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"`
	Duration    float64           `protobuf:"fixed64,6,opt,name=duration,proto3" json:"duration,omitempty"`
	// contains filtered or unexported fields
}

func DoRequest

func DoRequest(req *http.Request, redirect bool) (*Response, error)

func ParseResponse

func ParseResponse(oResp *http.Response) (*Response, error)

func (*Response) Descriptor deprecated

func (*Response) Descriptor() ([]byte, []int)

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetBody

func (x *Response) GetBody() []byte

func (*Response) GetContentType

func (x *Response) GetContentType() string

func (*Response) GetDuration

func (x *Response) GetDuration() float64

func (*Response) GetHeaders

func (x *Response) GetHeaders() map[string]string

func (*Response) GetStatus

func (x *Response) GetStatus() int32

func (*Response) GetUrl

func (x *Response) GetUrl() *UrlType

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

func (x *Response) ProtoReflect() protoreflect.Message

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

type Reverse

type Reverse struct {
	Url                string `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"`
	// contains filtered or unexported fields
}

func (*Reverse) Descriptor deprecated

func (*Reverse) Descriptor() ([]byte, []int)

Deprecated: Use Reverse.ProtoReflect.Descriptor instead.

func (*Reverse) GetDomain

func (x *Reverse) GetDomain() string

func (*Reverse) GetIp

func (x *Reverse) GetIp() string

func (*Reverse) GetIsDomainNameServer

func (x *Reverse) GetIsDomainNameServer() bool

func (*Reverse) GetUrl

func (x *Reverse) GetUrl() string

func (*Reverse) ProtoMessage

func (*Reverse) ProtoMessage()

func (*Reverse) ProtoReflect

func (x *Reverse) ProtoReflect() protoreflect.Message

func (*Reverse) Reset

func (x *Reverse) Reset()

func (*Reverse) String

func (x *Reverse) String() string

type RuleItem

type RuleItem struct {
	Key   string
	Value []Rules
}

type RuleMap

type RuleMap []RuleItem

func (*RuleMap) UnmarshalYAML

func (r *RuleMap) UnmarshalYAML(unmarshal func(interface{}) error) error

type Rules

type Rules struct {
	Method          string            `yaml:"method"`
	Path            string            `yaml:"path"`
	Headers         map[string]string `yaml:"headers"`
	Body            string            `yaml:"body"`
	Search          string            `yaml:"search"`
	FollowRedirects bool              `yaml:"follow_redirects"`
	Expression      string            `yaml:"expression"`
	Continue        bool              `yaml:"continue"`
}

type StrItem

type StrItem struct {
	Key, Value string
}

type StrMap

type StrMap []StrItem

func (*StrMap) UnmarshalYAML

func (r *StrMap) UnmarshalYAML(unmarshal func(interface{}) error) error

type Task

type Task struct {
	Req *http.Request
	Poc *Poc
}

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"`
	// contains filtered or unexported fields
}

func ParseUrl

func ParseUrl(u *url.URL) *UrlType

func (*UrlType) Descriptor deprecated

func (*UrlType) Descriptor() ([]byte, []int)

Deprecated: Use UrlType.ProtoReflect.Descriptor instead.

func (*UrlType) GetDomain

func (x *UrlType) GetDomain() string

func (*UrlType) GetFragment

func (x *UrlType) GetFragment() string

func (*UrlType) GetHost

func (x *UrlType) GetHost() string

func (*UrlType) GetPath

func (x *UrlType) GetPath() string

func (*UrlType) GetPort

func (x *UrlType) GetPort() string

func (*UrlType) GetQuery

func (x *UrlType) GetQuery() string

func (*UrlType) GetScheme

func (x *UrlType) GetScheme() string

func (*UrlType) ProtoMessage

func (*UrlType) ProtoMessage()

func (*UrlType) ProtoReflect

func (x *UrlType) ProtoReflect() protoreflect.Message

func (*UrlType) Reset

func (x *UrlType) Reset()

func (*UrlType) String

func (x *UrlType) String() string

Jump to

Keyboard shortcuts

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