Documentation ¶
Index ¶
- Variables
- func LoadTemplatesWithTags(templatesList, tags []string, ExcludeTags []string, Pocs embed.FS) []*templates.Template
- func NucleiStart(target string, template []*templates.Template) []string
- func XrayStart(target string, pocs []*xray_structs.Poc) []string
- type RequestFuncType
- type Rule
- type RuleRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BodyBufPool = sync.Pool{ New: func() interface{} { return make([]byte, 1024) }, } BodyPool = sync.Pool{ New: func() interface{} { return make([]byte, 4096) }, } VariableMapPool = sync.Pool{ New: func() interface{} { return make(map[string]interface{}) }, } )
View Source
var RequestsInvoke = func(target string, setMap map[string]interface{}, rule structs.Rule) bool { var req *http.Request var err error if rule.Request.Body == "" { req, err = http.NewRequest(rule.Request.Method, target+render(rule.Request.Path, setMap), nil) } else { req, err = http.NewRequest(rule.Request.Method, target+render(rule.Request.Path, setMap), bytes.NewBufferString(render(rule.Request.Body, setMap))) } for k, v := range setMap { vStr := fmt.Sprintf("%v", v) req.Header.Set(k, vStr) } if err != nil { gologger.Error().Msgf(fmt.Sprintf("http request error: %s", err.Error())) return false } tr := &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, } client := &http.Client{Transport: tr} resp, err := client.Do(req) if err != nil { println(err.Error()) return false } response := &structs.Response{} response.Body, _ = ioutil.ReadAll(resp.Body) return execRuleExpression(rule.Expression, map[string]interface{}{"response": response}) }
Functions ¶
func LoadTemplatesWithTags ¶
Types ¶
type RequestFuncType ¶
type RequestFuncType func(ruleName string, rule xray_structs.Rule) error
type Rule ¶
type Rule struct { Request RuleRequest `yaml:"request"` Expression string `yaml:"expression"` }
Click to show internal directories.
Click to hide internal directories.