更新mod库、编码、poc等

This commit is contained in:
shadow1ng
2021-05-06 11:37:29 +08:00
parent 7294051b44
commit 402add56c7
31 changed files with 388 additions and 62 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ func executePoc(oReq *http.Request, p *Poc) (bool, error) {
}
env, err := NewEnv(&c)
if err != nil {
//fmt.Println("environment creation error: %s\n", err)
//fmt.Printf("environment creation error: %s\n", err)
return false, err
}
req, err := ParseRequest(oReq)
+3 -3
View File
@@ -26,19 +26,19 @@ func NewEnv(c *CustomLib) (*cel.Env, error) {
func Evaluate(env *cel.Env, expression string, params map[string]interface{}) (ref.Val, error) {
ast, iss := env.Compile(expression)
if iss.Err() != nil {
//fmt.Println("compile: ", iss.Err())
//fmt.Printf("compile: ", iss.Err())
return nil, iss.Err()
}
prg, err := env.Program(ast)
if err != nil {
//fmt.Println("Program creation error: %v", err)
//fmt.Printf("Program creation error: %v", err)
return nil, err
}
out, _, err := prg.Eval(params)
if err != nil {
//fmt.Println("Evaluation error: %v", err)
//fmt.Printf("Evaluation error: %v", err)
return nil, err
}
return out, nil
+3
View File
@@ -10,6 +10,7 @@ import (
"net/http"
"net/url"
"strconv"
"strings"
"time"
)
@@ -39,6 +40,8 @@ func InitHttpClient(ThreadsNum int, DownProxy string, Timeout time.Duration) err
if DownProxy != "" {
if DownProxy == "1" {
DownProxy = "http://127.0.0.1:8080"
} else if !strings.Contains(DownProxy, "://") {
DownProxy = "http://127.0.0.1:" + DownProxy
}
u, err := url.Parse(DownProxy)
if err != nil {