<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
  <channel>
    <title><![CDATA[[SecurityRatty] tag: empty]]></title>
    <link>http://www.securityratty.com/tag/empty</link>
    <description></description>
    <pubDate>Fri, 18 Jul 2008 17:24:20 +0000</pubDate>
    <generator>iRatty Engine</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <item>
      <title><![CDATA[PasswordTextBox]]></title>
      <link>http://www.securityratty.com/article/4e1580792b56914339b6489792b99933</link>
      <guid>http://www.securityratty.com/article/4e1580792b56914339b6489792b99933</guid>
      <description><![CDATA[Chris Sells used to poke fun at me when we worked together in my former life . He used to call my security class, &quot;Essential Access Denied&quot;. His point was a good one: when they aren't applied...]]></description>
      <content:encoded><![CDATA[<p><a href="http://www.sellsbrothers.com/" target="_blank">Chris Sells</a> used to poke fun at me when we worked together in my <a href="http://www.flickr.com/photos/andyrs/240203382/" target="_blank">former life</a>. He used to call my security class, &quot;Essential Access Denied&quot;. His point was a good one: when they aren&#39;t applied carefully, security countermeasures often just get in the way of getting work done. I don&#39;t know about you, but password-mode text boxes in web forms have always been one of those annoyances.</p> <p>I&#39;m not complaining about the fact that I can&#39;t see what I&#39;m typing. I understand and laud that feature, because I don&#39;t want someone looking over my shoulder at the password I&#39;m typing, and this even applies when I&#39;m at home. I love my children, but I certainly don&#39;t want them knowing the password to my bank account!</p> <p>No, what I&#39;m bothered by is how a typical password text box behaves on a form that may incur multiple post-backs before it&#39;s finally submitted. If you use the built in ASP.NET TextBox control, it purposely does not repopulate the password text, which means if you press a button on the form that performs a post-back, or if you have a multi-page form that posts back on every step, that password disappears, and the user typically has to re-enter it. You could solve this with liberal use of ASP.NET Ajax UpdatePanels, but that adds its own complexities. I wanted a simpler solution.</p> <p>So I did a little research to see what others had discovered about this problem, and I ended up deriving my own custom control from TextBox to make a much more user-friendly (and developer-friendly) TextBox control. I called it PasswordTextBox, and it acts just like a TextBox in password mode, but it retains the password while still giving the user the same level of protection the standard TextBox supplies.</p> <p>My PasswordTextBox operates very simply: it stores the password in control state, and renders a series of fixed characters (with the same length as the actual password) into the text box so that it &quot;looks&quot; like the user&#39;s password has been rendered. Since control state is part of view state, and since view state is stored in a hidden field on the form, I encrypt the password before putting it into control state.</p> <p>The result is quite nice - the user can post your form back as many times as she needs to, perhaps moving back and forth across wizard steps or tabs, and when she finally presses the &quot;Finish&quot; button (or whatever you call the last step of your input form), your code will be able to read the password by simply accessing the Text property on the PasswordTextBox. The user will believe that her password is sitting there on the form while she&#39;s working, as the same number of obfuscated characters will show up in the field as she typed in originally (what she doesn&#39;t know is that those characters aren&#39;t her real password anymore, but what she doesn&#39;t know won&#39;t hurt her!)</p> <p>Note that to keep this simple, I used DPAPI to encrypt the password, which suited my purposes. But if you have a web farm, that won&#39;t work well at all if you don&#39;t know which machine the user&#39;s going to post back to, so you&#39;ll want to replace that with something more robust. I could see looking up the &lt;machineKey&gt; for entropy, as that tends to be sync&#39;d already across the farm, but I&#39;ve not yet spent the cycles to go down that road, since unfortunately all of the code for generating keys based on that config section are off limits in ASP.NET (most of the useful stuff is marked internal). I don&#39;t think it&#39;d be that hard to do though.</p> <p>Anyway, without further ado, here&#39;s the code, which you&#39;ll see is quite simple. I&#39;d love feedback, especially if you see any glaring problems with the idea or the implementation!</p><pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">class</span> PasswordTextBox : TextBox
{
    <span class="rem">// unlikely that a string of these would be used for a password</span>
    <span class="kwrd">const</span> <span class="kwrd">char</span> PasswordPlaceholderChar = <span class="str">&#39;}&#39;</span>;

    <span class="kwrd">string</span> password; <span class="rem">// stored encrypted in control state</span>

    <span class="kwrd">protected</span> <span class="kwrd">override</span> <span class="kwrd">void</span> OnInit(EventArgs e)
    {
        <span class="kwrd">base</span>.OnInit(e);
        Page.RegisterRequiresControlState(<span class="kwrd">this</span>);
    }

    <span class="kwrd">protected</span> <span class="kwrd">override</span> <span class="kwrd">object</span> SaveControlState()
    {
        <span class="kwrd">byte</span>[] encryptedPassword = ProtectPassword(password);

        <span class="kwrd">object</span> baseControlState = <span class="kwrd">base</span>.SaveControlState();
        <span class="kwrd">if</span> (<span class="kwrd">null</span> == baseControlState)
            <span class="kwrd">return</span> encryptedPassword;
        <span class="kwrd">else</span> <span class="kwrd">return</span> <span class="kwrd">new</span> Pair(baseControlState, encryptedPassword);
    }

    <span class="kwrd">protected</span> <span class="kwrd">override</span> <span class="kwrd">void</span> LoadControlState(<span class="kwrd">object</span> savedState)
    {
        <span class="kwrd">byte</span>[] encryptedPassword;

        Pair pair = savedState <span class="kwrd">as</span> Pair;
        <span class="kwrd">if</span> (<span class="kwrd">null</span> != pair)
        {
            <span class="kwrd">base</span>.LoadControlState(pair.First);
            encryptedPassword = pair.Second <span class="kwrd">as</span> <span class="kwrd">byte</span>[];
        }
        <span class="kwrd">else</span> encryptedPassword = savedState <span class="kwrd">as</span> <span class="kwrd">byte</span>[];

        password = UnprotectPassword(encryptedPassword);
    }

    <span class="rem">/// &lt;summary&gt;</span>
    <span class="rem">/// This control always uses TextMode=Password</span>
    <span class="rem">/// &lt;/summary&gt;</span>
    <span class="kwrd">public</span> <span class="kwrd">override</span> TextBoxMode TextMode
    {
        get
        {
            <span class="kwrd">return</span> TextBoxMode.Password;
        }
        set { }
    }

    <span class="rem">/// &lt;summary&gt;</span>
    <span class="rem">/// TextBox doesn&#39;t render value attribute for TextMode=Password</span>
    <span class="rem">/// So we add code that renders a placeholder text instead</span>
    <span class="rem">/// &lt;/summary&gt;</span>
    <span class="rem">/// &lt;param name=&quot;writer&quot;&gt;&lt;/param&gt;</span>
    <span class="kwrd">protected</span> <span class="kwrd">override</span> <span class="kwrd">void</span> AddAttributesToRender(HtmlTextWriter writer)
    {
        <span class="kwrd">base</span>.AddAttributesToRender(writer);

        <span class="kwrd">string</span> text = Text;
        <span class="kwrd">if</span> (text.Length &gt; 0)
            writer.AddAttribute(HtmlTextWriterAttribute.Value,
                GetPlaceholderPassword(text));
    }

    <span class="rem">/// &lt;summary&gt;</span>
    <span class="rem">/// TextBox doesn&#39;t save the &quot;Text&quot; viewstate in</span>
    <span class="rem">/// TextMode=Password and we don&#39;t want our behavior to break</span>
    <span class="rem">/// if ViewState is turned off so we store the password in</span>
    <span class="rem">/// Control State, encrypted with MachineKey</span>
    <span class="rem">/// &lt;/summary&gt;</span>
    <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">string</span> Text
    {
        get
        {
            <span class="kwrd">return</span> password ?? <span class="kwrd">string</span>.Empty;
        }
        set
        {
            <span class="rem">// this prevents us overwriting the actual</span>
            <span class="rem">// password with a placeholder</span>
            <span class="kwrd">if</span> (!<span class="kwrd">string</span>.IsNullOrEmpty(password) &amp;&amp;
                <span class="kwrd">value</span>.Equals(GetPlaceholderPassword(password)))
                <span class="kwrd">return</span>;

            password = <span class="kwrd">value</span>;
        }
    }

    <span class="kwrd">private</span> <span class="kwrd">string</span> GetPlaceholderPassword(<span class="kwrd">string</span> realPassword)
    {
        <span class="kwrd">int</span> length = 12;
        <span class="kwrd">if</span> (!<span class="kwrd">string</span>.IsNullOrEmpty(realPassword))
            length = realPassword.Length;

        StringBuilder sb = <span class="kwrd">new</span> StringBuilder();
        sb.Append(PasswordPlaceholderChar, length);

        <span class="kwrd">return</span> sb.ToString();
    }

    <span class="kwrd">public</span> <span class="kwrd">byte</span>[] ProtectPassword(<span class="kwrd">string</span> password)
    {
        <span class="kwrd">if</span> (<span class="kwrd">string</span>.IsNullOrEmpty(password))
            <span class="kwrd">return</span> <span class="kwrd">null</span>;
        <span class="kwrd">byte</span>[] cleartext = Encoding.UTF8.GetBytes(password);
        <span class="kwrd">return</span> ProtectedData.Protect(cleartext, <span class="kwrd">null</span>,
            DataProtectionScope.LocalMachine);
    }

    <span class="kwrd">public</span> <span class="kwrd">string</span> UnprotectPassword(<span class="kwrd">byte</span>[] ciphertext)
    {
        <span class="kwrd">if</span> (<span class="kwrd">null</span> == ciphertext)
            <span class="kwrd">return</span> <span class="kwrd">null</span>;
        <span class="kwrd">byte</span>[] cleartext = ProtectedData.Unprotect(ciphertext, <span class="kwrd">null</span>,
            DataProtectionScope.LocalMachine);
        <span class="kwrd">return</span> Encoding.UTF8.GetString(cleartext);
    }
}
</pre><div style="clear:both;"></div><img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=54154" width="1" height="1">]]></content:encoded>
      <pubDate>Wed, 29 Oct 2008 16:49:54 +0000</pubDate>
      <category domain="http://www.securityratty.com/tag/password-mode text boxes">password-mode text boxes</category>
      <category domain="http://www.securityratty.com/tag/text">text</category>
      <category domain="http://www.securityratty.com/tag/return null">return null</category>
      <category domain="http://www.securityratty.com/tag/return">return</category>
      <category domain="http://www.securityratty.com/tag/net">net</category>
      <category domain="http://www.securityratty.com/tag/net ajax updatepanels">net ajax updatepanels</category>
      <category domain="http://www.securityratty.com/tag/net textbox control">net textbox control</category>
      <category domain="http://www.securityratty.com/tag/password">password</category>
      <category domain="http://www.securityratty.com/tag/textbox control">textbox control</category>
      <source url="http://www.pluralsight.com/community/blogs/keith/archive/2008/10/29/passwordtextbox.aspx">PasswordTextBox</source>
    </item>
    <item>
      <title><![CDATA[VMworld 2008 Keynote with Paul Maritz]]></title>
      <link>http://www.securityratty.com/article/27088f9fffd4d9e8619b6768dd0513fa</link>
      <guid>http://www.securityratty.com/article/27088f9fffd4d9e8619b6768dd0513fa</guid>
      <description><![CDATA[Traveling towards VMworld 2008
I, along with thousands of others, wended my way through a vast dimly lit cavern of a place helped along by the strangely surreal sight of ushers in black waving wispy...]]></description>
      <content:encoded><![CDATA[<p><em><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 5px; border-right-width: 0px" height="160" alt="paulmaritzvmware" src="http://blog.sciencelogic.com/wp-content/uploads/2008/09/paulmaritzvmware.jpg" width="240" align="left" border="0" /> Traveling towards VMworld 2008</em></p>
<p>I, along with thousands of others, wended my way through a vast dimly lit cavern of a place helped along by the strangely surreal sight of ushers in black waving wispy red flags to guide us not to the empty seats in front of us, but to the ones 50 yards on. (Ah Vegas, my feet hurt already.) Perhaps the point was to live in the moment, soak in the pre-rock concert atmosphere complete with a hip and cool soundtrack ripped off from Apple commercials. (Do they all use the same ad firm?) A better way to build the anticipation for, yes, the kickoff keynote session at <a href="http://www.vmworld.com/conferences/2008/" target="_blank">VMworld 2008</a>. (<em><a href="http://www.flickr.com/photos/jumpingshark/2862470725/" target="_blank">photo credit: lodev</a>)</em></p>
<p>To the sounds of <a href="http://www.youtube.com/watch?v=PEinqCHPY08" target="_blank">Hey Ya</a> (Shake it like a Polaroid picture), we shifted forward in our uncomfortable temporary seating placed, as at all tech conferences, too close for all but the skinny girls. The moment was here &#8211; one of those videos started playing on the dozen or so huge monitors floating above the convention crowd. You know this video; you&#8217;ve probably seen it before from HP or someone like that. One of those videos with instrumental Coldplay music in the background with time <a href="http://www.hp.com/hpinfo/newsroom/hpads/" target="_blank">lapse/speeded-up video</a> of people in motion and floating captions dropping into the images that leave you with a slight smile on your face as you &#8220;get&#8221; the relationship between image and text. (Do they all use the same ad firm?)</p>
<p>And here he is, announced like a Vegas headliner, <a href="http://vmblog.com/archive/2008/07/23/forbes-interviews-vmware-ceo-paul-maritz-after-financial-analyst-call.aspx" target="_blank">Paul Maritz, the new CEO of VMware</a>. Hmm. After all that hype, I rather expected someone in a black turtleneck and jeans to come out. Instead here&#8217;s this guy with pleat-front pants and an admittedly cool accent (New Zealand?) who looks a little like Al from Home Improvement. Not that there&#8217;s anything wrong with that &#8211; everyone likes Al.</p>
<p><em>And then the real fun begins.</em></p>
<ul>
<li>30 years ago, Paul Maritz started off his business career as a developer </li>
<li>10 years ago, VMware was founded by <a href="http://blog.sciencelogic.com/diane-greene-ousted-from-vmware/07/2008" target="_blank">Diane</a> <a href="http://virtualization.com/news/2008/07/08/diane-greene-vmware-paul-maritz/" target="_blank">Greene</a> and <a href="http://www.cio-weblog.com/50226711/found_rosenblum_leaves_vmware.php" target="_blank">Mendel</a> <a href="http://blog.sciencelogic.com/another-vmware-founder-leaves/09/2008" target="_blank">Rosenblum</a> (BTW, 10 seconds spent showing a slide with cartoon-ized images of the founders, &#8220;thanks for what you did for the company for the past 10 years&#8221;. 10 seconds after 10 years&#8230;but maybe more would have been hypocritical&#8230;) </li>
<li>a retrospective of centralized vs. decentralized computing initiatives from the 1960&#8217;s to today </li>
<li>of course VMware milestones from 1998 to today </li>
<li>and then an analyst-ready diagram showing the product roadmap (to be delivered in 2009) with, you guessed it, finally a connection between <a href="http://advice.cio.com/laurianne_mclaughlin/vmworld_ceo_maritz_outlines_broad_plans_for_cloud_and_client" target="_blank">VMware and cloud computing</a> (remember Maritz&#8217;s cloud-computing company was bought by EMC just a couple of years ago and that&#8217;s the section he headed up at EMC before being brought into VMware). </li>
</ul>
<p><em>Forward Looking</em></p>
<p>2008 (and probably much of 2009) will be a very busy year for VMware. If you believe the roadmap, <a href="http://www.uberpulse.com/us/2008/09/vmwares_ambitious_expansion_plan.php" target="_blank">VMware seems to be taking on the management of everything</a> &#8211; from chargeback and capacity planning to virtual storage and virtual networking (more to come on just what the planned vStorage and vNetwork will deliver) &#8211; but all of it VMware-centric. As <a href="http://blog.sciencelogic.com/vmware-is-better-than-microsoft/09/2008" target="_blank">we said in an earlier post,</a> they&#8217;ve moved away from &#8220;defending&#8221; the hypervisor business proposition to focusing on management services on top of their own hypervisor platform. Revenue pressures must be excruciating &#8211; who wants to be a public company these days?</p>
<p>The best part of that new &#8220;Virtual Data Center Operating System&#8221; <a href="http://www.vmware.com/technology/virtual-datacenter-os/" target="_blank">diagram/roadmap</a> was the addition (and I mean addition) of something called <a href="http://vmetc.com/2008/09/16/vmwares-vcloud-iniatives-the-vision-for-the-next-10-years/" target="_blank">Cloud vServices</a>. (Did anyone else find it odd that <a href="http://virtualization.com/news/2008/09/15/vcloud-vmware-to-be-cloud-computing-provider-too-but-inside-your-private-dc-and-not-tomorrow/" target="_blank">Cloud vServices</a> is kind of on its own in the Infrastructure vServices area? AND, I&#8217;ll have to get the other version of the diagram/roadmap I actually saw at the show because that one shows an inexplicable 4<sup>th</sup> box in the Application vServices area titled &#8220;&#8230;&#8221;. Really. Maybe to balance out the addition of <a href="http://www.itpro.co.uk/606237/vmwares-paul-maritz-goes-on-offence" target="_blank">Cloud vServices?</a>)</p>
<p>What was clear is that the move from VirtualCenter to vCenter &#8211;and the new vServices for rolled-up management of <a href="http://www.virtualization.info/2008/09/live-from-vmworld-2008-day-2-vmware.html" target="_blank">virtualization components</a>/capability to span multiple <a href="http://blogs.zdnet.com/virtualization/?p=542" target="_blank">VirtualCenters</a> (or future vCenters) for reporting, monitoring and management at scale &#8211; has been in the works for a bit (but in tech time, that could mean 6 months), but the cloud stuff&#8230;not so much.</p>
<p>Beyond the very high-level speak appropriate to a keynote (100+ service provider partners for off-premise cloud&#8230;suspended VM&#8217;s that you don&#8217;t have to pay for until you need it), the details are uber-fuzzy. There was a session that Dave went to which was supposed to shed more light, but when questions were asked about how it really works, the answers seemed to be TBD. Does anyone know more? If VMware really has figured out practical cloud computing for enterprises, kudos to them. But I fear they&#8217;re <a href="http://news.cnet.com/8301-13505_3-10042463-16.html?part=rss&amp;subj=news&amp;tag=2547-1_3-0-20" target="_blank">like everyone else</a> (except maybe AT&amp;T) and are still working out the details.</p>
]]></content:encoded>
      <pubDate>Wed, 17 Sep 2008 15:00:53 +0000</pubDate>
      <category domain="http://www.securityratty.com/tag/vservices">vservices</category>
      <category domain="http://www.securityratty.com/tag/infrastructure vservices">infrastructure vservices</category>
      <category domain="http://www.securityratty.com/tag/cloud vservices">cloud vservices</category>
      <category domain="http://www.securityratty.com/tag/cloud">cloud</category>
      <category domain="http://www.securityratty.com/tag/vmware">vmware</category>
      <category domain="http://www.securityratty.com/tag/vmware milestones">vmware milestones</category>
      <category domain="http://www.securityratty.com/tag/keynote">keynote</category>
      <category domain="http://www.securityratty.com/tag/vmware-centric">vmware-centric</category>
      <category domain="http://www.securityratty.com/tag/paul maritz">paul maritz</category>
      <source url="http://blog.sciencelogic.com/vmworld-2008-keynote-with-paul-maritz/09/2008">VMworld 2008 Keynote with Paul Maritz</source>
    </item>
    <item>
      <title><![CDATA[Leave Your Webcam On 24/7? Might Want To Reconsider...]]></title>
      <link>http://www.securityratty.com/article/4d1de8afa43b141ff7ed90cd99cc3cb3</link>
      <guid>http://www.securityratty.com/article/4d1de8afa43b141ff7ed90cd99cc3cb3</guid>
      <description><![CDATA[It's nothing new that many hackers use programs that allow them to &quot;spy&quot; on their victims once they've compromised the PC (as long as they have a webcam switched on, of course). Similarly, hacking...]]></description>
      <content:encoded><![CDATA[
        It's nothing new that many hackers use programs that allow them to "spy" on their victims once they've compromised the PC (as long as they have a webcam switched on, of course). Similarly, hacking culture has always had a fascination for memes, <a href="http://blog.spywareguide.com/2008/05/memehacks_1.html">incorporating them</a> into part of the design of their latest DDoS tools.<br /><br />However, the strange obsession with <a href="http://en.wikipedia.org/wiki/Shock_sites">shock memes</a> has now spilled into a "fun" game currently doing the rounds on various hacking sites and forums.<br /><br />What this involves is hackers compromising a PC, ensuring the victim has a webcam switched on then opening up shock meme websites at the most inopportune moment, recording the moment of impact with the webcam feed. Or, as one guy put it:<br /><br /><div align="center"><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="spinny1.jpg" src="http://blog.spywareguide.com/images/spinny1.jpg" class="mt-image-none" style="" height="86" width="451" /></span></div><br /><br />If you don't know what Meatspin is, you can probably count yourself lucky. If you still want to know, click <a href="http://answers.yahoo.com/question/index?qid=20060710001351AAMxYqY">here</a> (for an <i>explanation</i>. Not Meatspin itself, though the explanation might be classed NSFW anyway).<br /><br />Here's a real life example of one such incident, taken from a message board:<br /><br /><div align="center"><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://blog.spywareguide.com/images/spinny2.html" onclick="window.open('http://blog.spywareguide.com/images/spinny2.html','popup','width=929,height=192,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://blog.spywareguide.com/images/spinny2-thumb-329x67.gif" alt="spinny2.gif" class="mt-image-none" style="" height="67" width="329" /></a></span><br />Click to Enlarge<br /></div><br />Typically, the shock meme website is opened up at full blast, which startles the victim (most sites of this nature loop a piece of music in the background while the, er, action takes place on screen). The bigger the shock, the better. Here's one guy who sounds like he shot about six feet in the air when the meme site fired up in his browser:<br /><br /><br /><div align="center"><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://blog.spywareguide.com/images/spinny3.html" onclick="window.open('http://blog.spywareguide.com/images/spinny3.html','popup','width=636,height=108,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://blog.spywareguide.com/images/spinny3-thumb-336x57.jpg" alt="spinny3.jpg" class="mt-image-none" style="" height="57" width="336" /></a></span><br />Click to Enlarge<br /></div><br />This might all sound like fun and games - <i>sort of</i> - but note that the above individual did try to grab the victims credit card details. <br /><br />Generally, the attacker doesn't interact with the victim (because they want friends, relatives or others to think the victim actually brought the site up themselves) but here's a little trash talk anyway:<br /><br /><div align="center"><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="spinny4.jpg" src="http://blog.spywareguide.com/images/spinny4.jpg" class="mt-image-none" style="" height="188" width="245" /></span></div><br /><br />At this point, the attacker may or may not grab a screenshot for posterity. I've seen quite a few galleries on sites comprised of people looking shocked at Tubgirl, or being spun round baby right round by Meatspin, and there's no doubt countless others out there floating around. Of course, not everybody is shocked (or indeed impressed) by a shockmeme site popping up on their computer. As an example of that, take this guy:<br /><br /><div align="center"><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="spinny5.jpg" src="http://blog.spywareguide.com/images/spinny5.jpg" class="mt-image-none" style="" height="342" width="334" /></span></div><br /><br />Full credit to anyone that counters a shockmeme site appearing on their desktop by picking their nose for five minutes. At any rate, the golden rule with this is that the hackers only bother doing this when a webcam is present and left switched on. If there's no webcam, there's no point trying to elicit a response (because for all they know they're popping open 2 Girls and 1 Cup to an empty server room).<br /><br />Webcams can be a fun tool, but remember to switch them off every now and again or they could come back to haunt you. Of course, depending on the shock meme site deployed (and who happens to be in the room with you at the time), that could be the least of your worries...<br /><div><br /></div><div><br /></div>
        
    ]]></content:encoded>
      <pubDate>Mon, 01 Sep 2008 11:46:09 +0000</pubDate>
      <category domain="http://www.securityratty.com/tag/shockmeme site">shockmeme site</category>
      <category domain="http://www.securityratty.com/tag/site">site</category>
      <category domain="http://www.securityratty.com/tag/meme site fired">meme site fired</category>
      <category domain="http://www.securityratty.com/tag/shock">shock</category>
      <category domain="http://www.securityratty.com/tag/shock meme websites">shock meme websites</category>
      <category domain="http://www.securityratty.com/tag/webcam">webcam</category>
      <category domain="http://www.securityratty.com/tag/shock meme site">shock meme site</category>
      <category domain="http://www.securityratty.com/tag/shock meme website">shock meme website</category>
      <category domain="http://www.securityratty.com/tag/webcam feed">webcam feed</category>
      <source url="http://blog.spywareguide.com/2008/09/leave-your-webcam-on-247-might.html">Leave Your Webcam On 24/7? Might Want To Reconsider...</source>
    </item>
    <item>
      <title><![CDATA[Null Strings in ASP.NET Declarative DataSource Updates]]></title>
      <link>http://www.securityratty.com/article/11f8906732a7b86831292456d642b2f5</link>
      <guid>http://www.securityratty.com/article/11f8906732a7b86831292456d642b2f5</guid>
      <description><![CDATA[I just spent about 15 minutes debugging a problem where a document was getting unexpected nulls where empty strings should have been. Indeed controls like the TextBox have code in them that allows you...]]></description>
      <content:encoded><![CDATA[<p>I just spent about 15 minutes debugging a problem where a document was getting unexpected nulls where empty strings should have been. Indeed controls like the TextBox have code in them that allows you to set the Text property to null and the TextBox will convert that into an empty string. So it&#39;s a bit counterintuitive that <em>the declarative data source works the opposite way by default</em>.</p> <p>When you use a declarative data source to perform a parameterized update that contains string parameters, consider setting ConvertEmptyStringToNull=&#39;false&#39; on your &lt;asp:Parameter&gt; elements, because <em>it&#39;s true by default</em>! In other words, if a text field contains an empty string, it&#39;ll be sent to your declarative data source not as string.Empty, but as null.</p> <p>Now I don&#39;t know about you, but I don&#39;t like dealing with nulls if I can avoid it. Especially strings. Unless there&#39;s a clear need to have a null state, I avoid them like the plague not only in my database designs but also in my XML schema designs. Hopefully this helps somebody out!</p><div style="clear:both;"></div><img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52773" width="1" height="1">]]></content:encoded>
      <pubDate>Fri, 29 Aug 2008 11:42:47 +0000</pubDate>
      <category domain="http://www.securityratty.com/tag/strings">strings</category>
      <category domain="http://www.securityratty.com/tag/declarative data source">declarative data source</category>
      <category domain="http://www.securityratty.com/tag/empty strings">empty strings</category>
      <category domain="http://www.securityratty.com/tag/null">null</category>
      <category domain="http://www.securityratty.com/tag/empty">empty</category>
      <category domain="http://www.securityratty.com/tag/xml schema designs">xml schema designs</category>
      <category domain="http://www.securityratty.com/tag/textbox">textbox</category>
      <category domain="http://www.securityratty.com/tag/text property">text property</category>
      <category domain="http://www.securityratty.com/tag/nulls">nulls</category>
      <source url="http://www.pluralsight.com/community/blogs/keith/archive/2008/08/29/null-strings-in-asp-net-declarative-datasource-updates.aspx">Null Strings in ASP.NET Declarative DataSource Updates</source>
    </item>
    <item>
      <title><![CDATA[Doctoring Photographs without Photoshop]]></title>
      <link>http://www.securityratty.com/article/343f81e5ef64999b63085fa59a40a0d8</link>
      <guid>http://www.securityratty.com/article/343f81e5ef64999b63085fa59a40a0d8</guid>
      <description><![CDATA[It's all about the captions : ...doctored photographs are the least of our worries. If you want to trick someone with a photograph, there are lots of easy ways to do it. You don't need Photoshop. You...]]></description>
      <content:encoded><![CDATA[<p>It's all about the <a href="http://morris.blogs.nytimes.com/2008/08/11/photography-as-a-weapon/?ref=opinion">captions</a>:</p>

<blockquote>...doctored photographs are the least of our worries. If you want to trick someone with a photograph, there are lots of easy ways to do it. You don't need Photoshop. You don't need sophisticated digital photo-manipulation. You don't need a computer. All you need to do is change the caption.

<p>The photographs presented by Colin Powell at the United Nations in 2003 provide several examples. Photographs that were used to justify a war. And yet, the actual photographs are low-res, muddy aerial surveillance photographs of buildings and vehicles on the ground in Iraq. I'm not an aerial intelligence expert. I could be looking at anything. It is the labels, the captions, and the surrounding text that turn the images from one thing into another. Photographs presented by Colin Powell at the United Nations in 2003.</p>

<p>Powell was arguing that the Iraqis were doing something wrong, knew they were doing something wrong, and were trying to cover their tracks. Later, it was revealed that the captions were wrong. There was no evidence of chemical weapons and no evidence of concealment. Morris's mockery of the sweeping interpretations made in Powell's photographs.</p>

<p>There is a larger point. I don't know what these buildings were really used for. I don't know whether they were used for chemical weapons at one time, and then transformed into something relatively innocuous, in order to hide the reality of what was going on from weapons inspectors. But I do know that the yellow captions influence how we see the pictures. "Chemical Munitions Bunker" is different from "Empty Warehouse" which is different from "International House of Pancakes." The image remains the same but we see it differently.</p>

<p>Change the yellow labels, change the caption and you change the meaning of the photographs. You don't need Photoshop. That's the disturbing part. Captions do the heavy lifting as far as deception is concerned. The pictures merely provide the window-dressing. The unending series of errors engendered by falsely captioned photographs are rarely remarked on.</blockquote></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/schneier/fulltext?a=agGdKK"><img src="http://feeds.feedburner.com/~f/schneier/fulltext?i=agGdKK" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/schneier/fulltext?a=6dATMK"><img src="http://feeds.feedburner.com/~f/schneier/fulltext?i=6dATMK" border="0"></img></a>
</div>]]></content:encoded>
      <pubDate>Wed, 27 Aug 2008 03:27:27 +0000</pubDate>
      <category domain="http://www.securityratty.com/tag/photographs">photographs</category>
      <category domain="http://www.securityratty.com/tag/actual photographs">actual photographs</category>
      <category domain="http://www.securityratty.com/tag/captions">captions</category>
      <category domain="http://www.securityratty.com/tag/yellow captions influence">yellow captions influence</category>
      <category domain="http://www.securityratty.com/tag/powell">powell</category>
      <category domain="http://www.securityratty.com/tag/colin powell">colin powell</category>
      <category domain="http://www.securityratty.com/tag/change">change</category>
      <category domain="http://www.securityratty.com/tag/chemical weapons">chemical weapons</category>
      <category domain="http://www.securityratty.com/tag/photoshop">photoshop</category>
      <source url="http://www.schneier.com/blog/archives/2008/08/doctoring_photo.html">Doctoring Photographs without Photoshop</source>
    </item>
    <item>
      <title><![CDATA[Straight Talking Warren Buffett]]></title>
      <link>http://www.securityratty.com/article/c3eda8d642477dccc307b946fd1f4926</link>
      <guid>http://www.securityratty.com/article/c3eda8d642477dccc307b946fd1f4926</guid>
      <description><![CDATA[For those who did not hear Warren Buffett being interviewed last Friday morning on CNBC, he did not beat about the bush when talking about the former Presidential hopeful, John Edwards

Mr. Buffett...]]></description>
      <content:encoded><![CDATA[For those who did not hear Warren Buffett being interviewed last Friday morning on CNBC, he did not beat about the bush when talking about the former Presidential hopeful, John Edwards. <br /><span id="fullpost"><br />Mr. Buffett came straight out and accused Mr. Edwards of soliciting and taking money by deceitful means during his unsuccessful Presidential bid earlier this year.  According to Mr. Buffett, John Edwards knew back then that it was only a matter of time before the media uncovered the story of his mistress and alleged love-child.  <br />  <br /></span><br />Unfortunately, this did not stop him from asking suporters to fund his campaign.  Had people knew about the extra-marital affair, they most likely would not have sent in their hard earned dollars as there was no chance that he could continue in the race once the damning news broke.  Mr. Buffett suggested that Edwards should cut back on a few of those expensive haircuts and return those fifty and one hundred dollar donations that came in from ordinary hard working followers.<br /><br />This sentiment rings true for my industry.  At our training courses, we focus on Ethics at the beginning of the course and it runs throughout the training.  Nobody is saying that we are not human and we do not make mistakes - we all do, but covering up the truth to further your own selfish goals is a practice that would probably even disgust the animal Kingdom - except the reptiles possibly.<br /><br />Thank you Mr. Buffett for being so frank and forthright in this era of sterile political correctness.  This is why I enjoy working with successful business people and despise the empty promises and double-talking of policticians, to whatever party they belong.  To those of you in the security world, again I implore you to never forget that your word is your bond and at the end of the day, your reputation will live on after you are long gone.<div class="blogger-post-footer">Visit Sexton Executive Security at www.sextonsecurity.com</div>]]></content:encoded>
      <pubDate>Mon, 25 Aug 2008 08:45:00 +0000</pubDate>
      <category domain="http://www.securityratty.com/tag/buffett">buffett</category>
      <category domain="http://www.securityratty.com/tag/edwards">edwards</category>
      <category domain="http://www.securityratty.com/tag/john edwards">john edwards</category>
      <category domain="http://www.securityratty.com/tag/people">people</category>
      <category domain="http://www.securityratty.com/tag/successful business people">successful business people</category>
      <category domain="http://www.securityratty.com/tag/sterile political correctness">sterile political correctness</category>
      <category domain="http://www.securityratty.com/tag/hard">hard</category>
      <category domain="http://www.securityratty.com/tag/unsuccessful presidential bid">unsuccessful presidential bid</category>
      <category domain="http://www.securityratty.com/tag/ordinary hard">ordinary hard</category>
      <source url="http://www.thebulletproofblog.com/2008/08/straight-talking-warren-buffett.html">Straight Talking Warren Buffett</source>
    </item>
    <item>
      <title><![CDATA[Scammers replace credit card readers in Irish stores]]></title>
      <link>http://www.securityratty.com/article/ae885c71f0d298db70c0923fd7cecf2c</link>
      <guid>http://www.securityratty.com/article/ae885c71f0d298db70c0923fd7cecf2c</guid>
      <description><![CDATA[Fraudsters in northeast Ireland posing as authorized bank service personnel replaced credit card readers in retailers' stores with their own, capturing data that can be used to empty bank accounts and...]]></description>
      <content:encoded><![CDATA[Fraudsters in northeast Ireland posing as authorized bank service personnel replaced credit card readers in retailers' stores with their own, capturing data that can be used to empty bank accounts and make purchases.<p><A href="http://ad.doubleclick.net/jump/idg.us.nwf.rss/security;sz=468x60;ord=79290?">
<IMG src="http://ad.doubleclick.net/ad/idg.us.nwf.rss/security;sz=468x60;ord=79290?" border="0" width="468" height="60"></A>
</p>]]></content:encoded>
      <pubDate>Sun, 17 Aug 2008 20:00:00 +0000</pubDate>
      <category domain="http://www.securityratty.com/tag/credit card readers">credit card readers</category>
      <category domain="http://www.securityratty.com/tag/bank service personnel">bank service personnel</category>
      <category domain="http://www.securityratty.com/tag/empty bank accounts">empty bank accounts</category>
      <category domain="http://www.securityratty.com/tag/northeast ireland">northeast ireland</category>
      <category domain="http://www.securityratty.com/tag/stores">stores</category>
      <category domain="http://www.securityratty.com/tag/retailers">retailers</category>
      <category domain="http://www.securityratty.com/tag/fraudsters">fraudsters</category>
      <category domain="http://www.securityratty.com/tag/purchases">purchases</category>
      <category domain="http://www.securityratty.com/tag/data">data</category>
      <source url="http://www.networkworld.com/news/2008/081808-scammers-replace-credit-card-readers.html?fsrc=rss-security">Scammers replace credit card readers in Irish stores</source>
    </item>
    <item>
      <title><![CDATA[The Four Horsemen of CLeopatra's Barge]]></title>
      <link>http://www.securityratty.com/article/1b20cf9bfdb87d0ef87e844686ac5d49</link>
      <guid>http://www.securityratty.com/article/1b20cf9bfdb87d0ef87e844686ac5d49</guid>
      <description><![CDATA[One of the more interesting session I went to yesterday was a talk by Chris Hoff called &quot; The Four Horsemen of the Virtualization Apocalypse .&quot; (If you've never read Hoff's blog, you should check it...]]></description>
      <content:encoded><![CDATA[<img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="151" alt="hoff-4horsemen" src="http://blogs.technet.com/blogfiles/security/WindowsLiveWriter/TheFourHorsemenofCLeopatrasBarge_AA28/hoff-4horsemen_3.png" width="200" align="left" border="0">  <p>One of the more interesting session I went to yesterday was a talk by <a href="http://rationalsecurity.typepad.com/about.html" target="_blank">Chris Hoff</a> called "<a href="https://www.blackhat.com/html/bh-usa-08/bh-usa-08-speakers.html#Hoff">The Four Horsemen of the Virtualization Apocalypse</a>."&nbsp; (If you've never read Hoff's blog, you should check it out at <a title="http://rationalsecurity.typepad.com/" href="http://rationalsecurity.typepad.com/">http://rationalsecurity.typepad.com/</a>.)</p> <p>I thought I was keeping a close eye on security and virtualization issues, but this talk illustrated how wide and varied the topic really is.&nbsp; This was not about Blue Pill and it wasn't about having security monitors in the hypervisor - instead he focused on how virtualizing physical devices (e.g. switches, systems) will cause lots of problems for security architects and administrators.</p> <p>Briefly, here are the four horsemen:</p> <ul> <li>Conquest - Translating your physical capacity planning implementation to virtual devices probably won't work.  <li>Death - Virtualized networks lack several physical attributes assumed by security applications and high-availability devices today - you'll probably have to re-architect it all to get the same functionality, which might not even be possible in your new virtual world  <li>War - Adding security VAs takes away precious resources that could have been used to dynamically add VMs.&nbsp; It is a war of resources.  <li>Famine - With all of the redesigning and accommodation happening, security costs are going to eat into any savings you make on server consolidation.</li></ul> <p>Now, if you want to read the much more thorough version, see Hoff's original post <a href="http://rationalsecurity.typepad.com/blog/2008/04/the-four-horsem.html" target="_blank">here</a>.</p> <p>&nbsp;</p> <p>Okay, how does this all relate to the title of my post?&nbsp; Not much.&nbsp; However, <em><strong>much</strong></em> later on day one, things really started rolling.</p> <p>After being crowded out of the Shadow Bar, a bunch of us ended up over at <a href="http://www.vegas.com/nightlife/bars/casafuente.html">Casa Fuente</a> (A cigar bar in Caesars forum).&nbsp; Five minutes after arriving, someone spilled a drink in my lap, big fun!&nbsp; It turns out that it was <a href="http://www.stepto.com" target="_blank">Stepto's</a> birthday, and Hoff makes sure everyone has a drink and we all sing happy birthday to Stepto.&nbsp; Check out part of it, courtesy of <a href="http://blog.uncommonsensesecurity.com/" target="_blank">Jack Daniel</a>:</p> <p> <object type="application/x-shockwave-flash" height="300" width="400" data="http://www.flickr.com/apps/video/stewart.swf?v=55430" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">     <embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/video/stewart.swf?v=55430" bgcolor="#000000" allowfullscreen="true" flashvars="intl_lang=en-us&amp;photo_secret=100e925a17&amp;photo_id=2742128920" height="300" width="400"></embed></object> </p> <p>Immediately after the toast, <a href="http://securityuncorked.squarespace.com/security-uncorked/">Jennifer Jabbusch</a> knocks over a table, falls to the floor and begins having a seizure. Stepto rushes over, trying to help, and just about that time, she flips over and starts laughing - total fakeout! Everybody bursts out laughing. </p> <p>Shortly after that, they closed for the night and kicked us out and we all headed over to Cleopatra's Barge. There weren't enough seats or tables for us, but I noticed that the "reserved" barge seating was empty. Drawing upon a clever technique (i.e. sometimes called "asking") I social engineered a waitress into letting us have the reserved area. Within mere minutes, several security geeks are on the dance floor, doing us proud. </p> <p><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="260" alt="hoff-cleopatra2" src="http://blogs.technet.com/blogfiles/security/WindowsLiveWriter/TheFourHorsemenofCLeopatrasBarge_AA28/hoff-cleopatra2_6.jpg" width="200" align="right" border="0"></p> <p>This leads me to the Four Horsemen of Cleopatra's Barge.&nbsp; (Though I was out there too, I am excluding myself since simply because I can.)</p> <ul> <li>JJ, for leadership</li> <li>Hoff, who owned the dance floor.</li> <li>Ryan Naraine, for getting low, low, low</li> <li>David, for letting his hair down.</li></ul> <p>Though our collective dancing does not signal the end of the world, it certainly capped an excellent day</p><img src="http://blogs.technet.com/aggbug.aspx?PostID=3102312" width="1" height="1">]]></content:encoded>
      <pubDate>Thu, 07 Aug 2008 16:36:03 +0000</pubDate>
      <category domain="http://www.securityratty.com/tag/security">security</category>
      <category domain="http://www.securityratty.com/tag/security architects">security architects</category>
      <category domain="http://www.securityratty.com/tag/security vas takes">security vas takes</category>
      <category domain="http://www.securityratty.com/tag/security geeks">security geeks</category>
      <category domain="http://www.securityratty.com/tag/security costs">security costs</category>
      <category domain="http://www.securityratty.com/tag/hoff">hoff</category>
      <category domain="http://www.securityratty.com/tag/chris hoff">chris hoff</category>
      <category domain="http://www.securityratty.com/tag/barge">barge</category>
      <category domain="http://www.securityratty.com/tag/floor">floor</category>
      <source url="http://blogs.technet.com/security/archive/2008/08/07/the-four-horsemen-of-cleopatra-s-barge.aspx">The Four Horsemen of CLeopatra's Barge</source>
    </item>
    <item>
      <title><![CDATA[Better exception reporting in ASP.NET part 2]]></title>
      <link>http://www.securityratty.com/article/b878f7921917b371086606df6d043229</link>
      <guid>http://www.securityratty.com/article/b878f7921917b371086606df6d043229</guid>
      <description><![CDATA[This is the third post in a series
The first post described the problem: ASP.NET wasn't reporting inner exception stack traces
The second post described my solution
This post shows the code I used to...]]></description>
      <content:encoded><![CDATA[<p>This is the third post in a series.</p> <p>The <a href="http://www.pluralsight.com/community/blogs/keith/archive/2008/08/01/asp-net-health-monitoring-doesn-t-log-inner-exception-stack-trace.aspx" target="_blank">first post</a> described the problem: ASP.NET wasn&#39;t reporting inner exception stack traces.</p> <p>The <a href="http://www.pluralsight.com/community/blogs/keith/archive/2008/08/01/better-exception-reporting-in-asp-net.aspx" target="_blank">second post</a> described my solution.</p> <p>This post shows the code I used to solve the problem: a custom email provider for the Health Monitoring system in ASP.NET. Enjoy!</p> <p>Here&#39;s the provider. Note that I opted *not* to build a buffering provider to keep things simple:</p><pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">class</span> MyMailWebEventProvider : WebEventProvider
{
    <span class="kwrd">string</span> to;
    <span class="kwrd">string</span> from;
    <span class="kwrd">string</span> subjectPrefix;

    <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">void</span> Initialize(<span class="kwrd">string</span> name,
        NameValueCollection config)
    {
        <span class="kwrd">base</span>.Initialize(name, config);

        to = GetAndRemoveStringAttribute(config, <span class="str">&quot;to&quot;</span>, <span class="kwrd">true</span>);
        from = GetAndRemoveStringAttribute(config, <span class="str">&quot;from&quot;</span>, <span class="kwrd">true</span>);
        subjectPrefix = GetAndRemoveStringAttribute(config,
            <span class="str">&quot;subjectPrefix&quot;</span>, <span class="kwrd">false</span>);
    }
    <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">void</span> ProcessEvent(WebBaseEvent raisedEvent)
    {
        SendMail(raisedEvent);
    }

    <span class="kwrd">private</span> <span class="kwrd">void</span> SendMail(WebBaseEvent raisedEvent)
    {
        <span class="kwrd">string</span> subject = ComputeEmailSubject(raisedEvent);
        <span class="kwrd">string</span> body = ComputeEmailBody(raisedEvent);

        MailMessage msg = <span class="kwrd">new</span> MailMessage(from, to, subject, body);
        <span class="kwrd">new</span> SmtpClient().Send(msg);
    }

    <span class="kwrd">private</span> <span class="kwrd">string</span> ComputeEmailBody(WebBaseEvent raisedEvent)
    {
        WebRequestErrorEvent errorEvent =
            raisedEvent <span class="kwrd">as</span> WebRequestErrorEvent;
        <span class="kwrd">if</span> (<span class="kwrd">null</span> != errorEvent)
            <span class="kwrd">return</span> ErrorEventFormattingHelper.FormatRequestErrorEvent(errorEvent);
        <span class="kwrd">else</span> <span class="kwrd">return</span> raisedEvent.ToString();
    }

    <span class="kwrd">private</span> <span class="kwrd">string</span> ComputeEmailSubject(WebBaseEvent raisedEvent)
    {
        StringBuilder subjectBuilder = <span class="kwrd">new</span> StringBuilder();

        <span class="rem">// surface some details in subject about error events</span>
        WebBaseErrorEvent errorEvent = raisedEvent <span class="kwrd">as</span> WebBaseErrorEvent;
        <span class="kwrd">if</span> (<span class="kwrd">null</span> != errorEvent)
        {
            Exception unhandledException = errorEvent.ErrorException;

            <span class="rem">// drill through reflection exceptions to show the root cause</span>
            TargetInvocationException invocationException =
                unhandledException <span class="kwrd">as</span> TargetInvocationException;
            <span class="kwrd">if</span> (<span class="kwrd">null</span> != invocationException)
            {
                Exception innerException =
                    DrillIntoTargetInvocationException(invocationException);
                subjectBuilder.AppendFormat(<span class="str">&quot;{0}&quot;</span>,
                    (innerException ?? invocationException).GetType().Name);
                <span class="kwrd">if</span> (<span class="kwrd">null</span> != innerException)
                    subjectBuilder.Append(<span class="str">&quot; (via reflection)&quot;</span>);
            }
            <span class="kwrd">else</span> subjectBuilder.Append(unhandledException.GetType().Name);
        }

        <span class="rem">// if we&#39;ve not got anything better</span>
        <span class="rem">// just show the event type in the subject</span>
        <span class="kwrd">if</span> (0 == subjectBuilder.Length)
            subjectBuilder.AppendFormat(<span class="str">&quot;Event type: {0}&quot;</span>,
                raisedEvent.GetType().Name);

        <span class="kwrd">if</span> (!<span class="kwrd">string</span>.IsNullOrEmpty(subjectPrefix)) {
            subjectBuilder.Insert(0, <span class="str">&#39; &#39;</span>);
            subjectBuilder.Insert(0, subjectPrefix);
        }
        <span class="kwrd">return</span> subjectBuilder.ToString();
    }

    <span class="rem">/// &lt;summary&gt;</span>
    <span class="rem">/// Reflection often hides exception details, so we try to drill down</span>
    <span class="rem">/// through the plumbing exceptions to find a likely cause</span>
    <span class="rem">/// &lt;/summary&gt;</span>
    <span class="kwrd">private</span> Exception DrillIntoTargetInvocationException(
        TargetInvocationException outerException)
    {
        Exception innerException = outerException.InnerException;
        TargetInvocationException innerInvocationException =
            innerException <span class="kwrd">as</span> TargetInvocationException;
        <span class="kwrd">if</span> (<span class="kwrd">null</span> != innerInvocationException)
            <span class="kwrd">return</span> DrillIntoTargetInvocationException(innerInvocationException);
        <span class="kwrd">else</span> <span class="kwrd">if</span> (<span class="kwrd">null</span> != innerException)
            <span class="kwrd">return</span> innerException;
        <span class="kwrd">else</span> <span class="kwrd">return</span> <span class="kwrd">null</span>;
    }

    <span class="kwrd">private</span> <span class="kwrd">static</span> <span class="kwrd">string</span> GetAndRemoveStringAttribute(NameValueCollection config,
        <span class="kwrd">string</span> attributeName, <span class="kwrd">bool</span> required)
    {
        <span class="kwrd">string</span> <span class="kwrd">value</span> = config.Get(attributeName);
        <span class="kwrd">if</span> (required &amp;&amp; <span class="kwrd">string</span>.IsNullOrEmpty(<span class="kwrd">value</span>))
            <span class="kwrd">throw</span> <span class="kwrd">new</span> ConfigurationErrorsException(<span class="kwrd">string</span>.Format(
                <span class="str">&quot;Expected attribute {0}, which is missing or empty.&quot;</span>,
                attributeName));
        config.Remove(attributeName);
        <span class="kwrd">return</span> <span class="kwrd">value</span>;
    }

    <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">void</span> Flush()
    {
        <span class="rem">// nothing to do - this is not a buffering provider</span>
    }

    <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">void</span> Shutdown()
    {
        <span class="rem">// nothing to do here either</span>
    }
}</pre>
<p>Here&#39;s a helper class that formats the error messages the way I want to see them. Note that I&#39;ve omitted some fields that I personally didn&#39;t care about, and I&#39;ve reordered things a bit, so you might want to tweak this if you&#39;re going to use it in your own system.</p><pre class="csharpcode"><span class="kwrd">internal</span> <span class="kwrd">static</span> <span class="kwrd">class</span> ErrorEventFormattingHelper
{
    <span class="kwrd">internal</span> <span class="kwrd">static</span> <span class="kwrd">string</span> FormatRequestErrorEvent(
        WebRequestErrorEvent errorEvent)
    {
        CustomEventFormatter formatter = 
            <span class="kwrd">new</span> CustomEventFormatter();

        formatter.AppendLine(<span class="kwrd">string</span>.Format(
            <span class="str">&quot;Unhandled Exception in {0}:&quot;</span>,
            WebBaseEvent.ApplicationInformation
            .ApplicationVirtualPath));
        formatter.Indent();
        EmitExceptionAtAGlance(formatter, 
            errorEvent.ErrorException);
        formatter.RevertIndent();

        formatter.AppendLine();
        formatter.AppendLine(<span class="str">&quot;Exception stack trace(s):&quot;</span>);
        EmitExceptionStackTrace(formatter, 
            errorEvent.ErrorException);

        formatter.AppendLine();
        formatter.AppendLine(<span class="str">&quot;Event information:&quot;</span>);
        formatter.Indent();
        EmitEventInfo(formatter, errorEvent);
        formatter.RevertIndent();

        formatter.AppendLine();
        formatter.AppendLine(<span class="str">&quot;Application information:&quot;</span>);
        formatter.Indent();
        EmitApplicationInfo(formatter, 
            WebBaseEvent.ApplicationInformation);
        formatter.RevertIndent();

        formatter.AppendLine();
        formatter.AppendLine(<span class="str">&quot;Process/thread information:&quot;</span>);
        formatter.Indent();
        EmitProcessInfo(formatter, 
            errorEvent.ProcessInformation);
        formatter.RevertIndent();

        formatter.AppendLine();
        formatter.AppendLine(<span class="str">&quot;Request information:&quot;</span>);
        formatter.Indent();
        EmitRequestInfo(formatter, 
            errorEvent.RequestInformation);
        formatter.RevertIndent();

        <span class="kwrd">return</span> formatter.ToString();
    }

    <span class="kwrd">private</span> <span class="kwrd">static</span> <span class="kwrd">void</span> EmitEventInfo(
        CustomEventFormatter formatter,
        WebBaseEvent theEvent)
    {
        formatter.AppendLine(<span class="kwrd">string</span>.Format(
            <span class="str">&quot;Event code: {0}&quot;</span>,
            theEvent.EventCode.ToString(
            CultureInfo.InvariantCulture)));
        formatter.AppendLine(<span class="kwrd">string</span>.Format(
            <span class="str">&quot;Event message: {0}&quot;</span>, 
            theEvent.Message));
        formatter.AppendLine(<span class="kwrd">string</span>.Format(
            <span class="str">&quot;Event time: {0}&quot;</span>, 
            theEvent.EventTime.ToString(
            CultureInfo.InvariantCulture)));
        formatter.AppendLine(<span class="kwrd">string</span>.Format(
            <span class="str">&quot;Event ID: {0}&quot;</span>, 
            theEvent.EventID.ToString(<span class="str">&quot;N&quot;</span>, 
            CultureInfo.InvariantCulture)));
    }

    <span class="kwrd">private</span> <span class="kwrd">static</span> <span class="kwrd">void</span> EmitApplicationInfo(
        CustomEventFormatter formatter, 
        WebApplicationInformation appInfo)
    {
        formatter.AppendLine(<span class="kwrd">string</span>.Format(
            <span class="str">&quot;Application domain: {0}&quot;</span>, 
            appInfo.ApplicationDomain));
        formatter.AppendLine(<span class="kwrd">string</span>.Format(
            <span class="str">&quot;Application Virtual Path: {0}&quot;</span>, 
            appInfo.ApplicationVirtualPath));
        formatter.AppendLine(<span class="kwrd">string</span>.Format(
            <span class="str">&quot;Application Physical Path: {0}&quot;</span>, 
            appInfo.ApplicationPath));
    }

    <span class="kwrd">private</span> <span class="kwrd">static</span> <span class="kwrd">void</span> EmitProcessInfo(
        CustomEventFormatter formatter, 
        WebProcessInformation webProcessInfo)
    {
        formatter.AppendLine(<span class="kwrd">string</span>.Format(
            <span class="str">&quot;Process ID: {0}&quot;</span>, 
            webProcessInfo.ProcessID.ToString(
            CultureInfo.InvariantCulture)));
        formatter.AppendLine(<span class="kwrd">string</span>.Format(
            <span class="str">&quot;Process name: {0}&quot;</span>, 
            webProcessInfo.ProcessName));
        formatter.AppendLine(<span class="kwrd">string</span>.Format(
            <span class="str">&quot;Account name: {0}&quot;</span>, 
            webProcessInfo.AccountName));
    }

    <span class="kwrd">private</span> <span class="kwrd">static</span> <span class="kwrd">void</span> EmitRequestInfo(
        CustomEventFormatter formatter, 
        WebRequestInformation webRequestInfo)
    {
        <span class="kwrd">string</span> name = <span class="kwrd">null</span>;
        <span class="kwrd">if</span> (webRequestInfo.Principal != <span class="kwrd">null</span>)
            name = webRequestInfo.Principal.Identity.Name;

        formatter.AppendLine(<span class="kwrd">string</span>.Format(
            <span class="str">&quot;Request URL: {0}&quot;</span>, 
            webRequestInfo.RequestUrl));
        formatter.AppendLine(<span class="kwrd">string</span>.Format(
            <span class="str">&quot;Request path: {0}&quot;</span>, 
            webRequestInfo.RequestPath));
        formatter.AppendLine(<span class="kwrd">string</span>.Format(
            <span class="str">&quot;User name: {0}&quot;</span>, 
            name ?? <span class="str">&quot;[ANONYMOUS]&quot;</span>));
        formatter.AppendLine(<span class="kwrd">string</span>.Format(
            <span class="str">&quot;User host address: {0}&quot;</span>, 
            webRequestInfo.UserHostAddress));
    }

    <span class="kwrd">private</span> <span class="kwrd">static</span> <span class="kwrd">void</span> EmitExceptionAtAGlance(
        CustomEventFormatter formatter, 
        Exception exception)
    {
        formatter.AppendLine(<span class="kwrd">string</span>.Format(
            <span class="str">&quot;Type: {0}&quot;</span>, 
            exception.GetType().Name));
        formatter.AppendLine(<span class="kwrd">string</span>.Format(
            <span class="str">&quot;Message: {0}&quot;</span>, 
            exception.Message));
        <span class="kwrd">if</span> (<span class="kwrd">null</span> != exception.InnerException)
        {
            formatter.Indent();
            formatter.AppendLine(<span class="str">&quot;--&gt;Inner Exception&quot;</span>);
            EmitExceptionAtAGlance(formatter, 
                exception.InnerException);
            formatter.RevertIndent();
        }
    }

    <span class="kwrd">private</span> <span class="kwrd">static</span> <span class="kwrd">void</span> EmitExceptionStackTrace(
        CustomEventFormatter formatter, Exception exception)
    {
        formatter.AppendLine(exception.StackTrace);

        <span class="kwrd">if</span> (<span class="kwrd">null</span> != exception.InnerException)
        {
            <span class="rem">// no point indenting</span>
            <span class="rem">// since stack traces typically wrap like crazy</span>
            formatter.AppendLine();
            formatter.AppendLine(<span class="str">&quot;--&gt;Inner exception stack trace:&quot;</span>);
            EmitExceptionStackTrace(formatter, exception.InnerException);
        }
    }
}
</pre>
<p>And finally, here&#39;s a helper class that manages indentation levels for the output email message:</p><pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">class</span> CustomEventFormatter
{
    <span class="kwrd">const</span> <span class="kwrd">int</span> TabSpaces = 4;

    StringBuilder sb = <span class="kwrd">new</span> StringBuilder();
    <span class="kwrd">private</span> <span class="kwrd">int</span> indentLevel;
    <span class="kwrd">private</span> <span class="kwrd">bool</span> startingNewLine = <span class="kwrd">true</span>;

    <span class="kwrd">public</span> <span class="kwrd">void</span> Indent()
    {
        ++indentLevel;
    }

    <span class="kwrd">public</span> <span class="kwrd">void</span> RevertIndent()
    {
        <span class="kwrd">if</span> (indentLevel &gt; 0)
            --indentLevel;
    }

    <span class="kwrd">public</span> <span class="kwrd">void</span> Append(<span class="kwrd">string</span> text)
    {
        <span class="kwrd">if</span> (startingNewLine)
            EmitIndent();
        sb.Append(text);
        startingNewLine = <span class="kwrd">false</span>;
    }

    <span class="kwrd">public</span> <span class="kwrd">void</span> AppendLine(<span class="kwrd">string</span> lineOfText)
    {
        <span class="kwrd">if</span> (startingNewLine)
            EmitIndent();
        EmitIndent();
        sb.AppendLine(lineOfText);
        startingNewLine = <span class="kwrd">true</span>;
    }

    <span class="kwrd">private</span> <span class="kwrd">void</span> EmitIndent()
    {
        sb.Append(<span class="str">&#39; &#39;</span>, TabSpaces * indentLevel);
    }

    <span class="kwrd">public</span> <span class="kwrd">void</span> AppendLine()
    {
        AppendLine(<span class="kwrd">string</span>.Empty);
    }

    <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">string</span> ToString()
    {
        <span class="kwrd">return</span> sb.ToString();
    }
}
</pre>
<p>Build this into a library application and reference it in your config file. Here&#39;s an example:</p><pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">healthMonitoring</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;</span><span class="html">providers</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">add</span> <span class="attr">name</span><span class="kwrd">=&quot;mailWebEventProvider&quot;</span>
         <span class="attr">type</span><span class="kwrd">=&quot;MyMailWebEventProvider&quot;</span>
         <span class="attr">to</span><span class="kwrd">=&quot;web-fault@fabrikam.com&quot;</span>
         <span class="attr">from</span><span class="kwrd">=&quot;website@fabrikam.com&quot;</span>
         <span class="attr">buffer</span><span class="kwrd">=&quot;false&quot;</span>
         <span class="attr">subjectPrefix</span><span class="kwrd">=&quot;[WEB-ERROR]&quot;</span>
       <span class="kwrd">/&gt;</span>
  <span class="kwrd">&lt;/</span><span class="html">providers</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;</span><span class="html">rules</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">add</span> <span class="attr">name</span><span class="kwrd">=&quot;All Errors Email&quot;</span>
         <span class="attr">eventName</span><span class="kwrd">=&quot;All Errors&quot;</span>
         <span class="attr">provider</span><span class="kwrd">=&quot;mailWebEventProvider&quot;</span>
         <span class="attr">profile</span><span class="kwrd">=&quot;Default&quot;</span>
         <span class="attr">minInstances</span><span class="kwrd">=&quot;1&quot;</span>
         <span class="attr">maxLimit</span><span class="kwrd">=&quot;Infinite&quot;</span>
         <span class="attr">minInterval</span><span class="kwrd">=&quot;00:01:00&quot;</span>
         <span class="attr">custom</span><span class="kwrd">=&quot;&quot;</span><span class="kwrd">/&gt;</span>
  <span class="kwrd">&lt;/</span><span class="html">rules</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">healthMonitoring</span><span class="kwrd">&gt;</span>
</pre><div style="clear:both;"></div><img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52349" width="1" height="1">]]></content:encoded>
      <pubDate>Mon, 04 Aug 2008 10:11:14 +0000</pubDate>
      <category domain="http://www.securityratty.com/tag/return">return</category>
      <category domain="http://www.securityratty.com/tag/return subjectbuilder">return subjectbuilder</category>
      <category domain="http://www.securityratty.com/tag/return formatter">return formatter</category>
      <category domain="http://www.securityratty.com/tag/exception">exception</category>
      <category domain="http://www.securityratty.com/tag/formatter">formatter</category>
      <category domain="http://www.securityratty.com/tag/crazy formatter">crazy formatter</category>
      <category domain="http://www.securityratty.com/tag/static void">static void</category>
      <category domain="http://www.securityratty.com/tag/static void emitprocessinfo">static void emitprocessinfo</category>
      <category domain="http://www.securityratty.com/tag/return null">return null</category>
      <source url="http://www.pluralsight.com/community/blogs/keith/archive/2008/08/04/better-exception-reporting-in-asp-net-part-2.aspx">Better exception reporting in ASP.NET part 2</source>
    </item>
    <item>
      <title><![CDATA[A New Generation of Tech in DC]]></title>
      <link>http://www.securityratty.com/article/661d52ff996fd0bc8a005ef1674fe686</link>
      <guid>http://www.securityratty.com/article/661d52ff996fd0bc8a005ef1674fe686</guid>
      <description><![CDATA[Perception is often a form of reality. When I look back at the first Dotcom revolution, the first thing I think of is the massive rise of technology and creative energy in Silicon Valley. But I soon...]]></description>
      <content:encoded><![CDATA[<p>Perception is often a form of reality.&nbsp; When I look back at the first Dotcom revolution, the first thing I think of is the massive rise of technology and creative energy in Silicon Valley. But I soon start thinking about the atmosphere that fostered that spirit and energy, a fun and easy-going vibe that allowed individuals to act like, well individuals!&nbsp; The fun laid-back atmosphere had many stories and tales of crazy parties to celebrate the success that was happening.&nbsp; Indeed those mavericks lived a “Play Hard, Work Harder” lifestyle.&nbsp;
<p>I recently spoke with a friend who left the DC region for a position in Silicon Valley. When I asked what he thought of the move he said, “Well, you have the same giant buildings with technology company names on the outside rising out of nowhere. You have the same high quality of engineer, but it seems that the difference is in DC, everyone wears a suit or a tie and looks down upon you if you grab a drink at lunch, or unwind like a younger person would.”&nbsp;
<p>I thought long and hard about his comment and decided that I would have to find out for myself. Is the <a href="http://www.washingtonpost.com/wp-dyn/content/article/2008/07/13/AR2008071301464.html" target="_blank">DC area high tech community</a> really that stuffy? Do people really not enjoy a good stiff drink after a long day?&nbsp;
<p><a href="http://blog.sciencelogic.com/wp-content/uploads/2008/07/dctwintech11.gif"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="75" alt="dctwintech1" src="http://blog.sciencelogic.com/wp-content/uploads/2008/07/dctwintech1-thumb1.gif" width="410" border="0"></a> </p>
<p>Last night, I attended the <a href="http://www.istrategylabs.com/sarah-lacy-in-dc-and-300-rsvps-to-twin-tech/" target="_blank">Twin Tech party</a>, a sponsored happy hour with the worthy goal of “<a href="http://blog.washingtonpost.com/washbizblog/2008/07/will_the_twin_tech_towns_find.html" target="_blank">mixing up our vast, and somewhat fragmented technology culture here in the greater DC region</a>”. I can officially say, the DC tech scene is changing and it’s changing fast.</p>
<p>Let’s start with the venue, instead of holding this event in the suburbs (McCormick &amp; Schmicks anyone?) or at a large hotel bar, they chose to have the event at a trendy up-and-coming part of town in what can be best described as one of DC’s hottest bars, Local 16.&nbsp; Not only that, because of the overwhelming response to attend, they had to rent out the bar next to it as well.&nbsp;
<p>I expected that I would arrive and find the place mostly empty and have a few suits there chatting over a drink or 2.&nbsp; Instead I found myself at the overflow bar with a number of young up and comers in the space.&nbsp; It was impossible to get into the original venue, and the second venue was packed as well!&nbsp; Amongst all the people I found a friendly, happy, open vibe that allowed for great conversation, and interesting discussion about new technologies and the ideas people had about using and building the future.&nbsp;
<p>It was the best of both worlds for a young technologist.&nbsp; I was able to discuss the topics and issues that were most facilitating and relevant (Social Networking from a corporate perspective, new blogging ideas, how new media is helping old media, etc), while still having a great time, and allowing myself to be properly refreshed for a hot DC summer night.</p>
<p><a href="http://sharethis.com/item?&wp=abc&amp;publisher=ea11358c-69de-4e80-9804-e964a8930b70&amp;title=A+New+Generation+of+Tech+in+DC&amp;url=http%3A%2F%2Fblog.sciencelogic.com%2Fa-new-generation-of-tech-in-dc%2F07%2F2008">ShareThis</a></p>]]></content:encoded>
      <pubDate>Fri, 18 Jul 2008 17:24:20 +0000</pubDate>
      <category domain="http://www.securityratty.com/tag/technology">technology</category>
      <category domain="http://www.securityratty.com/tag/technology company names">technology company names</category>
      <category domain="http://www.securityratty.com/tag/bar">bar</category>
      <category domain="http://www.securityratty.com/tag/atmosphere">atmosphere</category>
      <category domain="http://www.securityratty.com/tag/overflow bar">overflow bar</category>
      <category domain="http://www.securityratty.com/tag/ideas people">ideas people</category>
      <category domain="http://www.securityratty.com/tag/ideas">ideas</category>
      <category domain="http://www.securityratty.com/tag/fun laid-back atmosphere">fun laid-back atmosphere</category>
      <category domain="http://www.securityratty.com/tag/fun">fun</category>
      <source url="http://blog.sciencelogic.com/a-new-generation-of-tech-in-dc/07/2008">A New Generation of Tech in DC</source>
    </item>
  </channel>
</rss>
