<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-10795563</id><updated>2020-02-28T03:00:53.040+01:00</updated><category term="Vulnerability"/><category term="User space"/><category term="Kernel"/><category term="Linux"/><category term="Mitigation"/><category term="Tool"/><category term="Exploiting"/><category term="checksec.sh"/><category term="iPhone"/><category term="Books"/><category term="Browser"/><category term="Virtualization"/><category term="Apple"/><category term="Statistics"/><category term="Twitter"/><category term="iOS"/><title type='text'>trapkit blog</title><subtitle type='html'>random thoughts on information security</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://tk-blog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>38</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-10795563.post-4562069712453895033</id><published>2016-09-01T14:47:00.000+02:00</published><updated>2016-09-01T14:47:21.010+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Exploiting"/><title type='text'>BENIGNCERTAIN — Remote Extraction of RSA Private Keys</title><content type='html'>&lt;i&gt;&lt;b&gt;TL;DR: &lt;/b&gt;The so-called &lt;a href=&quot;http://arstechnica.com/security/2016/08/cisco-firewall-exploit-shows-how-nsa-decrypted-vpn-traffic/&quot;&gt;BENIGNCERTAIN &lt;/a&gt;exploit dropped by the&amp;nbsp;&lt;a href=&quot;https://www.engadget.com/2016/08/26/untangling-the-nsas-latest-alleged-embarrassment/&quot;&gt;Shadow Brokers&lt;/a&gt;&amp;nbsp;extracts RSA private keys from a&amp;nbsp;captured memory dump using a technique similar to the one I described in a paper in 2006.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;BENIGNCERTAIN is a &quot;[..] remote exploit for Cisco PIX devices that sends an Internet Key Exchange (IKE) packet to the victim machine, causing it to dump some of its memory. The memory dump can then be parsed to extract an RSA private key and other sensitive configuration information&quot; (from &lt;a href=&quot;https://musalbas.com/2016/08/18/equation-group-benigncertain.html&quot;&gt;Mustafa Al-Bassam&#39;s writeup&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;To extract RSA private keys from a captured memory dump, the exploit uses a technique similar to the one I described in a paper entitled &quot;&lt;a href=&quot;http://www.trapkit.de/tools/sslkeyfinder/index.html&quot;&gt;All Your Private Keys are Belong to Us — Extracting RSA Private Keys and Certificates from Process Memory&lt;/a&gt;&quot; (2006).&lt;br /&gt;&lt;br /&gt;A brief summary of the technique: The standard storage formats for RSA private keys and SSL certificates, as described in &lt;a href=&quot;https://www.ietf.org/rfc/rfc5208.txt&quot;&gt;PKCS #8&lt;/a&gt; and &lt;a href=&quot;https://tools.ietf.org/html/rfc5280&quot;&gt;x509&lt;/a&gt; respectively, are used to create a signature for locating them in memory. Using this signature, a simple pattern match could be done to extract the candidate asymmetric keys in their plaintext form, which could then be verified using an external tool such as OpenSSL.&lt;br /&gt;&lt;blockquote class=&quot;twitter-tweet&quot; data-lang=&quot;de&quot;&gt;&lt;div dir=&quot;ltr&quot; lang=&quot;en&quot;&gt;(!!!) BENIGNCERTAIN looks like it is based on a *2006* technique from &lt;a href=&quot;https://twitter.com/tobiklein&quot;&gt;@tobiklein&lt;/a&gt; to extract keys from proc memory  &lt;a href=&quot;https://t.co/bBByaj05jr&quot;&gt;https://t.co/bBByaj05jr&lt;/a&gt;&lt;/div&gt;— Matt Suiche (@msuiche) &lt;a href=&quot;https://twitter.com/msuiche/status/766929239589412864&quot;&gt;20. August 2016&lt;/a&gt;&lt;/blockquote&gt;&lt;script async=&quot;&quot; charset=&quot;utf-8&quot; src=&quot;//platform.twitter.com/widgets.js&quot;&gt;&lt;/script&gt; The following tweet contains different screenshots of the disassembly of the BENIGNCERTAIN exploit, showing the relevant code snippets:   &lt;br /&gt;&lt;blockquote class=&quot;twitter-tweet&quot; data-lang=&quot;de&quot;&gt;&lt;div dir=&quot;ltr&quot; lang=&quot;en&quot;&gt;Extractor of pub&amp;amp;priv DER keys (bc-parser)&lt;br /&gt;sign1 0x3000010&lt;br /&gt;sign2 &quot;\x0D\0x06\x09\x2a\x86\x48\x86\xf7\x0d\x01\x01\x01&quot; &lt;a href=&quot;https://t.co/qd7mBCcFZT&quot;&gt;pic.twitter.com/qd7mBCcFZT&lt;/a&gt;&lt;/div&gt;— Matt Suiche (@msuiche) &lt;a href=&quot;https://twitter.com/msuiche/status/766405140098187264&quot;&gt;18. August 2016&lt;/a&gt;&lt;/blockquote&gt;&lt;script async=&quot;&quot; charset=&quot;utf-8&quot; src=&quot;//platform.twitter.com/widgets.js&quot;&gt;&lt;/script&gt;For a more detailed description of the BENIGNCERTAIN exploit refer to:  &lt;br /&gt;&lt;blockquote class=&quot;twitter-tweet&quot; data-lang=&quot;de&quot;&gt;&lt;div dir=&quot;ltr&quot; lang=&quot;en&quot;&gt;Here&#39;s a quick writeup. BENIGNCERTAIN: remote exploit to extract Cisco VPN private keys. Will update as info comes. &lt;a href=&quot;https://t.co/cObvedgf1l&quot;&gt;https://t.co/cObvedgf1l&lt;/a&gt;&lt;/div&gt;— Mustafa Al-Bassam (@musalbas) &lt;a href=&quot;https://twitter.com/musalbas/status/766358843601383424&quot;&gt;18. August 2016&lt;/a&gt;&lt;/blockquote&gt;Key takeaways:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The Shadow Brokers leak illustrates that the proposed technique to extract RSA private keys from memory dumps is easy to use, very effective in the wild and extensively field-tested by the Equation Group (widely believed to be operated by the NSA).&lt;/li&gt;&lt;li&gt;Specialized hardware, like a&amp;nbsp;&lt;a href=&quot;https://en.wikipedia.org/wiki/Hardware_security_module&quot;&gt;hardware security module&lt;/a&gt;&amp;nbsp;(HSM) or a smartcard, can safeguard your cryptographic keys&amp;nbsp;from such an attack.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;script async=&quot;&quot; charset=&quot;utf-8&quot; src=&quot;//platform.twitter.com/widgets.js&quot;&gt;&lt;/script&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/4562069712453895033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/4562069712453895033'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/2016/09/benigncertain-remote-extraction-of-rsa.html' title='BENIGNCERTAIN — Remote Extraction of RSA Private Keys'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-10795563.post-1477986466818859059</id><published>2011-11-08T15:28:00.000+01:00</published><updated>2011-11-08T15:28:30.074+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Books"/><title type='text'>A Bug Hunter&#39;s Diary</title><content type='html'>I&#39;m happy to announce that my new book »&lt;i&gt;A Bug Hunter&#39;s Diary - A Guided Tour Through the Wilds of Software Security&lt;/i&gt;« is now available in paperback and ebook editions.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://2.bp.blogspot.com/-hp1UE2U-wyQ/Trk5w4eSbmI/AAAAAAAAADg/VDnd5TgVX0c/s1600/cover_en.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;http://2.bp.blogspot.com/-hp1UE2U-wyQ/Trk5w4eSbmI/AAAAAAAAADg/VDnd5TgVX0c/s200/cover_en.png&quot; width=&quot;133&quot; /&gt;&lt;/a&gt;&lt;br /&gt;► View the detailed Table of Contents &lt;a href=&quot;http://nostarch.com/download/bughunter_toc.pdf&quot;&gt;here&lt;/a&gt; (PDF).&lt;br /&gt;&lt;br /&gt;► Chapter 2 is available for download &lt;a href=&quot;http://nostarch.com/download/bughunter_ch2.pdf&quot;&gt;here&lt;/a&gt; (PDF).&lt;br /&gt;&lt;br /&gt;► Visit the book&#39;s &lt;a href=&quot;http://www.trapkit.de/books/bhd/en.html&quot;&gt;companion website&lt;/a&gt; for further information, news, and resources.&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&amp;nbsp; &lt;br /&gt;I hope you enjoy the book as much as I enjoyed writing it!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/1477986466818859059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/1477986466818859059'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/2011/11/bug-hunters-diary.html' title='A Bug Hunter&#39;s Diary'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-hp1UE2U-wyQ/Trk5w4eSbmI/AAAAAAAAADg/VDnd5TgVX0c/s72-c/cover_en.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-10795563.post-1729753493565729857</id><published>2011-05-16T16:02:00.001+02:00</published><updated>2011-05-16T16:08:53.583+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Apple"/><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><category scheme="http://www.blogger.com/atom/ns#" term="iPhone"/><title type='text'>How to get gdb working on Apple iOS 4.3.x</title><content type='html'>&lt;h4&gt;► Step 1: Download and install gdb&lt;/h4&gt;1) Download gdb at &lt;a href=&quot;http://apt.saurik.com/debs/gdb_1518-11_iphoneos-arm.deb&quot;&gt;http://apt.saurik.com/debs/gdb_1518-11_iphoneos-arm.deb&lt;/a&gt;&lt;br /&gt;2) Transfer the file to the iDevice (e.g. via SSH)&lt;br /&gt;3) Install the package with the following command &lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;iPhone:~ root# dpkg -i gdb_1518-11_iphoneos-arm.deb&lt;/pre&gt;&lt;br /&gt;This version of gdb will work on iOS 4.3.x with ASLR but it has a problem displaying the register values. To solve this issue I wrote a little gdb script.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;► Step 2: Download and use my gdb script&lt;/h4&gt;1) Download the gdb script at &lt;a href=&quot;http://www.trapkit.de/pub/registers.gdb&quot;&gt;http://www.trapkit.de/pub/registers.gdb&lt;/a&gt;&lt;br /&gt;2) Transfer the file to the iDevice (e.g. via SSH)&lt;br /&gt;3) Start gdb and load the script with the following command:&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;(gdb) source registers.gdb&lt;/pre&gt;&lt;br /&gt;The script implements a new gdb command called &#39;ir&#39; ([i]nfo[r]egisters) that lists the registers and their contents. Example output:&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;(gdb) ir r0      0x10004005      268451845 r1      0x07000006      117440518 r2      0x00000000      0 r3      0x00000c00      3072 r4      0x00001a03      6659 r5      0xffffffff      -1 r6      0x00000000      0 r7      0x2feb5dbc      803954108 r8      0x00000000      0 r9      0x3f45afb4      1061531572 r10     0x00000000      0 r11     0xffffffff      -1 sp      0x2feb5d84      803954052 lr      0x35cd575f      902649695 pc      0x35cd5c00      902650880&lt;/pre&gt;&lt;br /&gt;Alternatively, rename the file to &#39;.gdbinit&#39; and put it in the home directory of the user that will run gdb.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/1729753493565729857'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/1729753493565729857'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/2011/05/how-to-get-gdb-working-on-apple-ios-43x.html' title='How to get gdb working on Apple iOS 4.3.x'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-10795563.post-7860687558083568773</id><published>2011-01-14T11:42:00.001+01:00</published><updated>2011-01-14T11:50:55.380+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="checksec.sh"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Tool"/><title type='text'>checksec.sh now with FORTIFY_SOURCE support</title><content type='html'>New checksec.sh release.&lt;br /&gt;&lt;br /&gt;What&#39;s new with version 1.4:&lt;br /&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;  * Support for FORTIFY_SOURCE (--fortify-file, --fortify-proc)   * Lots of other bugfixes and improvements     - Check if the readelf command is available     - readelf support for 64-bit ELF files     - Check if the requested files and directories do exist     - &#39;--dir&#39; is now case-sensitive and correctly deals with trailing slashes     - Check user permissions     - Etc.&lt;/pre&gt;&lt;h4&gt;► Example of the new &#39;--fortify-file&#39; option&lt;/h4&gt;The following testcase is vulnerable to a classical stack buffer overflow (see line 10):&lt;br /&gt;&lt;pre class=&quot;brush: cpp; gutter: false;&quot;&gt;tk@ubuntu$ cat testcase.c 01 #include &amp;lt;string.h&amp;gt; 02 #include &amp;lt;stdio.h&amp;gt; 03 04 int 05 main (int argc, char* argv[]) 06 { 07        int     a = 1; 08        char    buf[12]; 09 10        strcpy (buf, argv[1]); 11        printf (&quot;%08x\n&quot;, a); 12 13        return 0; 14 }&lt;/pre&gt;Compile the testcase without stack canary support (-fno-stack-protector) and without &lt;a href=&quot;http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html&quot;&gt;FORTIFY_SOURCE&lt;/a&gt;:&lt;br /&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;tk@ubuntu$ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=10.10 DISTRIB_CODENAME=maverick DISTRIB_DESCRIPTION=&quot;Ubuntu 10.10&quot;  tk@ubuntu$ gcc -fno-stack-protector -o testcase testcase.c&lt;/pre&gt;Check the executable file with checksec.sh:&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/_QRbyLnYYriQ/TTAoEcNG_gI/AAAAAAAAADQ/udYXDaGm0IQ/s1600/1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;78&quot; src=&quot;http://4.bp.blogspot.com/_QRbyLnYYriQ/TTAoEcNG_gI/AAAAAAAAADQ/udYXDaGm0IQ/s320/1.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;The output shows, that FORTIFY_SOURCE is indeed not supported by the executable file. Now we try to overflow the stack buffer:&lt;br /&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;tk@ubuntu$ ./testcase AAAA 00000001  tk@ubuntu$ ./testcase AAAABBBBCCCCDDDD 44444444&lt;/pre&gt;As can be seen from the output, the stack variable &#39;a&#39; was successfully overwritten with our overly long command line argument (&#39;a&#39; was overwritten by the supplied D&#39;s or 0x44 in hexadecimal). Now we compile the testcase with FORTIFY_SOURCE support but without stack canaries and check the executable file with checksec.sh again:&lt;br /&gt;&lt;blockquote&gt;Under Ubuntu FORTIFY_SOURCE is activated when compiled with -O2 or higher. On other Linux distributions (e.g. Fedora or openSUSE) you need to add the compiler flag &#39;-D_FORTIFY_SOURCE=2&#39;.&lt;/blockquote&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/_QRbyLnYYriQ/TTAoJI1YARI/AAAAAAAAADU/8To20CAp-lo/s1600/2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;http://3.bp.blogspot.com/_QRbyLnYYriQ/TTAoJI1YARI/AAAAAAAAADU/8To20CAp-lo/s320/2.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;The output of checksec.sh shows, that the executable file was successfully compiled with FORTIFY_SOURCE. Now we try to overflow the buffer again:&lt;br /&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;tk@ubuntu$ ./testcase AAAABBBBCCCCDDDD *** buffer overflow detected ***: ./testcase terminated ======= Backtrace: ========= /lib/libc.so.6(__fortify_fail+0x50)[0x936970] /lib/libc.so.6(+0xe486a)[0x93586a] /lib/libc.so.6(__strcpy_chk+0x44)[0x934be4] ./testcase[0x8048447] /lib/libc.so.6(__libc_start_main+0xe7)[0x867ce7] ./testcase[0x8048381] ======= Memory map: ======== 007d4000-007f0000 r-xp 00000000 08:01 135323     /lib/ld-2.12.1.so 007f0000-007f1000 r--p 0001b000 08:01 135323     /lib/ld-2.12.1.so 007f1000-007f2000 rw-p 0001c000 08:01 135323     /lib/ld-2.12.1.so 0080f000-00829000 r-xp 00000000 08:01 131159     /lib/libgcc_s.so.1 00829000-0082a000 r--p 00019000 08:01 131159     /lib/libgcc_s.so.1 0082a000-0082b000 rw-p 0001a000 08:01 131159     /lib/libgcc_s.so.1 00851000-009a8000 r-xp 00000000 08:01 138119     /lib/libc-2.12.1.so 009a8000-009aa000 r--p 00157000 08:01 138119     /lib/libc-2.12.1.so 009aa000-009ab000 rw-p 00159000 08:01 138119     /lib/libc-2.12.1.so 009ab000-009ae000 rw-p 00000000 00:00 0 00ff9000-00ffa000 r-xp 00000000 00:00 0          [vdso] 08048000-08049000 r-xp 00000000 08:01 658356     /home/tk/testcase 08049000-0804a000 r--p 00000000 08:01 658356     /home/tk/testcase 0804a000-0804b000 rw-p 00001000 08:01 658356     /home/tk/testcase 09e50000-09e71000 rw-p 00000000 00:00 0          [heap] b779f000-b77a0000 rw-p 00000000 00:00 0 b77ae000-b77b0000 rw-p 00000000 00:00 0 bfb00000-bfb21000 rw-p 00000000 00:00 0          [stack] Aborted&lt;/pre&gt;&lt;br /&gt;This time the attempt to trigger the buffer overflow was successfully mitigated by FORTIFY_SOURCE.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;► Example of the new &#39;--fortify-proc&#39; option&lt;/h4&gt;With the new option &#39;--fortify-proc&#39; it is also possible to check running processes for FORTIFY_SOURCE support:&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/_QRbyLnYYriQ/TTAoNoGsNgI/AAAAAAAAADY/Ul5fQAo8GOk/s1600/3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://3.bp.blogspot.com/_QRbyLnYYriQ/TTAoNoGsNgI/AAAAAAAAADY/Ul5fQAo8GOk/s320/3.png&quot; width=&quot;237&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;You can download the new version 1.4 of checksec.sh &lt;a href=&quot;http://www.trapkit.de/tools/checksec.html&quot;&gt;here&lt;/a&gt;.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/7860687558083568773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/7860687558083568773'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/2011/01/checksecsh-now-with-fortifysource.html' title='checksec.sh now with FORTIFY_SOURCE support'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_QRbyLnYYriQ/TTAoEcNG_gI/AAAAAAAAADQ/udYXDaGm0IQ/s72-c/1.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-10795563.post-3338942529571863239</id><published>2010-07-15T22:05:00.000+02:00</published><updated>2010-07-15T22:05:03.825+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Kernel"/><category scheme="http://www.blogger.com/atom/ns#" term="Vulnerability"/><title type='text'>Zone Crasher</title><content type='html'>I released a new security advisory for Oracle Solaris and OpenSolaris. See &lt;a href=&quot;http://www.trapkit.de/advisories/TKADV2010-005.txt&quot;&gt;TKADV2010-005&lt;/a&gt; for a detailed description of the vulnerability and the &lt;a href=&quot;http://src.opensolaris.org/source/diff/onnv/onnv-gate/usr/src/uts/common/rpc/sec/sec_clnt.c?r2=%252Fonnv%252Fonnv-gate%252Fusr%252Fsrc%252Futs%252Fcommon%252Frpc%252Fsec%252Fsec_clnt.c%4012190:047643806cfa&amp;amp;r1=%252Fonnv%252Fonnv-gate%252Fusr%252Fsrc%252Futs%252Fcommon%252Frpc%252Fsec%252Fsec_clnt.c%408637:ea911f428078&quot;&gt;OpenSolaris source browser&lt;/a&gt; for the source code fixes.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/3338942529571863239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/3338942529571863239'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/2010/07/zone-crasher.html' title='Zone Crasher'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-10795563.post-5586657406726382103</id><published>2010-05-04T20:14:00.001+02:00</published><updated>2010-05-04T20:14:50.352+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="checksec.sh"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Mitigation"/><title type='text'>checksec.sh now with kernel support</title><content type='html'>New checksec.sh release.&lt;br /&gt;&lt;br /&gt;What&#39;s new with version 1.3:&lt;br /&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;* Additional checks for a number of kernel hardening features.   Thanks to Jon Oberheide (jon.oberheide.org).&lt;/pre&gt;Example of the new &quot;--kernel&quot; option:&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/_QRbyLnYYriQ/S-Bju4sBKLI/AAAAAAAAACk/-C4ZNlDxnpA/s1600/checksec_1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;259&quot; src=&quot;http://3.bp.blogspot.com/_QRbyLnYYriQ/S-Bju4sBKLI/AAAAAAAAACk/-C4ZNlDxnpA/s320/checksec_1.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;You can download the new version 1.3 of checksec.sh &lt;a href=&quot;http://www.trapkit.de/tools/checksec.html&quot;&gt;here&lt;/a&gt;.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/5586657406726382103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/5586657406726382103'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/2010/05/checksecsh-now-with-kernel-support.html' title='checksec.sh now with kernel support'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_QRbyLnYYriQ/S-Bju4sBKLI/AAAAAAAAACk/-C4ZNlDxnpA/s72-c/checksec_1.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-10795563.post-7919867164485238734</id><published>2010-04-18T16:42:00.001+02:00</published><updated>2010-05-02T13:02:27.188+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Browser"/><category scheme="http://www.blogger.com/atom/ns#" term="Mitigation"/><title type='text'>Split-process model FTW</title><content type='html'>As I already mentioned in my &lt;a href=&quot;http://tk-blog.blogspot.com/2010/04/kernel-bug-in-google-chrome.html&quot;&gt;last posting&lt;/a&gt; Google Chrome supports a split-process model that allows each browser tab to exist in its own process. The benefits to such a configuration include security and stability, as a bug in the renderer will only cause problems with a single tab that can be closed while others remain active.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;&amp;#9658; Want an example?&lt;/h4&gt;&lt;br /&gt;If you open this &lt;a href=&quot;https://bugs.webkit.org/attachment.cgi?id=53595&quot;&gt;testcase&lt;/a&gt; in Apple&#39;s Safari the browser will crash. If you open the &lt;a href=&quot;https://bugs.webkit.org/attachment.cgi?id=53595&quot;&gt;testcase&lt;/a&gt; in Google Chrome only the current tab will be affected. It&#39;s a simple stack overflow (stack exhaustion) bug. This is a stability issue that by itself cannot lead to remote code execution. See this &lt;a href=&quot;http://blogs.technet.com/srd/archive/2009/01/28/stack-overflow-stack-exhaustion-not-the-same-as-stack-buffer-overflow.aspx&quot;&gt;blog entry&lt;/a&gt; for more information about stack overflows. &lt;br /&gt;&lt;br /&gt;If you want some more information about the particular bug see the &lt;a href=&quot;http://code.google.com/p/chromium/issues/detail?id=41860&quot;&gt;Chromium bugtracker&lt;/a&gt; or &lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=37751&quot;&gt;Webkit&#39;s Bugzilla&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Apple also finally recognized the benefits of such a split-process model: see &lt;a href=&quot;http://trac.webkit.org/wiki/WebKit2&quot;&gt;WebKit2&lt;/a&gt;.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/7919867164485238734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/7919867164485238734'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/2010/04/split-process-model-ftw.html' title='Split-process model FTW'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-10795563.post-259641291734369268</id><published>2010-04-02T10:53:00.001+02:00</published><updated>2010-05-02T13:01:20.701+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Browser"/><category scheme="http://www.blogger.com/atom/ns#" term="User space"/><category scheme="http://www.blogger.com/atom/ns#" term="Vulnerability"/><title type='text'>&quot;Kernel Bug&quot; in Google Chrome</title><content type='html'>I have to admit that I&#39;m deeply impressed by the security architecture of &lt;a href=&quot;http://www.chromium.org/&quot;&gt;Chromium&lt;/a&gt;, the open-source browser upon which &lt;a href=&quot;http://www.google.com/chrome/&quot;&gt;Google Chrome&lt;/a&gt; is built. Google provides a lot of interesting background information on the security architecture of Chromium &lt;a href=&quot;http://dev.chromium.org/developers/design-documents/sandbox&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://seclab.stanford.edu/websec/chromium/&quot;&gt;here&lt;/a&gt;. The most important security feature of Chromium is that the browser has two modules in separate protection domains: a »browser kernel«, which interacts with the operating system, and a »rendering engine«, which runs with restricted privileges in a sandbox.&lt;br /&gt;&lt;br /&gt;If there&#39;s a bug in the rendering engine (JavaScript V8, Webkit, FFmpeg etc.) it will only affect a sandboxed renderer process. As long as you can&#39;t escape the sandbox you&#39;re quite limited in what you can do. But if you find a bug in the browser kernel the game changes.&lt;br /&gt;&lt;br /&gt;Lately (see &lt;a href=&quot;http://www.trapkit.de/advisories/TKADV2010-004.txt&quot;&gt;TKADV2010-004&lt;/a&gt;) I found an out-of-bounds array indexing bug in the FTP handling code of Google Chrome. As all the networking code, including the handling of FTP, is implemented in the browser kernel, the bug not only affects a sandboxed browser tab but the whole browser. &lt;br /&gt;&lt;br /&gt;If you want to crash your Google Chrome browser (Windows version &amp;lt;= 4.1.249.1036) see my &lt;a href=&quot;http://www.trapkit.de/advisories/TKADV2010-004.txt&quot;&gt;advisory&lt;/a&gt; for a proof of concept.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/259641291734369268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/259641291734369268'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/2010/04/kernel-bug-in-google-chrome.html' title='&quot;Kernel Bug&quot; in Google Chrome'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-10795563.post-5027237309949605129</id><published>2010-03-30T20:37:00.001+02:00</published><updated>2010-05-02T13:02:07.300+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Books"/><title type='text'>My new book just got released!</title><content type='html'>It&#39;s available in German only at the moment, but I&#39;m currently working on an English version of the book. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;&lt;a href=&quot;http://www.trapkit.de/books/bhd/cover_de.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;http://www.trapkit.de/books/bhd/cover_de.png&quot; width=&quot;136&quot; /&gt;&lt;/a&gt;► German Version&lt;/h4&gt;»&lt;b&gt;Aus dem Tagebuch eines Bughunters&lt;/b&gt;.&lt;br /&gt;&amp;nbsp;&lt;i&gt;Wie man Softwareschwachstellen aufspürt und behebt&lt;/i&gt;«&lt;br /&gt;&lt;br /&gt;Das Buch beschreibt den Lebenszyklus ausgewählter Softwareschwachstellen, die ich im Laufe der letzten Jahre gefunden habe. Jedes Kapitel erläutert dabei im Detail, wie ich die jeweilige Schwachstelle gefunden und anschließend ausgenutzt habe, sowie die durchgeführten Schritte zur Behebung der Schwachstelle seitens des Herstellers.&lt;br /&gt;&lt;br /&gt;Mehr Informationen zum Buch gibt es auf meiner &lt;a href=&quot;http://www.trapkit.de/books/bhd/&quot;&gt;Webseite&lt;/a&gt; oder beim &lt;a href=&quot;http://www.dpunkt.de/buecher/3309.html&quot;&gt;dpunkt.verlag&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;► English Version&lt;/h4&gt;&lt;b&gt;Working Title: »From A Bug Hunter&#39;s Diary«&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The book describes the lifetime of some interesting real-life software vulnerabilities I found over the last years. Each chapter goes into great detail on how I found a bug, the steps I took to exploit it and how it was rectified by the vendor. &lt;br /&gt;&lt;br /&gt;The English version will be released when it is finished ;)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/5027237309949605129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/5027237309949605129'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/2010/03/my-new-book-just-got-released.html' title='My new book just got released!'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-10795563.post-3635618183411679867</id><published>2010-02-22T14:35:00.001+01:00</published><updated>2010-02-22T17:08:41.959+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Exploiting"/><category scheme="http://www.blogger.com/atom/ns#" term="Kernel"/><category scheme="http://www.blogger.com/atom/ns#" term="Vulnerability"/><title type='text'>The Fix That Never Was</title><content type='html'>Approximately two years ago I found a &lt;a href=&quot;http://www.trapkit.de/advisories/TKADV2008-002.txt&quot;&gt;memory corruption bug&lt;/a&gt; in one of the kernel drivers shipped with &lt;a href=&quot;http://www.avast.com/&quot;&gt;avast! 4.7&lt;/a&gt;. After I reported the bug to ALWIL Software they only took about two weeks to provide a fixed version. That&#39;s quite fast for a commercial software vendor. To be honest, I never checked if and how the bug was fixed with that new version. Anyway, a few weeks ago I decided to have a look at the avast! drivers again. While reversing the drivers I quickly realized that the measures taken by ALWIL Software to fix my 2 year old bug weren&#39;t sufficient.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;►&amp;nbsp; A Short Recap of the &quot;old&quot; Bug&lt;/h4&gt;Disassembly of the vulnerable aavmker4.sys driver (avast! 4.7, file version 4.7.1098.0):&lt;br /&gt;&lt;pre class=&quot;brush: asm; gutter: false;&quot;&gt;[..] .text:00010E06    loc_10E06:  .text:00010E06      xor     edx, edx .text:00010E08      mov     eax, [ebp+v38_uc] .text:00010E0B      mov     [eax], edx .text:00010E0D      mov     [eax+4], edx .text:00010E10      add     esi, 4         ; src .text:00010E13      mov     ecx, 21Ah      ; len .text:00010E18      mov     edi, [eax+18h] ; dst .text:00010E1B      rep movsd              ; memcpy [..]&lt;/pre&gt;The memcpy() function at .text:00010E1B gets called with the following parameters: &lt;br /&gt;&lt;pre class=&quot;brush: cpp; gutter: false;&quot;&gt;memcpy (EDI, ESI, ECX);    EDI (dst): the value is extracted from user controlled IOCTL input data ESI (src): points to user controlled IOCTL input data ECX (len): 0x21A&lt;/pre&gt;As both the destination address as well as the source data of that memcpy() call could be controlled by the requesting user it was possible to overwrite arbitrary memory addresses with arbitrary values. This could be exploited to control the kernel execution flow and to execute arbitrary code at the kernel level. For more details see &lt;a href=&quot;http://www.trapkit.de/advisories/TKADV2008-002.txt&quot;&gt;TKADV2008-002&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;►&amp;nbsp;The Fix&lt;/h4&gt;The &quot;new&quot; version of the kernel driver (avast! 4.8 &amp;lt;= 4.8.1368.0) implements the following check to remediate the described bug.  &lt;br /&gt;&lt;br /&gt;Disassembly of the vulnerable aavmker4.sys driver (avast! 4.8, file version 4.8.1356.0):  &lt;br /&gt;&lt;pre class=&quot;brush: asm; gutter: false;&quot;&gt;[..]  .text:00010F21    loc_10F21:   .text:00010F21      and    [ebp+var_4], 0  .text:00010F25      cmp    dword ptr [edi], 0  .text:00010F28      jz     loc_10FC5  .text:00010F2E [1]  mov    esi, [edi+870h]  .text:00010F34      mov    [ebp+v34_uc], esi  .text:00010F37      mov    eax, ds:MmUserProbeAddress  .text:00010F3C [2]  cmp    esi, [eax]      ; user space or kernel space? .text:00010F3E      jnb    short loc_10F46  [..]&lt;/pre&gt;Before the described memcpy() function is called a pointer value gets extracted from the user supplied IOCTL input data. That value is then stored in ESI (see [1]). Then it is checked if ESI points into user space or kernel space (see [2]). This is done by comparing the pointer with MmUserProbeAddress. If ESI points into kernel space, the memcpy() function gets called as before. If it points into user space memcpy() won&#39;t be called.  &lt;br /&gt;&lt;br /&gt;If ESI points into kernel space the following code gets executed:  &lt;br /&gt;&lt;pre class=&quot;brush: asm; gutter: false;&quot;&gt;[..]  .text:00010F99    loc_10F99:  .text:00010F99      xor    edx, edx  .text:00010F9B      mov    eax, [ebp+v34_uc]  .text:00010F9E      mov    [eax], edx  .text:00010FA0      mov    [eax+4], edx  .text:00010FA3      lea    esi, [edi+4]    ; src  .text:00010FA6      mov    ecx, 21Ah       ; len  .text:00010FAB      mov    edi, [eax+18h]  ; dst  .text:00010FAE      rep movsd              ; memcpy  [..]&lt;/pre&gt;The memcpy() function at .text:00010FAE gets called with the following parameters: &lt;br /&gt;&lt;pre class=&quot;brush: cpp; gutter: false;&quot;&gt;memcpy (EDI, ESI, ECX);    EDI (dst): the value is extracted from a user defined kernel space address ESI (src): points to user controlled IOCTL input data ECX (len): 0x21A&lt;/pre&gt;&lt;b&gt;Assumption of the &quot;new&quot; check:&lt;/b&gt; As the destination address of memcpy() is now extracted from kernel space memory it isn&#39;t possible to directly control that value from user space anymore. &lt;br /&gt;&lt;br /&gt;This only holds true if we weren&#39;t able to (temporarily) store user controlled data at a user defined address in kernel space. Unfortunately, the aavmker4.sys driver supports at least one IOCTL that allows an unprivileged user to temporarily store arbitrary data at a known kernel space address. &lt;br /&gt;&lt;br /&gt;Well, the fix that never was ;)&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;►&amp;nbsp;Exploitation&lt;/h4&gt;Exploiting this bug is quite easy:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;STEP 1:&lt;/b&gt; Use one of the IOCTLs supported by aavmker4.sys to temporarily store arbitrary data at a known kernel space address (e.g. the IOCTL 0xb2d6001c).&lt;br /&gt;&lt;br /&gt;&lt;b&gt;STEP 2:&lt;/b&gt; Send a request to the vulnerable IOCTL. Store a pointer at offset 0x870 of the IOCTL data that points to the kernel space address of STEP 1.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;STEP 3:&lt;/b&gt; Manipulate a function pointer.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;STEP 4:&lt;/b&gt; Fun and profit.&lt;br /&gt;&lt;br /&gt;Working out the rest of the attack is left as an exercise for the reader ;)&lt;br /&gt;&lt;br /&gt;Affected are avast! 4.8 &amp;lt;= 4.8.1368.0 and avast! 5.0 &amp;lt; 5.0.418.0. See also my security advisory (&lt;a href=&quot;http://www.trapkit.de/advisories/TKADV2010-003.txt&quot;&gt;TKADV2010-003&lt;/a&gt;) for further information.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;►&amp;nbsp;EIP Control&lt;/h4&gt;I wrote a proof of concept (poc) that gains control of the kernel execution flow (EIP control). Output of the kernel debugger when executing the poc (avast! 5.0 under Windows XP SP3):&lt;br /&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;#################### AAVMKER: WRONG RQ ######################! Access violation - code c0000005 (!!! second chance !!!) 41414141 ??              ???  kd&amp;gt; kb *** ERROR: Symbol file could not be found.  Defaulted to export symbols for Aavmker4.SYS -  ChildEBP RetAddr  Args to Child               WARNING: Frame IP not in any known module. Following frames may be wrong. edc99bdc f7955cae 8621ada8 e21f0030 00000001 0x41414141 edc99c34 804ee129 861f8030 866c0d98 806d22d0 Aavmker4+0xcae edc99c44 80574dde 866c0e08 865833c0 866c0d98 nt!IopfCallDriver+0x31 edc99c58 80575c7f 861f8030 866c0d98 865833c0 nt!IopSynchronousServiceTail+0x70 edc99d00 8056e4ec 000002f8 00000000 00000000 nt!IopXxxControlFile+0x5e7 edc99d34 8053d648 000002f8 00000000 00000000 nt!NtDeviceIoControlFile+0x2a edc99d34 7c91e514 000002f8 00000000 00000000 nt!KiFastCallEntry+0xf8 039cb1b0 65006e90 000002f8 b2d60034 039cb1fc 0x7c91e514 039cb24c 00000000 00000000 00000000 00000000 0x65006e90  kd&amp;gt; r eax=8621ada8 ebx=866c0d98 ecx=00000000 edx=00000000 esi=867d2bc0 edi=80527660 eip=41414141 esp=edc99be0 ebp=edc99c34 iopl=0         nv up ei pl nz na po nc cs=0008  ss=0010  ds=0023  es=0023  fs=0030  gs=0000             efl=00010202 41414141 ??              ???&lt;/pre&gt;If no kernel debugger is attached the poc gives the following BSoD:&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/_QRbyLnYYriQ/S4KHdJ8OZOI/AAAAAAAAACE/8abvW2XWif4/s1600-h/bsod.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://3.bp.blogspot.com/_QRbyLnYYriQ/S4KHdJ8OZOI/AAAAAAAAACE/8abvW2XWif4/s320/bsod.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/3635618183411679867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/3635618183411679867'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/2010/02/fix-that-never-was.html' title='The Fix That Never Was'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_QRbyLnYYriQ/S4KHdJ8OZOI/AAAAAAAAACE/8abvW2XWif4/s72-c/bsod.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-10795563.post-6041706168301519410</id><published>2010-02-02T22:01:00.001+01:00</published><updated>2010-02-02T22:02:02.459+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iPhone"/><category scheme="http://www.blogger.com/atom/ns#" term="User space"/><category scheme="http://www.blogger.com/atom/ns#" term="Vulnerability"/><title type='text'>iPhone OS and Mac OS X Stack Buffer Overflow</title><content type='html'>My second security advisory in 2010 (&lt;a href=&quot;http://www.trapkit.de/advisories/TKADV2010-002.txt&quot;&gt;TKADV2010-002&lt;/a&gt;) describes the details of a stack buffer overflow I found in CoreAudio of Apple&#39;s iPhone OS and Mac OS X. The bug can be triggered by playing a maliciously crafted mp4 audio file. Example attack vectors on the iPhone are MobileSafari and malicious ringtones.&lt;br /&gt;&lt;br /&gt;Crashdump details:&lt;br /&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;[..] Process:         mediaserverd [17] Path:            /usr/sbin/mediaserverd  ..  Exception Type:  EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x41414140  ..  Unknown thread crashed with ARM Thread State:     r0: 0x6474613f    r1: 0x01380c40      r2: 0x380c561c      r3: 0x0000010d     r4: 0x41414141    r5: 0x41414141      r6: 0x41414141      r7: 0x41414141     r8: 0x41414141    r9: 0x00181494     r10: 0x41414141     r11: 0x41414141     ip: 0x00818000    sp: 0x01380c00      lr: 0x3072d454      pc: 0x41414140   cpsr: 0x60000030 [..]&lt;/pre&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/6041706168301519410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/6041706168301519410'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/2010/02/iphone-os-and-mac-os-x-stack-buffer.html' title='iPhone OS and Mac OS X Stack Buffer Overflow'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-10795563.post-4434414861757984484</id><published>2010-01-31T12:17:00.001+01:00</published><updated>2010-01-31T12:19:47.754+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Kernel"/><category scheme="http://www.blogger.com/atom/ns#" term="Vulnerability"/><title type='text'>Kernel NULL Pointer Dereference in (Open)Solaris</title><content type='html'>Today I released a security advisory (&lt;a href=&quot;http://www.trapkit.de/advisories/TKADV2010-001.txt&quot;&gt;TKADV2010-001&lt;/a&gt;) describing a NULL pointer dereference in the kernel of Oracle Solaris 10 and OpenSolaris (x86). The bug happens in processor microcode code when retrieving the microcode revision.&lt;br /&gt;&lt;br /&gt;Debugging information (SunOS 5.10 Generic_139556-08 i86pc i386 i86pc):&lt;br /&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;&amp;gt; ::msgbuf [..] panic[cpu0]/thread=ffffffff87df87c0: BAD TRAP: type=e (#pf Page fault) rp=fffffe80012dcbf0 addr=0 occurred in module &quot;unix&quot; due to a NULL pointer dereference   poc: #pf Page fault Bad kernel fault at addr=0x0 pid=1471, pc=0xfffffffffb81e8f3, sp=0xfffffe80012dcce0, eflags=0x10286 cr0: 8005003b&lt;pg,wp,ne,et,ts,mp,pe&gt; cr4: 6b0&lt;xmme,fxsr,pge,pae,pse&gt;cr2: 0 cr3: 9f84000 cr8: c &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rdi:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 rsi:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 rdx:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b6 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rcx:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp; r8: ffffffff88050b20&amp;nbsp; r9: ffffffff87df87c0 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rax:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 rbx:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 rbp: fffffe80012dccf0 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r10:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f5 r11:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 r12:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r13:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 r14:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3 r15:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100001 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fsb: ffffffff80000000 gsb: fffffffffbc278a0&amp;nbsp; ds:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 43 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; es:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 43&amp;nbsp; fs:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp; gs:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1c3 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trp:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e err:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2 rip: fffffffffb81e8f3 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cs:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 28 rfl:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10286 rsp: fffffe80012dcce0 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ss:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30  fffffe80012dcb00 unix:die+da () fffffe80012dcbe0 unix:trap+5e6 () fffffe80012dcbf0 unix:_cmntrap+140 () fffffe80012dccf0 unix:ucode_get_rev+53 () fffffe80012dcd80 ucode:ucode_ioctl+22e () fffffe80012dcd90 genunix:cdev_ioctl+1d () fffffe80012dcdb0 specfs:spec_ioctl+50 () fffffe80012dcde0 genunix:fop_ioctl+25 () fffffe80012dcec0 genunix:ioctl+ac () fffffe80012dcf10 unix:brand_sys_sysenter+1f2 ()  syncing file systems... &amp;nbsp;done dumping to /dev/dsk/c0d0s1, offset 110231552, content: kernel&lt;/xmme,fxsr,pge,pae,pse&gt;&lt;/pg,wp,ne,et,ts,mp,pe&gt;&lt;/pre&gt;&lt;br /&gt;Now that Oracle has completed its acquisition of Sun the Sun Alert for this vulnerability will be published in April as part of Oracle&#39;s next Critical Patch Update (CPU). The exact date would be 13 April 2010 as documented &lt;a href=&quot;http://www.oracle.com/technology/deploy/security/alerts.htm&quot;&gt;here&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;Since the &lt;a href=&quot;http://sunsolve.sun.com/search/document.do?assetkey=1-21-143913-01-1&quot;&gt;patch for Solaris 10&lt;/a&gt; is already available and the &lt;a href=&quot;http://src.opensolaris.org/source/history/ext3/ext2-gate/usr/src/uts/intel/io/ucode_drv.c&quot;&gt;diffs&lt;/a&gt; will be visible in the Mercurial repository and in the OpenSolaris source browser I chose not to wait until 13 April but published my advisory today.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/4434414861757984484'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/4434414861757984484'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/2010/01/kernel-null-pointer-dereference-in.html' title='Kernel NULL Pointer Dereference in (Open)Solaris'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-10795563.post-5621781933069356441</id><published>2010-01-02T15:18:00.001+01:00</published><updated>2010-01-02T15:19:25.738+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="checksec.sh"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Mitigation"/><title type='text'>checksec.sh with PaX support</title><content type='html'>New checksec.sh release.&lt;br /&gt;&lt;br /&gt;What&#39;s new with version 1.2:&lt;br /&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;* Additional PaX (http://pax.grsecurity.net/) checks   Thanks to Brad Spengler (grsecurity.net) for the PaX support.  * Some minor fixes (coloring adjusted, &#39;pidof&#39; replacement)&lt;/pre&gt;You can download the new version 1.2 of checksec.sh &lt;a href=&quot;http://www.trapkit.de/tools/checksec.html&quot;&gt;here&lt;/a&gt;.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/5621781933069356441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/5621781933069356441'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/2010/01/checksecsh-with-pax-support.html' title='checksec.sh with PaX support'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-10795563.post-4285953064648098016</id><published>2009-12-27T12:54:00.003+01:00</published><updated>2009-12-27T14:17:17.827+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="checksec.sh"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Tool"/><title type='text'>New version of checksec.sh</title><content type='html'>Modern Linux distributions offer some mitigation techniques to make it harder to exploit software vulnerabilities reliably. Mitigations such as RELRO, NoExecute (NX), Stack Canaries, Address Space Layout Randomization (ASLR) and Position Independent Executables (PIE) have made reliably exploiting any vulnerabilities that do exist far more challenging. The checksec.sh script is designed to test what &lt;b&gt;standard Linux OS security features&lt;/b&gt; are being used. &lt;br /&gt;&lt;br /&gt;While other mitigations do exist (e.g. &lt;a href=&quot;http://grsecurity.net/&quot;&gt;grsecurity.net&lt;/a&gt;) these are not tested.&lt;br /&gt;&lt;br /&gt;What&#39;s new with version 1.1: &lt;br /&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;* New &#39;--proc-libs&#39; option. This option instructs checksec.sh to test the loaded libraries of a process.   * Additional information on ASLR results (--proc, --proc-all, --proc-libs) &amp;nbsp; Thanks to Anthony G. Basile of the Tin Hat project for the hint. &amp;nbsp;  * Additional CPU NX check (--proc, --proc-all, --proc-libs)&lt;/pre&gt;I tested the new version on Ubuntu 9.10, openSUSE 11.2 and Fedora 12. &lt;br /&gt;&lt;br /&gt;You can download the new version 1.1 of checksec.sh &lt;a href=&quot;http://www.trapkit.de/tools/checksec.html&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Example of additional information on ASLR and NX results:&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/_QRbyLnYYriQ/SzdKXHo2S_I/AAAAAAAAABo/Dh0sdIJk02g/s1600-h/checksec_nx_aslr.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://4.bp.blogspot.com/_QRbyLnYYriQ/SzdKXHo2S_I/AAAAAAAAABo/Dh0sdIJk02g/s320/checksec_nx_aslr.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Example of the new &#39;--proc-libs&#39; option:&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/_QRbyLnYYriQ/SzdKtuenJKI/AAAAAAAAABw/1U9qp87q2RQ/s1600-h/checksec_proc-libs.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://3.bp.blogspot.com/_QRbyLnYYriQ/SzdKtuenJKI/AAAAAAAAABw/1U9qp87q2RQ/s320/checksec_proc-libs.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/4285953064648098016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/4285953064648098016'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/2009/12/new-version-of-checksecsh.html' title='New version of checksec.sh'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_QRbyLnYYriQ/SzdKXHo2S_I/AAAAAAAAABo/Dh0sdIJk02g/s72-c/checksec_nx_aslr.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-10795563.post-5895232520423778073</id><published>2009-11-05T12:37:00.003+01:00</published><updated>2009-12-23T17:17:08.353+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Twitter"/><title type='text'>I joined the Twitterverse</title><content type='html'>Of course, you should follow me on twitter &lt;a href=&quot;http://www.twitter.com/tobiklein&quot;&gt;here&lt;/a&gt; ;)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/5895232520423778073'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/5895232520423778073'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/2009/11/i-joined-twitterverse.html' title='I joined the Twitterverse'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-10795563.post-4760580801022991719</id><published>2009-09-09T23:37:00.003+02:00</published><updated>2009-12-23T17:45:22.234+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iPhone"/><category scheme="http://www.blogger.com/atom/ns#" term="User space"/><category scheme="http://www.blogger.com/atom/ns#" term="Vulnerability"/><title type='text'>The Ringtone Massacre</title><content type='html'>If you are an iPhone or iPod user then get the latest update of iPhone OS released today. This new version fixes a heap buffer overflow I found in CoreAudio of iPhone OS (see &lt;a href=&quot;http://trapkit.de/advisories/TKADV2009-007.txt&quot;&gt;TKADV2009-007&lt;/a&gt;). The bug may be exploited by maliciously crafted AAC or MP3 files. This includes ringtones on the iPhone.&lt;br /&gt;&lt;br /&gt;I&#39;m sure you are only listening to AAC/MP3&#39;s you got from trusted sources, right? :&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/4760580801022991719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/4760580801022991719'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/2009/09/ringtone-massacre.html' title='The Ringtone Massacre'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-10795563.post-5064021124210706292</id><published>2009-05-16T08:17:00.010+02:00</published><updated>2009-12-23T17:45:47.373+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="User space"/><category scheme="http://www.blogger.com/atom/ns#" term="Vulnerability"/><title type='text'>!exploitable vs. TKADV2009-006 vs. Static Analysis Tools</title><content type='html'>The following is the result of Microsoft&#39;s &lt;a href=&quot;http://www.codeplex.com/msecdbg&quot;&gt;!exploitable&lt;/a&gt; Windbg extension while analyzing the libsndfile bug I released today (&lt;a href=&quot;http://www.trapkit.de/advisories/TKADV2009-006.txt&quot;&gt;TKADV2009-006&lt;/a&gt;).&lt;br /&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;(3a8.62c): Access violation - code c0000005 (!!! second chance !!!) eax=00000000 ebx=0000ffff ecx=000029f1 edx=00000003 esi=02158008 edi=02166000 eip=7c34126b esp=04dbfa8c ebp=04dbfac0 iopl=0         nv up ei pl nz na pe cy cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000207 *** ERROR: Symbol file could not be found.  Defaulted to export symbols for  C:\Programme\Winamp\NSCRT.dll -  NSCRT!memset+0x49: 7c34126b f3ab            rep stos dword ptr es:[edi]  0:015&gt; !load winext\msec.dll 0:015&gt; !exploitable -v HostMachine\HostUser Executing Processor Architecture is x86 Debuggee is in User Mode Debuggee is a live user mode debugging session on the local machine Event Type: Exception Exception Faulting Address: 0x2166000 Second Chance Exception Type: STATUS_ACCESS_VIOLATION (0xC0000005) Exception Sub-Type: Write Access Violation  Exception Hash (Major/Minor): 0x21214e2e.0x67415f20  Stack Trace: NSCRT!memset+0x49 libsndfile!Ordinal9+0x290c2 libsndfile!Ordinal9+0x1994f libsndfile!Ordinal9+0x19eb9 libsndfile!sf_readf_double+0xd5f libsndfile!sf_open+0x89 in_wave+0x1276 kernel32!GetModuleFileNameA+0x1ba Instruction Address: 0x7c34126b  Description: User Mode Write AV Short Description: WriteAV Exploitability Classification: EXPLOITABLE Recommended Bug Title: Exploitable - User Mode Write AV starting at  NSCRT!memset+0x49 (Hash=0x21214e2e.0x67415f20)  User mode write access violations that are not near NULL are exploitable.&lt;/pre&gt;Erik, the libsndfile maintainer, also published &lt;a href=&quot;http://www.mega-nerd.com/erikd/Blog/CodeHacking/libsndfile/rel_19.html&quot;&gt;an interesting blog entry&lt;/a&gt; regarding the security measures he took to secure libsndfile. Amongst others he checked his code base with static analysis tools. Unfortunately the bug described in TKADV2009-006 (as well as others) were missed. What a surprise :)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/5064021124210706292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/5064021124210706292'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/2009/05/exploitable-vs-tkadv2009-006-vs-static.html' title='!exploitable vs. TKADV2009-006 vs. Static Analysis Tools'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-10795563.post-7588278985786492155</id><published>2009-04-04T11:17:00.039+02:00</published><updated>2009-12-23T17:54:23.369+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="User space"/><category scheme="http://www.blogger.com/atom/ns#" term="Vulnerability"/><title type='text'>TKADV2009-005</title><content type='html'>Today I released an advisory (&lt;a href=&quot;http://www.trapkit.de/advisories/TKADV2009-005.txt&quot;&gt;TKADV2009-005&lt;/a&gt;) describing an integer overflow vulnerability in the Quicktime demuxer of &lt;a href=&quot;http://www.xine-project.org/&quot;&gt;xine-lib&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Debug session of the bug&lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;tk@tk-desktop:~$ gdb -q xine&lt;/pre&gt;&lt;br /&gt;Adjusting the debugger environment:&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;(gdb) set disassembly-flavor intel  (gdb) directory /home/tk/Desktop/xine-lib-1.1.16.2/src/demuxers/ Source directories searched: /home/tk/Desktop/xine-lib-1.1.16.2/src/demuxers:$cdir:$cwd  (gdb) symbol-file /usr/lib/debug/usr/lib/xine/plugins/1.24/xineplug_decode_qt.so Load new symbol table from &quot;/usr/lib/debug/usr/lib/xine/plugins/1.24/xineplug_decode_qt.so&quot;? (y or n) y Reading symbols from /usr/lib/debug/usr/lib/xine/plugins/1.24/xineplug_decode_qt.so...done.&lt;/pre&gt;&lt;br /&gt;Set a breakpoint after calloc():&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;(gdb) break demux_qt.c:1550 No source file named demux_qt.c. Make breakpoint pending on future shared library load? (y or [n]) y  Breakpoint 1 (demux_qt.c:1550) pending.&lt;/pre&gt;&lt;br /&gt;Now let xine play our poc movie file:&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;(gdb) r Desktop/xine-lib_QuickTime_Bug/poc2.mov  Starting program: /usr/bin/xine Desktop/xine-lib_QuickTime_Bug/poc2.mov [Thread debugging using libthread_db enabled] [New Thread 0xb78646d0 (LWP 11878)] Dies ist xine (X11 gui) - Ein freier Video-Player v0.99.6cvs. (c) 2000-2007 Das xine Team. [New Thread 0xb76edb90 (LWP 11881)] [New Thread 0xb6eecb90 (LWP 11882)] [New Thread 0xb5d60b90 (LWP 11883)] [New Thread 0xb513bb90 (LWP 11884)] [New Thread 0xb48b8b90 (LWP 11885)] [New Thread 0xb3eb6b90 (LWP 11886)] [New Thread 0xb32ccb90 (LWP 11887)] [New Thread 0xb28feb90 (LWP 11888)] [New Thread 0xb1cf2b90 (LWP 11889)] [New Thread 0xb14f1b90 (LWP 11890)] [New Thread 0xb0cf0b90 (LWP 11891)] [New Thread 0xb0106b90 (LWP 11892)] [New Thread 0xaf905b90 (LWP 11893)] [New Thread 0xaed1bb90 (LWP 11894)] [New Thread 0xadcf3b90 (LWP 11895)] [New Thread 0xad4f2b90 (LWP 11896)] [Switching to Thread 0xb78646d0 (LWP 11878)]  Breakpoint 1, parse_moov_atom (info=0x8ec1978, moov_atom=0x8ec19e8 &quot;&quot;, bandwidth=1544000) at demux_qt.c:1550 warning: Source file is more recent than executable. 1550       if (!trak-&gt;time_to_sample_table) {  (gdb) x/1i $eip 0xaccdefc8 &amp;lt;parse_moov_atom+1528&gt;: test   eax,eax&lt;/pre&gt;&lt;br /&gt;EAX points to the overflow heap buffer allocated by calloc():&lt;br /&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;(gdb) i r eax eax            0x8e48d18 149196056&lt;/pre&gt;&lt;br /&gt;Content of the heap (before the overflow):&lt;br /&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;(gdb) x/8x 0x8e48d18 0x8e48d18: 0x00000000 0x00000000 0x00000000 0x00000000 0x8e48d28: 0x00000000 0x00000029 0x00000000 0xade1bcae&lt;/pre&gt;&lt;br /&gt;Breakpoint after the first written bytes:&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;(gdb) break 1563 Breakpoint 2 at 0xaccdf052: file demux_qt.c, line 1563.  (gdb) c Continuing.  Breakpoint 2, parse_moov_atom (info=0x8ec1928, moov_atom=0x8ec1998 &quot;???]}??O?j??q?\212_?\022\177;J?w??h~/?o?]\204\032?_??`??\a????L?\234G?&quot;, bandwidth=0x178f40) at demux_qt.c:1565 1565       trak-&gt;time_to_sample_table[j].count = 0; /* terminate with zero */&lt;/pre&gt;&lt;br /&gt;The heap buffer is indeed overflowed with user controlled data from the Quicktime movie file:&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;(gdb) x/8x 0x8e48d18 0x8e48d18: 0x41414141 0x42424242 0x43434343 0x44444444 0x8e48d28: 0x45454545 0x46464646 0x47474747 0x48484848  (gdb) c Continuing.  Program received signal SIGSEGV, Segmentation fault.&lt;/pre&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/7588278985786492155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/7588278985786492155'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/2009/04/tkadv2009-005.html' title='TKADV2009-005'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-10795563.post-638051735334788016</id><published>2009-02-28T12:09:00.010+01:00</published><updated>2009-12-27T13:04:54.132+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="checksec.sh"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Tool"/><title type='text'>checksec</title><content type='html'>In my &lt;a href=&quot;http://tk-blog.blogspot.com/2009/02/relro-not-so-well-known-memory.html&quot;&gt;last blog post&lt;/a&gt; I described a script called &quot;checkrelro.sh&quot; that can be used to check if ELF executables or processes support the RELRO mitigation technique. I extended that script to also support other memory corruption mitigation techniques. The extended version is now called &quot;checksec.sh&quot; and is able to check Linux ELF executables and running processes if they support the following mitigation techniques: RELRO, Stack Canaries, NX, PIE and ASLR (for more information see &lt;a href=&quot;http://www.ubuntu.com/products/whatisubuntu/serveredition/features/security&quot;&gt;Ubuntu&lt;/a&gt;, &lt;a href=&quot;http://en.opensuse.org/Security_Features&quot;&gt;SUSE/Novell&lt;/a&gt;, &lt;a href=&quot;http://fedoraproject.org/wiki/Security/Features&quot;&gt;Red Hat&lt;/a&gt;).  &lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Example 1 - Check a single executable (Ubuntu 8.10):&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href=&quot;http://4.bp.blogspot.com/_QRbyLnYYriQ/SakbvUEbCwI/AAAAAAAAAA4/UtTrTEhevxU/s1600-h/pic1.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5307804135487900418&quot; src=&quot;http://4.bp.blogspot.com/_QRbyLnYYriQ/SakbvUEbCwI/AAAAAAAAAA4/UtTrTEhevxU/s320/pic1.png&quot; style=&quot;cursor: pointer; display: block; height: 72px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Example 2 - Check all executables in a directory (Ubuntu 8.10):&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://4.bp.blogspot.com/_QRbyLnYYriQ/Sakb9vty7QI/AAAAAAAAABA/IpT83I_9qyk/s1600-h/pic2.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5307804383427357954&quot; src=&quot;http://4.bp.blogspot.com/_QRbyLnYYriQ/Sakb9vty7QI/AAAAAAAAABA/IpT83I_9qyk/s320/pic2.png&quot; style=&quot;cursor: pointer; display: block; height: 238px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Example 3 - Check a single process by name (Ubuntu 8.10):&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://2.bp.blogspot.com/_QRbyLnYYriQ/SakcHGPS4AI/AAAAAAAAABI/8xH6X9p3Vbk/s1600-h/pic3.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5307804544092266498&quot; src=&quot;http://2.bp.blogspot.com/_QRbyLnYYriQ/SakcHGPS4AI/AAAAAAAAABI/8xH6X9p3Vbk/s320/pic3.png&quot; style=&quot;cursor: pointer; display: block; height: 44px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Example 4 - Check all running processes (Ubuntu 8.10):&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://2.bp.blogspot.com/_QRbyLnYYriQ/SakcRlYsjMI/AAAAAAAAABQ/nSow24eqvRU/s1600-h/pic4.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5307804724251888834&quot; src=&quot;http://2.bp.blogspot.com/_QRbyLnYYriQ/SakcRlYsjMI/AAAAAAAAABQ/nSow24eqvRU/s320/pic4.png&quot; style=&quot;cursor: pointer; display: block; height: 218px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I successfully tested checksec under Ubuntu 8.10 and openSUSE 11.1.&lt;br /&gt;&lt;br /&gt;&lt;strike&gt;Get checksec.sh here. &lt;/strike&gt;&lt;b&gt;&amp;nbsp; UPDATE (27.12.2009):&lt;/b&gt; A newer version of checksec.sh is available &lt;a href=&quot;http://www.trapkit.de/tools/checksec.html&quot;&gt;here&lt;/a&gt;. See also this &lt;a href=&quot;http://tk-blog.blogspot.com/2009/12/new-version-of-checksecsh.html&quot;&gt;link&lt;/a&gt;.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/638051735334788016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/638051735334788016'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/2009/02/checksec.html' title='checksec'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_QRbyLnYYriQ/SakbvUEbCwI/AAAAAAAAAA4/UtTrTEhevxU/s72-c/pic1.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-10795563.post-9070877402226426554</id><published>2009-02-21T09:11:00.021+01:00</published><updated>2009-12-23T21:17:43.271+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Exploiting"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Mitigation"/><category scheme="http://www.blogger.com/atom/ns#" term="Tool"/><title type='text'>RELRO - A (not so well known) Memory Corruption Mitigation Technique</title><content type='html'>&lt;blockquote&gt;After a discussion with &lt;a href=&quot;http://c-skills.blogspot.com/&quot;&gt;Sebastian Krahmer&lt;/a&gt; about RELRO I did a little writeup on this memory corruption mitigation technique for my own purpose. I also decided to post it here just in case someone else might find this information valuable.&lt;br /&gt;&lt;/blockquote&gt;RELRO is a generic mitigation technique to harden the data sections of an ELF binary/process. There are two different &quot;operation modes&quot; of RELRO:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Partial RELRO&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;compiler command line: gcc -Wl,-z,relro&lt;/li&gt;&lt;li&gt;the ELF sections are reordered so that the ELF internal data sections (.got, .dtors, etc.) precede the program&#39;s data sections (.data and .bss)&lt;/li&gt;&lt;li&gt;non-PLT GOT is read-only&lt;/li&gt;&lt;li&gt;GOT is still writeable&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Full RELRO&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;compiler command line: gcc -Wl,-z,relro,-z,now&lt;/li&gt;&lt;li&gt;supports all the features of partial RELRO&lt;/li&gt;&lt;li&gt;bonus: the entire GOT is also (re)mapped as read-only&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Interim conclusion:&lt;/span&gt; In case of a bss or data overflow bug partial and full RELRO protect the ELF internal data sections from being overwritten (as the ELF sections are reordered). Only full RELRO mitigates the well known technique of modifying a GOT entry to get control over the program execution flow.&lt;br /&gt;&lt;/blockquote&gt;&lt;h3&gt;Testcases&lt;/h3&gt;The &lt;a href=&quot;http://www.trapkit.de/tools/checkrelro.sh&quot;&gt;checkrelro.sh&lt;/a&gt; script can be used to test if an ELF binary or a process supports RELRO.&lt;br /&gt;&lt;br /&gt;Recent Linux distris have partial RELRO enabled by default (e.g. Ubuntu 8.10 and openSUSE 11.1). There is therefore no difference between &quot;gcc testcase.c&quot; and &quot;gcc -Wl,-z,relro testcase.c&quot; on these platforms.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Testcase 1 (Ubuntu 8.10): Partial RELRO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;File: testcase.c&lt;br /&gt;&lt;pre class=&quot;brush: cpp;&quot;&gt;#include &amp;lt;stdio.h&amp;gt;  int main (int argc, char *argv[]) {   size_t *p = (size_t *)strtol (argv[1], NULL, 16);    p[0] = 0x41414141;   printf (&quot;RELRO: %p\n&quot;, p);    return 0; }&lt;/pre&gt;&lt;br /&gt;This test program tries to write the value 0x41414141 at a given memory address.&lt;br /&gt;&lt;br /&gt;Compiling &quot;testcase&quot; with partial RELRO:&lt;br /&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;$ gcc -g -o testcase testcase.c&lt;/pre&gt;&lt;br /&gt;Test binary:&lt;br /&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;$ ./checkrelro.sh --file testcase testcase - partial RELRO&lt;/pre&gt;&lt;br /&gt;Get GOT entry of printf(3):&lt;br /&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;$ readelf -r ./testcase | grep printf 0804a00c  00000407 R_386_JUMP_SLOT   00000000   printf&lt;/pre&gt;&lt;br /&gt;Try to modify the GOT address:&lt;br /&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;$ gdb -q ./testcase (gdb) r 0x0804a00c Starting program: /home/tk/Desktop/testcase 0x0804a00c  Program received signal SIGSEGV, Segmentation fault. 0x41414141 in ?? ()&lt;/pre&gt;If only partial RELRO is used, it is still possible to modify arbitrary GOT entries to gain control of the execution flow of a process. &lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Testcase 2 (Ubuntu 8.10): Full RELRO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Compiling &quot;testcase&quot; with full RELRO:&lt;br /&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;$ gcc -g -Wl,-z,relro,-z,now -o testcase testcase.c&lt;/pre&gt;&lt;br /&gt;Test binary:&lt;br /&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;$ ./checkrelro.sh --file testcase  testcase - full RELRO&lt;/pre&gt;&lt;br /&gt;Get GOT entry of printf(3):&lt;br /&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;$ readelf -r ./testcase | grep printf 08049ff8  00000407 R_386_JUMP_SLOT   00000000   printf&lt;/pre&gt;&lt;br /&gt;Try to modify the GOT address:&lt;br /&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;$ gdb -q ./testcase (gdb) r 0x08049ff8 Starting program: /home/tk/Desktop/testcase 0x08049ff8  Program received signal SIGSEGV, Segmentation fault. 0x0804842b in main (argc=Cannot access memory at address 0x0 ) at testcase.c:8 8               p[0] = 0x41414141;&lt;/pre&gt;&lt;br /&gt;If full RELRO is enabled, the attempt to overwrite a GOT address leads to an error as the GOT section is mapped read-only.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;How is RELRO used in recent Linux distris?&lt;/h3&gt;The checkrelro.sh script is also able to enumerate all processes running on a system and test each one of them if they have RELRO enabled.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Testcase 3 (Ubuntu 8.10): Inspect all running processes&lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;$ sudo ./checkrelro.sh --proc-all init (1) - full RELRO vmware-guestd (15296) - no RELRO gedit (15771) - partial RELRO sshd (16181) - partial RELRO sshd (16193) - partial RELRO bash (16196) - no RELRO notification-da (16626) - partial RELRO udevd (2542) - partial RELRO getty (4382) - partial RELRO getty (4383) - partial RELRO getty (4390) - partial RELRO getty (4393) - partial RELRO getty (4395) - partial RELRO acpid (4563) - partial RELRO syslogd (4677) - partial RELRO dd (4729) - partial RELRO klogd (4731) - partial RELRO dbus-daemon (4754) - partial RELRO avahi-daemon (4776) - partial RELRO avahi-daemon (4777) - partial RELRO sshd (4806) - partial RELRO cupsd (4849) - partial RELRO hald (4913) - partial RELRO console-kit-dae (4916) - partial RELRO hald-runner (4979) - partial RELRO hald-addon-inpu (4999) - partial RELRO hald-addon-stor (5004) - partial RELRO hald-addon-acpi (5009) - partial RELRO bluetoothd (5055) - partial RELRO NetworkManager (5110) - partial RELRO wpa_supplicant (5115) - partial RELRO nm-system-setti (5118) - partial RELRO gdm (5148) - partial RELRO gdm (5151) - partial RELRO Xorg (5155) - partial RELRO system-tools-ba (5171) - partial RELRO atd (5206) - partial RELRO cron (5234) - partial RELRO dhclient (5236) - partial RELRO getty (5333) - partial RELRO gnome-keyring-d (5425) - partial RELRO x-session-manag (5436) - partial RELRO dbus-launch (5554) - partial RELRO dbus-daemon (5555) - partial RELRO pulseaudio (5558) - partial RELRO gconf-helper (5561) - partial RELRO gconfd-2 (5563) - partial RELRO seahorse-agent (5569) - partial RELRO gnome-keyring-d (5574) - partial RELRO gnome-settings- (5575) - partial RELRO metacity (5577) - partial RELRO gvfsd (5599) - partial RELRO gnome-panel (5600) - partial RELRO nautilus (5603) - partial RELRO bonobo-activati (5606) - partial RELRO gvfs-fuse-daemo (5610) - partial RELRO gnome-screensav (5630) - partial RELRO gvfs-hal-volume (5634) - partial RELRO gvfs-gphoto2-vo (5636) - partial RELRO trashapplet (5640) - partial RELRO gvfsd-trash (5643) - partial RELRO gvfsd-burn (5646) - partial RELRO fast-user-switc (5650) - partial RELRO mixer_applet2 (5653) - partial RELRO nm-applet (5655) - partial RELRO evolution-alarm (5658) - partial RELRO trackerd (5659) - partial RELRO update-notifier (5662) - partial RELRO tracker-applet (5663) - partial RELRO bluetooth-apple (5664) - partial RELRO python (5666) - partial RELRO gnome-power-man (5669) - partial RELRO gnome-terminal (5733) - partial RELRO gnome-pty-helpe (5735) - partial RELRO  # of Processes: 74 No RELRO      : 2 Partial RELRO : 71 Full RELRO    : 1&lt;/pre&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Testcase 4 (openSUSE 11.1): Inspect all running processes&lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;tk@linux-0skt:~&amp;gt; sudo ./checkrelro.sh --proc-all init (1) - partial RELRO acpid (1599) - partial RELRO klogd (1621) - partial RELRO syslog-ng (1635) - partial RELRO dbus-daemon (1645) - partial RELRO hald (1734) - partial RELRO console-kit-dae (1746) - partial RELRO hald-runner (1818) - partial RELRO hald-addon-inpu (1880) - partial RELRO hald-addon-stor (1929) - partial RELRO rpcbind (1930) - partial RELRO hald-addon-stor (1931) - partial RELRO hald-addon-acpi (1933) - partial RELRO kdm (1966) - partial RELRO X (1982) - partial RELRO auditd (2173) - partial RELRO audispd (2175) - partial RELRO avahi-daemon (2194) - partial RELRO kdm (2227) - partial RELRO nscd (2286) - full RELRO NetworkManager (2290) - partial RELRO cupsd (2291) - partial RELRO modem-manager (2293) - partial RELRO dbus-launch (2294) - partial RELRO dbus-daemon (2297) - partial RELRO wpa_supplicant (2299) - partial RELRO nm-system-setti (2302) - partial RELRO master (2377) - partial RELRO pickup (2391) - partial RELRO qmgr (2392) - partial RELRO cron (2404) - partial RELRO dhclient (2475) - partial RELRO vmware-guestd (2484) - partial RELRO sshd (2485) - partial RELRO startpar (2488) - partial RELRO mingetty (2607) - partial RELRO mingetty (2609) - partial RELRO mingetty (2611) - partial RELRO mingetty (2613) - partial RELRO mingetty (2615) - partial RELRO mingetty (2622) - partial RELRO startkde (2658) - partial RELRO dbus-launch (3025) - partial RELRO dbus-daemon (3029) - partial RELRO kdeinit4 (3048) - partial RELRO klauncher (3052) - partial RELRO kded4 (3085) - partial RELRO kwrapper4 (3289) - partial RELRO ksmserver (3290) - partial RELRO kwin (3292) - partial RELRO plasma (3299) - partial RELRO knotify4 (3300) - partial RELRO krunner (3305) - partial RELRO nepomukserver (3307) - partial RELRO nepomukservices (3309) - partial RELRO nepomukservices (3310) - partial RELRO nepomukservices (3311) - partial RELRO kaccess (3315) - partial RELRO kmix (3325) - partial RELRO amarok (3327) - partial RELRO policykit-kde (3331) - partial RELRO pulseaudio (3334) - partial RELRO klipper (3336) - partial RELRO kupdateapplet (3340) - partial RELRO knetworkmanager (3341) - partial RELRO kdeinit (3346) - partial RELRO dcopserver (3349) - partial RELRO klauncher (3351) - partial RELRO kded (3354) - partial RELRO kio_file (3379) - partial RELRO konsole (3421) - partial RELRO bash (3423) - partial RELRO sshd (3436) - partial RELRO sshd (3439) - partial RELRO bash (3440) - partial RELRO krunner_lock (4565) - partial RELRO kblankscrn.kss (4567) - partial RELRO udevd (529) - partial RELRO  # of Processes: 78 No RELRO      : 0 Partial RELRO : 77 Full RELRO    : 1&lt;/pre&gt;&lt;br /&gt;&lt;h3&gt;Conclusion&lt;/h3&gt;In case of a bss or data overflow bug both partial and full RELRO protect the ELF internal data sections from being overwritten.&lt;br /&gt;&lt;br /&gt;With full RELRO a working mitigation technique to successfully prevent the modification of GOT entries is available. But as the above testcases have shown, this mitigation technique is not used as default on current Linux distris. The only argument why full RELRO isn&#39;t widely used is that the startup of processes is slowed down as the linker has to perform all relocations at startup time. &lt;br /&gt;&lt;br /&gt;In consequence the good old GOT overwrite technique can still be used today to get reliable control of the execution flow of a process while exploiting &quot;write n bytes anywhere in memory&quot; bugs like the one in &lt;a href=&quot;http://www.trapkit.de/advisories/TKADV2009-004.txt&quot;&gt;FFmpeg&lt;/a&gt;. To gain reliable code execution from that point if ASLR and NX are also enabled is another story :)&lt;br /&gt;&lt;br /&gt;There is another interesting &lt;a href=&quot;http://chris.rohlf.googlepages.com/Self-Protecting-GOT.html&quot;&gt;writeup&lt;/a&gt; available that describes a generic way to implement a similar mitigation technique for ELF objects even if the platform doesn&#39;t support RELRO.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/9070877402226426554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/9070877402226426554'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/2009/02/relro-not-so-well-known-memory.html' title='RELRO - A (not so well known) Memory Corruption Mitigation Technique'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-10795563.post-4148934017519933396</id><published>2009-02-15T14:11:00.007+01:00</published><updated>2009-12-23T17:46:59.505+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="User space"/><category scheme="http://www.blogger.com/atom/ns#" term="Vulnerability"/><title type='text'>TKADV2009-004 vs. xine-lib</title><content type='html'>Tomas Hoger from the Red Hat Security Response Team notified me that the 4xm demuxer of &lt;a href=&quot;http://www.xine-project.org/&quot;&gt;xine-lib&lt;/a&gt; seems to have the same origin with FFmpeg&#39;s version, and is therefore affected by a variant of the bug I described in &lt;a href=&quot;http://www.trapkit.de/advisories/TKADV2009-004.txt&quot;&gt;TKADV2009-004&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;xine-lib-1.1.16.1/src/demuxers/demux_4xm.c: &lt;br /&gt;&lt;pre class=&quot;brush: cpp; gutter: false;&quot;&gt;... 192 [1]   const uint32_t current_track = _X_LE_32(&amp;header[i + 8]); 193       if (current_track + 1 &gt; fourxm-&gt;track_count) { 194 [2]     fourxm-&gt;track_count = current_track + 1; 195 [3]     fourxm-&gt;tracks = realloc(fourxm-&gt;tracks, 196           fourxm-&gt;track_count * sizeof(audio_track_t)); 197         if (!fourxm-&gt;tracks) { 198           free(header); 199           return 0; 200         } 201       } ...&lt;/pre&gt;Unlike FFmpeg, &quot;current_track&quot; is unsigned in xine-lib (see [1]), therefore the exploitation vector described in TKADV2009-004 does not seem directly applicable. However, xine-lib&#39;s version of the 4xm demuxer is missing an integer overflow check prior to the allocation of the &quot;fourxm-&gt;tracks&quot; buffer (see [2] and [3]).&lt;br /&gt;&lt;br /&gt;Tomas also identified a way to exploit this variant of TKADV2009-004: If the first track number is e.g. 0x10000000, a small &quot;fourxm-&gt;tracks&quot; array gets allocated in [3]. Subsequent tracks with numbers lower than 0x10000000 will not trigger the array reallocation in [3], but will cause an OOB write.&lt;br /&gt;&lt;br /&gt;The bug is fixed in version &lt;a href=&quot;http://sourceforge.net/project/shownotes.php?group_id=9655&amp;release_id=660071&quot;&gt;1.1.16.2&lt;/a&gt; of xine-lib.&lt;br /&gt;&lt;br /&gt;Thanks to Tomas for notification and filing the bug.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/4148934017519933396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/4148934017519933396'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/2009/02/tkadv2009-004-vs-xine-lib.html' title='TKADV2009-004 vs. xine-lib'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-10795563.post-1859343893201705062</id><published>2009-01-28T20:51:00.018+01:00</published><updated>2009-12-23T21:16:12.284+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Exploiting"/><category scheme="http://www.blogger.com/atom/ns#" term="User space"/><category scheme="http://www.blogger.com/atom/ns#" term="Vulnerability"/><title type='text'>Exploitable Userland NULL Pointer Dereference</title><content type='html'>Today I released a security advisory (&lt;a href=&quot;http://www.trapkit.de/advisories/TKADV2009-004.txt&quot;&gt;TKADV2009-004&lt;/a&gt;) that describes the details of a very interesting vulnerability I found in &lt;a href=&quot;http://ffmpeg.mplayerhq.hu/&quot;&gt;FFmpeg&lt;/a&gt;. FFmpeg is a software solution to record, convert and stream audio and video. The FFmpeg libraries are used by a lot of popular software projects like &lt;a href=&quot;http://www.videolan.org/&quot;&gt;VLC&lt;/a&gt;, &lt;a href=&quot;http://www.mplayerhq.hu/&quot;&gt;Mplayer&lt;/a&gt;, &lt;a href=&quot;http://perian.org/&quot;&gt;Perian&lt;/a&gt; and &lt;a href=&quot;http://xinehq.de/&quot;&gt;Xine&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;As I said, this vulnerability is quite interesting as it is &lt;a href=&quot;http://blogs.iss.net/archive/flash.html&quot;&gt;another&lt;/a&gt; &lt;a href=&quot;http://blogs.iss.net/archive/cve-2008-0017.html&quot;&gt;example&lt;/a&gt; for an exploitable NULL pointer dereference in an userland application. &lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;The vulnerability&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The initial vulnerability is a type conversion bug while converting an user controlled unsigned int value to a signed int. &lt;br /&gt;&lt;pre class=&quot;brush: cpp;&quot;&gt;.. fourxm-&amp;gt;track_count = 0; .. current_track = AV_RL32(&amp;amp;header[i + 8]); ..&lt;/pre&gt;The AV_RL32() macro in the above code snippet reads an unsigned int value from the media file and stores the value in the signed int variable &quot;current_track&quot;.&lt;br /&gt;&lt;br /&gt;Later on &quot;current_track&quot; is checked against another value. If &quot;current_track&quot; is greater than this value a heap buffer pointed to by &quot;fourxm-&amp;gt;tracks&quot; gets (re)allocated. &lt;br /&gt;&lt;pre class=&quot;brush: cpp;&quot;&gt;.. fourxm-&amp;gt;tracks = NULL;  &amp;lt;-- [4] .. if (current_track + 1 &amp;gt; fourxm-&amp;gt;track_count) {   fourxm-&amp;gt;track_count = current_track + 1;  &amp;lt;-- [1]   if((unsigned)fourxm-&amp;gt;track_count &amp;gt;= UINT_MAX /  &amp;lt;-- [3]         sizeof(AudioTrack))     return -1;   fourxm-&amp;gt;tracks = av_realloc(fourxm-&amp;gt;tracks,   fourxm-&amp;gt;track_count * sizeof(AudioTrack));  &amp;lt;-- [2]   if (!fourxm-&amp;gt;tracks) {     av_free(header);     return AVERROR(ENOMEM);   } } ..&lt;/pre&gt;If &quot;current_track&quot; is greater than &quot;fourxm-&amp;gt;track_count&quot; the user controlled value of &quot;current_track&quot; is stored into &quot;fourxm-&amp;gt;track_count&quot; (see [1]). The value of &quot;fourxm-&amp;gt;track_count&quot; is then used to calculate the size of the heap buffer (see [2]). To avoid an integer overflow, the size of &quot;fourxm-&amp;gt;track_count&quot; is checked before the allocation takes place (see [3]).&lt;br /&gt;&lt;br /&gt;Now what happens if we supply a value &amp;gt;= 0x80000000 for &quot;current_track&quot;? Well, as there is an unchecked type conversion between unsigned and signed, &quot;current_track&quot; will become negative. If &quot;current_track&quot; is negative, the if statement shown above will always return false and the heap buffer will never be allocated. This results in &quot;fourxm-&amp;gt;tracks&quot; still pointing to NULL (see [4]).&lt;br /&gt;&lt;br /&gt;Directly after the if statement the following write operations are performed:&lt;br /&gt;&lt;pre class=&quot;brush: cpp;&quot;&gt;.. fourxm-&amp;gt;tracks[current_track].adpcm = AV_RL32(&amp;amp;header[i + 12]); fourxm-&amp;gt;tracks[current_track].channels = AV_RL32(&amp;amp;header[i + 36]); fourxm-&amp;gt;tracks[current_track].sample_rate = AV_RL32(&amp;amp;header[i+40]); fourxm-&amp;gt;tracks[current_track].bits = AV_RL32(&amp;amp;header[i + 44]); ..&lt;/pre&gt;As &quot;fourxm-&amp;gt;tracks&quot; is pointing to NULL these write operations are leading to four classical NULL pointer dereferences. But as NULL is dereferenced by the user controlled value of &quot;current_track&quot; it is possible to write user controlled data to a wide range of memory locations. &lt;br /&gt;&lt;br /&gt;Result: &lt;br /&gt;&lt;pre class=&quot;brush: cpp; gutter: false;&quot;&gt;NULL[current_track].offset = user_controlled_data;&lt;/pre&gt;&lt;br /&gt;As there are four write operations, four memory locations can be overwritten with arbitrary data.&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;Short summary:&lt;/b&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&quot;fourxm-&amp;gt;tracks&quot; is initialized with NULL&amp;nbsp;&lt;/li&gt;&lt;li&gt;The type conversion bug allows us to avoid the allocation of &quot;fourxm-&amp;gt;tracks&quot;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&quot;fourxm-&amp;gt;tracks&quot; still points to NULL&amp;nbsp;&lt;/li&gt;&lt;li&gt;The resulting NULL pointer is then dereferenced by the user controlled value of &quot;current_track&quot; and four 32bit values of user controlled data are assigned to the dereferenced location(s).&amp;nbsp;&lt;/li&gt;&lt;li&gt;It is therefore possible to overwrite four user controlled memory locations with four user controlled data bytes each.&lt;/li&gt;&lt;/ol&gt;&lt;/blockquote&gt;As I said, that&#39;s a beautiful bug.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Exploitability &lt;br /&gt;&lt;br /&gt;&lt;/span&gt;In my advisory I wrote: &quot;A malicious party may exploit this issue to execute arbitrary code by overwriting a sensitive memory location (such as a GOT/IAT entry, a return address, buffer length or boolean variable)&quot;. To see if this nice bug is indeed exploitable I chose the following two test cases:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;VLC 0.9.8a under Windows XP SP3&lt;/li&gt;&lt;li&gt;Mplayer under openSUSE 11.1&lt;/li&gt;&lt;/ul&gt;As VLC and Mplayer are both using the FFmpeg libraries they are vulnerable to this bug.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Result:&lt;/span&gt; Reliable EIP control confirmed under both test cases&lt;br /&gt;&lt;br /&gt;Here is the result for VLC under Windows XP SP3:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://2.bp.blogspot.com/_QRbyLnYYriQ/SYC5GOg39jI/AAAAAAAAAAw/vOZpJa0H3cU/s1600-h/screenshot_1.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5296436678414038578&quot; src=&quot;http://2.bp.blogspot.com/_QRbyLnYYriQ/SYC5GOg39jI/AAAAAAAAAAw/vOZpJa0H3cU/s320/screenshot_1.png&quot; style=&quot;cursor: pointer; display: block; height: 240px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here is the result for Mplayer under openSUSE 11.1:&lt;br /&gt;&lt;pre class=&quot;brush: plain; gutter: false;&quot;&gt;tk@linux-0skt:~/Documents/ffmpeg-checkout-2009-01-02&amp;gt; gdb mplayer GNU gdb (GDB; openSUSE 11.1) 6.8.50.20081120-cvs Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt; This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.  Type &quot;show copying&quot; and &quot;show warranty&quot; for details. This GDB was configured as &quot;i586-suse-linux&quot;. For bug reporting instructions, please see: &amp;lt;http://bugs.opensuse.org/&amp;gt;... (no debugging symbols found)  (gdb) run ex_eip_control_mplayer.avi Starting program: /usr/bin/mplayer ex_eip_control_mplayer.avi (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) [Thread debugging using libthread_db enabled] (no debugging symbols found) [...] MPlayer dev-SVN-r27637-4.3-openSUSE Linux 11.1 (i686)-Packman (C) 2000-2008 MPlayer Team CPU: Intel(R) Core(TM)2 Duo CPU     T7500  @ 2.20GHz (Family: 6, Model: 15, Stepping: 11) CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1 Compiled with runtime CPU detection. Can&#39;t open joystick device /dev/input/js0: No such file or directory Can&#39;t init input joystick mplayer: could not connect to socket mplayer: No such file or directory Failed to open LIRC support. You will not be able to use your remote control.  Playing ex_eip_control_mplayer.avi. libavformat file format detected.  Program received signal SIGSEGV, Segmentation fault. 0x55555555 in ?? ()  (gdb) bt #0  0x55555555 in ?? () #1  0x77777777 in ?? () Cannot access memory at address 0x6666666a  (gdb) i r eax            0x0      0 ecx            0x8d4cce0        148163808 edx            0x160    352 ebx            0x806e13f6       -2140269578 esp            0xbfffcfbc       0xbfffcfbc ebp            0x8998f38        0x8998f38 esi            0x160    352 edi            0x8d59db0        148217264 eip            0x55555555       0x55555555 eflags         0x10297  [ CF PF AF SF IF RF ] cs             0x73     115 ss             0x7b     123 ds             0x7b     123 es             0x7b     123 fs             0x0      0 gs             0x33     5&lt;/pre&gt;As a bonus I developed a full working exploit (executes calc.exe) using VLC in version 0.9.8a as an injection vector.&lt;br /&gt;&lt;br /&gt;Here is &lt;a href=&quot;http://www.trapkit.de/movies/TKADV2009-004.htm&quot;&gt;the result under Windows XP SP3&lt;/a&gt;.&lt;br /&gt;&lt;blockquote&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Roundup:&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;This is a very nice bug ;)&amp;nbsp;&lt;/li&gt;&lt;li&gt;Reliable EIP control confirmed while using Mplayer as injection vector under openSUSE 11.1 and VLC 0.9.8a under Windows XP SP3&amp;nbsp;&lt;/li&gt;&lt;li&gt;Reliable code execution confirmed while using VLC 0.9.8a as injection vector under Windows XP SP3&lt;/li&gt;&lt;/ol&gt;&lt;/blockquote&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/1859343893201705062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/1859343893201705062'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/2009/01/exploitable-userland-null-pointer.html' title='Exploitable Userland NULL Pointer Dereference'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_QRbyLnYYriQ/SYC5GOg39jI/AAAAAAAAAAw/vOZpJa0H3cU/s72-c/screenshot_1.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-10795563.post-8331394411359024770</id><published>2009-01-22T21:07:00.004+01:00</published><updated>2009-12-23T17:47:41.894+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="User space"/><category scheme="http://www.blogger.com/atom/ns#" term="Vulnerability"/><title type='text'>GStreamer bugs</title><content type='html'>I just released a security advisory (&lt;a href=&quot;http://www.trapkit.de/advisories/TKADV2009-003.txt&quot;&gt;TKADV2009-003&lt;/a&gt;) describing the details of some heap buffer overflows and an array index out of bounds vulnerability I found in the &lt;a href=&quot;http://gstreamer.freedesktop.org/&quot;&gt;GStreamer multimedia framework&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The following screenshot shows the result of a poc for the array index out of bounds vulnerability that can be exploited to write the value 0x00000001 to (nearly) any location in memory. I used &lt;a href=&quot;http://www.getsongbird.com/&quot;&gt;Songbird&lt;/a&gt; as an injection vector as this music player (&lt;a href=&quot;http://gstreamer.freedesktop.org/apps/&quot;&gt;like many others&lt;/a&gt;) is using the GStreamer framework.&lt;br /&gt;&lt;br /&gt;Note: EAX holds the user controlled value&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://4.bp.blogspot.com/_QRbyLnYYriQ/SXjSrf9cFEI/AAAAAAAAAAo/BC_CNgUwY0A/s1600-h/gstreamer.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 210px;&quot; src=&quot;http://4.bp.blogspot.com/_QRbyLnYYriQ/SXjSrf9cFEI/AAAAAAAAAAo/BC_CNgUwY0A/s320/gstreamer.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5294213006729417794&quot; /&gt;&lt;/a&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/8331394411359024770'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/8331394411359024770'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/2009/01/gstreamer-bugs.html' title='GStreamer bugs'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_QRbyLnYYriQ/SXjSrf9cFEI/AAAAAAAAAAo/BC_CNgUwY0A/s72-c/gstreamer.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-10795563.post-9064865434954351531</id><published>2009-01-14T22:23:00.004+01:00</published><updated>2009-12-23T18:23:17.346+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Tool"/><category scheme="http://www.blogger.com/atom/ns#" term="Virtualization"/><title type='text'>Commercial usage of ScoopyNG</title><content type='html'>&lt;a href=&quot;http://www.atempo.com&quot;&gt;Atempo Time Navigator&lt;/a&gt; is now officially using the VMware detection tricks of &lt;a href=&quot;http://www.trapkit.de/research/vmm/scoopyng/index.html&quot;&gt;ScoopyNG&lt;/a&gt;. Thanks to Atempo for asking for permission instead of just using it without confirmation. I&#39;m wondering what other software products are using ScoopyNG. Let me know if you know one.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/9064865434954351531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/9064865434954351531'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/2009/01/commercial-usage-of-scoopyng.html' title='Commercial usage of ScoopyNG'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-10795563.post-4096758999136181281</id><published>2009-01-11T18:17:00.005+01:00</published><updated>2009-12-23T17:43:54.175+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Statistics"/><title type='text'>Some statistics</title><content type='html'>In my experience, open source projects are much faster in fixing security bugs than commercial vendors.&lt;br /&gt;&lt;br /&gt;Current example:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Commercial product: &lt;/span&gt;Sun Solaris &lt;a href=&quot;http://www.trapkit.de/advisories/TKADV2009-001.txt&quot;&gt;TKADV2009-001&lt;/a&gt;&lt;br /&gt;Patch development time 115 days&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;Open source project: &lt;/span&gt;Amarok &lt;a href=&quot;http://www.trapkit.de/advisories/TKADV2009-002.txt&quot;&gt;TKADV2009-002&lt;/a&gt;&lt;br /&gt;Patch development time 7 days&lt;br /&gt;&lt;br /&gt;The fact itself is not surprising as open source projects are normally not as tightly bound to business processes like commercial vendors. Nevertheless, the time difference is quite impressive. &lt;br /&gt;&lt;br /&gt;Since a while I keep record of the &quot;patch development time&quot; in each of my security advisories. This is the time a vendor or open source project needed to provide a fix or patch for the vulnerability.&lt;br /&gt;&lt;br /&gt;Here are some patch development time statistics of the vulnerabilities I reported so far:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Average patch development time of open source software projects:&lt;br /&gt;&lt;/span&gt;(How long does it take open source projects to patch vulnerabilities?)&lt;br /&gt;&lt;br /&gt;Average patch development time: 5.1 days&lt;br /&gt;Total number of vulnerabilities: 8 &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;Average patch development time of commercial software vendors:&lt;/span&gt;&lt;br /&gt;(How long does it take commercial software vendors to patch vulnerabilities?)&lt;br /&gt;&lt;br /&gt;Average patch development time: 169.9 days&lt;br /&gt;Total number of vulnerabilities: 12 &lt;br /&gt;&lt;br /&gt;Well, I think these numbers are self-explanatory. I will keep these statistics updated under &lt;a href=&quot;http://www.trapkit.de/advisories/pdts.php&quot;&gt;http://www.trapkit.de/advisories/pdts.php&lt;/a&gt;.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/4096758999136181281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10795563/posts/default/4096758999136181281'/><link rel='alternate' type='text/html' href='http://tk-blog.blogspot.com/2009/01/some-statistics.html' title='Some statistics'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>