mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-22 18:35:25 +00:00
base64_decode fix
This commit is contained in:
parent
cd5569f7ac
commit
163e2bc35b
@ -10,7 +10,7 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
"log"
|
||||||
"github.com/Knetic/govaluate"
|
"github.com/Knetic/govaluate"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -72,11 +72,14 @@ func HelperFunctions() (functions map[string]govaluate.ExpressionFunction) {
|
|||||||
return sEnc, nil
|
return sEnc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
functions["base64_decode"] = func(args ...interface{}) (interface{}, error) {
|
functions["base64_decode"] = func(args ...interface{}) (interface{}, error) {
|
||||||
sEnc := base64.StdEncoding.EncodeToString([]byte(args[0].(string)))
|
sDec, err := base64.StdEncoding.DecodeString(args[0].(string))
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal("error:", err)
|
||||||
|
}
|
||||||
|
|
||||||
return sEnc, nil
|
return sDec, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
functions["url_encode"] = func(args ...interface{}) (interface{}, error) {
|
functions["url_encode"] = func(args ...interface{}) (interface{}, error) {
|
||||||
return url.PathEscape(args[0].(string)), nil
|
return url.PathEscape(args[0].(string)), nil
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user