<?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: grep]]></title>
    <link>http://www.securityratty.com/tag/grep</link>
    <description></description>
    <pubDate>Fri, 07 Dec 2007 06:19:00 +0000</pubDate>
    <generator>iRatty Engine</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <item>
      <title><![CDATA[Improve Security with "A Layer of Hurt"]]></title>
      <link>http://www.securityratty.com/article/8863df5f439aabcb64e3fc7d0777f2bf</link>
      <guid>http://www.securityratty.com/article/8863df5f439aabcb64e3fc7d0777f2bf</guid>
      <description><![CDATA[Hello, Michael here
I got a lot of interesting comments from my TechEd 2008 presentation entitled, &quot;How To Review Your Code And Test For Security Bugs,&quot; but the most comments and questions were...]]></description>
      <content:encoded><![CDATA[Hello, Michael here. 
<P>I got a lot of interesting comments from my <A href="http://blogs.msdn.com/sdl/archive/2008/06/26/security-thoughts-from-teched-2008.aspx" mce_href="http://blogs.msdn.com/sdl/archive/2008/06/26/security-thoughts-from-teched-2008.aspx">TechEd 2008 presentation</A> entitled, "How To Review Your Code And Test For Security Bugs," but the most comments and questions were reserved for fuzz testing; I was blown away by the number of people who thought fuzz testing was hard, or that you only left fuzz testing to ‘leet hackers.</P>
<P>During the presentation I mentioned in some depth how to perform fuzz testing, and what parts of an application should be fuzz testing targets. I also introduced an idea (that's not new) to help people who have never performed fuzz testing begin fuzz testing with very little cost and friction. The idea is to add a small layer of code to an application to automatically mutate untrusted data as it comes into an application; I called that code layer "a layer of hurt."</P>
<P>Before I continue, I want to point out that fuzzing is an SDL requirement, but the idea in this blog post is not an SDL requirement, it's just another way to help meet SDL fuzzing requirements.</P>
<P>Adding a layer of hurt, as shown in the picture below, is pretty simple as it involves adding code to an application to tweak data as it comes into an application. You can work out where to place the fuzzing code by looking at your threat models to see where data crosses trust boundaries. You could also simply grep the code looking for APIs that read data, for example:</P>
<UL>
<LI>Read from files: fread, ReadFile</LI>
<LI>Reading from sockets: recv, recvfrom</LI>
<LI>For .NET code, any stream.Read</LI></UL>
<P>You get the picture.</P>
<P>The fuzzing code should appear right after the API that reads that data.</P>
<P mce_keep="true">For example, C or C++ code that reads from a UDP socket and then fuzzes the data before it's consumed by the rest of the application might look like this:</P><FONT size=1 face=Courier>
<P>char RecvBuf[1024];<BR>int&nbsp; BufLen = sizeof(RecvBuf);</P>
<P mce_keep="true">int result = recvfrom(<BR>&nbsp;&nbsp; RecvSocket, <BR>&nbsp;&nbsp; RecvBuf, <BR>&nbsp;&nbsp; BufLen, <BR>&nbsp;&nbsp; 0, <BR>&nbsp;&nbsp; (SOCKADDR *)&amp;SenderAddr, <BR>&nbsp;&nbsp; &amp;SenderAddrSize);</P></FONT><FONT size=1 face=Courier>
<P>#ifdef _FUZZ<BR>&nbsp;&nbsp; Fuzz(RecvBuf,&amp;BufLen);<BR>#endif</P></FONT>
<P>Or, in C#, code that reads from an untrusted file:</P><FONT size=1 face=Courier>
<P>FileStream fileStream = new FileStream(filename, FileMode.Open, FileAccess.Read);<BR>uint len = (uint)(fileStream.Length);<BR>byte[] fileData = new byte[fileStream.Length];<BR>fileStream.Read(fileData, 0, (int)len);<BR>fileStream.Close();</P></FONT><FONT size=1 face=Courier>
<P mce_keep="true">#if _FUZZ_<BR>&nbsp; Malform pain = new Malform();<BR>&nbsp; fileData = pain.Fuzz(fileData);<BR>#endif</P></FONT>
<P>In both code examples, Fuzz() mutates the incoming data. In the C++ case, the fuzzing code looks like this:</P><FONT size=1 face=Courier>
<P>void Fuzz(_Inout_bytecap_(*pcbBuf) char *pBuf, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _Inout_ size_t *pcbBuf) {<BR><BR>&nbsp; if (!pcbBuf || !pBuf || !*pcbBuff || *pBuf) return;<BR>&nbsp; if ((rand() % 100) &gt; 5) return; // fuzz about 5% of Buffers</P>
<P>&nbsp; size_t cLoop = 1 + (rand() % 4);</P>
<P>&nbsp; for (size_t j = 0; j &lt; cLoop; j++) {</P>
<P>&nbsp;&nbsp;&nbsp; size_t i=0,&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; iLow = rand() % *pcbBuf,&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; iHigh = 1+rand() % *pcbBuf,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; iIter = 1+rand() % 8;<BR><BR>&nbsp;&nbsp;&nbsp; if (iLow &gt; iHigh)&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {size_t t=iHigh; iHigh=iLow; iLow=t;}</P>
<P>&nbsp;&nbsp;&nbsp; char ch=0;<BR>&nbsp;&nbsp;&nbsp; switch(rand() % 9) {</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 0 : // reset upper bits<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i=iLow; i &lt; iHigh; i++)&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pBuf[i] &amp;= 0x7F;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case 1 : // set upper bits<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i=iLow; i &lt; iHigh; i++)&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pBuf[i] |= 0x80;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 2 : // toggle all bits<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i=iLow; i &lt; iHigh; i++)&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pBuf[i] ^= 0xFF;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case 3 : // set to random chars<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i=iLow; i &lt; iHigh; i++)&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pBuf[i] = (char)(rand() % 256);&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 4 : // set NULL chars to (possibly) non-NULL<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i=iLow; i &lt; iHigh; i++)&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!pBuf[i])&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pBuf[i] = (char)(rand() % 256);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case 5 : // swap adjacent bytes<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i=iLow; i &lt; __max(iHigh-1,iLow); i+= iIter)&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {char t=pBuf[i]; pBuf[i] = pBuf[i+1]; pBuf[i+1]=t;}&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 6 : // set to random chars every n-bytes<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i=iLow; i &lt; __max(iHigh-1,iLow); i+= iIter)&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pBuf[i] = (char)(rand()%256);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 7 : // set bytes to one random char<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ch=(char)(rand() % 256);&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i=iLow; i &lt; iHigh; i++)&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pBuf[i] = ch;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; default: // truncate stream<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *pcbBuf = iHigh;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp; }<BR>}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </P></FONT>
<P>The sample C# and C++ fuzzing code is available as a ZIP file at the end of this post.</P>
<P>This code is an example of dumb-fuzzing, which is fuzzing with little or no regard for the data structure being manipulated. If you've never performed any kind of fuzz testing in the past, then you will probably find bugs with this simple fuzzing technique. Once you have weeded out the low-hanging bugs, you may need to turn your attention to smarter fuzzers. For example, in theory, this code would find few if any bugs in a PNG parser, because PNG files have a built in check-sum, so if you fuzz a PNG file, you'd have to recalculate the checksum to get decent code coverage.</P>
<P>When I showed this code during my presentation, I urged people to add it to their applications today if they currently don't do fuzz testing, and simply run their applications through their normal testing processes. Within three days of my presentation I received emails from people saying they had found bugs. I have no doubt others did too.</P>
<P>One of the comments I made during the session was,"If you can't spend the time on great fuzzing, fuzz anyway" and adding a "layer of hurt" is a reasonable start.</P>
<P>Please feel free to sound off if you have ideas to help improve the code and let us know what you think, either through email or comments to this post.</P><img src="http://blogs.msdn.com/aggbug.aspx?PostID=8794487" width="1" height="1">]]></content:encoded>
      <pubDate>Thu, 31 Jul 2008 15:13:00 +0000</pubDate>
      <category domain="http://www.securityratty.com/tag/layer">layer</category>
      <category domain="http://www.securityratty.com/tag/code layer">code layer</category>
      <category domain="http://www.securityratty.com/tag/code">code</category>
      <category domain="http://www.securityratty.com/tag/decent code coverage">decent code coverage</category>
      <category domain="http://www.securityratty.com/tag/fuzz">fuzz</category>
      <category domain="http://www.securityratty.com/tag/void fuzz">void fuzz</category>
      <category domain="http://www.securityratty.com/tag/ifdef fuzz">ifdef fuzz</category>
      <category domain="http://www.securityratty.com/tag/code examples">code examples</category>
      <category domain="http://www.securityratty.com/tag/perform fuzz">perform fuzz</category>
      <source url="http://blogs.msdn.com/sdl/archive/2008/07/31/improve-security-with-a-layer-of-hurt.aspx">Improve Security with "A Layer of Hurt"</source>
    </item>
    <item>
      <title><![CDATA[Your 3 Favorite Linux Commands?]]></title>
      <link>http://www.securityratty.com/article/e67c509e7acd7499f31f094c69c7584b</link>
      <guid>http://www.securityratty.com/article/e67c509e7acd7499f31f094c69c7584b</guid>
      <description><![CDATA[Heres a fun Friday post
Some of you may know Ive been preparing to brush up on my *nix skills. A couple of our new solutions are running on Linux platforms and I feel compelled to understand any...]]></description>
      <content:encoded><![CDATA[<P>Here&#8217;s a fun Friday post&#8230; </P>
<P>Some of you may know I&#8217;ve been preparing to brush up on my *nix skills. A couple of our new solutions are running on Linux platforms and I feel compelled to understand any platform I&#8217;m working with inside and out&#8230; I know, it&#8217;s a bit OCD. </P>
<P>But to be honest, I haven&#8217;t really touched a Linux platform for about 10 years, since I was one of the three students running the Sun network over at <A class=offsite-link-inline title=NCSSM href="http://www.ncssm.edu/" target=_blank>NCSSM</A>. I still remember the humorous &#8216;root&#8217; &#8216;of all evil&#8217; admin name that we used and the password, <em>iaceo</em> (in mixed caps), which was a Latin word for (I think) to lie dead. (Please correct me if you know what it means).&nbsp; When you&#8217;re 17, these things are amusing. </P>
<P>I&#8217;ve kept my ls-ing and cd-ing over the years, but will be brushing up on the grep-ing and tail-ing ;)</P>
<P>So with any system, I think we all have our favourite commands that we use daily and are part of our daily arsenal. I&#8217;m working out mine but wanted to hear from you&#8230; </P>
<P>
<blockquote>
<P><strong>What are your 3 favorite Linux commands? <br><br>And is there 1 obscure one you really love (or hate)?</strong><br><br><br></P></blockquote>
<br>
<P># # #</P>
]]></content:encoded>
      <pubDate>Fri, 25 Jul 2008 10:02:41 +0000</pubDate>
      <category domain="http://www.securityratty.com/tag/favorite linux commands">favorite linux commands</category>
      <category domain="http://www.securityratty.com/tag/daily">daily</category>
      <category domain="http://www.securityratty.com/tag/linux platform">linux platform</category>
      <category domain="http://www.securityratty.com/tag/daily arsenal">daily arsenal</category>
      <category domain="http://www.securityratty.com/tag/platform">platform</category>
      <category domain="http://www.securityratty.com/tag/fun friday post">fun friday post</category>
      <category domain="http://www.securityratty.com/tag/evil admin">evil admin</category>
      <category domain="http://www.securityratty.com/tag/mixed caps">mixed caps</category>
      <category domain="http://www.securityratty.com/tag/sun network">sun network</category>
      <source url="http://www.securityuncorked.com/security-uncorked/2008/7/25/your-3-favorite-linux-commands.html">Your 3 Favorite Linux Commands?</source>
    </item>
    <item>
      <title><![CDATA[My kids get XO's, I go to the command line]]></title>
      <link>http://www.securityratty.com/article/3a9e8d231a2aaed129e3cb1c93e2a03a</link>
      <guid>http://www.securityratty.com/article/3a9e8d231a2aaed129e3cb1c93e2a03a</guid>
      <description><![CDATA[They finally came! My friend Raj Bhargava bought my two sons laptops from the OLPC project around the holiday season. Unfortunately due to the high demand, the project ran out of laptops and we have...]]></description>
      <content:encoded><![CDATA[<p><a onclick="window.open(this.href, '_blank', 'width=480,height=425,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false" href="http://www.stillsecureafteralltheseyears.com/.shared/image.html?/photos/uncategorized/2008/03/22/xo.gif"><img title="Xo" height="212" alt="Xo" src="http://www.stillsecureafteralltheseyears.com/ashimmy/images/2008/03/22/xo.gif" width="240" border="0" style="FLOAT: left; MARGIN: 0px 5px 5px 0px"></img></a> They finally came! My friend Raj Bhargava bought my two sons laptops from the <a href="http://www.laptop.org/">OLPC project</a> around the holiday season. Unfortunately due to the high demand, the project ran out of laptops and we have been waiting 3 months for them to arrive. They finally came on Friday. This was part of the buy one, donate one program so two other lucky children in the world have computers now too thanks to Raj's generosity. For those of you not familiar with the project, this was born out of Nicholas Negroponte's MIT lab to bring a $100 dollar laptop to children the world over. While they have not quite hit the $100 dollar cost, they are under $200. The laptop's are called XO laptops.<br><br>The laptops use low power, are extremely rugged and kid friendly and run Linux. The interface is called Sugar and is very different than a Windows type of metaphor. It takes some getting used to, but my kids seem to have picked it up pretty quickly. The wireless networking is great. In addition to regular wireless access points, the computers network in a "mesh" network that allow them to share information and chat with each other with the pre-installed software. My kids discovered chat pretty quickly and now sit next to each other chatting away over the computer. Why they just don't talk to each other I guess is part of the magic of computers. It also has a nice Mozilla based browser, a word processor, video camera and a bunch of other software. The boys are having a blast using the machines and take them everywhere. All of their friends who see them want one too, so maybe it will lead to more folks joining the buy one, give one program.<br><br>My kids are also really into <a href="http://www.webkinz.com/">webkinz</a>. One of the first things they wanted to do was get on the webkinz site with their new machines. The webkinz site uses flash extensively. The XO laptop though only comes with open software, free is not enough. So they use an open source flash plug in, but it does not play all flash files. You can download and install the flash plug in for Linux, but this takes a little behind the scenes Linux command line work. So Dad told them to go to sleep and when they woke up, their machines would play webkinz in the morning. <br><br>It has been years since I had to work on a Linux/Unix system in the command line. Actually since I first started TriStar Web hosting with my partners and a few nights a week, I was the designated graveyard shift technical support dude. Even then, I knew only enough to get myself in trouble. Kill a process, grep files, chmod permissions, stuff like that. These laptops, while they run Linux, have a different kind of file and directory structure as to where they keep and store files and the naming system is weird. Files are truncated into numeric named files that bear no resemblance to the file name that shows up in the Sugar GUI. You have to go by the date created and size to recognize the file you are looking for and then you can rename it. The script I was trying to run got messed up in the word processor that comes with the laptop, so I had to go into Vi and fix that. It has been a while since I have used Vi too. Than the script did not have execute permissions set, so I had to do that. Well I have to tell you that this all took a few hours, but when the boys woke up in the morning, they turned on their computers and went to webkinz world and just as Dad promised, everything worked fine. I wish all of their wishes and wants were solved so easily!</p>
<p><a href="http://feeds.feedburner.com/~a/StillsecureAfterAllTheseYears?a=T4tLzK"><img src="http://feeds.feedburner.com/~a/StillsecureAfterAllTheseYears?i=T4tLzK" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/StillsecureAfterAllTheseYears?a=TqvJQIF"><img src="http://feeds.feedburner.com/~f/StillsecureAfterAllTheseYears?i=TqvJQIF" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/StillsecureAfterAllTheseYears?a=bxbv5jF"><img src="http://feeds.feedburner.com/~f/StillsecureAfterAllTheseYears?i=bxbv5jF" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/StillsecureAfterAllTheseYears?a=aIVaPUF"><img src="http://feeds.feedburner.com/~f/StillsecureAfterAllTheseYears?i=aIVaPUF" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/StillsecureAfterAllTheseYears?a=MmZ90oF"><img src="http://feeds.feedburner.com/~f/StillsecureAfterAllTheseYears?i=MmZ90oF" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/StillsecureAfterAllTheseYears?a=TuPgIJf"><img src="http://feeds.feedburner.com/~f/StillsecureAfterAllTheseYears?i=TuPgIJf" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/StillsecureAfterAllTheseYears?a=DlhEB0f"><img src="http://feeds.feedburner.com/~f/StillsecureAfterAllTheseYears?i=DlhEB0f" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/StillsecureAfterAllTheseYears/~4/256368453" height="1" width="1"/>]]></content:encoded>
      <pubDate>Sat, 22 Mar 2008 22:30:39 +0000</pubDate>
      <category domain="http://www.securityratty.com/tag/webkinz world">webkinz world</category>
      <category domain="http://www.securityratty.com/tag/world">world</category>
      <category domain="http://www.securityratty.com/tag/files">files</category>
      <category domain="http://www.securityratty.com/tag/grep files">grep files</category>
      <category domain="http://www.securityratty.com/tag/webkinz">webkinz</category>
      <category domain="http://www.securityratty.com/tag/flash files">flash files</category>
      <category domain="http://www.securityratty.com/tag/webkinz site">webkinz site</category>
      <category domain="http://www.securityratty.com/tag/store files">store files</category>
      <category domain="http://www.securityratty.com/tag/chat pretty quickly">chat pretty quickly</category>
      <source url="http://feeds.feedburner.com/~r/StillsecureAfterAllTheseYears/~3/256368453/my-kids-get-xos.html">My kids get XO's, I go to the command line</source>
    </item>
    <item>
      <title><![CDATA[Evil Silos]]></title>
      <link>http://www.securityratty.com/article/9aaf7611c83c71eee9ec558f1b76b641</link>
      <guid>http://www.securityratty.com/article/9aaf7611c83c71eee9ec558f1b76b641</guid>
      <description><![CDATA[Today I will speak about evil. Yes, evil! There is plenty of evil in the world of logs (e.g. ugly logs ), but this is a &quot;bigger, better&quot; evil :-): siloed approach to logs
There is little that I hate...]]></description>
      <content:encoded><![CDATA[<p>Today I will speak about evil. Yes, evil! There is plenty of evil in the world of logs (e.g. <a href="http://www.loganalysis.org/pipermail/loganalysis/2008-January/000536.html">ugly logs</a>), but this is a "bigger, better" evil :-): <strong>siloed approach to logs!</strong></p> <p>There is little that I hate more than&nbsp; siloed approach to logs. A situation when you have your security team "owning" network IDS logs, network team having firewall and router logs (as well as all SNMP traps) and, say, a sysadmins possessing&nbsp; (or, rather, ignoring!) the logs from servers and desktop is not only sad, counterproductive, inefficient and wasteful, but also dangerous.</p> <p>Where does such approach to logs (where they are divided by both technical and political chasms) breaks down most painfully? In case of<strong> an incident response</strong>, of course. This is where instead of one query across all logs and all log sources (or whatever needed subset of logs or log sources), you'd end up with having run around, beg, connect, wait, swear, wait, download logs, dig in many places at once, wait, <em>grep</em>, suffer with many UIs, swear more - and have a time of your life in general! :-) All of the above instead of connecting to your shiny new <a href="http://www.loglogic.com/">log management system</a> and running a few reports, drilldowns and searches across the relevant logs.</p> <p>Ideally, you'd fight the evil and break down the silo walls by deploying <a href="http://www.loglogic.com/">a log management platform</a> across the entire organization and then letting every team that needs logs to get them from the system in a controlled fashion, via the interface or a web API (BTW, <a href="www.loglogic.com/">LogLogic</a> has <a href="http://www.loglogic.com/news/news-releases/2006/12/loglogic_open_log_services_power_first_servicesoriented_architecture_soa/">a web API</a> to get logs!). Apart from being a trend (e.g. see <a href="http://www.pr-inside.com/new-esg-research-finds-large-organizations-r262532.htm">recent ESG report</a> on that), it will make your IT and security operations that much more efficient - and pleasant!</p> <p>On the other hand, what is bizarre is that some newer vendors,&nbsp; who claim to do log management, actually work to propagate, not combat, the siloed approach. For example, selling the tool for $5000 to each of the many separate teams within the organization IMHO must be made illegal :-) as it builds walls, not bridges; digs holes and overall "silo-izes" your operation...</p> <div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:45efbdcf-f268-4735-85db-eac69fcaaff7" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati tags: <a href="http://technorati.com/tags/logging" rel="tag">logging</a>, <a href="http://technorati.com/tags/log%20management" rel="tag">log management</a></div>  <div class="blogger-post-footer">About me: http://www.chuvakin.org</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/AntonChuvakinPersonalBlog?a=PlwIyGD"><img src="http://feeds.feedburner.com/~f/AntonChuvakinPersonalBlog?i=PlwIyGD" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/AntonChuvakinPersonalBlog?a=8hIUYBD"><img src="http://feeds.feedburner.com/~f/AntonChuvakinPersonalBlog?i=8hIUYBD" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AntonChuvakinPersonalBlog/~4/222574533" height="1" width="1"/>]]></content:encoded>
      <pubDate>Thu, 24 Jan 2008 12:42:00 +0000</pubDate>
      <category domain="http://www.securityratty.com/tag/network ids logs">network ids logs</category>
      <category domain="http://www.securityratty.com/tag/logs">logs</category>
      <category domain="http://www.securityratty.com/tag/relevant logs">relevant logs</category>
      <category domain="http://www.securityratty.com/tag/download logs">download logs</category>
      <category domain="http://www.securityratty.com/tag/ugly logs">ugly logs</category>
      <category domain="http://www.securityratty.com/tag/router logs">router logs</category>
      <category domain="http://www.securityratty.com/tag/log management platform">log management platform</category>
      <category domain="http://www.securityratty.com/tag/log management">log management</category>
      <category domain="http://www.securityratty.com/tag/evil">evil</category>
      <source url="http://feeds.feedburner.com/~r/AntonChuvakinPersonalBlog/~3/222574533/evil-silos.html">Evil Silos</source>
    </item>
    <item>
      <title><![CDATA[Google Spamming Us]]></title>
      <link>http://www.securityratty.com/article/60650c1930bf82a02a20fd5776dccb4e</link>
      <guid>http://www.securityratty.com/article/60650c1930bf82a02a20fd5776dccb4e</guid>
      <description><![CDATA[You know, we get some really odd traffic. Some of it good, some of it not so much. Lets take a look at some of Googles traffic since its a slow day. If nothing else its good for a laugh. First lets...]]></description>
      <content:encoded><![CDATA[<p>You know, we get some really odd traffic.  Some of it good, some of it not so much.  Let&#8217;s take a look at some of Google&#8217;s traffic since it&#8217;s a slow day.  If nothing else it&#8217;s good for a laugh.  First let&#8217;s look at Google trying to hack us - XSS style:</p>
<p>
<blockquote>66.249.73.40 - - [26/Nov/2007:01:53:58 +0000] &#8220;GET /blog/?%22%3E%3Cscript%3Ealert(1)%3C/script%3E HTTP/1.1&#8243; 200 55053 &#8220;-&#8221; &#8220;Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)&#8221;</p></blockquote>
<p>Not too bad for a robot.  How about some totally innane Apache directory structure stuff that couldn&#8217;t possibly work?</p>
<p>
<blockquote>66.249.73.40 - - [26/Nov/2007:00:46:03 +0000] &#8220;GET /bluehat-spring-2007/?C=S;O=A HTTP/1.1&#8243; 200 3681 &#8220;-&#8221; &#8220;Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)&#8221;
</p></blockquote>
<p>Someone needs to figure out how UTF-7 works:</p>
<p>
<blockquote>66.249.73.40 - - [26/Nov/2007:02:25:19 +0000] &#8220;GET /s.js+ACIAPgA8-/script+AD4-x HTTP/1.1&#8243; 302 204 &#8220;-&#8221; &#8220;Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)&#8221;</p></blockquote>
<p>Oh don&#8217;t we love the Google spam?  I really am disheartened that it&#8217;s this easy to con Google into spamming websites.  As if I don&#8217;t get enough referrer spam, Google does one better.  *sigh*</p>
<p>
<blockquote>66.249.73.40 - - [23/Nov/2007:19:11:23 +0000] &#8220;GET /weird/popup.html/Buy-NET.html HTTP/1.1&#8243; 302 204 &#8220;-&#8221; &#8220;Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)&#8221;<br />
66.249.73.40 - - [09/Dec/2007:07:21:51 +0000] &#8220;GET /weird/popup.html/Buy-COM.html HTTP/1.1&#8243; 302 204 &#8220;-&#8221; &#8220;Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)&#8221;<br />
66.249.73.40 - - [11/Dec/2007:05:24:19 +0000] &#8220;GET /weird/popup.html/Buy-MEUK.html HTTP/1.1&#8243; 302 204 &#8220;-&#8221; &#8220;Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)&#8221;<br />
66.249.73.40 - - [14/Dec/2007:17:48:58 +0000] &#8220;GET /weird/popup.html/Buy-INFO.html HTTP/1.1&#8243; 302 204 &#8220;-&#8221; &#8220;Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)&#8221;
</p></blockquote>
<p>Google has a lust for the goatse!  Cannot get enough of it!!!!!  Seriously, Google.  I just don&#8217;t have Goatse on my machine.  I promise!  Granted, I 302 redirect all 404s to the homepage, instead of 301, so that&#8217;s my bad, but seriously - there is a reason I might want to do that and still not have goatse on my site.  I don&#8217;t ever remember having it anyway.  Time to give up the obsession, Google!</p>
<p>
<blockquote>66.249.73.40 - - [30/Nov/2007:01:04:10 +0000] &#8220;GET /goatse.html HTTP/1.1&#8243; 302 204 &#8220;-&#8221; &#8220;Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)&#8221;<br />
66.249.73.40 - - [07/Dec/2007:19:36:57 +0000] &#8220;GET /goatse.html HTTP/1.1&#8243; 302 204 &#8220;-&#8221; &#8220;Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)&#8221;<br />
66.249.73.40 - - [10/Dec/2007:20:17:00 +0000] &#8220;GET /goatse.html HTTP/1.1&#8243; 302 204 &#8220;-&#8221; &#8220;Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)&#8221;<br />
66.249.73.40 - - [19/Dec/2007:22:58:31 +0000] &#8220;GET /goatse.html HTTP/1.1&#8243; 302 204 &#8220;-&#8221; &#8220;Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)&#8221;</p></blockquote>
<p>More spam anyone?  Let&#8217;s see here&#8230; Google likes Viagra and goatse.  I&#8217;m seeing a theme here!</p>
<p>
<blockquote>66.249.73.40 - - [26/Nov/2007:04:47:00 +0000] &#8220;GET /fierce/?ref=SaglikAlani.Com HTTP/1.1&#8243; 304 - &#8220;-&#8221; &#8220;Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)&#8221;</p></blockquote>
<p>And the trackbacks&#8230; oh Google, please figure out what a Trackback is and stop spidering it.  I swear, no matter how many bazillion times you look at the trackback pages, you&#8217;re still not going to find anything useful there.  I double cross my heart and swear to die.  This is from Nov 18th-Dec 20th (just over one month):</p>
<p>
<blockquote>$ grep 66.249.73.40 error_log |grep -c wp-trackback<br />
938
</p></blockquote>
<p>Think how much bandwidth Google uses that is just completely unnecessary.  The countless and senseless bandwidth waste-age.  I started using Google because it was light on my personal bandwidth - so much for that idea.</p>
<!--Thu, 27 December 2007 09:12:07 +000-->]]></content:encoded>
      <pubDate>Thu, 20 Dec 2007 19:11:11 +0000</pubDate>
      <category domain="http://www.securityratty.com/tag/google">google</category>
      <category domain="http://www.securityratty.com/tag/html http1">html http1</category>
      <category domain="http://www.securityratty.com/tag/http1">http1</category>
      <category domain="http://www.securityratty.com/tag/html">html</category>
      <category domain="http://www.securityratty.com/tag/google likes viagra">google likes viagra</category>
      <category domain="http://www.securityratty.com/tag/referrer spam">referrer spam</category>
      <category domain="http://www.securityratty.com/tag/spam">spam</category>
      <category domain="http://www.securityratty.com/tag/google spam">google spam</category>
      <category domain="http://www.securityratty.com/tag/con google">con google</category>
      <source url="http://ha.ckers.org/blog/20071220/google-spamming-us/">Google Spamming Us</source>
    </item>
    <item>
      <title><![CDATA[Logging Poll #3 "What Do You Do With Logs?" Analysis]]></title>
      <link>http://www.securityratty.com/article/87a7e6cc8d308997c3f23e7bc418446b</link>
      <guid>http://www.securityratty.com/article/87a7e6cc8d308997c3f23e7bc418446b</guid>
      <description><![CDATA[So, the results of my 3rd poll are ready: live results are here , picture is also in this post. This sure was fun

First, this poll way more popular than my previous &quot;why&quot; poll . Yes, it seems like...]]></description>
      <content:encoded><![CDATA[<p>So, the results of <a href="http://chuvakin.blogspot.com/2007/11/poll-what-do-you-do-with-collected-logs.html">my 3rd poll</a> are ready: live results are <a href="http://www.misterpoll.com/polls/262289/results">here</a>, picture is also in this post. This sure was fun! </p> <p><a href="http://lh4.google.com/anton.chuvakin/R1mAiBiuomI/AAAAAAAACLs/gpjQjLdj0sc/poll3-what-done%5B2%5D"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="152" alt="poll3-what-done" src="http://lh5.google.com/anton.chuvakin/R1mAjRiuonI/AAAAAAAACL0/OR4HMbQVgEw/poll3-what-done_thumb" width="244" border="0"></a> </p> <p>First, this poll way more popular than <a href="http://chuvakin.blogspot.com/2007/11/logging-poll-2-analysis.html">my previous "why" poll</a>. Yes, it seems like people do hate to wonder "why" :-)</p> <p>Second, what are&nbsp; the two choices, that are <em><strong>by far</strong></em> the most popular? They are:</p> <ul> <li>Store raw logs on a server (23%)</li> <li>Search raw logs (grep) when needed (24%)</li></ul> <p>Yes, this is the "state of the art" of logging:&nbsp;&nbsp; collection of raw logs and "as needed" <em>grep</em> aka "slow and painful" search. In fact, the above answers might not even be given by the same people: some might be <em>grepping</em> logs on the individual servers, while <em>others</em> collect them on syslog servers and never touch them. That is why being in <a href="http://www.loglogic.com/">log management business</a> is such a great thing: you have nearly the whole world to evangelize about the value of logs and <a href="http://www.loglogic.com/products">log management tools</a>.</p> <p>Third, what's the next most popular idea of analyzing logs? It is "Run my own log analysis tool" at 10% of the respondents. Indeed, the <a href="http://en.wikipedia.org/wiki/Masochism">movement</a> started by the "<em>enlightened</em>" <a href="http://en.wikipedia.org/wiki/Leopold_von_Sacher-Masoch">Leopold von Sacher-Masoch</a>&nbsp; still lives and thrives: people choose the <a href="http://chuvakin.blogspot.com/2007/11/log-management-strategy-built-suffer.html">Build-&gt;Suffer</a> approach to <a href="http://www.loglogic.com/">log management</a> often enough ...</p> <p>Fourth, next come my somewhat self-inflicted surprise: apart from <a href="http://www.loglogic.com/">commercial log management</a> (at 4%) and rolling one's own (discussed above at 10%), I added the option of "Use other log analysis tools"&nbsp;&nbsp; which captured 7% of the vote. But what does that mean? I have no idea!</p> <p>Fifth, I am NOT surprised by the lack of popularity of the rule-based correlation tools, such as <a href="http://chuvakin.blogspot.com/search/label/SIEM">SIEM</a> (at 2%). When I <a href="http://chuvakin.blogspot.com/2006/03/logblog-log-guru-joins-loglogic.html">made my decision</a> to join <a href="http://www.loglogic.com/">LogLogic</a>, I had to ponder this one really, really hard. Sorry to use this post to rant, but my conclusion at the time (which is also valid now) was that "<a href="http://chuvakin.blogspot.com/search/label/SIEM">SIEM</a> is for some, <a href="http://www.loglogic.com/">log management</a> is for <strong>everybody</strong>." This poll confirms this further.</p> <p>Finally, all my logging polls and analysis are <a href="http://chuvakin.blogspot.com/search/label/poll">here</a>. Next one is coming up!</p> <div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:c47b2bc4-cf6b-4de8-8f86-7fd8046d4888" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati tags: <a href="http://technorati.com/tags/logging" rel="tag">logging</a>, <a href="http://technorati.com/tags/polls" rel="tag">polls</a>, <a href="http://technorati.com/tags/log%20management" rel="tag">log management</a></div>  <div class="blogger-post-footer">About me: http://www.chuvakin.org</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/AntonChuvakinPersonalBlog?a=2DB9wlC"><img src="http://feeds.feedburner.com/~f/AntonChuvakinPersonalBlog?i=2DB9wlC" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/AntonChuvakinPersonalBlog?a=hUyrpcC"><img src="http://feeds.feedburner.com/~f/AntonChuvakinPersonalBlog?i=hUyrpcC" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AntonChuvakinPersonalBlog/~4/196737531" height="1" width="1"/>]]></content:encoded>
      <pubDate>Fri, 07 Dec 2007 06:19:00 +0000</pubDate>
      <category domain="http://www.securityratty.com/tag/logs">logs</category>
      <category domain="http://www.securityratty.com/tag/store raw logs">store raw logs</category>
      <category domain="http://www.securityratty.com/tag/log management business">log management business</category>
      <category domain="http://www.securityratty.com/tag/log management">log management</category>
      <category domain="http://www.securityratty.com/tag/analysis">analysis</category>
      <category domain="http://www.securityratty.com/tag/poll">poll</category>
      <category domain="http://www.securityratty.com/tag/commercial log management">commercial log management</category>
      <category domain="http://www.securityratty.com/tag/raw logs">raw logs</category>
      <category domain="http://www.securityratty.com/tag/log management tools">log management tools</category>
      <source url="http://feeds.feedburner.com/~r/AntonChuvakinPersonalBlog/~3/196737531/logging-poll-3-do-you-do-with-logs.html">Logging Poll #3 "What Do You Do With Logs?" Analysis</source>
    </item>
  </channel>
</rss>
