initial cleanup

This commit is contained in:
au
2023-06-05 19:02:55 +03:00
parent 4cfe02ac2c
commit 04a7ba1357
26 changed files with 363 additions and 726 deletions
+3 -5
View File
@@ -132,7 +132,6 @@ func executePoc(oReq *http.Request, p *Poc) (bool, error, string) {
newRequest, err := http.NewRequest(rule.Method, fmt.Sprintf("%s://%s%s", req.Url.Scheme, req.Url.Host, string([]rune(req.Url.Path))), strings.NewReader(rule.Body))
if err != nil {
//fmt.Println("[-] newRequest error: ",err)
return false, err
}
newRequest.Header = oReq.Header.Clone()
@@ -149,7 +148,7 @@ func executePoc(oReq *http.Request, p *Poc) (bool, error, string) {
// 先判断响应页面是否匹配search规则
if rule.Search != "" {
result := doSearch(rule.Search, GetHeader(resp.Headers)+string(resp.Body))
if result != nil && len(result) > 0 { // 正则匹配成功
if len(result) > 0 { // 正则匹配成功
for k, v := range result {
variableMap[k] = v
}
@@ -161,7 +160,7 @@ func executePoc(oReq *http.Request, p *Poc) (bool, error, string) {
if err != nil {
return false, err
}
//fmt.Println(fmt.Sprintf("%v, %s", out, out.Type().TypeName()))
//如果false不继续执行后续rule
// 如果最后一步执行失败,就算前面成功了最终依旧是失败
flag, ok = out.Value().(bool)
@@ -445,7 +444,6 @@ func clustersend(oReq *http.Request, variableMap map[string]interface{}, req *Re
//
newRequest, err := http.NewRequest(rule.Method, fmt.Sprintf("%s://%s%s", req.Url.Scheme, req.Url.Host, req.Url.Path), strings.NewReader(rule.Body))
if err != nil {
//fmt.Println("[-] newRequest error:",err)
return false, err
}
newRequest.Header = oReq.Header.Clone()
@@ -477,7 +475,7 @@ func clustersend(oReq *http.Request, variableMap map[string]interface{}, req *Re
}
return false, err
}
//fmt.Println(fmt.Sprintf("%v, %s", out, out.Type().TypeName()))
if fmt.Sprintf("%v", out) == "false" { //如果false不继续执行后续rule
return false, err // 如果最后一步执行失败,就算前面成功了最终依旧是失败
}
+1 -2
View File
@@ -570,7 +570,7 @@ func reverseCheck(r *Reverse, timeout int64) bool {
time.Sleep(time.Second * time.Duration(timeout))
sub := strings.Split(r.Domain, ".")[0]
urlStr := fmt.Sprintf("http://api.ceye.io/v1/records?token=%s&type=dns&filter=%s", ceyeApi, sub)
//fmt.Println(urlStr)
req, _ := http.NewRequest("GET", urlStr, nil)
resp, err := DoRequest(req, false)
if err != nil {
@@ -621,7 +621,6 @@ func DoRequest(req *http.Request, redirect bool) (*Response, error) {
oResp, err = ClientNoRedirect.Do(req)
}
if err != nil {
//fmt.Println("[-]DoRequest error: ",err)
return nil, err
}
defer oResp.Body.Close()