<?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>Security Research by Dan Rosenberg</title>
	<atom:link href="http://vulnfactory.org/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://vulnfactory.org/blog</link>
	<description>It&#039;s Bugs All the Way Down</description>
	<lastBuildDate>Tue, 09 Apr 2013 17:47:52 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.2.20</generator>
	<item>
		<title>Motorola Bootloader Unlocking</title>
		<link>http://vulnfactory.org/blog/2013/04/08/motorola-bootloader-unlocking/</link>
		<comments>http://vulnfactory.org/blog/2013/04/08/motorola-bootloader-unlocking/#comments</comments>
		<pubDate>Mon, 08 Apr 2013 16:22:58 +0000</pubDate>
		<dc:creator><![CDATA[drosenbe]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vulnfactory.org/blog/?p=545</guid>
		<description><![CDATA[I recently unlocked the bootloader for the consumer editions of Motorola Android devices using Qualcomm Snapdragon processors. This includes the Razr HD, Razr Maxx HD, Razr M, and Atrix HD models. The details of this research have been published on Azimuth Security&#8217;s blog. Terms of Use I have created a tool that may be used to unlock your bootloader. It requires that your device has been rooted and that the &#8220;su&#8221; binary has been properly installed. By using this tool, you agree to the following conditions: 1. You understand that using this tool will permanently, irreversibly void your device&#8217;s warranty. 2. You &#8230; <a href="http://vulnfactory.org/blog/2013/04/08/motorola-bootloader-unlocking/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I recently unlocked the bootloader for the consumer editions of Motorola Android devices using Qualcomm Snapdragon processors. This includes the Razr HD, Razr Maxx HD, Razr M, and Atrix HD models. The details of this research have been published on <a href="http://blog.azimuthsecurity.com/2013/04/unlocking-motorola-bootloader.html">Azimuth Security&#8217;s blog</a>.</p>
<p><span id="more-545"></span></p>
<h1>Terms of Use</h1>
<p>I have created a tool that may be used to unlock your bootloader. It requires that your device has been rooted and that the &#8220;su&#8221; binary has been properly installed. By using this tool, you agree to the following conditions:</p>
<ol>
<li><span style="line-height: 16px;">1. You understand that using this tool will permanently, irreversibly void your device&#8217;s warranty.</span></li>
<li>2. You understand that it may not be possible to &#8220;relock&#8221; your device&#8217;s bootloader after unlocking using this tool. A side effect of this is that if you lose your device and you are not using disk encryption, a malicious party who acquires your phone may be able to extract all personal data from the device regardless of any lock screen.</li>
<li>3. You agree that I am in no way responsible for any damage to your device as a result of using this tool.</li>
</ol>
<h1>Instructions</h1>
<p>The tool may be downloaded <a href="http://vulnfactory.org/public/motopocalypse.zip">here</a>. It may be used as follows:</p>
<ol>
<li><span style="line-height: 16px;">1. Extract the entire contents of the zip file.</span></li>
<li>2. If you are using Windows, ensure you have installed the latest Motorola USB drivers available for your phone.</li>
<li>3. Ensure your device has been rooted and you have a working installation of &#8220;su&#8221;.</li>
<li>4. Ensure USB Debugging mode is enabled on your device.</li>
<li>5. If you are using Windows, navigate to the extracted directory and execute &#8220;run.bat&#8221;. If you are using Linux or OS X, navigate to the extracted directory in a terminal and execute &#8220;./run.sh&#8221;.</li>
</ol>
<h1>Frequently Asked Questions</h1>
<p><i>Will this support _____?</i></p>
<p>This tool supports the Razr HD, Razr Maxx HD, Razr M, and Atrix HD. No other models are supported. In particular, earlier OMAP-based Motorola phones will not be unlockable using this approach. Attempting to use this tool on unsupported devices may result in irreparable damage.</p>
<p><i>Can I re-package this tool and put my name on it?</i></p>
<p>No.</p>
<p><em>Can this be patched by Motorola or my carrier?</em></p>
<p>Absolutely. As always, if you&#8217;re interested in keeping your root access or unlocked bootloader, approach all OTA updates with caution. Be aware that failing to install OTA updates may deprive your device of important security and stability fixes and new features.</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations"><br />
<input type="hidden" name="business" value="KJBYX8NX3QGN2"><br />
<input type="hidden" name="lc" value="US"><br />
<input type="hidden" name="item_name" value="Dan Rosenberg"><br />
<input type="hidden" name="currency_code" value="USD"><br />
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted"><br />
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"><br />
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
</form>
]]></content:encoded>
			<wfw:commentRss>http://vulnfactory.org/blog/2013/04/08/motorola-bootloader-unlocking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Linux Memory Trick</title>
		<link>http://vulnfactory.org/blog/2013/02/06/a-linux-memory-trick/</link>
		<comments>http://vulnfactory.org/blog/2013/02/06/a-linux-memory-trick/#comments</comments>
		<pubDate>Wed, 06 Feb 2013 18:23:38 +0000</pubDate>
		<dc:creator><![CDATA[drosenbe]]></dc:creator>
				<category><![CDATA[Kernel]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://vulnfactory.org/blog/?p=513</guid>
		<description><![CDATA[I discovered a neat little trick on Linux: on x86 (and a few other less common architectures), it&#8217;s possible to determine from an unprivileged process whether an address residing within the kernel address space is mapped or unmapped. The top-level page fault handler on x86 is do_page_fault(), found in arch/x86/mm/fault.c. When the CPU fires a page fault exception, it pushes an error code onto the stack, which is accessible as an argument to the page fault handler. When a userland process attempts to access unmapped memory or memory whose page permissions do not allow the desired type of access, the &#8230; <a href="http://vulnfactory.org/blog/2013/02/06/a-linux-memory-trick/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I discovered a neat little trick on Linux: on x86 (and a few other less common architectures), it&#8217;s possible to determine from an unprivileged process whether an address residing within the kernel address space is mapped or unmapped.</p>
<p><span id="more-513"></span>The top-level page fault handler on x86 is <code>do_page_fault()</code>, found in <code>arch/x86/mm/fault.c</code>. When the CPU fires a page fault exception, it pushes an error code onto the stack, which is accessible as an argument to the page fault handler.</p>
<p>When a userland process attempts to access unmapped memory or memory whose page permissions do not allow the desired type of access, the following code path is invoked:<br />
<code><br />
do_page_fault()<br />
__do_page_fault()<br />
bad_area_nosemaphore()<br />
__bad_area_nosemaphore()<br />
show_signal_msg()<br />
</code></p>
<p>This last function prints a message to the kernel syslog with information about the uncaught <code>SIGSEGV</code> that is thrown as a result of the invalid memory access:</p>
<pre>
static inline void
show_signal_msg(struct pt_regs *regs, unsigned long error_code,
        unsigned long address, struct task_struct *tsk)
{
    if (!unhandled_signal(tsk, SIGSEGV))
        return;
        
    if (!printk_ratelimit())
        return;
        
    printk("%s%s[%d]: segfault at %lx ip %p sp %p error %lx",
        task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG,
        tsk->comm, task_pid_nr(tsk), address,
        (void *)regs->ip, (void *)regs->sp, error_code);
    
    print_vma_addr(KERN_CONT " in ", regs->ip);

    printk(KERN_CONT "\n");
}
</pre>
<p>Note that the <code>error_code</code> printed to the syslog has been passed down all the way from the top-level page fault handler. It&#8217;s worth taking a look at what the bits of this error code correspond to. Most importantly, bit 0 is the Present flag, indicating whether or not the page the process was trying to access is present at all. Bit 1 is the Read/Write flag, indicating whether this was a read or write fault, and bit 2 is the User/Supervisor flag, which is 0 when the fault was caused by a supervisory process, and 1 if the fault was caused by a user process.</p>
<p>In other words, regardless of whether the attempted access resides in user or kernel space, the error code logged to the syslog indicates whether the address corresponds to a present or absent page. This can be verified as follows:</p>
<pre>
$ cat trick.c
#include &lt;stdlib.h&gt;

int main(int argc, char **argv)
{
    int *ptr, foo;
    ptr = (int *)strtoul(argv[1], NULL, 16);
    foo = *ptr;
}

$ ./trick ffffffff81aa3690
Segmentation fault (core dumped)
$ ./trick ffffffffc1aa3690
Segmentation fault (core dumped)
$ dmesg | grep segfault
[391396.756467] trick[31865]: segfault at ffffffff81aa3690 ip 0000000000400528 sp 00007fff7c026ba0 error 5 in trick[400000+1000]
[391404.736606] trick[31872]: segfault at ffffffffc1aa3690 ip 0000000000400528 sp 00007fff170fac60 error 4 in trick[400000+1000]
</pre>
<p>The first invocation deliberately causes an access violation on a mapped kernel address, resulting in an error code of 5 (a read violation from user mode on a present page). The second invocation causes an access violation on an unmapped kernel address, resulting in an error code of 4 (a read violation from user mode on a non-present page).</p>
<p>This trick is only possible if you can read the syslog in the first place, so the <code>dmesg_restrict</code> sysctl must be disabled.</p>
]]></content:encoded>
			<wfw:commentRss>http://vulnfactory.org/blog/2013/02/06/a-linux-memory-trick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rooting the LG Thrill / Optimus 3D</title>
		<link>http://vulnfactory.org/blog/2012/02/26/rooting-the-lg-thrill-optimus-3d/</link>
		<comments>http://vulnfactory.org/blog/2012/02/26/rooting-the-lg-thrill-optimus-3d/#comments</comments>
		<pubDate>Sun, 26 Feb 2012 21:02:43 +0000</pubDate>
		<dc:creator><![CDATA[drosenbe]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vulnfactory.org/blog/?p=499</guid>
		<description><![CDATA[Another silly file permissions bug. At least the exploitation of this one was a little bit more interesting. Exploitation The vulnerability in this case allowed me to chmod an arbitrary file or directory 0777 (world-writable). Normally I&#8217;d go for /data/local.prop (if it already exists) or /data itself (if it doesn&#8217;t). However, on this particular device, setting the ro.kernel.qemu property (to cause ADB to give a root shell) caused the device to bootloop before ADBD started. My second go-to for these types of bugs is /proc/sys/kernel/modprobe or /proc/sys/kernel/hotplug, since writing the path of a user-controlled executable and triggering a module load &#8230; <a href="http://vulnfactory.org/blog/2012/02/26/rooting-the-lg-thrill-optimus-3d/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Another silly file permissions bug.  At least the exploitation of this one was a little bit more interesting.</p>
<p><span id="more-499"></span></p>
<h2>Exploitation</h2>
<p>The vulnerability in this case allowed me to <code>chmod</code> an arbitrary file or directory 0777 (world-writable).  Normally I&#8217;d go for <code>/data/local.prop</code> (if it already exists) or <code>/data</code> itself (if it doesn&#8217;t).  However, on this particular device, setting the ro.kernel.qemu property (to cause ADB to give a root shell) caused the device to bootloop before ADBD started.</p>
<p>My second go-to for these types of bugs is <code>/proc/sys/kernel/modprobe</code> or <code>/proc/sys/kernel/hotplug</code>, since writing the path of a user-controlled executable and triggering a module load or hotplug event would be a win.  For some reason, changing the permissions on these files with this particular bug didn&#8217;t work &#8211; I suspect either /proc wasn&#8217;t mounted at the time of the <code>chmod</code> or a later init script restored the permissions of these files.  Either way, these options were out.</p>
<p>As yet another vector, I chose to make the block device corresponding to the /system partition world-writable.  I pulled the setuid-root &#8220;run-as&#8221; application from the device, opened it up in IDA, and found a good place to patch it to cause it to fail to drop privileges, so that rather than allowing me to run with a particular application&#8217;s privileges, it would grant me a root shell.  I then patched these bytes by writing directly to the block device.  It&#8217;s ugly, but it works.</p>
<h2>Download</h2>
<p>Download the Windows version <a href="http://vulnfactory.org/public/megatron_windows.zip">here</a>.  To root your phone, install LG ADB drivers, put the device in USB debugging mode, connect via USB, extract the zip file, and execute &#8220;run.bat&#8221;.</p>
<p>This exploit is not guaranteed to be 100% effective or stable.  In a worst-case scenario, you may need to reflash your build and try again.</p>
<p>I encourage anyone thinking of donating in thanks to direct your donation to the American Red Cross or another reputable charitable organization.  If you absolutely insist on throwing money at me instead, you can donate below.</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations"><br />
<input type="hidden" name="business" value="KJBYX8NX3QGN2"><br />
<input type="hidden" name="lc" value="US"><br />
<input type="hidden" name="item_name" value="Dan Rosenberg"><br />
<input type="hidden" name="currency_code" value="USD"><br />
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted"><br />
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"><br />
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
</form>
]]></content:encoded>
			<wfw:commentRss>http://vulnfactory.org/blog/2012/02/26/rooting-the-lg-thrill-optimus-3d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rooting the LG Spectrum</title>
		<link>http://vulnfactory.org/blog/2012/02/19/rooting-the-lg-spectrum/</link>
		<comments>http://vulnfactory.org/blog/2012/02/19/rooting-the-lg-spectrum/#comments</comments>
		<pubDate>Sun, 19 Feb 2012 00:24:23 +0000</pubDate>
		<dc:creator><![CDATA[drosenbe]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vulnfactory.org/blog/?p=493</guid>
		<description><![CDATA[Yawn. LG loses, users win. Download the Windows version here, or the Linux/OSX version here. To root your phone, install LG ADB drivers if on Windows, put the device in USB debugging mode, connect via USB, extract the zip file, and execute &#8220;run.bat&#8221; (on Windows) or &#8220;run.sh&#8221; from a terminal (on Linux/OSX). I encourage anyone thinking of donating in thanks to direct your donation to the American Red Cross or another reputable charitable organization. If you absolutely insist on throwing money at me instead, you can donate below.]]></description>
				<content:encoded><![CDATA[<p>Yawn.  LG loses, users win.<br />
<span id="more-493"></span></p>
<p>Download the Windows version <a href="http://vulnfactory.org/public/spectrum_root_windows.zip">here</a>, or the Linux/OSX version <a href="http://vulnfactory.org/public/spectrum_root_linux_osx.zip">here</a>.  To root your phone, install LG ADB drivers if on Windows, put the device in USB debugging mode, connect via USB, extract the zip file, and execute &#8220;run.bat&#8221; (on Windows) or &#8220;run.sh&#8221; from a terminal (on Linux/OSX).</p>
<p>I encourage anyone thinking of donating in thanks to direct your donation to the American Red Cross or another reputable charitable organization.  If you absolutely insist on throwing money at me instead, you can donate below.</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations"><br />
<input type="hidden" name="business" value="KJBYX8NX3QGN2"><br />
<input type="hidden" name="lc" value="US"><br />
<input type="hidden" name="item_name" value="Dan Rosenberg"><br />
<input type="hidden" name="currency_code" value="USD"><br />
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted"><br />
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"><br />
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
</form>
]]></content:encoded>
			<wfw:commentRss>http://vulnfactory.org/blog/2012/02/19/rooting-the-lg-spectrum/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Xoom FE: Stupid Bugs, and More Plagiarism</title>
		<link>http://vulnfactory.org/blog/2012/02/18/xoom-fe-stupid-bugs-and-more-plagiarism/</link>
		<comments>http://vulnfactory.org/blog/2012/02/18/xoom-fe-stupid-bugs-and-more-plagiarism/#comments</comments>
		<pubDate>Sat, 18 Feb 2012 17:20:38 +0000</pubDate>
		<dc:creator><![CDATA[drosenbe]]></dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Exploitation]]></category>

		<guid isPermaLink="false">http://vulnfactory.org/blog/?p=473</guid>
		<description><![CDATA[Someone mentioned to me that yesterday&#8217;s root for the Motorola XYBoard appeared to not work on the Xoom Family Edition (FE), so I took a look. What I found was a set of vulnerabilities so egregious that it&#8217;s hard to not draw comparisons to a deliberate backdoor. Plagiarism for Profit After doing some research on what&#8217;s been done on this device in the past, I found that it has apparently been rooted before, prior to the most recent OTA update. Someone by the name of &#8220;Evil_DevNull&#8221; published a root exploit here, that appeared to take advantage of a command injection &#8230; <a href="http://vulnfactory.org/blog/2012/02/18/xoom-fe-stupid-bugs-and-more-plagiarism/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Someone mentioned to me that yesterday&#8217;s root for the Motorola XYBoard appeared to not work on the Xoom Family Edition (FE), so I took a look.  What I found was a set of vulnerabilities so egregious that it&#8217;s hard to not draw comparisons to a deliberate backdoor.</p>
<p><span id="more-473"></span></p>
<h1>Plagiarism for Profit</h1>
<p>After doing some research on what&#8217;s been done on this device in the past, I found that it has apparently been rooted before, prior to the most recent OTA update.  Someone by the name of &#8220;Evil_DevNull&#8221; published a root exploit <a href="http://www.xoomforums.com/forum/evil_devnull/13595-motorola-xoom-family-edition-rooting-exploit.html">here</a>, that appeared to take advantage of a command injection vulnerability in a utility called &#8220;cmdclient&#8221;.  He then proceeded to repeatedly request and receive monetary donations.  This would all be fine (donating to developers is a good way to support their otherwise unpaid work), except Evil_DevNull seems to have ripped off the exploit used <a href="http://forum.xda-developers.com/showthread.php?t=1213014">here</a> to root the Acer Iconia A100, which is just a variation on an exploit published as &#8220;iconiaroot&#8221; <a href="http://forum.xda-developers.com/showthread.php?t=1138228">here</a>, authored by &#8220;sc2k&#8221;.  Congratulations, Evil_DevNull, you&#8217;ve managed to profit by ripping off someone else&#8217;s exploit without credit!</p>
<h1>Stupidest Root Ever?</h1>
<p>Anyway, back to the fun stuff.  After confirming that cmdclient is installed setuid root, I pulled up IDA and took a look at what it does.  What I saw was so broken it was hard to believe.</p>
<p>The first few arguments cmdclient supports are &#8220;ec_recovery&#8221;, &#8220;ec_btmac&#8221;, &#8220;ec_snid&#8221;, &#8220;ec_skunumber&#8221;, and &#8220;ec_imeiwithbarcode&#8221;.  Each of these commands builds a command string using the second argument (such as &#8220;echo [arg] > /sys//EcControl/RecoveryMode&#8221;) and executes it using system().  These are all trivial command injection vulnerabilities: something like &#8220;cmdclient ec_skunumber &#8216;; [my cmd];'&#8221; works fine to execute arbitrary commands as root.  Ok, device rooted, that was easy.</p>
<p>But one of the other cmdclient options was so ridiculous that it&#8217;s hard to believe it isn&#8217;t a deliberate backdoor.  &#8220;cmdclient sys_open&#8221; will perform a &#8220;chmod 777 /data&#8221; and &#8220;chmod 777 /cache&#8221;, among a few other things, which obviously cripples the security of the device and allows gaining root yet again.  They might as well rename the application &#8220;own_my_device_now&#8221;.</p>
<h1>Download</h1>
<p>If you&#8217;re a Xoom FE owner, you can download a Windows root script <a href="/public/xoomfail_windows.zip">here</a> or a Linux/OSX version <a href="/public/xoomfail_linux_osx.zip">here</a>.  Install the appropriate Motorola drivers, connect your device via USB, extract the appropriate zip, and execute &#8220;run.bat&#8221; (on Windows) or &#8220;run.sh&#8221; from a terminal (on Linux/OSX).  Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://vulnfactory.org/blog/2012/02/18/xoom-fe-stupid-bugs-and-more-plagiarism/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rooting the XYBoard/Xoom 2</title>
		<link>http://vulnfactory.org/blog/2012/02/17/rooting-the-xyboardxoom-2/</link>
		<comments>http://vulnfactory.org/blog/2012/02/17/rooting-the-xyboardxoom-2/#comments</comments>
		<pubDate>Fri, 17 Feb 2012 18:59:51 +0000</pubDate>
		<dc:creator><![CDATA[drosenbe]]></dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Exploitation]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://vulnfactory.org/blog/?p=467</guid>
		<description><![CDATA[Another day, another tablet rooted. I wonder when Motorola will realize that it&#8217;s hopeless to try to prevent device owners from controlling their own hardware. Download the Windows version here, or the Linux/OSX version here. To root your tablet, install Motorola ADB drivers if on Windows, put the device in USB debugging mode, connect via USB, extract the zip file, and execute &#8220;run.bat&#8221; (on Windows) or &#8220;run.sh&#8221; from a terminal (on Linux/OSX).]]></description>
				<content:encoded><![CDATA[<p>Another day, another tablet rooted.  I wonder when Motorola will realize that it&#8217;s hopeless to try to prevent device owners from controlling their own hardware.<br />
<span id="more-467"></span></p>
<p>Download the Windows version <a href="http://vulnfactory.org/public/xyz_windows.zip">here</a>, or the Linux/OSX version <a href="http://vulnfactory.org/public/xyz_linux_osx.zip">here</a>.  To root your tablet, install Motorola ADB drivers if on Windows, put the device in USB debugging mode, connect via USB, extract the zip file, and execute &#8220;run.bat&#8221; (on Windows) or &#8220;run.sh&#8221; from a terminal (on Linux/OSX).</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations"><br />
<input type="hidden" name="business" value="KJBYX8NX3QGN2"><br />
<input type="hidden" name="lc" value="US"><br />
<input type="hidden" name="item_name" value="Dan Rosenberg"><br />
<input type="hidden" name="currency_code" value="USD"><br />
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted"><br />
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"><br />
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
</form>
]]></content:encoded>
			<wfw:commentRss>http://vulnfactory.org/blog/2012/02/17/rooting-the-xyboardxoom-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Re-Rooting the LG Esteem</title>
		<link>http://vulnfactory.org/blog/2012/02/15/re-rooting-the-lg-esteem/</link>
		<comments>http://vulnfactory.org/blog/2012/02/15/re-rooting-the-lg-esteem/#comments</comments>
		<pubDate>Wed, 15 Feb 2012 17:42:16 +0000</pubDate>
		<dc:creator><![CDATA[drosenbe]]></dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://vulnfactory.org/blog/?p=460</guid>
		<description><![CDATA[Someone told me that LG patched the last vulnerability used to root the LG Esteem. Here&#8217;s another root. Is anyone else getting bored of this? I sure am. OEMs: unlock your bootloaders, you are not going to win this one. Download the Windows version here, or the Linux/OSX version here. Same deal as always: install LG ADB drivers if on Windows, put device in USB debugging mode, connect via USB, extract zip file, and execute &#8220;run.bat&#8221; (on Windows) or &#8220;run.sh&#8221; from a terminal (on Linux/OSX).]]></description>
				<content:encoded><![CDATA[<p>Someone told me that LG patched the last vulnerability used to root the LG Esteem.  Here&#8217;s another root.<br />
<span id="more-460"></span></p>
<p>Is anyone else getting bored of this?  I sure am.  OEMs: unlock your bootloaders, you are not going to win this one.</p>
<p>Download the Windows version <a href="http://vulnfactory.org/public/LG_Esteem_Root_v2_Windows.zip">here</a>, or the Linux/OSX version <a href="http://vulnfactory.org/public/LG_Esteem_Root_v2_Linux_OSX.zip">here</a>.  Same deal as always: install LG ADB drivers if on Windows, put device in USB debugging mode, connect via USB, extract zip file, and execute &#8220;run.bat&#8221; (on Windows) or &#8220;run.sh&#8221; from a terminal (on Linux/OSX).</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations"><br />
<input type="hidden" name="business" value="KJBYX8NX3QGN2"><br />
<input type="hidden" name="lc" value="US"><br />
<input type="hidden" name="item_name" value="Dan Rosenberg"><br />
<input type="hidden" name="currency_code" value="USD"><br />
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted"><br />
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"><br />
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
</form>
]]></content:encoded>
			<wfw:commentRss>http://vulnfactory.org/blog/2012/02/15/re-rooting-the-lg-esteem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rooting the Droid 4: A Failed Bounty Experiment</title>
		<link>http://vulnfactory.org/blog/2012/02/11/rooting-the-droid-4-a-failed-bounty-experiment/</link>
		<comments>http://vulnfactory.org/blog/2012/02/11/rooting-the-droid-4-a-failed-bounty-experiment/#comments</comments>
		<pubDate>Sat, 11 Feb 2012 14:05:35 +0000</pubDate>
		<dc:creator><![CDATA[drosenbe]]></dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Exploitation]]></category>

		<guid isPermaLink="false">http://vulnfactory.org/blog/?p=449</guid>
		<description><![CDATA[Yesterday, I tried a little experiment in releasing a root exploit for the Motorola Droid 4. I set up a bounty, where the first $200 would go towards me buying myself a Droid 4 in exchange for the work I&#8217;ve done developing the exploit, and the remaining bounty money would go directly to the American Red Cross. I thought this would be a good arrangement for everyone: users get a shiny root exploit for a few bucks, I get a new phone in payment, and money gets donated to charity. Everybody wins. Apparently this was considered unacceptable by the raging &#8230; <a href="http://vulnfactory.org/blog/2012/02/11/rooting-the-droid-4-a-failed-bounty-experiment/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Yesterday, I tried a little experiment in releasing a root exploit for the Motorola Droid 4.  I set up a bounty, where the first $200 would go towards me buying myself a Droid 4 in exchange for the work I&#8217;ve done developing the exploit, and the remaining bounty money would go directly to the American Red Cross.  I thought this would be a good arrangement for everyone: users get a shiny root exploit for a few bucks, I get a new phone in payment, and money gets donated to charity.  Everybody wins.<br />
<span id="more-449"></span></p>
<p>Apparently this was considered unacceptable by the raging masses of Android fanboys, who not only believe they are entitled to exploits for free, but are also under the delusion that $200 total is a lot of money in exchange for this kind of work.  I&#8217;m disappointed in the response by the community, but I&#8217;m going to turn it into a positive thing.</p>
<p>The bounty is now entirely for charity.  100% of proceeds will be donated to the American Red Cross.  I will post donation receipts after donating.  You can donate at <a href="https://www.wepay.com/donations/droid-4-root-bounty">https://www.wepay.com/donations/droid-4-root-bounty</a>.</p>
<h2>But Where&#8217;s the Root Exploit?</h2>
<p>The Windows version of the exploit can be downloaded <a href="http://vulnfactory.org/public/motofail_windows.zip">here</a>.  Make sure your device is in USB debugging mode, attach it to your PC, ensure you have the latest Motorola drivers installed, extract the entire zip file, and execute &#8220;run.bat&#8221;.  Enjoy.</p>
<p><b>Update:</b> a Linux/OSX version of the script is available <a href="http://vulnfactory.org/public/motofail_linux_osx.zip">here</a>.  Same deal: USB debugging mode, attach to PC, extract zip file, change into the zip directory, and invoke &#8220;./run.sh&#8221; from a shell.</p>
]]></content:encoded>
			<wfw:commentRss>http://vulnfactory.org/blog/2012/02/11/rooting-the-droid-4-a-failed-bounty-experiment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rooting the Sony Tablet S</title>
		<link>http://vulnfactory.org/blog/2012/02/08/rooting-the-sony-tablet-s/</link>
		<comments>http://vulnfactory.org/blog/2012/02/08/rooting-the-sony-tablet-s/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 14:43:35 +0000</pubDate>
		<dc:creator><![CDATA[drosenbe]]></dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Exploitation]]></category>

		<guid isPermaLink="false">http://vulnfactory.org/blog/?p=426</guid>
		<description><![CDATA[After getting a taste of rooting tablets with the Lenovo Thinkpad tablet, I decided to turn my attention to the Sony Tablet S. It turned out to be a tough device to root. The Bug The Sony Tablet S has a logging service running as root named nfx_log_service. This service maintains on-disk backups of the Android logcat buffers in the /log directory. This directory is group-writable and group &#8220;log&#8221;, which is granted to the ADB shell, so we can modify files in this directory. The logging service uses predictable filenames for its output. Specifically, &#8220;Kernel.txt&#8221;, &#8220;AndroidMain.txt&#8221;, &#8220;AndroidEvent.txt&#8221;, and &#8220;AndroidRadio.txt&#8221; are &#8230; <a href="http://vulnfactory.org/blog/2012/02/08/rooting-the-sony-tablet-s/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>After getting a taste of rooting tablets with the Lenovo Thinkpad tablet, I decided to turn my attention to the Sony Tablet S.  It turned out to be a tough device to root.</p>
<p><span id="more-426"></span></p>
<h2>The Bug</h2>
<p>The Sony Tablet S has a logging service running as root named <code>nfx_log_service</code>.  This service maintains on-disk backups of the Android logcat buffers in the <code>/log</code> directory.  This directory is group-writable and group &#8220;log&#8221;, which is granted to the ADB shell, so we can modify files in this directory.</p>
<p>The logging service uses predictable filenames for its output.  Specifically, &#8220;Kernel.txt&#8221;, &#8220;AndroidMain.txt&#8221;, &#8220;AndroidEvent.txt&#8221;, and &#8220;AndroidRadio.txt&#8221; are used.  As you might expect, by replacing these files with symbolic links, it&#8217;s possible to cause the logging service to either create a new file containing the contents of the appropriate log buffer, or if the symlink is in place at boot time, append the appropriate log buffer to an existing file.  These files are created as root:root 0644, so once they are created we do not have the ability to control their contents.</p>
<h2>The Goal</h2>
<p>Normally, I&#8217;d go straight for victory by creating a symlink at one of the logfile locations (I chose &#8220;<code>/log/AndroidRadio.txt</code>&#8220;) to <code>/data/local.prop</code> and writing &#8220;ro.kernel.qemu=1&#8243; a whole bunch of times to the radio log.  This would cause <code>/data/local.prop</code> to be created containing the ro.kernel.qemu property, so that when I reboot the device ADB runs as root and it&#8217;s game over.</p>
<p>Unfortunately, that doesn&#8217;t quite work here.  The Sony Tablet S already has a <code>/data/local.prop</code> file, and worse, it&#8217;s actually a symlink to <code>/configs/local.prop</code>.  Since <code>/configs</code> is a read-only mountpoint, we won&#8217;t be able to overwrite this file.  However, if we could remove the existing <code>/data/local.prop</code>, we could create a new file there that sets the ro.kernel.qemu property and allows us to win.  But how can we use our logger vulnerability to remove a file?</p>
<h2>Trickiness</h2>
<p>It turns out the Android package manager has an interesting behavior.  Packages have data directories at <code>/data/data/[package]/</code>.  Ordinary packages have a <code>lib</code> directory in the data directory for native libraries.  However, system packages (like the ones installed by Google or the OEM, in this case Sony) are not expected to have libraries in this directory.  If any system package has files in its <code>/data/data/[package]/lib/</code> directory, those files are deleted on boot by the package manager.  Interestingly, this includes following symlinks.  So if we can somehow cause a system package&#8217;s data folder to contain a symlink at <code>/data/data/[package]/lib</code> that points to <code>/data</code>, then the <code>/data</code> directory will be erased on boot, wiping out <code>/data/local.prop</code> and allowing us to create a new one and gain root.</p>
<p>Android devices contain a program called &#8220;run-as&#8221; that allows the ADB shell to assume the privileges of any application that is marked as &#8220;debuggable&#8221;.  This is determined by checking the <code>/data/system/packages.list</code> file, which contains a list of packages, their uids, the debuggable flag, and their data directories.  For the exploit, we can pick any system application &#8211; I chose com.google.android.location.</p>
<p>We can use our logging vulnerability by creating a symlink at <code>/log/AndroidRadio.txt</code> that points to <code>/data/system/packages.list</code>, rebooting the device, and running a program that logs <code>packages.list</code> lines for a fake application that&#8217;s marked as debuggable with the same uid as this system application.  For example, I used:</p>
<pre>
com.pwn.me 10026 1 /data/data/com.google.android.location
</pre>
<p>In this case, 10026 was the uid of com.google.android.location.  This might vary based on device.  At this point, the logging service appends this line to <code>packages.list</code>, and we can &#8220;run-as com.pwn.me&#8221;, at which point we have the privileges of our system package.  We can then replace the system package&#8217;s <code>lib</code> directory with a symlink to <code>/data</code>, reboot the device, exploit the logger again to create a fresh <code>/data/local.prop</code> containing the line &#8220;ro.kernel.qemu=1&#8243;, and reboot again, at which point ADB is running as root and we can install su and Superuser.</p>
<h2>The Final Product</h2>
<p>A script that automates these steps on Windows is available <a href="/public/Sony_Tablet_S_Root_Windows.zip">here</a>.  To run it, ensure your device is in USB debugging mode, connect it via USB, extract the zip, and run &#8220;run.bat&#8221;.  Enjoy!</p>
<p>If you were involved in raising a bounty for this exploit, donations can be made below.</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations"><br />
<input type="hidden" name="business" value="KJBYX8NX3QGN2"><br />
<input type="hidden" name="lc" value="US"><br />
<input type="hidden" name="item_name" value="Dan Rosenberg"><br />
<input type="hidden" name="currency_code" value="USD"><br />
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted"><br />
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"><br />
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
</form>
]]></content:encoded>
			<wfw:commentRss>http://vulnfactory.org/blog/2012/02/08/rooting-the-sony-tablet-s/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rooting the Thinkpad Tablet</title>
		<link>http://vulnfactory.org/blog/2012/01/22/rooting-the-thinkpad-tablet/</link>
		<comments>http://vulnfactory.org/blog/2012/01/22/rooting-the-thinkpad-tablet/#comments</comments>
		<pubDate>Sun, 22 Jan 2012 18:40:10 +0000</pubDate>
		<dc:creator><![CDATA[drosenbe]]></dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Exploitation]]></category>

		<guid isPermaLink="false">http://vulnfactory.org/blog/?p=413</guid>
		<description><![CDATA[Another day, another Android root. Let&#8217;s just skip the details this time and let Lenovo figure it out for themselves. The following root package only works on Windows. I feel like a Linux traitor right now, but 99% of the people using this run Windows, and if you run Linux, just peek at the batch script and perform the steps manually. Instructions 1. Make sure you have the latest ADB drivers installed on your PC, and that your device is in USB Debugging mode. More detailed instructions for this are available here. 2. Download the root exploit here. 3. Make &#8230; <a href="http://vulnfactory.org/blog/2012/01/22/rooting-the-thinkpad-tablet/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Another day, another Android root.  Let&#8217;s just skip the details this time and let Lenovo figure it out for themselves.  The following root package only works on Windows.  I feel like a Linux traitor right now, but 99% of the people using this run Windows, and if you run Linux, just peek at the batch script and perform the steps manually.</p>
<p><span id="more-413"></span><br />
<h2>Instructions</h2>
<ul>
<li>1. Make sure you have the latest ADB drivers installed on your PC, and that your device is in USB Debugging mode.  More detailed instructions for this are available <a href="http://thinkpadtabletforums.com/thinkpad-tablet-root-hacks-mods-and-development/complete-setup-guide-android-sdk-and-adb/">here</a>.</li>
<li>2. Download the root exploit <a href="http://vulnfactory.org/public/Thinkpad_Root_Windows.zip">here</a>.</li>
<li>3. Make sure your Thinkpad is connected to your PC via USB, is turned on, has the screen unlocked, and is connected to a wifi network.</li>
<li>4. Extract the entire zipfile, and run &#8220;run.bat&#8221;.  Follow any directions given in the command prompt closely, and ignore any activity on the Thinkpad itself.</li>
</ul>
<p>Enjoy!</p>
<p>If you were involved in raising a bounty for this exploit, donations can be made below.</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations"><br />
<input type="hidden" name="business" value="KJBYX8NX3QGN2"><br />
<input type="hidden" name="lc" value="US"><br />
<input type="hidden" name="item_name" value="Dan Rosenberg"><br />
<input type="hidden" name="currency_code" value="USD"><br />
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted"><br />
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"><br />
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
</form>
]]></content:encoded>
			<wfw:commentRss>http://vulnfactory.org/blog/2012/01/22/rooting-the-thinkpad-tablet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
