Documentation ¶
Index ¶
- Variables
- func BeUsedForRedirect(key string, value interface{}) bool
- func GetSensitiveKeyList() []string
- func HaveServerError(body []byte) bool
- func IsBase64(s string) bool
- func IsBase64Password(s string) bool
- func IsCaptchaKey(key string) bool
- func IsFullURL(v interface{}) bool
- func IsGenericURLParam(key string, value interface{}) bool
- func IsHTMLResponse(resp *http.Response) bool
- func IsJSONPParam(key string, value interface{}) bool
- func IsJsonResponse(resp *http.Response) bool
- func IsJsonResponseRaw(resp []byte) bool
- func IsMD5Data(s string) bool
- func IsPasswordKey(key string) bool
- func IsSHA256Data(s string) bool
- func IsSQLColumnName(s string) bool
- func IsSensitiveJSON(data []byte) bool
- func IsSensitiveJSONP(reqRaw []byte, rspRaw []byte) bool
- func IsTokenParam(key string) bool
- func IsURLPath(v interface{}) bool
- func IsUsernameKey(key string) bool
- func IsXMLBytes(data []byte) bool
- func IsXMLParam(key string, value interface{}) bool
- func IsXMLRequest(raw []byte) bool
- func IsXMLString(data string) bool
- func SearchChineseIDCards(data []byte) []string
Constants ¶
This section is empty.
Variables ¶
View Source
var GuessExports = map[string]interface{}{ "IsAlpha": func(i interface{}) bool { return utils.MatchAllOfRegexp(i, `[a-zA-Z]+`) }, "IsDigit": func(i interface{}) bool { return utils.MatchAllOfRegexp(i, `[0-9]+`) }, "IsAlphaNum": func(i interface{}) bool { return utils.MatchAllOfRegexp(i, `[a-zA-Z0-9]+`) }, "IsAlNum": func(i interface{}) bool { return utils.MatchAllOfRegexp(i, `[a-zA-Z0-9]+`) }, "IsTLSServer": utils.IsTLSService, "IsHttpURL": IsFullURL, "IsUrlPath": IsURLPath, "IsHtmlResponse": func(i interface{}) bool { switch ret := i.(type) { case string: rsp, err := lowhttp.ParseBytesToHTTPResponse([]byte(ret)) if err != nil { log.Error(err) return false } return IsHTMLResponse(rsp) case []byte: rsp, err := lowhttp.ParseBytesToHTTPResponse(ret) if err != nil { log.Error(err) return false } return IsHTMLResponse(rsp) case *http.Response: return IsHTMLResponse(ret) default: log.Errorf("need []byte/string/*http.Response but got %s", reflect.TypeOf(ret)) return false } }, "IsServerError": func(i interface{}) bool { switch ret := i.(type) { case string: return HaveServerError([]byte(ret)) case []byte: return HaveServerError(ret) default: return HaveServerError([]byte(fmt.Sprint(ret))) } }, "ExtractChineseIDCards": func(i interface{}) []string { switch ret := i.(type) { case string: return SearchChineseIDCards([]byte(ret)) case []byte: return SearchChineseIDCards(ret) default: return SearchChineseIDCards([]byte(fmt.Sprint(ret))) } }, "IsJsonResponse": func(i interface{}) bool { switch ret := i.(type) { case string: rsp, err := lowhttp.ParseBytesToHTTPResponse([]byte(ret)) if err != nil { log.Error(err) return false } return IsJsonResponse(rsp) case []byte: rsp, err := lowhttp.ParseBytesToHTTPResponse(ret) if err != nil { log.Error(err) return false } return IsJsonResponse(rsp) case *http.Response: return IsJsonResponse(ret) default: log.Errorf("need []byte/string/*http.Response but got %s", reflect.TypeOf(ret)) return false } }, "IsRedirectParam": BeUsedForRedirect, "IsJSONPParam": IsJSONPParam, "IsUrlParam": IsGenericURLParam, "IsXmlParam": IsXMLParam, "IsSensitiveJson": IsSensitiveJSON, "IsSensitiveTokenField": IsTokenParam, "IsPasswordField": IsPasswordKey, "IsUsernameField": IsUsernameKey, "IsSQLColumnField": IsSQLColumnName, "IsCaptchaField": IsCaptchaKey, "IsBase64Value": IsBase64, "IsPlainBase64Value": IsBase64Password, "IsMD5Value": IsMD5Data, "IsSha256Value": IsSHA256Data, "IsXmlRequest": func(i interface{}) bool { switch ret := i.(type) { case []byte: return IsXMLRequest(ret) case string: return IsXMLRequest([]byte(ret)) case *http.Request: raw, _ := utils.HttpDumpWithBody(i, true) return IsXMLRequest(raw) default: return false } }, "IsXmlValue": func(i interface{}) bool { switch ret := i.(type) { case string: return IsXMLString(ret) case []byte: return IsXMLBytes(ret) } return false }, }
Functions ¶
func BeUsedForRedirect ¶
根据 key 的名字猜测是否是用于重定向的参数
func GetSensitiveKeyList ¶
func GetSensitiveKeyList() []string
func HaveServerError ¶
func IsBase64Password ¶
func IsCaptchaKey ¶
func IsFullURL ¶
func IsFullURL(v interface{}) bool
IsFullURL 根据 value 猜测是否是一个完整 url,目前只关心 http 和 https
func IsGenericURLParam ¶
func IsHTMLResponse ¶
IsHTMLResponse 判断 response 是否为 html 格式 1. response content-type 2. check fist 500 bytes
func IsJSONPParam ¶
func IsJsonResponse ¶
func IsJsonResponseRaw ¶
func IsPasswordKey ¶
func IsSHA256Data ¶
func IsSQLColumnName ¶
func IsSensitiveJSON ¶
func IsSensitiveJSONP ¶
ref: https://portswigger.net/blog/json-hijacking-for-the-modern-web
判断逻辑 1. get method 2. query 中有 callback, cb, jsonp 参数 3. (nosniff = true && content-type = js) || (nosniff = false && content-type maybe js) 4. 不能是 {, <, [, " 开头 5. 包含 ( 或者 = 6. 重要!包含敏感数据,username, ip 等 7. 该函数用于初筛(Check 函数), 具体漏洞确定在 jsonp package 内
func IsTokenParam ¶
func IsUsernameKey ¶
func IsXMLBytes ¶
func IsXMLParam ¶
func IsXMLRequest ¶
func IsXMLString ¶
func SearchChineseIDCards ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.