Documentation
¶
Index ¶
- type CacheItem
- type Expr
- type GlobalCache
- type List
- type Map
- type Output
- type POC
- func (p *POC) Clone() (*POC, error)
- func (p *POC) DoReq(req *client.TheRequest) (*client.TheResponse, error)
- func (p *POC) GetAllResults() map[string]bool
- func (p *POC) GetLocal(key string) expression.EValue
- func (p *POC) GetReq(rule string) *client.TheRequest
- func (p *POC) GetResp(rule string) *client.TheResponse
- func (p *POC) GetResult(rule string) bool
- func (p *POC) Locals() map[string]expression.EValue
- func (p *POC) SetLocal(key string, value expression.EValue)
- func (p *POC) SetReq(rule string, req *client.TheRequest)
- func (p *POC) SetResp(rule string, resp *client.TheResponse)
- func (p *POC) SetResult(rule string, result bool)
- type Payload
- type PocContext
- type Request
- type Rule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheItem ¶
type CacheItem struct {
PocName string
RuleName string
Req *client.TheRequest
Resp *client.TheResponse
}
CacheItem 缓存
type Expr ¶
type Expr struct {
Env *expression.Environment
StrValue string
}
Expr 表达式 一开始没有把表达式当作 string 所以给到了一个 struct 未来拓展
type GlobalCache ¶
type GlobalCache struct {
// contains filtered or unexported fields
}
GlobalCache 全局的缓存
func NewGlobalCache ¶
func NewGlobalCache() *GlobalCache
func (*GlobalCache) GetCache ¶
func (g *GlobalCache) GetCache(req *client.TheRequest) (*client.TheResponse, error)
func (*GlobalCache) SetCache ¶
func (g *GlobalCache) SetCache( pocName string, rule string, req *client.TheRequest, resp *client.TheResponse) error
type List ¶
type List[T any] struct { // contains filtered or unexported fields }
List 这是一个 list 的包装
type Map ¶
type Map[K comparable, V any] struct { // contains filtered or unexported fields }
Map golang 的 map 是无序的 有时候其实是需要一个有序的 map 结构
func NewMap ¶
func NewMap[K comparable, V any]() *Map[K, V]
type POC ¶
type POC struct {
Ctx context.Context
// 这是 EXPRESSION 的环境
Env *expression.Environment
// 当前 POC 需要保存的信息
Context *PocContext
// 全局的缓存
Caches *GlobalCache
Target string
Name string
// 目前仅支持 HTTP
Transport string
Set *Map[string, *Expr]
Payload *Payload
Rules *Map[string, *Rule]
Expression *Expr
// DETAIL 暂未实现
Detail *Map[string, string]
}
POC XRAY 的 POC 总结构体
func (*POC) DoReq ¶
func (p *POC) DoReq(req *client.TheRequest) (*client.TheResponse, error)
func (*POC) GetAllResults ¶
type Payload ¶
type Payload struct {
// contains filtered or unexported fields
}
Payload XRAY 的 PAYLOAD 语法后续考虑支持
func NewPayload ¶
func NewPayload() *Payload
type PocContext ¶
type PocContext struct {
// 包装后的 HTTP CLIENT
// 不建议直接使用 RAW CLIENT
Client *client.HttpClient
// 适用于当前 POC 运行环境的本地变量
Local *Map[string, expression.EValue]
// 记录每一个 rule 的 request 信息
AllRequests *Map[string, *client.TheRequest]
// 记录每一个 rule 的 response 信息
AllResponses *Map[string, *client.TheResponse]
// 记录每一个 rule 的执行结果
AllResults *Map[string, bool]
}
PocContext 单个 POC 的 Context 这里的很多信息保存暂时未用到 考虑到未来做统计需要
func NewPocContext ¶
func NewPocContext(c *client.HttpClient) (*PocContext, error)
Click to show internal directories.
Click to hide internal directories.