Skip to content

Commit

Permalink
Update v0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
j3ssie committed Feb 4, 2020
1 parent 676cf1c commit e30b8ca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
14 changes: 14 additions & 0 deletions core/detecter.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,20 @@ func RunDetector(record libs.Record, detectionString string) (string, bool) {
return result
})

vm.Set("StringGrepCmd", func(call otto.FunctionCall) otto.Value {
command := call.Argument(0).String()
searchString := call.Argument(0).String()
result, _ := vm.ToValue(StringSearch(Execution(command), searchString))
return result
})

vm.Set("RegexGrepCmd", func(call otto.FunctionCall) otto.Value {
command := call.Argument(0).String()
searchString := call.Argument(0).String()
result, _ := vm.ToValue(RegexSearch(Execution(command), searchString))
return result
})

vm.Set("StringSearch", func(call otto.FunctionCall) otto.Value {
componentName := call.Argument(0).String()
analyzeString := call.Argument(1).String()
Expand Down
14 changes: 1 addition & 13 deletions core/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,6 @@ func ParseParams(rawParams []string) map[string]string {
return params
}

// JoinURL just joining baseURL with path
func JoinURL(base string, child string) string {
u, err := url.Parse(child)
if err != nil {
return ""
}
result, err := url.Parse(base)
if err != nil {
return ""
}
return result.ResolveReference(u).String()
}

// ParseOrigin parse origin request
func ParseOrigin(req libs.Request, sign libs.Signature, options libs.Options) libs.Request {
Expand Down Expand Up @@ -440,7 +428,7 @@ func ParseBurpResponse(rawReq string, rawRes string) (res libs.Response) {
return res
}

// ParseRequestFromServer parse request recive from API server
// ParseRequestFromServer parse request receive from API server
func ParseRequestFromServer(record *libs.Record, req libs.Request, sign libs.Signature) {
if req.Raw != "" {
parsedReq := ParseBurpRequest(req.Raw)
Expand Down

0 comments on commit e30b8ca

Please sign in to comment.