<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.askapache.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.askapache.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>AskApache Web Devleopment</title>
	
	<link>http://www.askapache.com</link>
	<description>Apache htaccess, Web Development and Design</description>
	<pubDate>Tue, 29 Apr 2008 12:25:03 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.askapache.com/apache/htaccess" type="application/rss+xml" /><feedburner:emailServiceId>634703</feedburner:emailServiceId><feedburner:feedburnerHostname>http://www.feedburner.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.askapache.com%2Fapache%2Fhtaccess" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.askapache.com%2Fapache%2Fhtaccess" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.askapache.com%2Fapache%2Fhtaccess" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.rojo.com/add-subscription?resource=http%3A%2F%2Ffeeds.askapache.com%2Fapache%2Fhtaccess" src="http://blog.rojo.com/RojoWideRed.gif">Subscribe with Rojo</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.askapache.com/apache/htaccess" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.askapache.com%2Fapache%2Fhtaccess" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.askapache.com%2Fapache%2Fhtaccess" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.askapache.com%2Fapache%2Fhtaccess" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.askapache.com%2Fapache%2Fhtaccess" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:browserFriendly>Thanks for your Interest, you are very nice!</feedburner:browserFriendly><item>
		<title>SEO Secrets of AskApache.com</title>
		<link>http://feeds.askapache.com/~r/apache/htaccess/~3/279762843/seo-secrets.html</link>
		<comments>http://www.askapache.com/seo/seo-secrets.html#comments</comments>
		<pubDate>Tue, 29 Apr 2008 01:44:02 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
		
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://www.askapache.com/?p=566</guid>
		<description><![CDATA[<p><a rel="lb" class="IFL" href='http://z.askapache.com/uploads/2008/04/google-rankings.png'><img src="http://z.askapache.com/uploads/2008/04/google-rankings.png" alt="SEO Secrets for Google High Ranking" title="google-rankings" /></a>Learn how in a year, with no previous blogging experience this blog was able to rank so high in search engines and achieve 15,000 unique visitors every day.  Uses combination of tricks and tips from throughout AskApache.com for Search Engine Optimization.<br class="C" /></p>]]></description>
			<content:encoded><![CDATA[<p><a rel="lb" class="IFL" href='http://z.askapache.com/uploads/2008/04/google-rankings.png'><img src="http://z.askapache.com/uploads/2008/04/google-rankings.png" alt="SEO Secrets for Google High Ranking" title="google-rankings" /></a>First let me say that I am not into SEO, I don&#8217;t read the research, I don&#8217;t participate in the SEO community, I only have an interest in regards to the technology used by the search engines.  All websites are hosted on servers, mostly Apache, and that is the primary topic of this blog.  During the past year of this blog, my research into non-seo areas has turned up some very valuable SEO techniques.. All of them legal, ethical, and genuinely good for the Internet at large.<br class="C" /></p>
<h2>Some Background</h2>
<p>I started this blog in January 2007, my first foray into blogging, and I&#8217;ve been extremely successful at achieving top ten google rankings and maintaining on average 15K unique visitors/day (per google analytics) 85% of which come from search engine traffic.</p>
<p class="cnote"><strong>NOTE:</strong>  I take it for granted that anyone reading AskApache is an expert of some skill, if you aren&#8217;t I apologize, I can&#8217;t waste time on the easy stuff.</p>
<h2>Prerequisite SEO</h2>
<p>There are literally hundreds of thousands of SEO articles on the net, 99.9% of which are absolute garbage.  Especially in the sense that they just repeat the same 10 year old stuff.  However, to do any kind of advanced SEO like I am going to discuss in this article, I am assuming that you, the intelligent reader, has already read those and has a basic understanding of SEO fundamentals like meta tags, titles, keywords, etc.</p>
<h2>First, Great Content</h2>
<p>The foremost and most important step in achieving any kind of traffic is to produce great content.  I&#8217;m sure you&#8217;ve heard that a million times, but let me break it down how I perceive it.  Before I even started to mess with SEO for AskApache.com I began by writing articles.  At that point I didn&#8217;t have a clue what my blog was going to be about or even if I was going to be doing it after a week.</p>
<h3>What is Content</h3>
<p>For me, being a top-paid professional web developer, I spend about 80% of my time doing research.  I think that is a bit uncommon, but its a throwback from the 10 years I spent in the network/computer security field, where research is 99% of the job, a story for another time perhaps.</p>
<p>So the research I was doing at that time was about best-practice standards-based web design, mainly <a href="http://www.askapache.com/xhtml/">XHTML Strict</a>, <a href="http://www.askapache.com/css/">CSS</a>, and <a href="http://www.askapache.com/javascript/">unobtrusive javascript</a>.  Each of those subjects has become near and dear to my heart, and each should also be mandatory learning for anyone interested in SEO.  The best advice I can give towards that end is checking out the CSS, Javascript, and XHTML Strict source code for this page and site.  And of course the holy <a href="http://www.w3.org/QA/">W3.org</a>.</p>
<p>In addition to striving to master those 3 subjects, I was also and always will be researching web programming languages like <a href="http://www.askapache.com/php/">PHP</a>, Ajax, Ruby, and Server Technology like <a href="http://www.askapache.com/apache/">Apache</a>.   Although I should note that my research into Apache and server technologies is more of a hobby than a job requirement, also a throwback to my days in the security industry and of course my love for <a href="http://nongnu.askapache.com/">open source software</a>.</p>
<h3>My Content</h3>
<p>So basically I was spending 25% of my time at work actually working, and the other 75% of the time I would research how to do something better, faster, the best.  Incredibly, I discovered or re-discovered a ton of tips, tricks, and methods to aid me in my work.  I was learning so much valuable information that I joined a couple of forums to discuss them and get feedback on making them even better.  Soon I realized that I was one of a small few who actually post content to a forum instead of just questions, so I decided to write my tutorials down on a blog, and AskApache was born.</p>
<p>So that is why this blog is comprised of almost 100% tutorials, and why almost all of them are completely original works you won&#8217;t find elsewhere.  That&#8217;s how I create content, but you might do something different.  Whatever it is that you do for content, just make sure you are providing VALUE with everything you do.  Not to everyone, just stuff that you would consider to have value if you were reading it.</p>
<h2>Second, Great Site</h2>
<p>Ok so I had 10 or so great articles that I knew would provide value for many web developers, but so what?  Nobody cares you know..  That&#8217;s when I decided to take a closer look at the software that was running my new blog, WordPress, and I&#8217;ve been <a href="http://www.askapache.com/wordpress-plugins/">hacking the code</a> ever since on my never-ending quest to be the best and know the most advanced web development.  You&#8217;ll see why in a couple paragraphs.</p>
<h3>I Mean, a Really Great Site</h3>
<p><a class="IFL" rel="lb" href='http://z.askapache.com/uploads/2008/04/the-web.png'><img src="http://z.askapache.com/uploads/2008/04/the-web-289x300.png" alt="Google Want A Spider Web" title="the-web" width="289" height="300" class="alignnone size-medium wp-image-569" /></a>By great, I mean you need to make it incredibly user-friendly.  Every design and development decision you make should be about the visitor.  THATS the number one key to success on the net, regardless of endeavor.  Here is a list of things you definately need to have before you do SEO, I&#8217;m not listing obvious stuff like descriptions, titles, and good writing.<br class="C" /></p>
<ol>
<li>Intuitive and circular, your website should be a spider-web of urls.</li>
<li>Easy to read, plenty of white-space, design is your decision but I like minimalistic.</li>
<li>Super fast rendering.  You need effective <a href="http://www.askapache.com/web-cache/">caching and optimization</a>.</li>
<li>A very <a href="http://www.askapache.com/seo/google-ajax-search-seo-tips.html">helpful 404 error page</a>, hopefully never seen.</li>
</ol>
<h2>Focus in on your URL&#8217;s</h2>
<p>Many sites that use a CMS of some kind, be it <a href="http://drupal.org/">Drupal</a> or <a href="http://wordpress.org/">WordPress</a>, have hundreds or thousands of URL&#8217;s even if they only have 10 actual posts/articles.</p>
<h3>Removing Duplicate Content</h3>
<p>You&#8217;ve all heard this before, but almost no-one has taken it to the level I am going to discuss.  Bear with me.</p>
<p>Removing duplicate content is actually a very straightforward process if you know what you are doing, and if you don&#8217;t, well that&#8217;s why I&#8217;m going to quickly explain how to really do a good job.</p>
<h3>Locate Duplicate Content and URLS</h3>
<p>People misunderstand that you should just not repeat the same paragraph in a different article, that is partially true, but the main impact this has on your site is if you can access the same article from more than a single URL.</p>
<p>I hope you realize you MUST use pretty urls like my site and not codey looking ones with question marks.  You can find any potential <a href="http://www.askapache.com/htaccess/rewriterule-viewer-plugin.html">duplicate urls on wordpress</a> with the rewriterules plugin. Also look at Google&#8217;s webmaster tools to look for any duplicate urls, and you can use xenus link sleuth tool as well.</p>
<h3>Remove Duplicate Urls with .htaccess</h3>
<p>Once you&#8217;ve found duplicate urls, you need to instruct google and other search engine robots to be redirected to the correct url.  By doing a 301 redirect you tell the search engines NOT to index the bad url, only the good one.  Below are some of the .htaccess code I use on this site to accomplish this technique, this is gold I myself use so pay attention.  It works.</p>
<h4>301 Redirects with mod_rewrite</h4>
<p>First lets start with one everyone should know, and the most common, <em>to www or not to www?</em></p>
<pre>
RewriteCond %{HTTP_HOST} !^www\.askapache\.com$ [NC]
RewriteRule ^(.*)$ http://www.askapache.com/$1 [R=301,L]
</pre>
<p>Its a highly rare individual who has seen this one, which forces requests for <code>.html/</code> to <code>.html</code></p>
<pre>
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /[^\.]+\.html/\ HTTP/ [NC]
RewriteRule ^(.*)\.html/$ http://www.askapache.com/$1.html [R=301,L]
</pre>
<h4>301 Redirects without mod_rewrite</h4>
<p>For the rest of the duplicate urls that you find, I like to use Redirect and RedirectMatch.</p>
<p>This redirects requests that start with an <code>&amp; or /&amp;amp or /(</code>  to my homepage. </p>
<pre>
RedirectMatch 301 ^/&amp;(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/&amp;amp(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/([\(]+)(.*)$ http://www.askapache.com/
</pre>
<p>This redirects requests with <code>//whatev</code> to <code>/whatev</code></p>
<pre>
RedirectMatch 301 ^//(.*)$ http://www.askapache.com/$1
</pre>
<p>But this is just a brief look at what you will have to spend some time on.  There are detailed guides to doing this with <a href="http://www.askapache.com/htaccess/mod_rewrite-tips-and-tricks.html">mod_rewrite</a> and using <a href="http://www.askapache.com/htaccess/seo-search-engine-friendly-redirects-without-mod_rewrite.html">Redirect</a> on my blog.  Its time now for <strong>some real SEO tips</strong>.  The heart of the matter, as it were.</p>
<h2>Wrap It Up</h2>
<p>So I realize that was brief, so I want to really stress 2 things or you won&#8217;t take away much from part 1.</p>
<h3>Locate Duplicate URLS</h3>
<p>This is truly one of the most important things in my personal experience.  I personally take this as extreme as I can, I regularly grep my access files, mod_security and error log files looking for bad URLS.  I am always checking them out to see if someone has a bad link to me somewhere, or if someone just typed it in wrong.   If its a bad link on a site, I will very politely attempt contacting the webmaster about it until they fix it.</p>
<p>Even I, with my many colorful years of Internet travel, was caught off-guard by the variety and creativity and the sheer number of urls people are using to link to my site.  I found that often bad links would be published because my URL was just too long, so I shortened the URL&#8217;s.  Now of course bad links can&#8217;t really even touch my site with all my 301&#8217;s in place.</p>
<p>Besides grepping your server&#8217;s logs, the 2nd best place to locate duplicate urls or just plain wrong urls is by using Googles free webmaster tools.  They keep track of all the bad urls linking to your site and allow you to download this data in a .csv spreadsheet format.  The first time I checked into this I found over 1,000 bad links, after a couple months with my RewriteRules and 301 Redirects, I&#8217;ve narrowed the list down to under 50 most months.  That is a powerful reason to use 301 Redirects, as we&#8217;ll really get into in part 2.</p>
<h3>301 Redirect Bad URLS</h3>
<p>Finding the bad urls takes some time, a couple hours even, and then the whole reason you do that is to be able to create 301 Redirects for all of those bad urls to good urls.</p>
<p>One reason that I wasn&#8217;t even aware of until several months ago is that when Googlebot locates a bad URL for your site, it tries to access it, and if you haven&#8217;t planned for this in advance, your page most likely will return a <code>200 OK</code> status header, or if you are lucky a <code>404 Not Found</code> error, both of which really hurt you.</p>
<p>Basically, a 200 response will produce duplicate content in 99.9% of the time, and 404 responses will whisper to Google&#8217;s algorithms that you don&#8217;t know what you are doing and your site isn&#8217;t authoritative.  200 means google will index your site, 404 means google won&#8217;t index your site, but it also won&#8217;t give up trying for awhile, which takes away from your real urls.</p>
<h4>What a 301 Response tells Google</h4>
<p><a href="http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html#status-301">301 Responses</a> were practically invented for user-agents/clients/web-crawling robots like google.  They instruct the client, whether that be a persons browser or a googlebot, that the resource/page that they are looking for is actually at a different URL.  This is an authoritative response that makes googlebot and other search engines ecstatic because now they can give up on the 200 and 404 responses that didn&#8217;t really give them an answer either way.</p>
<p>On the other hand, a <a href="http://www.askapache.com/seo/404-google-wordpress-plugin.html">great 404</a> can and should be just as powerful as a 301, but hardly anyone uses them in the correct way according to HTTP 1.1 or 1.0 Specifications.  We&#8217;ll tear that subject apart further down the road.</p>
<p>I&#8217;ll leave this topic for now with one last idea, 301 Redirects when implemented and used correctly, actually redirect the page rank and search engine ranking for itself to the redirected / correct url.  That means if you have 1000 unique links pointing to your article, and all of them are incorrect in some way, if you can 301 redirect all of those bad links to your correct link you now have 1000 new good links!  It has to be done right and in a classy way though of course.</p>
<p class="cnote"><strong>Now that you have content and a great site, its time to SEO like a mofo</strong>.</p>
<p>I just have a few things left before I publish Part 2, which goes into the actual details and SEO Secrets I use.  This intro post was a neccessary evil I&#8217;m afraid.</p>
<h3>Random Posts</h3>
<ul class="related_post">
<li><a href="http://www.askapache.com/htaccess/mixed-ssl-content-warning-secure-fixed.html" title="Mixed SSL Content Warning Secure Fixed">Mixed SSL Content Warning Secure Fixed</a></li>
<li><a href="http://www.askapache.com/tools/css-browser-screenshots.html" title="CSS Cross-Browser Compatibility Tip">CSS Cross-Browser Compatibility Tip</a></li>
<li><a href="http://www.askapache.com/dreamhost/howto-spf-records-on-dreamhost.html" title="SPF Records on DreamHost">SPF Records on DreamHost</a></li>
<li><a href="http://www.askapache.com/dreamhost/php5-custom-install.html" title="PHP5 Custom Install Shell Script Example">PHP5 Custom Install Shell Script Example</a></li>
<li><a href="http://www.askapache.com/htaccess/rewriterule-viewer-plugin.html" title="WordPress RewriteRules Viewer">WordPress RewriteRules Viewer</a></li>
<li><a href="http://www.askapache.com/htaccess/ssl-example-usage-in-htaccess.html" title="htaccess HTTPS / SSL Tips, Tricks, and Hacks">htaccess HTTPS / SSL Tips, Tricks, and Hacks</a></li>
<li><a href="http://www.askapache.com/htaccess/htaccess-htpasswd-basic-auth.html" title="Log all .htaccess/.htpasswd logins">Log all .htaccess/.htpasswd logins</a></li>
<li><a href="http://www.askapache.com/seo/updated-robotstxt-for-wordpress.html" title="Updated robots.txt for WordPress">Updated robots.txt for WordPress</a></li>
<li><a href="http://www.askapache.com/htaccess/fight-blog-spam-with-apache.html" title="Fight Blog Spam with Apache">Fight Blog Spam with Apache</a></li>
<li><a href="http://www.askapache.com/htaccess/using-time_hour-and-time_min-rewritecond-in-htaccess-2.html" title="Using TIME_HOUR and TIME_MIN for htaccess RewriteCond">Using TIME_HOUR and TIME_MIN for htaccess RewriteCond</a></li>
</ul>
<p class="rnote"><a href="http://www.askapache.com/search/seo/" rel="tag">seo</a> <a href="http://www.askapache.com/search/google/" rel="tag">google</a> <a href="http://www.askapache.com/search/searchengineoptimization/" rel="tag">searchengineoptimization</a> <a href="http://www.askapache.com/search/robots.txt/" rel="tag">robots.txt</a> <a href="http://www.askapache.com/search/wordpress/" rel="tag">wordpress</a> <a href="http://www.askapache.com/search/seo-tips/" rel="tag">seo-tips</a> <a href="http://www.askapache.com/search/seo-tricks/" rel="tag">seo-tricks</a></p>
<p><a href="http://feeds.askapache.com/~a/apache/htaccess?a=DuGB0c"><img src="http://feeds.askapache.com/~a/apache/htaccess?i=DuGB0c" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.askapache.com/~f/apache/htaccess?a=nxQDNg"><img src="http://feeds.askapache.com/~f/apache/htaccess?i=nxQDNg" border="0"></img></a> <a href="http://feeds.askapache.com/~f/apache/htaccess?a=vjwXMg"><img src="http://feeds.askapache.com/~f/apache/htaccess?i=vjwXMg" border="0"></img></a> <a href="http://feeds.askapache.com/~f/apache/htaccess?a=9LY5hg"><img src="http://feeds.askapache.com/~f/apache/htaccess?i=9LY5hg" border="0"></img></a> <a href="http://feeds.askapache.com/~f/apache/htaccess?a=rTHZWG"><img src="http://feeds.askapache.com/~f/apache/htaccess?i=rTHZWG" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/seo/seo-secrets.html/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.askapache.com/seo/seo-secrets.html</feedburner:origLink></item>
		<item>
		<title>Mod_Security .htaccess tricks</title>
		<link>http://feeds.askapache.com/~r/apache/htaccess/~3/202578923/mod_security-htaccess-tricks.html</link>
		<comments>http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#comments</comments>
		<pubDate>Wed, 23 Apr 2008 06:17:01 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
		
		<category><![CDATA[Apache]]></category>

		<category><![CDATA[Apache Modules]]></category>

		<category><![CDATA[DreamHost]]></category>

		<category><![CDATA[Security]]></category>

		<category><![CDATA[Web Hosting]]></category>

		<category><![CDATA[Webmaster]]></category>

		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html</guid>
		<description><![CDATA[<p><a class="IFL"  href="http://www.modsecurity.org/"><img src='http://z.askapache.com/uploads/2007/12/modsecurity.gif' alt='ModSecurity.com' /></a>Mod_Security rivals Mod_Rewrite in the amount of features it provides.  I decided to go ahead and post what I learned about it today, even though its tough to give away such awesome htaccess and apache tricks..  Learn how to control spam once and for all, conditionally log/deny/allow/redirect requests based on IP, username, etc..  Mod_Security is so fine!</p>]]></description>
			<content:encoded><![CDATA[<blockquote cite="http://www.modsecurity.org/documentation/modsecurity-apache/2.1.4/modsecurity2-apache-reference.html"><p><a class="IFL"  href="http://www.modsecurity.org/"><img src='http://z.askapache.com/uploads/2007/12/modsecurity.gif' alt='ModSecurity.com' /></a>.With over 70% of all attacks now carried out over the web application level, organizations need as much help as they can get in making their systems secure. WAFs are deployed to establish an external security layer that increases security, detects, and prevents attacks before they reach web applications.</p></blockquote>
<p class="ment"><a rel="prev" href="http://www.askapache.com/htaccess/apache-variable-fun-in-htaccess.html" title="Apache variables info, tricks, and tips">&laquo;  Apache Variable fun (mod_env)</a> | <a href="http://www.askapache.com/htaccess/apache-htaccess.html" class="acd1" rel="Contents Index Start" title=".htaccess tutorial">.htaccess Tutorial Index</a> | <a rel="next" href="http://www.askapache.com/htaccess/setenvif.html" title="SetEnvIf and SetEnvIfNoCase Examples for conditionally setting variables in Apache .htaccess">SetEnvIf and SetEnvIfNoCase Examples</a></p>
<hr />
<p><strong>Target Audience:</strong></p>
<ul>
<li>Web Server Administrators</li>
<li>Web security Adminis</li>
<li>Security consultants and other ballers.</li>
<li>Web Developers</li>
</ul>
<h2><a class="acd" href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#smack-down_attacks" name="smack-down_attacks" id="smack-down_attacks" title="Lay the smack down on attacks">Laying the smack down on attacks</a></h2>
<p><img class="IFR" src='http://z.askapache.com/uploads/2008/01/modsecurity.gif' alt='mod_Security sits in front of Apache' />ModSecurityâ„¢ is an Apache Module just like mod_rewrite that is in fact a Web Application Firewall, providing access to every tiny bit of a HTTP Connection. HTTP Headers, Cookie and Post Payloads in their entirety, XML-RPC calls from Ajax, protocol and connection information, etc&#8230; <strong>its totally stacked</strong>.</p>
<p>Mod_Security uses Regex and .htaccess / httpd.conf directives similar to <a href="http://www.askapache.com/htaccess/mod_rewrite-tips-and-tricks.html">mod_rewrite</a>, allowing for complete control from within <a href="http://www.askapache.com/htaccess/apache-htaccess.html">.htaccess files</a> and httpd.conf blocks.<br class="C" /></p>
<p><strong>Contents</strong></p>
<ul class="u4">
<li><a href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#smack-down_attacks">Laying the smack down on attacks</a></li>
<li><a href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#mod_security-mod_rewrite">mod_security + mod_rewrite</a></li>
<li><a href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#block-post-spam">Block Spam by examining POST form fields</a></li>
<li><a href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#enabling-mod_security">Enable mod_security - DreamHost</a></li>
<li><a href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#disable-mod_security">Disabling mod_security conditionally per IP</a></li>
<li><a href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#mod_security-authorization">Disabling mod_security with .htaccess Authorization</a>
<ul>
<li><a href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#password-bypass">Adding password protection for mod_security bypass</a></li>
<li><a href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#magic-auth-shutdown">Magic Authorization shut-off using .htaccess</a></li>
</ul>
</li>
<li><a href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#sample-mod_security">AskApache&#8217;s MOD_SECURITY config for DreamHost</a></li>
<li><a href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#block-wordpress-spam">Block WordPress Spam Forever!</a></li>
<li><a href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#pause-connections">Force Any Connections to be Paused a set number of ms</a></li>
<li><a href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#allow-request-methods">Only Allow Certain REQUEST_METHODS</a></li>
<li><a href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#mod_security-debugging">ModSecurity Debugging and Logging</a>
<ul>
<li><a href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#mod_sec-errorlog">Control mod_security logging to your error log</a></li>
</ul>
</li>
<li><a href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#conditional-logging">Turn Off/On Logging JUST for your IP Address</a></li>
<li><a href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#mod_security-directives">Mod_Security Directives for DreamHost</a></li>
<li><a href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#mod_security-curve">How I got Started with mod_sec</a></li>
<li><a href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#httpdconf-rules">Example httpd.conf mod_security rule files</a></li>
</ul>
<hr />
<h2><a class="acd" href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#mod_security-mod_rewrite" name="mod_security-mod_rewrite" id="mod_security-mod_rewrite" title="mod_security + mod_rewrite">mod_security + mod_rewrite</a></h2>
<p>mod_security is the missing piece if all you know is mod_rewrite.  This gives you the ability to scan ALL messages received by your website, including POST, Trackbacks, Pings, Ajax XMLHTTP calls, etc.  It lets you create your own rules so that you can stop spam and prevent web application, protocol, and server attacks.</p>
<p class="cnote">Mod_Security has the ability to parse entire POST_PAYLOADS, specific and individual POST/GET arguments&#8230; This is a spammers worst nightmare, and I&#8217;m going to make that nightmare reality for them.</p>
<h2><a class="acd" href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#block-post-spam" name="block-post-spam" id="block-post-spam" title="Block Spam by examining POST form fields">Block Spam by examining POST form fields</a></h2>
<p>mod_security gives you the option to block, redirect, handle using an errordocument, PAUSE, close, and chain connections.  If someone is spamming your blog from many different IP&#8217;s, but they often use the same keywords in a certain field of your form (like .blackjack. in the url field) mod_security lets you examine that specific url field and block all connections that contain the regexp pattern of your choice.</p>
<h2><a class="acd" href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#enabling-mod_security" name="enabling-mod_security" id="enabling-mod_security" title="Enable mod_security On DreamHost">Enable mod_security - DreamHost</a></h2>
<p>To enable mod_security, login to the DreamHost panel and navigate to the <a href="https://panel.dreamhost.com/index.cgi?tree=domain.manage">&#8220;Manage Domains&#8221;</a> area, Edit your site and enable the extra security option.</p>
<p><a rel="lb" href='http://z.askapache.com/uploads/2007/12/mod_security-step2.png' title='Mod_Security Step 2'><img src='http://z.askapache.com/uploads/2007/12/mod_security-step2.png' alt='Mod_Security Step 2' /></a></p>
<p><a href="http://www.dreamhost.com/">DreamHost</a>, has set itself apart as being the top web host IMHO. They&#8217;ve provided the option to enable an Apache module called <strong>mod_security</strong> for any of your hosted domains.  The sysops and tech over there are really doing a great job of staying true to the industry, they are web hosts, not some corporate outsourced bought-out thing.  Anyways thanks DH!</p>
<h2><a class="acd" href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#disable-mod_security" name="disable-mod_security" id="disable-mod_security" title="Disabling mod_security conditionally per IP">Disabling mod_security conditionally per IP</a></h2>
<p>This will make sure that you aren&#8217;t processed by mod_security, but this only works if you have a static IP (<a href="http://www.askapache.com/online-tools/whoami/">Get your IP information</a>). Just add this towards the top of your <a href="http://www.askapache.com/htaccess/apache-htaccess.html">.htaccess file</a>. before your mod_security code.  Setting this variable causes the module to be disabled for this specific IP address, this means you won&#8217;t run into any problems while posting yourself..</p>
<pre>
SetEnvIfNoCase Remote_Addr ^208\.113\.183\.103$ MODSEC_ENABLE=Off
&nbsp;
# You can use multiple SetEnvIf directives to control it further.&nbsp;&nbsp;
# This only turns it off for your IP + a POST request method.
#
# SetEnvIf Remote_Addr ^208\.113\.183\.103$ MODSEC_ENABLE=Off
# SetEnvIf Request_Method !^POST$ MODSEC_ENABLE=On
</pre>
<h2><a class="acd" href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#mod_security-authorization" name="mod_security-authorization" id="mod_security-authorization" title="Disabling mod_security with .htaccess Authorization">Disabling mod_security with .htaccess Authorization</a></h2>
<p>So I did some experimenting to see if there was an alternative way to disable mod_security for the users out there without a static IP address.  I found a couple silly solutions that suggested you simply modify your browsers User Agent request header, but thats not very safe is it?  No.  So I came up with using Basic Authorization.</p>
<p>First you need to setup password protection for the directory that you want mod_security disabled for. In the case of WordPress blogs, you can use the <a href="http://www.askapache.com/wordpress/htaccess-password-protect.html">AskApache Password Protect Plugin</a> to get setup.  Or you can <a href="http://www.askapache.com/online-tools/htpasswd-generator/">generate a new htpasswd</a>.</p>
<h3><a class="acd" href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#password-bypass" name="password-bypass" id="password-bypass" title=".htaccess password protection">Adding password protection for mod_security bypass</a></h3>
<pre>
AuthName &quot;htaccess password prompt&quot;
AuthType Basic
AuthUserFile /fullpath-to/.htpasswd
Require valid-user
</pre>
<h3><a class="acd" href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#magic-auth-shutdown" name="magic-auth-shutdown" id="magic-auth-shutdown" title="Authorization shut-off">Magic Authorization shut-off using .htaccess</a></h3>
<p>When you login using this authentication, the environment variables REMOTE_USER and AUTH_TYPE are set <em>(though its hard to find them)</em>.  Since these are unique to you specifically and hard to <strong>spoof</strong>, use them to turn off mod_security only after you login.  This is added up at the top of your mod_security rules.</p>
<pre>
SecFilterSelective REMOTE_USER &quot;^yourusername$&quot; &quot;allow&quot;
&nbsp;
# More variables you can experiment with
# HTTP_Authorization|AUTH_TYPE 
#
# You may have to add this to your mod_rewrite code
#RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</pre>
<h2><a class="acd" href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#sample-mod_security" name="sample-mod_security" id="sample-mod_security" title="AskApache's MOD_SECURITY config for DreamHost">AskApache&#8217;s MOD_SECURITY config for DreamHost</a></h2>
<h3>Custom mod_security .htaccess code</h3>
<p>Heres how I start my mod_security code, keep in mind I have a <strong>lot</strong> to learn.</p>
<pre>
### ASKAPACHE MOD_SECURITY ###
&lt;IfModule mod_security.c&gt;
# Turn the filtering engine On or Off or DynamicOnly for cgi/php/etc
SecFilterEngine On
&nbsp;
# Only log suspicious requests
SecAuditEngine RelevantOnly
&nbsp;
# Goes up to 9 but at 2 its overwhelming trust me
SecFilterDebugLevel 0
&nbsp;
# Make sure that URL encoding is valid
SecFilterCheckURLEncoding On
&nbsp;
# Unicode encoding check
SecFilterCheckUnicodeEncoding Off
&nbsp;
# Should mod_security inspect POST payloads
SecFilterScanPOST On
&nbsp;
# The default rule to apply to inherited rules
SecFilterDefaultAction &quot;deny,log,status:500&quot;
</pre>
<h3>Minimal httpd.conf or .htaccess sample from <a href="http://z.askapache.com/t/mod_sec-httpd.conf">source</a></h3>
<pre>
&lt;IfModule mod_security.c&gt;
&nbsp;
# Enable ModSecurity
SecFilterEngine On
&nbsp;
# Reject requests with status 403
SecFilterDefaultAction &quot;deny,log,status:403&quot;
&nbsp;
# Some sane defaults
SecFilterScanPOST On
SecFilterCheckURLEncoding On
SecFilterCheckUnicodeEncoding Off
&nbsp;
# Accept almost all byte values
SecFilterForceByteRange 1 255
&nbsp;
# Server masking is optional
# SecServerSignature &quot;Microsoft-IIS/5.0&quot;
&nbsp;
# Designate a directory for temporary files
# storage. It is a good idea to change the
# value below to a private directory, just as
# an additional measure against race conditions
SecUploadDir /tmp
SecUploadKeepFiles Off
&nbsp;
# Only record the interesting stuff
SecAuditEngine RelevantOnly
# Uncomment below to record responses with unusual statuses
# SecAuditLogRelevantStatus ^5
SecAuditLog logs/modsec_audit.log
&nbsp;
# You normally won&#039;t need debug logging
SecFilterDebugLevel 0
SecFilterDebugLog logs/modsec_debug.log
&nbsp;
# Only accept request encodings we know how to handle
# we exclude GET requests from this because some (automated)
# clients supply &quot;text/html&quot; as Content-Type
SecFilterSelective REQUEST_METHOD &quot;!^(GET|HEAD)$&quot; chain
SecFilterSelective HTTP_Content-Type &quot;!(^application/x-www-form-urlencoded$|^multipart/form-data;)&quot;
&nbsp;
# Do not accept GET or HEAD requests with bodies
SecFilterSelective REQUEST_METHOD &quot;^(GET|HEAD)$&quot; chain
SecFilterSelective HTTP_Content-Length &quot;!^$&quot;
&nbsp;
# Require Content-Length to be provided with
# every POST request
SecFilterSelective REQUEST_METHOD &quot;^POST$&quot; chain
SecFilterSelective HTTP_Content-Length &quot;^$&quot;
&nbsp;
# Don&#039;t accept transfer encodings we know we don&#039;t handle
SecFilterSelective HTTP_Transfer-Encoding &quot;!^$&quot;
&nbsp;
&lt;/IfModule&gt;
</pre>
<h2><a class="acd" href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#block-wordpress-spam" name="block-wordpress-spam" id="block-wordpress-spam" title="Block WordPress Spam Forever!">Block WordPress Spam Forever!</a></h2>
<p>Ok this is my first attempt at this, and I am really excited about the possibilities!  This example goes inside your mod_security block towards the bottom, and it sets up a default action for each of the filters below it.  This denies the connection, doesn&#8217;t log it, and issues a <a href="http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html#status-403">403 Forbidden</a> Status code, which causes my Apache ErrorDocument to be displayed.  This ErrorDocument can be a blank page to minimize bandwidth, or it can be a cgi perl type of script that send you an email, whatever.  Many people use different Status Codes for different situations, some like 400, 412, 406, and 410 for spammers.  Others prefer 503.  You can see all 57 that are available for anyone running Apache and <a href="http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html#status-403">choose your own</a>.</p>
<pre>
&lt;FilesMatch &quot;wp-comments-post\.php$&quot;&gt;
SecFilterSignatureAction deny,nolog,status:403
SecFilterSelective ARG_url &quot;casino|ringtone|lyrics&quot;
SecFilterSelective ARG_comment_post_ID &quot;^$&quot;
&nbsp;
# reject blog spam from all POST and GET fields
SecFilterSelective ARGS &quot;blockspam|blockspam|blockspam|blockspam|blockspam|blockspam|blockspam|blockspam \
blockspam|blockspam|blockspam|blockspam|blockspam|blockspam|blockspam|blockspam|blockspam|blockspam \
nomorespam|nospam&quot;
&lt;/FilesMatch&gt;
</pre>
<ul>
<li>The <a href="http://www.askapache.com/htaccess/using-filesmatch-and-files-in-htaccess.html">FilesMatch Directive</a> specifies that these rules only apply to these files.</li>
<li>The <code>ARG_url</code> line says that if those words appear in the form field with the <code>id/name</code> of <code>&quot;url&quot;</code>, than deny them.</li>
<li>The <code>ARG_comment_post_ID</code> line denies requests that have an empty <code>comment_post_ID</code> field, which a surprisingly large number of spammers forget to add.</li>
<li>The final multi-line section searches ALL get and post items for any of these keywords.</li>
</ul>
<h2><a class="acd" href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#pause-connections" name="pause-connections" id="pause-connections" title="Force Any Connections to be Paused a set number of ms">Force Any Connections to be Paused a set number of ms</a></h2>
<p>This is just an example to show you how cool this module is, you really shouldn&#8217;t every do this except for very specific instances, because it will end up consuming your servers resources and making a ddos attack more likely.  This example forces anyone who doesn&#8217;t come from the askapache.com site to have their connection delayed 5000 ms, then processing continues.</p>
<pre>
SecFilterSelective &quot;HTTP_REFERER&quot; &quot;askapache\.com&quot; log,pass,pause:5000
</pre>
<h2><a class="acd" href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#allow-request-methods" name="allow-request-methods" id="allow-request-methods" title="Only Allow Certain REQUEST_METHODS">Only Allow Certain REQUEST_METHODS</a></h2>
<p>I&#8217;ve created a <a href="http://www.askapache.com/online-tools/request-method-scanner/">free online scanner</a> that you can use to scan your site and see how it handles all 27 <a href="http://www.askapache.com/htaccess/27-request-methods-for-use-with-apache-and-rewritecond-and-htaccess.html">REQUEST_METHODS</a>.</p>
<pre>
# Sends matching requests a 405 Method Not Allowed Status Code
SecFilterSelective REQUEST_METHOD &quot;!^(GET|HEAD|POST|OPTIONS)$&quot; &quot;deny,auditlog,status:405&quot;
</pre>
<h2><a class="acd" href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#mod_security-debugging" name="mod_security-debugging" id="mod_security-debugging" title="Debugging and Logging">Debugging and Logging</a></h2>
<p>First its my best guess that DreamHost is running <strong>ModSecurity v1.9.4</strong> so its pretty darn difficult to find information about this modules directives and how to use it.  So debugging through the use of trial and error and logging is the best or only way to figure it out.</p>
<p><strong>On DreamHost we lucked out</strong></p>
<p>If you have already been using DreamHosts &#8220;extra security&#8221; option and use your shell or check your error logs, you will have seen plenty of verbose messages about something or other being blocked.  Thats mod_security doing its thing but it takes up resources on everyones servers and makes your error log close to unusable.</p>
<h3><a class="acd" href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#mod_sec-errorlog" name="mod_sec-errorlog" id="mod_sec-errorlog" title="Control mod_security logging to your error log">Control mod_security logging to your error log</a></h3>
<p>Each filter can have its own actions, so turn logging on (<code>log</code>, <code>auditlog</code>) only for those you want, turn off (<code>nolog</code>, <code>noauditlog</code>) for anything else.</p>
<pre>
# Not logged
SecFilterDefaultAction &quot;deny,nolog,noauditlog,status:500&quot;
&nbsp;
# Logged but not as verbose.
SecFilterDefaultAction &quot;deny,nolog,auditlog,status:500&quot;
</pre>
<dl>
<dt>log</dt>
<dd>Indicates that a successful match of the rule needs to be logged.</dd>
<dt>noauditlog</dt>
<dd>Indicates that a successful match of the rule should not be used as criteria whether the transaction should be logged to the audit log.</dd>
<dt>nolog</dt>
<dd>Prevents rule matches from appearing in both the error and audit logs.</dd>
</dl>
<h2><a class="acd" href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#conditional-logging" name="conditional-logging" id="conditional-logging" title="Turn Off/On Logging JUST for your IP Address">Turn Off/On Logging JUST for your IP Address</a></h2>
<p>This is handy when you want to test your rules.</p>
<pre>
# Turn logging of for your IP
SecFilterSelective REMOTE_ADDR &quot;208\.113\.183\.103&quot; &quot;nolog,noauditlog,pass&quot;
&nbsp;
# Turn logging on just for your IP
SecFilterSelective REMOTE_ADDR &quot;!^208\.113\.183\.103&quot; &quot;nolog,noauditlog,pass&quot;
SecFilterSelective REMOTE_ADDR &quot;208\.113\.183\.103&quot; &quot;log,auditlog,pass&quot;
</pre>
<h2><a class="acd" href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#mod_security-directives" name="mod_security-directives" id="mod_security-directives" title="Mod_Security Directives for DreamHost">Mod_Security Directives for DreamHost</a></h2>
<dl>
<dt>SecFilter</dt>
<dd>The filtering expression</dd>
<dt>SecFilterDebugLog</dt>
<dd>The filename of the filter debugging log file</dd>
<dt>SecFilterDebugLevel</dt>
<dd>The level of the debugging log file verbosity</dd>
<dt>SecFilterSelective</dt>
<dd>The variable representing areas where filtering is wanted, the filtering regular expression and optional action to take on match</dd>
<dt>SecFilterEngine</dt>
<dd>On, Off, or DynamicOnly to determine when will request be filtered</dd>
<dt>SecServerResponseToken</dt>
<dd>On or Off to set whether the mod_security token will appear in the server signature</dd>
<dt>SecFilterScanPOST</dt>
<dd>On or Off to set whether a request body will be processed</dd>
<dt>SecFilterDefaultAction</dt>
<dd>The default action to take on rule match</dd>
<dt>SecFilterSignatureAction</dt>
<dd>Base action template for signatures that follow this directive</dd>
<dt>SecFilterInheritance</dt>
<dd>On or Off to set whether rules from the parent context will be inherited</dd>
<dt>SecAuditEngine</dt>
<dd>On, Off, RelevantOnly or DynamicOrRelevent to determine the level of audit logging</dd>
<dt>SecAuditLog</dt>
<dd>The filename of the audit log file</dd>
<dt>SecUploadDir</dt>
<dd>The path to the directory where uploaded files should be stored</dd>
<dt>SecUploadKeepFiles</dt>
<dd>On or Off to choose whether to keep the uploaded files or not</dd>
<dt>SecUploadApproveScript</dt>
<dd>The path to the script that will be called to approve every uploaded file</dd>
<dt>SecFilterCheckURLEncoding</dt>
<dd>On or Off to set whether URL encoding validation will be performed</dd>
<dt>SecFilterCheckUnicodeEncoding</dt>
<dd>On or Off to set whether Unicode encoding validation will be performed</dd>
<dt>SecFilterForceByteRange</dt>
<dd>The first and the last byte value of the range that will be accepted</dd>
<dt>SecChrootDir</dt>
<dd>The path of the directory to which server will be chrooted</dd>
<dt>SecChrootLock</dt>
<dd>The filename of the lock file used during the chroot process, defaults to &#8220;logs/modsec_chroot.lock&#8221;</dd>
<dt>SecServerSignature</dt>
<dd>The new signature of the server</dd>
<dt>SecFilterNormalizeCookies</dt>
<dd>On or Off to determine whether cookie values will be normalized for testing, defaults to On</dd>
<dt>SecFilterCheckCookieFormat</dt>
<dd>On or Off to determine whether cookie format will be checked. Defaults to On</dd>
<dt>SecFilterCookieFormat</dt>
<dd>version of the Cookie specification to use for parsing. Possible values are 0 and 1.</dd>
<dt>SecCharset</dt>
<dd>Configures the charset</dd>
<dt>SecFilterImport</dt>
<dd>imports a rule from the parent configuration context.</dd>
<dt>SecFilterRemove</dt>
<dd>removes a rule that was inherited from the parent configuration context.</dd>
<dt>SecFilterInheritanceMandatory</dt>
<dd>when this directive is set to On then the rules in the parent context cannot be removed from a child context.</dd>
<dt>SecAuditLogType</dt>
<dd>whether to use the old audit log format (Serial) or new (Concurrent)</dd>
<dt>SecAuditLogStorageDir</dt>
<dd>path to the audit log storage area; absolute, or relative to the root of the server</dd>
<dt>SecAuditLogParts</dt>
<dd>list of audit log parts that go into the log.</dd>
<dt>SecAuditLogRelevantStatus</dt>
<dd>regular expression that will be used to determine if the response status is relevant for audit logging</dd>
<dt>SecFilterActionsRestricted</dt>
<dd>whether to allow rules to override SecFiltersDefaultAction configuration</dd>
</dl>
<p class="bnote">Just remember each version is different, I think most of the directives in the above list are allowed on DreamHosts install, but I&#8217;m not 100%, I&#8217;m sure they&#8217;ll be upgrading soon anyway.</p>
<h2><a class="acd" href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#mod_security-curve" name="mod_security-curve" id="mod_security-curve" title="How I got Started with mod_sec">How I got Started with mod_sec</a></h2>
<blockquote><p><strong>Subject: mod_security denying blog post</strong></p>
<p>Is there any way you could modify the mod_security rules for me? For the past 2-4 months I have been having a problem on WordPress where I go to edit a post and when I hit submit and POST the changes it gives me a 503 Message, which is odd to use a <em>503 Service Temporarily Unavailable</em>, that threw me off for at a month thinking the service was unavailable.</p>
<p>Basically this only happens to about 5 of my posts, and almost all of them have something to do with php code, or some other type of programming language. An example is when I try to edit <a href="http://www.askapache.com/php/custom-phpini-tips-and-tricks.html">custom-phpini-tips-and-tricks</a>.  So what I&#8217;ve had to do is go into phpmyadmin and <em>manually edit the database</em>.. I don&#8217;t want to <em>turn off the mod_security</em> for my site because I am getting hit all the time by malicious looking bots, is that the only way around this? I have no clue, but if it helps that IP 64.233.167.99 is static for me, and this problem only occurs when posting to the <code>/wp-admin/post.php</code> file.</p>
<blockquote><p><strong>Reply from DreamHost Support</strong><br />
Unfortunately, the mod_security rules need to be changed on all machines and Apache instances if they are changed on just one as our admins like to keep the servers in sync. So getting mod_security modified isn&#8217;t really something that can be done easily. I&#8217;ll put in a suggestion as we do host a lot of WordPress blogs, but I can&#8217;t guarantee that we&#8217;ll be able to do it very quickly.</p>
<p>I know you don&#8217;t want to turn mod_security off, but honestly it&#8217;s your best bet if you want to be able to post without 503&#8217;s right now. If &#8220;64.233.167.99&#8243; is always your IP, might I suggest setting up an .htaccess rule in your wp-admin folder to deny all traffic to that folder except for your IP address? I know that doesn&#8217;t work if you&#8217;re on the road - although adding IPs to allow to an .htaccess file is pretty easy to do - but it will keep the malicious folks out.</p></blockquote>
</blockquote>
<h2><a class="acd" href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html#httpdconf-rules" name="httpdconf-rules" id="httpdconf-rules" title="Example httpd.conf mod_security rules">Example httpd.conf mod_security rules</a></h2>
<ul class="files">
<li><a href="http://z.askapache.com/t/mod_sec-httpd.conf">mod_sec-httpd.conf</a></li>
<li><a href="http://www.gotroot.com/mod_security+rules">got_root example rules for httpd.conf</a></li>
<li><a href="http://z.askapache.com/httpd/modules/modsecurity-apache_2.1.4/">Parent Directory</a></li>
<li><a href="http://z.askapache.com/httpd/modules/modsecurity-apache_2.1.4/rules/modsecurity_crs_21_protocol_anomalies.conf" title="modsecurity_crs_21_protocol_anomalies.conf">modsecurity_crs_21_protocol_anomalies.conf</a></li>
<li><a href="http://z.askapache.com/httpd/modules/modsecurity-apache_2.1.4/rules/modsecurity_crs_20_protocol_violations.conf" title="modsecurity_crs_20_protocol_violations.conf">modsecurity_crs_20_protocol_violations.conf</a></li>
<li><a href="http://z.askapache.com/httpd/modules/modsecurity-apache_2.1.4/rules/README" title="README">README</a></li>
<li><a href="http://z.askapache.com/httpd/modules/modsecurity-apache_2.1.4/rules/modsecurity_crs_45_trojans.conf" title="modsecurity_crs_45_trojans.conf">modsecurity_crs_45_trojans.conf</a></li>
<li><a href="http://z.askapache.com/httpd/modules/modsecurity-apache_2.1.4/rules/modsecurity_crs_35_bad_robots.conf" title="modsecurity_crs_35_bad_robots.conf">modsecurity_crs_35_bad_robots.conf</a></li>
<li><a href="http://z.askapache.com/httpd/modules/modsecurity-apache_2.1.4/rules/modsecurity_crs_10_config.conf" title="modsecurity_crs_10_config.conf">modsecurity_crs_10_config.conf</a></li>
<li><a href="http://z.askapache.com/httpd/modules/modsecurity-apache_2.1.4/rules/modsecurity_crs_50_outbound.conf" title="modsecurity_crs_50_outbound.conf">modsecurity_crs_50_outbound.conf</a></li>
</ul>
<p>Some of the attacks this Apache module has the ability to smack with its unique positioning within Apache HTTP.</p>
<ol>
<li><strong>HTTP protection</strong> - detecting violations of the HTTP protocol and a locally defined usage policy
<ul>
<li>SQL Injection</li>
<li>Cross-Site Scripting (XSS)</li>
<li>OS Command execution</li>
<li>Remote code inclusion</li>
<li>LDAP Injection</li>
<li>SSI Injection</li>
<li>Information leak</li>
<li>Buffer overflows</li>
<li>File disclosure</li>
</ul>
</li>
<li><strong>Common Web Attacks Protection</strong> - detecting common web application security attack</li>
<li><strong>Automation detection</strong> - Detecting bots, crawlers, scanners and other surface malicious activity</li>
<li><strong>Trojan Protection</strong> - Detecting access to Trojans horses</li>
<li><strong>Errors Hiding</strong> - Disguising error messages sent by the server</li>
</ol>
<p><strong>mod_security links</strong></p>
<ol>
<li><a href="http://z.askapache.com/httpd/mod_security/doc/modsecurity-manual.html">DreamHost Version 1.9.5 Manual</a></li>
<li><a href="http://www.modsecurity.org/documentation/modsecurity-apache/2.1.4/modsecurity2-apache-reference.html">Reference of Actions, Commands, etc.</a> - Official Site</li>
<li><a href="http://www.gotroot.com/mod_security+rules">version 1.9 got_root rules</a></li>
<li><a href="http://sourceforge.net/mailarchive/forum.php?forum_name=mod-security-users">mod-security-users</a> - mailing list</li>
<li><a href="http://noeljackson.com/tools/modsecurity/">mod_security online rules generator</a> - Noel Jackson</li>
<li><a href="http://atomicplayboy.net/blog/2005/01/30/an-introduction-to-mod-security/">An Intro to mod_security</a> - Atomic Playboy</li>
<li><a href="http://www.modsecurity.org/training/index.html">Get mod_sec training</a></li>
</ol>
<p class="anote"><strong>MOD_SECURITY</strong>: The Most Powerful Server-Side Security Technology I&#8217;ve Seen</p>
<hr />
<h2>htaccess Guide Sections</h2>
<ul class="ou">
<li><a rel="chapter bookmark" href="http://www.askapache.com/htaccess/htaccess-for-webmasters.html" title="Apache HTTP Web Server htaccess tips and tricks">htaccess tricks for Webmasters</a></li>
<li><a rel="chapter bookmark" href="http://www.askapache.com/htaccess/using-http-headers-with-htaccess.html" title="Creating and using HTTP Headers with htaccess">HTTP Header control with htaccess</a></li>
<li><a rel="chapter bookmark" href="http://www.askapache.com/htaccess/php-htaccess-tips-and-tricks.html" title="mod_php or php as a cgi with htaccess tips, htaccess php tricks">PHP on Apache tips and tricks</a></li>
<li><a rel="chapter bookmark" href="http://www.askapache.com/htaccess/seo-search-engine-friendly-redirects-without-mod_rewrite.html" title="SEO-Friendly 301 Redirects without mod_rewrite">SEO Redirects without mod_rewrite</a></li>
<li><a rel="chapter bookmark" href="http://www.askapache.com/htaccess/mod_rewrite-tips-and-tricks.html" title="mod_rewrite tips and tricks with RewriteEngine, RewriteBase, RewriteRule, and RewriteCond">mod_rewrite examples, tips, and tricks</a></li>
<li><a rel="chapter bookmark" href="http://www.askapache.com/htaccess/speed-up-your-site-with-caching-and-cache-control.html" title="Caching, cache-control, cache, expires, and optimizing htaccess">HTTP Caching and Site Speedups</a></li>
<li><a rel="chapter bookmark" href="http://www.askapache.com/htaccess/apache-authentication-in-htaccess.html" title="htaccess and Apache authentication with htpasswd, 401, and 403">Authentication on Apache</a></li>
<li><a rel="chapter bookmark" href="http://www.askapache.com/htaccess/security-with-apache-htaccess.html" title="Security, hacking, and anti-hacking tips and tricks for htaccess">htaccess Security Tricks and Tips</a></li>
<li><a rel="chapter bookmark" href="http://www.askapache.com/htaccess/ssl-example-usage-in-htaccess.html" title="Apache SSL examples">SSL tips and examples</a></li>
<li><a rel="chapter bookmark" href="http://www.askapache.com/htaccess/apache-variable-fun-in-htaccess.html" title="Apache variables info, tricks, and tips">Variable Fun (mod_env) Section</a></li>
<li><a rel="chapter bookmark" href="http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html" title="mod_security Guide and sample mod_Security diretive usage in .htaccess">.htaccess Security with MOD_SECURITY</a></li>
<li><a rel="chapter bookmark" href="http://www.askapache.com/htaccess/setenvif.html" title="SetEnvIf and SetEnvIfNoCase Examples for conditionally setting variables in Apache .htaccess">SetEnvIf and SetEnvIfNoCase Examples</a></li>
</ul>
<p class="ment"><a rel="prev" href="http://www.askapache.com/htaccess/apache-variable-fun-in-htaccess.html" title="Apache variables info, tricks, and tips">&laquo;  Apache Variable fun (mod_env)</a> | <a href="http://www.askapache.com/htaccess/apache-htaccess.html" class="acd1" rel="Contents Index Start" title=".htaccess tutorial">.htaccess Tutorial Index</a> | <a rel="next" href="http://www.askapache.com/htaccess/setenvif.html" title="SetEnvIf and SetEnvIfNoCase Examples for conditionally setting variables in Apache .htaccess">SetEnvIf and SetEnvIfNoCase Examples</a></p>
<hr />
<h3>Random Posts</h3>
<ul class="related_post">
<li><a href="http://www.askapache.com/htaccess/mod_rewrite-tips-and-tricks.html" title="Mod_rewrite Tips and Tricks">Mod_rewrite Tips and Tricks</a></li>
<li><a href="http://www.askapache.com/htaccess/preload-and-cache-flash-flv-files.html" title="Preload flash .flv files into browser cache">Preload flash .flv files into browser cache</a></li>
<li><a href="http://www.askapache.com/htaccess/using-http-headers-with-htaccess.html" title="Manipulating HTTP Headers with htaccess">Manipulating HTTP Headers with htaccess</a></li>
<li><a href="http://www.askapache.com/tools/lft-traceroute-tool.html" title="LFT traceroute tool">LFT traceroute tool</a></li>
<li><a href="http://www.askapache.com/tools/wget-header-trick.html" title="Wget Trick to Download from Restrictive Sites">Wget Trick to Download from Restrictive Sites</a></li>
<li><a href="http://www.askapache.com/security/arp-stuff.html" title="Arp Packet Hacking ">Arp Packet Hacking </a></li>
<li><a href="http://www.askapache.com/htaccess/apache-ssl-in-htaccess-examples.html" title="Apache SSL in htaccess examples">Apache SSL in htaccess examples</a></li>
<li><a href="http://www.askapache.com/seo/tip-google-analytics-404-error-page.html" title="Advanced Google Analytics 404 Error Page">Advanced Google Analytics 404 Error Page</a></li>
<li><a href="http://www.askapache.com/dreamhost/php5-custom-install.html" title="PHP5 Custom Install Shell Script Example">PHP5 Custom Install Shell Script Example</a></li>
<li><a href="http://www.askapache.com/web-cache/top-methods-for-faster-speedier-web-sites.html" title="Top methods for Faster, Speedier web sites">Top methods for Faster, Speedier web sites</a></li>
</ul>
<p class="rnote"><a href="http://www.askapache.com/search/mod_security/" rel="tag">mod_security</a> <a href="http://www.askapache.com/search/-htaccess/" rel="tag">-htaccess</a> <a href="http://www.askapache.com/search/-MODSEC/" rel="tag">-MODSEC</a> <a href="http://www.askapache.com/search/-SetEnvIf/" rel="tag">-SetEnvIf</a> <a href="http://www.askapache.com/search/-SecFilter/" rel="tag">-SecFilter</a> <a href="http://www.askapache.com/search/-SecAudit/" rel="tag">-SecAudit</a></p>
<p><a href="http://feeds.askapache.com/~a/apache/htaccess?a=Fp1zrT"><img src="http://feeds.askapache.com/~a/apache/htaccess?i=Fp1zrT" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.askapache.com/~f/apache/htaccess?a=ntCk66c"><img src="http://feeds.askapache.com/~f/apache/htaccess?i=ntCk66c" border="0"></img></a> <a href="http://feeds.askapache.com/~f/apache/htaccess?a=oDO50cc"><img src="http://feeds.askapache.com/~f/apache/htaccess?i=oDO50cc" border="0"></img></a> <a href="http://feeds.askapache.com/~f/apache/htaccess?a=AG1fQac"><img src="http://feeds.askapache.com/~f/apache/htaccess?i=AG1fQac" border="0"></img></a> <a href="http://feeds.askapache.com/~f/apache/htaccess?a=iHT7s6C"><img src="http://feeds.askapache.com/~f/apache/htaccess?i=iHT7s6C" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.askapache.com/htaccess/mod_security-htaccess-tricks.html</feedburner:origLink></item>
		<item>
		<title>Undetectable Sniffing On Ethernet</title>
		<link>http://feeds.askapache.com/~r/apache/htaccess/~3/119374549/sniffing-on-ethernet-undetected.html</link>
		<comments>http://www.askapache.com/security/sniffing-on-ethernet-undetected.html#comments</comments>
		<pubDate>Mon, 14 Apr 2008 18:04:09 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
		
		<category><![CDATA[Hacking]]></category>

		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.askapache.com/?p=556</guid>
		<description><![CDATA[<p><a class="IFL" rel="lb" href='http://z.askapache.com/uploads/2008/04/sniffing_ethernet.jpg'><img src="http://z.askapache.com/uploads/2008/04/sniffing_ethernet-150x150.jpg" alt="Invisible Undetected Sniffing on an Ethernet Network" title="Invisible Undetected Sniffing on an Ethernet Network" /></a><strong>I have been in some tight spots where I had to sniff</strong> a password or two off the wire, or sniff some packets off the wire and based on the packets content perform some action... Accidentally, I stumbled on a method to sniff data while remaining undetected and invisible.<br class="C" /></p>]]></description>
			<content:encoded><![CDATA[<p><a class="IFL" rel="lb" href='http://z.askapache.com/uploads/2008/04/sniffing_ethernet.jpg'><img src="http://z.askapache.com/uploads/2008/04/sniffing_ethernet-150x150.jpg" alt="Undetectable Sniffing, Invisible Data Capture On Ethernet" title="Undetectable Sniffing, Invisible Data Capture On Ethernet" /></a><strong>This article is NOT about promisc network interfaces, it is about passively sniffing data off the wire without sending/transmitting any data out onto the wire.</strong>  No transmitting, just receiving.  I have been in some tight spots where I had to sniff data off the wire, like a password or username, or capture some packets off the wire and programmatically preform actions based on the captured packets.<br class="C" /></p>
<p>Unexpectedly, I stumbled on a method to passively capture packets from the wire without transmitting packets.  This is surprising because it is achieved using only software and not messing with the hardware, which is the normal way to passively sniff packets.  I&#8217;ve only achieved this running various flavors of linux and BSD.</p>
<p class="anote"><strong>Note:  </strong>  You may be looking for <a href="http://wiki.wireshark.org/CaptureSetup/Ethernet">ethernet capture implementations</a> using the best open source network debugging tool ever created, <a href="http://wireshark.askapache.com/" title="An Official U.S. Mirror for WireShark.org">WireShark</a></p>
<h2>Commands to become undetectable on linux/BSD</h2>
<h3>Bring up the ethernet interface with no IP address and arp ignore mode (stealth mode).</h3>
<pre>
$ ifconfig eth0 hw ether 00:00:00:00:00:00 promisc
$ ifconfig eth0 -arp up
</pre>
<h3>Delete the inet and inet6 address, prevent stack routing.</h3>
<pre>
$ route -nv // should produce nothing, same with netstat -r
</pre>
<h3>what does this do?</h3>
<ol>
<li>You can&#8217;t route packets to an interface without an entry in the routing table.</li>
<li>You can&#8217;t create an entry in the routing table without an IP address assigned to the interface.</li>
</ol>
<h2>Packet Capture Software</h2>
<p>Capture all the packets that pass the wire using <a href="http://www.wireshark.org">Wireshark</a>, the ONLY packet capturing tool I recommend.</p>
<p>I also like using <strong>tethereal</strong> in a shell script and <strong>egrep</strong> the output for something I&#8217;m looking for:</p>
<ul>
<li>a basic authorization string</li>
<li>a certain bootfile being called using tftp</li>
<li>spanning trees and switch communication</li>
<li>etc.</li>
</ul>
<p>Then based on the output I&#8217;ll have the shell script perform an action like append to a file or send me a text message to my cell.  This could be called an inefficient or sloppy way to do this, but it works great when I&#8217;m booting from knoppix or I just need to grab some packets silently.</p>
<h2>Caveats and Notes</h2>
<p>I did notice that after I had received 490MB of data on my eth0 device, it actually did say that it had Transmitted 12<strong>bytes</strong>.. so this method is not 100% silent, but without a route or an address it can&#8217;t really write data anywhere, so I&#8217;m still wondering where those 12bytes went.</p>
<p>I suppose you could create a dummy device in a chroot or something and pass the output from your promisc NIC to the dummy which would route the packets along a GRE or a wireless device or something. I will try something like this for a syslog server.</p>
<p class="cnote"><strong>NOTE:</strong> You should also check out the <a href="http://www.askapache.com/security/arp-stuff.html">Arp stuff</a> article for more in-depth info about this topic.</p>
<h2>Q&amp;A: from a forum discussion</h2>
<blockquote><p>i&#8217;m not that familar with linux, so i don&#8217;t know if you corrected this with one of these commands, but aren&#8217;t there many tools that simply check if the ethernet interface is in promisc. mode? so what&#8217;s undetected about this?</p>
</blockquote>
<p>Those tools are very easily circumvented. The reason is that they rely on set patterns of behaviour that are common to programs like nmap, ettercap, etc.. This method circumvents every single one of them. Most of those progs rely on sending arbitrary data across the wire and looking for set patterns of replies that indicate a promisc eth. The simple thing about this method is that you are basically stripping the IP stack of its fallback or default settings.</p>
<p>If you understand the definition of promisc mode, and understand how the IP stack in all major OS&#8217;s use routeing, arp, MACs, and basic TCP/IP 101, the concept doesn&#8217;t seem special.</p>
<p>The key is really that the listening promisc interface has no address, has no routes to any networks or hosts. An ip stack set up this way is not a like a listening service. Its more like a logging host in a honeynet with the TX wires cut off.</p>
<blockquote><p>Something about passive sniffing: <a href="http://www.ethereal.com/lists/ethereal-users/200305/msg00114.html">etheral mailing list</a></p>
<p>If you sniff passive you dont send any data frames?  All i know is that a switch only send data based on mac address (and recv port). Where a hub just sends it out to everyone. So how would you start sniffing (on a switch) without doing smth like arp poising (sending data frames)? Also, your MAC and ip gets sent out every x seconds by ARP requests right?  Or did i misunderstood the question?</p>
<p><code>00:00:00:00:00:00</code> - this is not an invalid mac address? Are you sure you can sniff other computers with this configuration? (diferents computers like yours)</p>
</blockquote>
<p>You definately could NOT use this method to use an active sniffing program like ettercap or perform an mitm or something, the whole goal of this method is to NOT transmit a single byte.</p>
<p>The reason you set the mac to <code>00:00:00:00:00:00</code> is the same reason you could also set the mac to <code>aa:bb:cc:dd:ee:ff</code> there are a lot of UPnP devices and other types of devices out there that use this mac address as a form of default. The point is just to change your mac to anything other than your real mac so that an IDS or system admin doesn&#8217;t see you. Thus, undetected sniffing.</p>
<p>If an admin or IDS saw 12 packets (as in my example) originating from <code>00:00:00:00:00:00</code> or <code>aa:bb:cc:dd:ee:ff</code> do you think he would pull out all the stops and think there is someone eavedropping? Of course not.</p>
<p>And yes, I have used this method on knoppix, archlinux, slackware, and FreeBSD. Of course, the differences in ifconfig in different distros need to be taken into account, and you can figure it out for yourself on your own distro by checking out your ifconfig man page.</p>
<pre>man -a ifconfig</pre>
<blockquote><p>i would suggest plugging off pathc cord just before and do like that</p>
<pre>
ifconfig eth0 down
#UNPLUG CORD
ifconfig eth0 hw ether AA:BB:CC:DD:EE:FF
ifconfig eth0 &lt;IP&gt;
#PLUG IN CORD
ifconfig eth0 up
</pre>
<p>and then try to look for outgoing packets.  Check for promisc:  <code>ifconfig</code></p>
<p>I would also suggest filling up switchs memory to make it act like a regural HUB so u will be able to sniff with normal oldstyle IP sniffers.  You can sniff over switch by filling up its temporary MAC addr table.  Then switch to work correctly <em>(from its view its just overload)</em> has to send data to every port just like HUB , and then u r at home. Also check out <strong>passive network scanning software</strong>:  p0f by Lcamtuff, check it out</p>
</blockquote>
<p>I haven&#8217;t used p0f for about 6 years.. When I used it was just a passive way to detect the OS/versions of a host. It was still pretty beta back then though.</p>
<p>Yes I have overloaded several switches CAM tables adn turned it into &#8220;HUB&#8221; operating mode.. But man is that ever loud! The ISP called me up and asked me if I knew anything about 2 GIGs of data being sent out from my port on the switch.. (layer 2) ..</p>
<p>Really the best way In my experience is arp poisoning. Ettercap has the basics included in their program. I have also had the experience of literally shutting down a switch from flooding the CAM.. you never really know what will happen. It&#8217;s usually not in your favor.</p>
<p>Also, if you start arp poisoning RIGHT after a power-outage (whether you shut off the power or it just went out) a lot of times you have a 15-45 second window where the switches will be acting like HUBs.. If you can poison some key targets in different network segments before the switch starts switching, you can really drop the normal restrictions.</p>
<p>Oh and you can also turn off your arp using ifconfig.</p>
<pre>$ ifconfig eth0 -arp</pre>
<p>But When you use the method outlined above, of course your NIC never sends out arp requests.. That is the whole point of NOT having an ipv6 or ip address.. and that is also why this method dictates NO ROUTES in the kernel or userland.  Your NIC and ip stack just doesn&#8217;t have any body to send the arps to! If you aren&#8217;t connected to any networks, how can it send a broadcast? And if you don&#8217;t have an IP address, where would the arp tell everyone to reply to? See what I mean?</p>
<p>The MAC address being set to a non-suspicious looking address is just to slip by as a network anomololy instead of actually looking like a roque MAC.</p>
<p>In general though, I was talking about using this technique to splice into the wire at an uplink spot.  So If I wanted to capture the router passwords for my apartment complex, I would find the router and use a portable hub to connect my packet-sniffing computer in-between the router and the modem or uplink. Then I would call tech-support about something and watch them log into the router.. then I have the password and its almost detectionless because it is completely passive.</p>
<p>I would say that my absolute favorite tool for <strong>hacking switches</strong> (we are basically just talking about layer-2&#8217;s) is hping. I also like nc, socat, vconfig, and dsniff was always fun but its really out of date now, ettercap is probably the king of automated switch hacking, its just not as much fun automated..</p>
<p>I&#8217;m sure you are also aware of the fun you can have with port-stealing. This is where you actually make the switch believe that you are coming in from a different port. Its pretty simple but a little harder than arp-poisoning. Most of my experience comes from circumventing vlans and hacking my way into switches on differnet network segments and on differnent vlans. Man talk about off-topic!</p>
<blockquote><p>Now I got ur point, sorry I ,misunderstood at first totaly agree that ettercap is king nowadays and is most up to date. Anyways , I was always thinking in a little different way, I mean something  like &#8220;fog cover&#8221;.  IMO its better to spoof MAC and act as other regular user instead run all loud and silent techniques.<br />
But your idea is very interesing.</p>
<p>Anywayz i think that there will be always something sent to the wire.  As a first example that comes to my mind is link speed detection with NLP and FLP.</p>
</blockquote>
<p>Thanks but its not an idea.. its a field-tested technique. Also, in my humble opinion, spoofing another host on the network is for newbies, unless you don&#8217;t mean just spoofing their MAC and IP. Because that is a really fast way to get caught where I come from. And it only takes 1 single command from a nix.  Yes when I first started hacking into switches I was also operating under the assumption that if I spoofed a MAC address and mimicked an allowed machine that was somehow a good thing.  First thing I realized was that before I could pretend to be a machine, I had to take that machine offline. If you are lucky and its running windows, that is no problem, you can run any number of techniques against a windows box and take it down.  Of course, taking down a host, whether by exploits or DoS is an entirely differnet topic, and I won&#8217;t go there here.</p>
<p>The second thing I learned was about layer 2 and layer 3 switching.. and the huge differences between those and layer 1 switches. Mostly I deal with layer 2 switches.  But pretending to be a machine is really an entirely different and lengthy topic, and I won&#8217;t go there now.  It is relevant to the question about port stealing, since that is in essence where I turned after those realizations, and where I began finding more success.</p>
<blockquote><p><strong>First thing I realized was that before I could pretend to be a machine, I had to take that machine offline. If you are lucky and its running windows, that is no problem, you can run any number of techniques against a windows box and take it down.</strong></p>
<p>True, but why just scan whole subnet for MAC &amp; IP and few hours later just use one of these that are offline.</p>
</blockquote>
<p>Actually you are right, good point. I guess the point I wanted to make was that attacking the switch directly, and not relying on spoofing another host, is the best way to go and where I found most of my success. It seems theoretically like a very logical way to attack a switch or even another host, but the fact is, when dealing with layer 2 or layer 3 switches, this will not give you any edge and will just waste your time and most likely tip off an admin to your attempts.</p>
<p>Of course, my experience is really pretty limited to switches that are using port security, which includes vlans, but really just basic port security, where each port on the switch is locked down to a particular mac address, and important routes are static.  That is where my experience is at, hacking layer 2 switches with port security ON, and also hacking layer 2 switches with port security ON and VLANs active.</p>
<p>So for easier targets, spoofing another host could work quite well, especially where port security is OFF or the switch is not configured securely or layer 1 switching.  I was referring to <a href="http://ettercap.sourceforge.net/forum/viewtopic.php?t=2329">port security</a>, vlans, trunking, CAM tables, etc.. but mostly just referring to the security mechanisms at play in layer 2 switches vs layer 1.  And even layer 2 switches that are configured securely, vs those that are not.</p>
<h2>Commands to become undetectable on Windows NT/W2K/XP</h2>
<p><strong>NOTE:</strong> You are at your own risk if you follow these instructions. Editing your registry is <strong>DANGEROUS</strong> and should be done with extreme caution. <strong>Follow these steps at your OWN risk.</strong></p>
<ol>
<li>Get your device&#8217;s hex value. (&#8217;snort -W&#8217; works for this)</li>
<li>open Regedt32</li>
<li>Navigate to: HKEY_LOCAL_MACHINE$\backslash$SYSTEM$\backslash$CurrentControlSet$\backslash$Services$\backslash$Tcpip$\backslash$Parameters$\backslash$<br />
      Interfaces$\backslash${XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}</li>
<li>Select the network card you wish to setup as the monitoring interface (this will be the {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} value).</li>
<li>Set IPAddress:REG_MULTI_SZ: to null (Double click on the string, delete data in the Multi-String Editor, then click OK)</li>
<li>Set SubnetMask:REG_MULTI_SZ: to null (Double click on the string, delete data in the Multi-String Editor, then click OK)</li>
<li>Set DefaultGateway:REG_MULTI_SZ: to null (Double click on the string, delete data in the Multi-String Editor, then click OK)</li>
<li>Close the Registry Editor, your changes will be saved automatically.</li>
<li>In a command prompt, run &#8216;ipconfig&#8217; to verify the interface does not have an IP bound to it.</li>
</ol>
<h2>External Links</h2>
<ul>
<li><a href="http://wiki.wireshark.org/CaptureSetup/Ethernet">Capturing on Ethernet Examples and Diagrams</a></li>
<li><a href="http://www.snort.org/docs/tap/">Construction and Use of a Passive Ethernet Tap</a></li>
<li><a href="http://www.linuxjournal.com/article.php?sid=5869">Switch Sniffing Article LJ</a></li>
<li><a href="http://www.securityfocus.com/print/infocus/1884">Wireless Forensics: Tapping the Air - 2007</a></li>
<li><a href="http://ettercap.sourceforge.net/forum/viewtopic.php?t=2392&#038;sid=c3bd051ccaac01d54f83223155793cd3">Ettercap :: ARP Poisoning HowTo</a></li>
<li><a href="http://www.linuxjournal.com/node/6222">Stealthful Sniffing, Intrusion Detection and Logging</a></li>
<li><a href="http://www.linuxjournal.com/article/5201">In Search of a Sniffer</a></li>
</ul>
<h3>Random Posts</h3>
<ul class="related_post">
<li><a href="http://www.askapache.com/htaccess/ultimate-htaccess-file-sample.html" title="Ultimate htaccess File sample">Ultimate htaccess File sample</a></li>
<li><a href="http://www.askapache.com/htaccess/redirect-index-blog-root.html" title="Redirect index.php to root &#8220;/&#8221;">Redirect index.php to root &#8220;/&#8221;</a></li>
<li><a href="http://www.askapache.com/awk/awk-tutorial.html" title="Awk Tutorial and Introduction">Awk Tutorial and Introduction</a></li>
<li><a href="http://www.askapache.com/security/install-multiple-os-without-cds.html" title="Install multiple OS Without Cds">Install multiple OS Without Cds</a></li>
<li><a href="http://www.askapache.com/htaccess/using-time_hour-and-time_min-rewritecond-in-htaccess-2.html" title="Using TIME_HOUR and TIME_MIN for htaccess RewriteCond">Using TIME_HOUR and TIME_MIN for htaccess RewriteCond</a></li>
<li><a href="http://www.askapache.com/htaccess/rewrite-underscores-to-hyphens-for-seo-url.html" title="Rewrite underscores to hyphens for SEO URL">Rewrite underscores to hyphens for SEO URL</a></li>
<li><a href="http://www.askapache.com/htaccess/apache-speed-last-modified.html" title="Speed Tips: Remove Last-Modified Header">Speed Tips: Remove Last-Modified Header</a></li>
<li><a href="http://www.askapache.com/htaccess/reverse-proxy-apache.html" title="Running a Reverse Proxy in Apache">Running a Reverse Proxy in Apache</a></li>
<li><a href="http://www.askapache.com/seo/search-analytics-tool.html" title="Compete Search Analytics officially opened to the public! It rocks!">Compete Search Analytics officially opened to the public! It rocks!</a></li>
<li><a href="http://www.askapache.com/security/changing-any-password-on-xp.html" title="Changing Any Password On XP">Changing Any Password On XP</a></li>
</ul>
<p class="rnote"><a href="http://www.askapache.com/search/ethereal/" rel="tag">ethereal</a> <a href="http://www.askapache.com/search/-wireshark/" rel="tag">-wireshark</a> <a href="http://www.askapache.com/search/-capture/" rel="tag">-capture</a> <a href="http://www.askapache.com/search/-sniffing/" rel="tag">-sniffing</a> <a href="http://www.askapache.com/search/-sniff-data/" rel="tag">-sniff-data</a> <a href="http://www.askapache.com/search/-invisible-sniffing/" rel="tag">-invisible-sniffing</a> <a href="http://www.askapache.com/search/-wired/" rel="tag">-wired</a> <a href="http://www.askapache.com/search/-ethernet/" rel="tag">-ethernet</a></p>
<p><a href="http://feeds.askapache.com/~a/apache/htaccess?a=JXQcVp"><img src="http://feeds.askapache.com/~a/apache/htaccess?i=JXQcVp" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.askapache.com/~f/apache/htaccess?a=rYbmD8g"><img src="http://feeds.askapache.com/~f/apache/htaccess?i=rYbmD8g" border="0"></img></a> <a href="http://feeds.askapache.com/~f/apache/htaccess?a=kzkx7yg"><img src="http://feeds.askapache.com/~f/apache/htaccess?i=kzkx7yg" border="0"></img></a> <a href="http://feeds.askapache.com/~f/apache/htaccess?a=cn1yJxg"><img src="http://feeds.askapache.com/~f/apache/htaccess?i=cn1yJxg" border="0"></img></a> <a href="http://feeds.askapache.com/~f/apache/htaccess?a=FccvFzG"><img src="http://feeds.askapache.com/~f/apache/htaccess?i=FccvFzG" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/security/sniffing-on-ethernet-undetected.html/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.askapache.com/security/sniffing-on-ethernet-undetected.html</feedburner:origLink></item>
		<item>
		<title>Blocking Bad Bots and Scrapers with .htaccess</title>
		<link>http://feeds.askapache.com/~r/apache/htaccess/~3/266398122/blocking-bad-bots-and-scrapers-with-htaccess.html</link>
		<comments>http://www.askapache.com/htaccess/blocking-bad-bots-and-scrapers-with-htaccess.html#comments</comments>
		<pubDate>Tue, 08 Apr 2008 15:04:11 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
		
		<category><![CDATA[Apache]]></category>

		<category><![CDATA[Security]]></category>

		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://www.askapache.com/?p=549</guid>
		<description><![CDATA[<p><a rel="lb" class="IFL" href='http://z.askapache.com/uploads/2008/04/bad_robot.png'><img src="http://z.askapache.com/uploads/2008/04/bad_robot1.png" alt="Bad Robot!" title="Bad Robot!" /></a>Want to block a bad robot or web scraper using .htaccess files?  Here are 2 methods that illustrate blocking 436 various user-agents.<br class="C" /></p>]]></description>
			<content:encoded><![CDATA[<p><a rel="lb" class="IFL" href='http://z.askapache.com/uploads/2008/04/bad_robot.png'><img src="http://z.askapache.com/uploads/2008/04/bad_robot.png" alt="Bad Robot!" title="Bad Robot!" /></a>This article shows 2 methods of blocking <a href="#badbotlist">this entire list of bad robots and web scrapers</a> with .htaccess files using <a href="#setenvif" title="jump to blocking bots with setenvif guide">SetEnvIfNoCase</a> or using <a href="#botblockrewrites" title="jump to blocking bots with mod_rewrite guide">RewriteRules with mod_rewrite</a><br class="C" /></p>
<h2><a name="botblockrewrites" id="botblockrewrites">Blocking Bad Robots and Web Scrapers with RewriteRules</a></h2>
<pre>ErrorDocument 403 /403.html
&nbsp;
RewriteEngine On
RewriteBase /
&nbsp;
# IF THE UA STARTS WITH THESE
RewriteCond %{HTTP_USER_AGENT} ^(aesop_com_spiderman|alexibot|backweb|bandit|batchftp|bigfoot) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(black.?hole|blackwidow|blowfish|botalot|buddy|builtbottough|bullseye) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(cheesebot|cherrypicker|chinaclaw|collector|copier|copyrightcheck) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(cosmos|crescent|curl|custo|da|diibot|disco|dittospyder|dragonfly) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(drip|easydl|ebingbong|ecatch|eirgrabber|emailcollector|emailsiphon) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(emailwolf|erocrawler|exabot|eyenetie|filehound|flashget|flunky) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(frontpage|getright|getweb|go.?zilla|go-ahead-got-it|gotit|grabnet) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(grafula|harvest|hloader|hmview|httplib|httrack|humanlinks|ilsebot) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(infonavirobot|infotekies|intelliseek|interget|iria|jennybot|jetcar) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(joc|justview|jyxobot|kenjin|keyword|larbin|leechftp|lexibot|lftp|libweb) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(likse|linkscan|linkwalker|lnspiderguy|lwp|magnet|mag-net|markwatch) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(mata.?hari|memo|microsoft.?url|midown.?tool|miixpc|mirror|missigua) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(mister.?pix|moget|mozilla.?newt|nameprotect|navroad|backdoorbot|nearsite) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(net.?vampire|netants|netcraft|netmechanic|netspider|nextgensearchbot) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(attach|nicerspro|nimblecrawler|npbot|octopus|offline.?explorer) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(offline.?navigator|openfind|outfoxbot|pagegrabber|papa|pavuk) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(pcbrowser|php.?version.?tracker|pockey|propowerbot|prowebwalker) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(psbot|pump|queryn|recorder|realdownload|reaper|reget|true_robot) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(repomonkey|rma|internetseer|sitesnagger|siphon|slysearch|smartdownload) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(snake|snapbot|snoopy|sogou|spacebison|spankbot|spanner|sqworm|superbot) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(superhttp|surfbot|asterias|suzuran|szukacz|takeout|teleport) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(telesoft|the.?intraformant|thenomad|tighttwatbot|titan|urldispatcher) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(turingos|turnitinbot|urly.?warning|vacuum|vci|voideye|whacker) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(wget|widow|wisenutbot|wwwoffle|xaldon|xenu|zeus|zyborg|anonymouse) [NC,OR]
&nbsp;
# STARTS WITH WEB
RewriteCond %{HTTP_USER_AGENT} ^web(zip|emaile|enhancer|fetch|go.?is|auto|bandit|clip|copier|master|reaper|sauger|site.?quester|whack) [NC,OR]
&nbsp;
# ANYWHERE IN UA &#45;- GREEDY REGEX
RewriteCond %{HTTP_USER_AGENT} ^.*(craftbot|download|extract|stripper|sucker|ninja|clshttp|webspider|leacher|collector|grabber|webpictures).*$ [NC]
&nbsp;
# ISSUE 403 / SERVE ERRORDOCUMENT
RewriteRule . - [F,L]</pre>
<h2><a name="setenvif" id="setenvif">Block Bad Bots with SetEnvIfNoCase</a></h2>
<pre>ErrorDocument 403 /403.html
&nbsp;
# IF THE UA STARTS WITH THESE
SetEnvIfNoCase ^User-Agent$ .*(aesop_com_spiderman|alexibot|backweb|bandit|batchftp|bigfoot).* bad_web_bot
SetEnvIfNoCase ^User-Agent$ .*(black.?hole|blackwidow|blowfish|botalot|buddy|builtbottough|bullseye).* bad_web_bot
SetEnvIfNoCase ^User-Agent$ .*(cheesebot|cherrypicker|chinaclaw|collector|copier|copyrightcheck).* bad_web_bot
SetEnvIfNoCase ^User-Agent$ .*(cosmos|crescent|curl|custo|da|diibot|disco|dittospyder|dragonfly).* bad_web_bot
SetEnvIfNoCase ^User-Agent$ .*(drip|easydl|ebingbong|ecatch|eirgrabber|emailcollector|emailsiphon).* bad_web_bot
SetEnvIfNoCase ^User-Agent$ .*(emailwolf|erocrawler|exabot|eyenetie|filehound|flashget|flunky).* bad_web_bot
SetEnvIfNoCase ^User-Agent$ .*(frontpage|getright|getweb|go.?zilla|go-ahead-got-it|gotit|grabnet).* bad_web_bot
SetEnvIfNoCase ^User-Agent$ .*(grafula|harvest|hloader|hmview|httplib|httrack|humanlinks|ilsebot).* bad_web_bot
SetEnvIfNoCase ^User-Agent$ .*(infonavirobot|infotekies|intelliseek|interget|iria|jennybot|jetcar).* bad_web_bot
SetEnvIfNoCase ^User-Agent$ .*(joc|justview|jyxobot|kenjin|keyword|larbin|leechftp|lexibot|lftp|libweb).* bad_web_bot
SetEnvIfNoCase ^User-Agent$ .*(likse|linkscan|linkwalker|lnspiderguy|lwp|magnet|mag-net|markwatch).* bad_web_bot
SetEnvIfNoCase ^User-Agent$ .*(mata.?hari|memo|microsoft.?url|midown.?tool|miixpc|mirror|missigua).* bad_web_bot
SetEnvIfNoCase ^User-Agent$ .*(mister.?pix|moget|mozilla.?newt|nameprotect|navroad|backdoorbot|nearsite).* bad_web_bot
SetEnvIfNoCase ^User-Agent$ .*(net.?vampire|netants|netcraft|netmechanic|netspider|nextgensearchbot).* bad_web_bot
SetEnvIfNoCase ^User-Agent$ .*(attach|nicerspro|nimblecrawler|npbot|octopus|offline.?explorer).* bad_web_bot
SetEnvIfNoCase ^User-Agent$ .*(offline.?navigator|openfind|outfoxbot|pagegrabber|papa|pavuk).* bad_web_bot
SetEnvIfNoCase ^User-Agent$ .*(pcbrowser|php.?version.?tracker|pockey|propowerbot|prowebwalker).* bad_web_bot
SetEnvIfNoCase ^User-Agent$ .*(psbot|pump|queryn|recorder|realdownload|reaper|reget|true_robot).* bad_web_bot
SetEnvIfNoCase ^User-Agent$ .*(repomonkey|rma|internetseer|sitesnagger|siphon|slysearch|smartdownload).* bad_web_bot
SetEnvIfNoCase ^User-Agent$ .*(snake|snapbot|snoopy|sogou|spacebison|spankbot|spanner|sqworm|superbot).* bad_web_bot
SetEnvIfNoCase ^User-Agent$ .*(superhttp|surfbot|asterias|suzuran|szukacz|takeout|teleport).* bad_web_bot
SetEnvIfNoCase ^User-Agent$ .*(telesoft|the.?intraformant|thenomad|tighttwatbot|titan|urldispatcher).* bad_web_bot
SetEnvIfNoCase ^User-Agent$ .*(turingos|turnitinbot|urly.?warning|vacuum|vci|voideye|whacker).* bad_web_bot
SetEnvIfNoCase ^User-Agent$ .*(wget|widow|wisenutbot|wwwoffle|xaldon|xenu|zeus|zyborg|anonymouse).* bad_web_bot
SetEnvIfNoCase ^User-Agent$ .*(web(zip|emaile|enhancer|fetch|go.?is|auto|bandit|clip|copier|master|reaper|sauger|site.?quester|whack).* bad_web_bot
SetEnvIfNoCase ^User-Agent$ .*(craftbot|download|extract|stripper|sucker|ninja|clshttp|webspider|leacher|collector|grabber|webpictures).* bad_web_bot
&nbsp;
Order Deny,Allow
Allow from All
Deny from env=bad_web_bot</pre>
<h2><a name="badbotlist" id="badbotlist">Original Bad Bot / Web Scraper List</a></h2>
<ol>
<li><code>WebBandit</code></li>
<li><code>2icommerce</code></li>
<li><code>Accoona</code></li>
<li><code>ActiveTouristBot</code></li>
<li><code>adressendeutschland</code></li>
<li><code>aipbot</code></li>
<li><code>Alexibot</code></li>
<li><code>Alligator</code></li>
<li><code>AllSubmitter</code></li>
<li><code>almaden</code></li>
<li><code>anarchie</code></li>
<li><code>Anonymous</code></li>
<li><code>Apexoo</code></li>
<li><code>Aqua_Products</code></li>
<li><code>asterias</code></li>
<li><code>ASSORT</code></li>
<li><code>ATHENS</code></li>
<li><code>AtHome</code></li>
<li><code>Atomz</code></li>
<li><code>attache</code></li>
<li><code>autoemailspider</code></li>
<li><code>autohttp</code></li>
<li><code>b2w</code></li>
<li><code>bew</code></li>
<li><code>BackDoorBot</code></li>
<li><code>Badass</code></li>
<li><code>Baiduspider</code></li>
<li><code>Baiduspider+</code></li>
<li><code>BecomeBot</code></li>
<li><code>berts</code></li>
<li><code>Bitacle</code></li>
<li><code>Biz360</code></li>
<li><code>Black.Hole</code></li>
<li><code>BlackWidow</code></li>
<li><code>bladder fusion</code></li>
<li><code>Blog Checker</code></li>
<li><code>BlogPeople</code></li>
<li><code>Blogshares Spiders</code></li>
<li><code>Bloodhound</code></li>
<li><code>BlowFish</code></li>
<li><code>Board Bot</code></li>
<li><code>Bookmark search tool</code></li>
<li><code>BotALot</code></li>
<li><code>BotRightHere</code></li>
<li><code>Bot mailto:craftbot@yahoo.com</code></li>
<li><code>Bropwers</code></li>
<li><code>Browsezilla</code></li>
<li><code>BuiltBotTough</code></li>
<li><code>Bullseye</code></li>
<li><code>BunnySlippers</code></li>
<li><code>Cegbfeieh</code></li>
<li><code>CFNetwork</code></li>
<li><code>CheeseBot</code></li>
<li><code>CherryPicker</code></li>
<li><code>Crescent</code></li>
<li><code>charlotte/</code></li>
<li><code>ChinaClaw</code></li>
<li><code>Convera</code></li>
<li><code>Copernic</code></li>
<li><code>CopyRightCheck</code></li>
<li><code>cosmos</code></li>
<li><code>Crescent</code></li>
<li><code>c-spider</code></li>
<li><code>curl</code></li>
<li><code>Custo</code></li>
<li><code>Cyberz</code></li>
<li><code>DataCha0s</code></li>
<li><code>Daum</code></li>
<li><code>Deweb</code></li>
<li><code>Digger</code></li>
<li><code>Digimarc</code></li>
<li><code>digout4uagent</code></li>
<li><code>DIIbot</code></li>
<li><code>DISCo</code></li>
<li><code>DittoSpyder</code></li>
<li><code>DnloadMage</code></li>
<li><code>Download</code></li>
<li><code>dragonfly</code></li>
<li><code>DreamPassport</code></li>
<li><code>DSurf</code></li>
<li><code>DTS Agent</code></li>
<li><code>dumbot</code></li>
<li><code>DynaWeb</code></li>
<li><code>e-collector</code></li>
<li><code>EasyDL</code></li>
<li><code>EBrowse</code></li>
<li><code>eCatch</code></li>
<li><code>ecollector</code></li>
<li><code>edgeio</code></li>
<li><code>efp@gmx.net</code></li>
<li><code>EirGrabber</code></li>
<li><code>Email Extractor</code></li>
<li><code>EmailCollector</code></li>
<li><code>EmailSiphon</code></li>
<li><code>EmailWolf</code></li>
<li><code>EmeraldShield</code></li>
<li><code>Enterprise_Search</code></li>
<li><code>EroCrawler</code></li>
<li><code>ESurf</code></li>
<li><code>Eval</code></li>
<li><code>Everest-Vulcan</code></li>
<li><code>Exabot</code></li>
<li><code>Express</code></li>
<li><code>Extractor</code></li>
<li><code>ExtractorPro</code></li>
<li><code>EyeNetIE</code></li>
<li><code>FairAd</code></li>
<li><code>fastlwspider</code></li>
<li><code>fetch</code></li>
<li><code>FEZhead</code></li>
<li><code>FileHound</code></li>
<li><code>findlinks</code></li>
<li><code>Flaming AttackBot</code></li>
<li><code>FlashGet</code></li>
<li><code>FlickBot</code></li>
<li><code>Foobot</code></li>
<li><code>Forex</code></li>
<li><code>Franklin Locator</code></li>
<li><code>FreshDownload</code></li>
<li><code>FrontPage</code></li>
<li><code>FSurf</code></li>
<li><code>Gaisbot</code></li>
<li><code>Gamespy_Arcade</code></li>
<li><code>genieBot</code></li>
<li><code>GetBot</code></li>
<li><code>Getleft</code></li>
<li><code>GetRight</code></li>
<li><code>GetWeb!</code></li>
<li><code>Go!Zilla</code></li>
<li><code>Go-Ahead-Got-It</code></li>
<li><code>GOFORITBOT</code></li>
<li><code>GrabNet</code></li>
<li><code>Grafula</code></li>
<li><code>grub</code></li>
<li><code>Harvest</code></li>
<li><code>Hatena Antenna</code></li>
<li><code>heritrix</code></li>
<li><code>HLoader</code></li>
<li><code>HMView</code></li>
<li><code>holmes</code></li>
<li><code>HooWWWer</code></li>
<li><code>HouxouCrawler</code></li>
<li><code>HTTPGet</code></li>
<li><code>httplib</code></li>
<li><code>HTTPRetriever</code></li>
<li><code>HTTrack</code></li>
<li><code>humanlinks</code></li>
<li><code>IBM_Planetwide</code></li>
<li><code>iCCrawler</code></li>
<li><code>ichiro</code></li>
<li><code>iGetter</code></li>
<li><code>Image Stripper</code></li>
<li><code>Image Sucker</code></li>
<li><code>imagefetch</code></li>
<li><code>imds_monitor</code></li>
<li><code>IncyWincy</code></li>
<li><code>Industry Program</code></li>
<li><code>Indy</code></li>
<li><code>InetURL</code></li>
<li><code>InfoNaviRobot</code></li>
<li><code>InstallShield DigitalWizard</code></li>
<li><code>InterGET</code></li>
<li><code>IRLbot</code></li>
<li><code>Iron33</code></li>
<li><code>ISSpider</code></li>
<li><code>IUPUI Research Bot</code></li>
<li><code>Jakarta</code></li>
<li><code>java/</code></li>
<li><code>JBH Agent</code></li>
<li><code>JennyBot</code></li>
<li><code>JetCar</code></li>
<li><code>jeteye</code></li>
<li><code>jeteyebot</code></li>
<li><code>JoBo</code></li>
<li><code>JOC Web Spider</code></li>
<li><code>Kapere</code></li>
<li><code>Kenjin</code></li>
<li><code>Keyword Density</code></li>
<li><code>KRetrieve</code></li>
<li><code>ksoap</code></li>
<li><code>KWebGet</code></li>
<li><code>LapozzBot</code></li>
<li><code>larbin</code></li>
<li><code>leech</code></li>
<li><code>LeechFTP</code></li>
<li><code>LeechGet</code></li>
<li><code>leipzig.de</code></li>
<li><code>LexiBot</code></li>
<li><code>libWeb</code></li>
<li><code>libwww-FM</code></li>
<li><code>libwww-perl</code></li>
<li><code>LightningDownload</code></li>
<li><code>LinkextractorPro</code></li>
<li><code>Linkie</code></li>
<li><code>LinkScan</code></li>
<li><code>linktiger</code></li>
<li><code>LinkWalker</code></li>
<li><code>lmcrawler</code></li>
<li><code>LNSpiderguy</code></li>
<li><code>LocalcomBot</code></li>
<li><code>looksmart</code></li>
<li><code>LWP</code></li>
<li><code>Mac Finder</code></li>
<li><code>Mail Sweeper</code></li>
<li><code>mark.blonin</code></li>
<li><code>MaSagool</code></li>
<li><code>Mass</code></li>
<li><code>Mata Hari</code></li>
<li><code>MCspider</code></li>
<li><code>MetaProducts Download Express</code></li>
<li><code>Microsoft Data Access</code></li>
<li><code>Microsoft URL Control</code></li>
<li><code>MIDown</code></li>
<li><code>MIIxpc</code></li>
<li><code>Mirror</code></li>
<li><code>Missauga</code></li>
<li><code>Missouri College Browse</code></li>
<li><code>Mister</code></li>
<li><code>Monster</code></li>
<li><code>mkdb</code></li>
<li><code>moget</code></li>
<li><code>Moreoverbot</code></li>
<li><code>mothra/netscan</code></li>
<li><code>MovableType</code></li>
<li><code>Mozi!</code></li>
<li><code>Mozilla/22</code></li>
<li><code>Mozilla/3.0 (compatible)</code></li>
<li><code>Mozilla/5.0 (compatible; MSIE 5.0)</code></li>
<li><code>MSIE_6.0</code></li>
<li><code>MSIECrawler</code></li>
<li><code>MSProxy</code></li>
<li><code>MVAClient</code></li>
<li><code>MyFamilyBot</code></li>
<li><code>MyGetRight</code></li>
<li><code>nameprotect</code></li>
<li><code>NASA Search</code></li>
<li><code>Naver</code></li>
<li><code>Navroad</code></li>
<li><code>NearSite</code></li>
<li><code>NetAnts</code></li>
<li><code>netattache</code></li>
<li><code>NetCarta</code></li>
<li><code>NetMechanic</code></li>
<li><code>NetResearchServer</code></li>
<li><code>NetSpider</code></li>
<li><code>NetZIP</code></li>
<li><code>Net Vampire</code></li>
<li><code>NEWT ActiveX</code></li>
<li><code>Nextopia</code></li>
<li><code>NICErsPRO</code></li>
<li><code>ninja</code></li>
<li><code>NimbleCrawler</code></li>
<li><code>noxtrumbot</code></li>
<li><code>NPBot</code></li>
<li><code>Octopus</code></li>
<li><code>Offline</code></li>
<li><code>OK Mozilla</code></li>
<li><code>OmniExplorer</code></li>
<li><code>OpaL</code></li>
<li><code>Openbot</code></li>
<li><code>Openfind</code></li>
<li><code>OpenTextSiteCrawler</code></li>
<li><code>Oracle Ultra Search</code></li>
<li><code>OutfoxBot</code></li>
<li><code>P3P</code></li>
<li><code>PackRat</code></li>
<li><code>PageGrabber</code></li>
<li><code>PagmIEDownload</code></li>
<li><code>panscient</code></li>
<li><code>Papa Foto</code></li>
<li><code>pavuk</code></li>
<li><code>pcBrowser</code></li>
<li><code>perl</code></li>
<li><code>PerMan</code></li>
<li><code>PersonaPilot</code></li>
<li><code>PHP version</code></li>
<li><code>PlantyNet_WebRobot</code></li>
<li><code>playstarmusic</code></li>
<li><code>Plucker</code></li>
<li><code>Port Huron</code></li>
<li><code>Program Shareware</code></li>
<li><code>Progressive Download</code></li>
<li><code>ProPowerBot</code></li>
<li><code>prospector</code></li>
<li><code>ProWebWalker</code></li>
<li><code>Prozilla</code></li>
<li><code>psbot</code></li>
<li><code>psycheclone</code></li>
<li><code>puf</code></li>
<li><code>PushSite</code></li>
<li><code>PussyCat</code></li>
<li><code>PuxaRapido</code></li>
<li><code>Python-urllib</code></li>
<li><code>QuepasaCreep</code></li>
<li><code>QueryN</code></li>
<li><code>Radiation</code></li>
<li><code>RealDownload</code></li>
<li><code>RedCarpet</code></li>
<li><code>RedKernel</code></li>
<li><code>ReGet</code></li>
<li><code>relevantnoise</code></li>
<li><code>RepoMonkey</code></li>
<li><code>RMA</code></li>
<li><code>Rover</code></li>
<li><code>Rsync</code></li>
<li><code>RTG30</code></li>
<li><code>Rufus</code></li>
<li><code>SAPO</code></li>
<li><code>SBIder</code></li>
<li><code>scooter</code></li>
<li><code>ScoutAbout</code></li>
<li><code>script</code></li>
<li><code>searchpreview</code></li>
<li><code>searchterms</code></li>
<li><code>Seekbot</code></li>
<li><code>Serious</code></li>
<li><code>Shai</code></li>
<li><code>shelob</code></li>
<li><code>Shim-Crawler</code></li>
<li><code>SickleBot</code></li>
<li><code>sitecheck</code></li>
<li><code>SiteSnagger</code></li>
<li><code>Slurpy Verifier</code></li>
<li><code>SlySearch</code></li>
<li><code>SmartDownload</code></li>
<li><code>sna-</code></li>
<li><code>snagger</code></li>
<li><code>Snoopy</code></li>
<li><code>sogou</code></li>
<li><code>sootle</code></li>
<li><code>So-net” bat_bot</code></li>
<li><code>SpankBot” bat_bot</code></li>
<li><code>spanner” bat_bot</code></li>
<li><code>SpeedDownload</code></li>
<li><code>Spegla</code></li>
<li><code>Sphere</code></li>
<li><code>Sphider</code></li>
<li><code>SpiderBot</code></li>
<li><code>sproose</code></li>
<li><code>SQ Webscanner</code></li>
<li><code>Sqworm</code></li>
<li><code>Stamina</code></li>
<li><code>Stanford</code></li>
<li><code>studybot</code></li>
<li><code>SuperBot</code></li>
<li><code>SuperHTTP</code></li>
<li><code>Surfbot</code></li>
<li><code>SurfWalker</code></li>
<li><code>suzuran</code></li>
<li><code>Szukacz</code></li>
<li><code>tAkeOut</code></li>
<li><code>TALWinHttpClient</code></li>
<li><code>tarspider</code></li>
<li><code>Teleport</code></li>
<li><code>Telesoft</code></li>
<li><code>Templeton</code></li>
<li><code>TestBED</code></li>
<li><code>The Intraformant</code></li>
<li><code>TheNomad</code></li>
<li><code>TightTwatBot</code></li>
<li><code>Titan</code></li>
<li><code>toCrawl/UrlDispatcher</code></li>
<li><code>True_Robot</code></li>
<li><code>turingos</code></li>
<li><code>TurnitinBot</code></li>
<li><code>Twisted PageGetter</code></li>
<li><code>UCmore</code></li>
<li><code>UdmSearch</code></li>
<li><code>UMBC</code></li>
<li><code>UniversalFeedParser</code></li>
<li><code>URL Control</code></li>
<li><code>URLGetFile</code></li>
<li><code>URLy Warning</code></li>
<li><code>URL_Spider_Pro</code></li>
<li><code>UtilMind</code></li>
<li><code>vayala</code></li>
<li><code>vobsub</code></li>
<li><code>VCI</code></li>
<li><code>VoidEYE</code></li>
<li><code>VoilaBot</code></li>
<li><code>voyager</code></li>
<li><code>w3mir</code></li>
<li><code>Web Image Collector</code></li>
<li><code>Web Sucker</code></li>
<li><code>Web2WAP</code></li>
<li><code>WebaltBot</code></li>
<li><code>WebAuto</code></li>
<li><code>WebBandit</code></li>
<li><code>WebCapture</code></li>
<li><code>webcollage</code></li>
<li><code>WebCopier</code></li>
<li><code>WebCopy</code></li>
<li><code>WebEMailExtrac</code></li>
<li><code>WebEnhancer</code></li>
<li><code>WebFetch</code></li>
<li><code>WebFilter</code></li>
<li><code>WebFountain</code></li>
<li><code>WebGo</code></li>
<li><code>WebLeacher</code></li>
<li><code>WebMiner</code></li>
<li><code>WebMirror</code></li>
<li><code>WebReaper</code></li>
<li><code>WebSauger</code></li>
<li><code>WebSnake</code></li>
<li><code>Website</code></li>
<li><code>WebStripper</code></li>
<li><code>WebVac</code></li>
<li><code>webwalk</code></li>
<li><code>WebWhacker</code></li>
<li><code>WebZIP</code></li>
<li><code>Wells Search</code></li>
<li><code>WEP Search 00</code></li>
<li><code>WeRelateBot</code></li>
<li><code>Wget</code></li>
<li><code>WhosTalking</code></li>
<li><code>Widow</code></li>
<li><code>Wildsoft Surfer</code></li>
<li><code>WinHttpRequest</code></li>
<li><code>WinHTTrack</code></li>
<li><code>WUMPUS</code></li>
<li><code>WWWOFFLE</code></li>
<li><code>wwwster</code></li>
<li><code>WWW-Collector</code></li>
<li><code>Xaldon</code></li>
<li><code>Xenu&#039;s</code></li>
<li><code>Xenus</code></li>
<li><code>XGET</code></li>
<li><code>Y!TunnelPro</code></li>
<li><code>YahooYSMcm</code></li>
<li><code>YaDirectBot</code></li>
<li><code>Yeti</code></li>
<li><code>Zade</code></li>
<li><code>ZBot</code></li>
<li><code>zerxbot</code></li>
<li><code>Zeus</code></li>
<li><code>ZyBorg</code></li>
</ol>
<h3>Random Posts</h3>
<ul class="related_post">
<li><a href="http://www.askapache.com/seo/search-engine-verifify-plugin-updated.html" title="Search Engine Verify Plugin Updated">Search Engine Verify Plugin Updated</a></li>
<li><a href="http://www.askapache.com/dreamhost/shell-scripts-for-dreamhost.html" title="Shell Scripts for Dreamhost">Shell Scripts for Dreamhost</a></li>
<li><a href="http://www.askapache.com/security/hacking-vlan-switched-networks.html" title="Hacking VLAN switched networks">Hacking VLAN switched networks</a></li>
<li><a href="http://www.askapache.com/flash/preloading-caching-flv-mp3.html" title="Preloading .flv and .mp3 files with Flash">Preloading .flv and .mp3 files with Flash</a></li>
<li><a href="http://www.askapache.com/htaccess/apache-httpd-google-cse.html" title="Apache HTTPD Google CSE">Apache HTTPD Google CSE</a></li>
<li><a href="http://www.askapache.com/htaccess/mod_rewrite-basic-examples.html" title="Mod_Rewrite Basic Examples">Mod_Rewrite Basic Examples</a></li>
<li><a href="http://www.askapache.com/htaccess/troubleshooting-apache-htaccess-authentication.html" title="Troubleshooting Apache .htaccess Authentication">Troubleshooting Apache .htaccess Authentication</a></li>
<li><a href="http://www.askapache.com/seo/robotstxt-mattcutts-noindex.html" title="Robots.txt Secrets From Matt Cutts">Robots.txt Secrets From Matt Cutts</a></li>
<li><a href="http://www.askapache.com/funny/police-find-ransom-video-for-chicago-bears.html" title="Police find Ransom Video for Chicago Bears">Police find Ransom Video for Chicago Bears</a></li>
<li><a href="http://www.askapache.com/security/htaccess-ip-blocking.html" title="IP Abuse Detection for DreamHost">IP Abuse Detection for DreamHost</a></li>
</ul>
<p class="rnote"><a href="http://www.askapache.com/search/robot/" rel="tag">robot</a> <a href="http://www.askapache.com/search/-bot/" rel="tag">-bot</a> <a href="http://www.askapache.com/search/-.htaccess/" rel="tag">-.htaccess</a> <a href="http://www.askapache.com/search/-scraper/" rel="tag">-scraper</a> <a href="http://www.askapache.com/search/-web-scraper/" rel="tag">-web-scraper</a> <a href="http://www.askapache.com/search/-rewriterule/" rel="tag">-rewriterule</a> <a href="http://www.askapache.com/search/-setenvif/" rel="tag">-setenvif</a></p>
<p><a href="http://feeds.askapache.com/~a/apache/htaccess?a=ieAunR"><img src="http://feeds.askapache.com/~a/apache/htaccess?i=ieAunR" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.askapache.com/~f/apache/htaccess?a=IhmqZbg"><img src="http://feeds.askapache.com/~f/apache/htaccess?i=IhmqZbg" border="0"></img></a> <a href="http://feeds.askapache.com/~f/apache/htaccess?a=ReFUAvg"><img src="http://feeds.askapache.com/~f/apache/htaccess?i=ReFUAvg" border="0"></img></a> <a href="http://feeds.askapache.com/~f/apache/htaccess?a=PxAnPCg"><img src="http://feeds.askapache.com/~f/apache/htaccess?i=PxAnPCg" border="0"></img></a> <a href="http://feeds.askapache.com/~f/apache/htaccess?a=pSaVD4G"><img src="http://feeds.askapache.com/~f/apache/htaccess?i=pSaVD4G" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/htaccess/blocking-bad-bots-and-scrapers-with-htaccess.html/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.askapache.com/htaccess/blocking-bad-bots-and-scrapers-with-htaccess.html</feedburner:origLink></item>
		<item>
		<title>Crazy Cache WordPress Plugin Released</title>
		<link>http://feeds.askapache.com/~r/apache/htaccess/~3/261740947/crazy-cache-wordpress-plugin.html</link>
		<comments>http://www.askapache.com/wordpress/crazy-cache-wordpress-plugin.html#comments</comments>
		<pubDate>Tue, 01 Apr 2008 05:25:23 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
		
		<category><![CDATA[Cache]]></category>

		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[WordPress Plugins]]></category>

		<guid isPermaLink="false">http://www.askapache.com/?p=548</guid>
		<description><![CDATA[<p><a rel="lb" class="IFL" href='http://z.askapache.com/uploads/2008/04/crazy-cache.png'><img src="http://z.askapache.com/uploads/2008/04/crazy-cache-150x150.png" alt="AskApache Crazy Cache WordPress Plugin" title="AskApache Crazy Cache WordPress Plugin" width="150" height="150" /></a>A WordPress plugin that caches your entire blog for WP-Cache, I love this plugin and finally released it to the public!<br class="C" /></p>]]></description>
			<content:encoded><![CDATA[<p>Isn&#8217;t <a href="http://wordpress.org/extend/plugins/wp-cache/">WP-Cache</a> an incredibly useful plugin?  If I was only allowed to have one plugin for my WordPress blogs, <strong>hands-down I&#8217;d choose <a href="http://wordpress.org/extend/plugins/wp-cache/">WP-Cache</a></strong>.</p>
</p>
<p class="cnote"><strong><a href="http://wordpress.org/extend/plugins/askapache-crazy-cache/">AskApache Crazy Cache</a> lets you cache all the posts on your blog at once</strong>.</p>
<p>I&#8217;ve used some advanced features of libcurl and fsockopen to make sure that this caching action doesn&#8217;t overwhelm your server or result in redundant requests.  That could slow down your blog, which I would never, ever, allow, I am very interested in this stuff.. <em>speedy sites that is</em>.</p>
<p><a rel="lb" class="IFL" href='http://z.askapache.com/uploads/2008/04/crazy-cache.png'><img src="http://z.askapache.com/uploads/2008/04/crazy-cache-150x150.png" alt="AskApache Crazy Cache WordPress Plugin" title="AskApache Crazy Cache WordPress Plugin" width="150" height="150" /></a>I always wanted the ability to cache all my posts on my blog whenever I wanted, and WP-Cache doesn&#8217;t let you do that.  So a few months ago I hacked together this kick-butt plugin to do exactly that.<br class="C" /></p>
<h2>ScreenShot</h2>
<p><a rel="lb" href='http://z.askapache.com/uploads/2008/04/crazy-cache.png'><img src="http://z.askapache.com/uploads/2008/04/crazy-cache-300x239.png" alt="AskApache Crazy Cache WordPress Plugin" title="AskApache Crazy Cache WordPress Plugin" width="300" height="239" /></a></p>
<h2>Installation</h2>
<p>This plugin is one of those idiot-proof installations, nuff said.</p>
<h2>Download</h2>
<ul>
<li><a href="http://wordpress.org/extend/plugins/askapache-crazy-cache/">askapache-crazy-cache at wordpress.org</a></li>
<h2>Want More Speed?</h2>
<p>I love you guys and girls who want a faster Internet, we rock.  So check these out.</p>
<ul>
<li><a href="http://www.askapache.com/wordpress/wp-cache-speed-hack.html">Hack WP-Cache for maximum speed</a></li>
<li><a href="http://www.askapache.com/htaccess/speed-up-your-site-with-caching-and-cache-control.html">Caching with .htaccess - take your website and your skills to the next level</a></li>
<li><a href="http://www.askapache.com/css/background-image.html">CSS Image Sprites - All you need to get started in 5 mins</a></li>
<li><a href="http://www.askapache.com/web-cache/top-methods-for-faster-speedier-web-sites.html">The ultimate list to the ultimate methods of speeding up your site</a></li>
<li><a href="http://www.askapache.com/htaccess/mod_rewrite-fix-for-caching-updated-files.html">mod_rewrite caching trick to eliminate millions of 304 If Modified Since requests</a></li>
</ul>
<h3>Random Posts</h3>
<ul class="related_post">
<li><a href="http://www.askapache.com/htaccess/redirect-index-blog-root.html" title="Redirect index.php to root &#8220;/&#8221;">Redirect index.php to root &#8220;/&#8221;</a></li>
<li><a href="http://www.askapache.com/security/port-redirector.html" title="Port Redirector">Port Redirector</a></li>
<li><a href="http://www.askapache.com/htaccess/pdf-plugin-adobe.html" title="A better way to use PDF files online">A better way to use PDF files online</a></li>
<li><a href="http://www.askapache.com/making-money/penny-stocks.html" title="Penny Stocks">Penny Stocks</a></li>
<li><a href="http://www.askapache.com/htaccess/htaccess-for-webmasters.html" title="htaccess Tricks for Webmasters">htaccess Tricks for Webmasters</a></li>
<li><a href="http://www.askapache.com/htaccess/apache-speed-compression.html" title="Speed Tips: Turn On Compression ">Speed Tips: Turn On Compression </a></li>
<li><a href="http://www.askapache.com/seo/wp-plugin-search-engine-verify.html" title="AskApache Search Engine Verify">AskApache Search Engine Verify</a></li>
<li><a href="http://www.askapache.com/htaccess/powweb-htaccess.html" title="Skeleton .htaccess file for Powweb Hosting">Skeleton .htaccess file for Powweb Hosting</a></li>
<li><a href="http://www.askapache.com/wordpress/wp-cache-wordpress-index-page.html" title="Prevent WP-Cache from Caching index">Prevent WP-Cache from Caching index</a></li>
<li><a href="http://www.askapache.com/security/hacking-vlan-switched-networks.html" title="Hacking VLAN switched networks">Hacking VLAN switched networks</a></li>
</ul>
<p class="rnote"><a href="http://www.askapache.com/search/cache/" rel="tag">cache</a> <a href="http://www.askapache.com/search/-wpcache/" rel="tag">-wpcache</a> <a href="http://www.askapache.com/search/-wp-cache/" rel="tag">-wp-cache</a> <a href="http://www.askapache.com/search/-wordpess/" rel="tag">-wordpess</a> <a href="http://www.askapache.com/search/-plugin/" rel="tag">-plugin</a> <a href="http://www.askapache.com/search/-askapache/" rel="tag">-askapache</a> <a href="http://www.askapache.com/search/-speed/" rel="tag">-speed</a></p>
<p><a href="http://feeds.askapache.com/~a/apache/htaccess?a=mwgS0W"><img src="http://feeds.askapache.com/~a/apache/htaccess?i=mwgS0W" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.askapache.com/~f/apache/htaccess?a=TFq8WZg"><img src="http://feeds.askapache.com/~f/apache/htaccess?i=TFq8WZg" border="0"></img></a> <a href="http://feeds.askapache.com/~f/apache/htaccess?a=xu3KwMg"><img src="http://feeds.askapache.com/~f/apache/htaccess?i=xu3KwMg" border="0"></img></a> <a href="http://feeds.askapache.com/~f/apache/htaccess?a=ajIbOSg"><img src="http://feeds.askapache.com/~f/apache/htaccess?i=ajIbOSg" border="0"></img></a> <a href="http://feeds.askapache.com/~f/apache/htaccess?a=CSOglAG"><img src="http://feeds.askapache.com/~f/apache/htaccess?i=CSOglAG" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/wordpress/crazy-cache-wordpress-plugin.html/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.askapache.com/wordpress/crazy-cache-wordpress-plugin.html</feedburner:origLink></item>
		<item>
		<title>Hacking VLAN switched networks</title>
		<link>http://feeds.askapache.com/~r/apache/htaccess/~3/261600071/hacking-vlan-switched-networks.html</link>
		<comments>http://www.askapache.com/security/hacking-vlan-switched-networks.html#comments</comments>
		<pubDate>Mon, 31 Mar 2008 23:48:53 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
		
		<category><![CDATA[Hacking]]></category>

		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.askapache.com/?p=541</guid>
		<description><![CDATA[<p><a rel="lb" class="IFL" href='http://z.askapache.com/uploads/2008/03/vlan-bypass.jpg'><img src="http://z.askapache.com/uploads/2008/03/vlan-bypass-150x150.jpg" alt="Bypassing VLAN security on networked switches" title="Bypassing VLAN security on networked switches" width="150" height="150" /></a>There isn't much vlan info on the net in terms of specifics and I had to learn all about it because I needed to log in to a switch that was on a different vlan. With the help of the Ettercap developers NaGA and ALoR I figured it out.<br class="C" /></p>]]></description>
			<content:encoded><![CDATA[<p><a rel="lb" class="IFL" href='http://z.askapache.com/uploads/2008/03/vlan-bypass.jpg'><img src="http://z.askapache.com/uploads/2008/03/vlan-bypass-150x150.jpg" alt="Bypassing VLAN security on networked switches" title="Bypassing VLAN security on networked switches" width="150" height="150" /></a><strong>I wanted to post this for those rare hackers and network admins out there trying to find vlan info.</strong>  Even though vlans are rarer these days..There isn&#8217;t much vlan info on the net in terms of specifics and I had to learn all about it because I needed to log in to a switch that was on a different vlan. Impossible? No it is really easy after the research.. It was beautiful when I finally got to that terminal login.<br class="C" /></p>
<p class="bnote"><strong>Update:  </strong>  There is a great resource for vlan information now available at <a href="http://wiki.wireshark.org/CaptureSetup/VLAN">Capturing VLAN Packets</a> from the incomparable, uncommonly great open-source gem <a href="http://wireshark.askapache.com/" title="An Official U.S. Mirror for WireShark.org">WireShark</a></p>
<hr />
<h2>Discussion I had with the developers of ettercap.</h2>
<p>The original post is still up on the <a href="http://ettercap.sourceforge.net/forum/viewtopic.php?t=2134">Ettercap Development Form</a></p>
<p>
<strong>VLAN Virtual Lan. VLAN spoof. Layer-2 switch. wvlan.</strong></p>
<p>Hello there, first post here. First I want to thank all of the developers for an outstanding product. Also I notice that you freely give your time to peruse through the forums and help people. Outstanding..</p>
<p>My problem is this.</p>
<p>I am connected to an Allied Telesyn 8024 layer 2 switch (http://alliedtelesyn.com/products/details.aspx?9) with port security enabled to the Secure mode. By misconfiguration, only the switch itself is on a vlan. The router is not, the other switches in the network are also not. No ports are included in this vlan on the switch. The management vlan is 1. The switch checks its CAM table for the correct mac from the correct port before it forwards the frame. This means that a remote management session is highly improbable from the current setup (static mapping). The only response I can get from the switch is with an arp request. For this I use the arping utility for linux.</p>
<p>The switch is on vlan 1. Here is an ethereal capture of an arp reply from the switch.
</p>
<pre>
No. Time Source Destination Protocol Info
3 1.500954 AlliedTe_XX:XX:XX LinksysG_XX:XX:XX 0&#215;0806 ARP
&nbsp;
Frame 3 (60 bytes on wire, 60 bytes captured)
Arrival Time: May 29, 2004 15:21:41.982501000
Time delta from previous packet: 0.001966000 seconds
Time since reference or first frame: 1.500954000 seconds
Frame Number: 3
Packet Length: 60 bytes
Capture Length: 60 bytes
Ethernet II, Src: 00:30:84:XX:XX:XX, Dst: 00:04:5a:XX:XX:XX
Destination: 00:04:5a:XX:XX:XX (LinksysG_XX:XX:XX)
Source: 00:30:84:XX:XX:XX (AlliedTe_XX:XX:XX)
Type: 802.1Q Virtual LAN (0&#215;8100)
802.1q Virtual LAN
000. &#46;&#8230; &#46;&#8230; &#46;&#8230; = Priority: 0
&#46;..0 &#46;&#8230; &#46;&#8230; &#46;&#8230; = CFI: 0
&#46;&#8230; 0000 0000 0001 = ID: 1
Type: ARP (0&#215;0806)
Data (42 bytes)
&nbsp;
0000 00 04 5a XX XX XX 00 30 84 XX XX XX 81 00 00 01 ..Zj&#46;..0.M. &#46;&#8230;
0010 08 06 00 01 08 00 06 04 00 02 00 30 84 XX XX XX &#46;..&#46;..&#46;&#8230;.0.M.
0020 ac 10 00 05 00 04 5a XX XX XX ac 10 00 80 00 00 &#46;..&#46;..Zj&#46;..&#46;&#8230;.
0030 00 00 00 00 00 00 00 00 00 00 00 00 &#46;..&#46;..&#46;..&#46;..
</pre>
<p>The switch connects to the router through port 24. Enhanced Stacking is enabled and this switch is set up as a master. It can only see 1 other switch. The second switch is between the first switch and the router. I am unable to connect to the second switch or get any type of response. This is important because if I could connect to the second switch via telnet or web management, I could set it up as a master and reconfigure switch one. So keep that in mind.</p>
<p>I am able to use ettercap to <strong>arp poison</strong> all of the other hosts connected to the switch. I am not able to see the rest of the net. I know the rest of the net is there from broadcast arps from the router. I also have the macs and IPS of most of them.</p>
<p>Would it be possible to DoS the switch? Any recommendations? What about some type of vlan packet DoSer.</p>
<p>Could I use ifconfig to spoof my mac and ip address to look like an allied telesyn switch, and then generate packets with the correct vlan header to access the switch management ports?</p>
<p>How can I generate vlan packets (libnids, libnet, libdnet) and use them with ettercap?</p>
<p>What, as developers, are you thinking about vlans? As they are becoming increasingly used. Don&#8217;t tell me this is the beginning of the end for ettercap!</p>
<p>Trunking is not enabled. Spanning tree is not enabled.</p>
<blockquote>
<p><strong>&#8230; with port security enabled to the Secure mode.</strong></p>
<p>Looking at the docs, there are three modes of Port Security on your switch. In &#8220;Limited mode&#8221; the port is only going to allow a preset number of mac address to be learned from each port. Anything else is dropped. If that&#8217;s the case, see if you can get into another port that may be misconfigured. This port could be used by a second NIC to send out the spoofed ARPs. This isn&#8217;t built into ettercap but nemesis would do the trick. Just write a shell script to repeat the ARP every 10 seconds or so.</p>
<p>Another thing you may want to look into is becoming a trunk port. Chances are your admins have removed this function as well but be careful, apparently the switch can only handle one trunk at a time (what a cheap switch!).</p>
<p>When all else fails find the console, hook up a serial cable, reset it and hit enter while it&#8217;s booting. type &#8220;boot&#8221; at the prompt and then put the password of &#8220;admin&#8221; in.</p>
<p>(WARNING - all advise here can get you into deep doodoo. If you&#8217;re not authorized to do any of these things and you get caught, you&#8217;re SOL)</p>
<p>I really think your best option is a second NIC with nemesis. If port security is enabled then you&#8217;re really kinda stuck. Can&#8217;t overflow, can&#8217;t mitm.</p>
</blockquote>
<h3>Solution</h3>
<p><strong>Whoah&#8230;</strong></p>
<p>I was going to try the various types of attacks in those articles, and had the libnet codes all ready, but then I decided to look here <a href="http://www.candelatech.com/~greear/vlan.html">http://www.candelatech.com/~greear/vlan.html</a></p>
<p>I recompiled my kernel with 8021q as a loadable module. (included with my kernel)</p>
<p>I edited my rc.d/rc.local file with the lines</p>
<pre>
/sbin/i forget it loads the module dependencies.
&nbsp;
/sbin/modprobe -a 8021q
</pre>
<p>and then rebooted, I installed the vconfig utility (rpmfind.net) and then did</p>
<pre>
$ vconfig add eth0 1 (1 is the vlan id I needed) This created device eth0.1
&nbsp;
$ ifconfig eth0.1 netmask 255.255.255.0 broadcast 255.255.255.255 hw ether (mac from eth0 becasue port security is on and drops all other macs) (IP but different from eth0)
&nbsp;
$ ifconfig eth0.1 up
</pre>
<p>Now, I tried to ping the switch and examined packets in ethereal on the &#8220;any&#8221; device.</p>
<pre>
$ ping switch&nbsp;&nbsp;//didn&#039;t work.
&nbsp;
$ ping -I eth0.1 switch //Bingo! It responded!
&nbsp;
$ telnet -b eth0.1 switch
</pre>
<p>Bingo!  I then configured the switch to operate correctly, saved changes, and quit. I rmmod 8120q and edited rc.d file. Fixed.</p>
<p>Standard Port security has nothing to do with arp poisoning, because &#8220;spoofed&#8221; arp packets have the right source mac address of the ettercap machine.</p>
<p>Well the switch had a predefined static mac address that was allowed on each individual port. IOW, I couldn&#8217;t connect to anything with a mac other than the one predefined. Not even by spoofing other legal macs located on different ports.</p>
<p>Maybe you guys should look into a plugin that spoofs a vlan header so you could arp poison different vlans?</p>
<blockquote><p><strong>NaGA</strong> wrote:</p>
<p>Standard Port security has nothing to do with arp poisoning, because &#8220;spoofed&#8221; arp packets have the right source mac address of the ettercap machine.</p>
<p>D&#8217;oh, you&#8217;re right. My brain wasn&#8217;t engaged while replying. I was thinking about something entirely different.</p></blockquote>
<blockquote><p>
<strong>ALoR</strong> wrote:</p>
<blockquote><p>Maybe you guys should look into a plugin that spoofs a vlan header so you could arp poison different vlans?</p>
</blockquote>
<p>you can use the in-kernel support for 802.1q and setup a virtual NIC on that vlan, then use the -i to select it as the default interface</p>
</blockquote>
<h2>Downloads and Documents</h2>
<p>Ive googled the sauce out of vlan info and these are the best docs I&#8217;ve come across.  It includes actual code used with libnet to attempt the various types of attacks with vlans. A must read.</p>
<ul>
<li><a id="p52" href="http://z.askapache.com/uploads/2006/12/vlan-security-3.pdf">VLAN Security: weaknesses and countermeasures</a></li>
<li><a id="p53" href="http://z.askapache.com/uploads/2006/12/blackhat-switches-vlan.pdf">BLACKHAT Presentation on VLANs and switches</a></li>
<li><a href="http://standards.ieee.org/getieee802/download/802.1Q-1998.pdf">Info on the VLAN protocol</a></li>
</ul>
<h2>Making unidirectional VLAN and PVLAN jumping bidirectional</h2>
<blockquote><p>Advisory:                     Making unidirectional VLAN and PVLAN<br />
jumping bidirectional<br />
Class:                          design bug<br />
Vulnerable protocols:   802.1q, various PVLAN implementations<br />
Model Specific:           This is a protocol, and not vendor-specific attack</p>
<p>DETAILS:</p>
<p>Wepwedgie, a tool by Anton Rager for traffic injection on 802.11<br />
networks protected by WEP, solves the problem of unidirectional<br />
communication by bouncing packets from the target host to a third<br />
external host under the attackers control. We employ exactly the same<br />
principle to bypass both VLAN and PVLAN network segmentation.</p>
<p>1. Modification of the double-tagging VLAN jumping attack.</p>
<p>The attacker tags his malicious data with two 802.1q tags and sends the<br />
packet with a spoofed source IP of a host under his or her control. This<br />
can be any host to which a valid route from the target VLAN is present,<br />
including an external host on the Internet. The first tag gets stripped<br />
by the switch the attacker is plugged into and the packet is forwarded<br />
to the next switch. The remaining tag contains a different VLAN number,<br />
to which the packet is sent. So, data is forced to pass between the<br />
VLANs. The receiving host will check the source IP of the arriving<br />
packet and send the reply to this IP, which is a host that belongs to<br />
the attacker.</p>
<p>This attack can be launched using Yersinia<br />
(http://sourceforge.net/projects/yersinia/).</p>
<p>2. Modification of the MAC spoofing PVLAN jumping attack.</p>
<p>The attacker sends a packet with a valid source MAC but a spoofed source<br />
IP of a host under his or her control. This can be any host to which a<br />
valid route from the target PVLAN is present, including an external host<br />
on the Internet. The target MAC address is replaced with the one of a<br />
gateway router. A switch would forward such packet to the router, which<br />
will then look at the IP and direct the packet to the target. Of course,<br />
the source MAC of the packet will be replaced by the one of the router,<br />
which would then direct the reply packet from the target to the host<br />
that belongs to the attacker.</p>
<p>This attack can be launched using pvlan.c from the Steve A. Rouiller&#8217;s<br />
&#8220;Virtual LAN Security: weaknesses and countermeasures&#8221; GIAC Security<br />
Essentials Practical Assignment.</p>
<p>Note: Such attacks can be used for different purposes from portscanning<br />
to communicating with a backdoor on a different VLAN or PVLAN.</p>
<p>Risk Factor: Medium</p>
<p>Workarounds: There are no direct workarounds. Implement strict egress<br />
filtering against the spoofed packets described.</p>
</blockquote>
<h2>Interview of ALoR and NaGA</h2>
<p>Here is a quick interview with Alberto Ornaghi (a.k.a. ALoR) and Marco Valleri (a.k.a. NaGA). Each is 26 years old, and they work as security consultants for two different company in Milan.</p>
<p><a href="http://www.newsforge.com/article.pl?sid=04/11/04/2114203">http://www.newsforge.com/article.pl?sid=04/11/04/2114203</a></p>
<h2>Other Links</h2>
<ul>
<li><a href="http://lists.grok.org.uk/pipermail/full-disclosure/2005-December/040333.html">Making unidirectional VLAN and PVLAN jumping bidirectional</a></li>
<li><a href="http://ettercap.sourceforge.net/forum/viewtopic.php?t=2&#038;highlight=vlan">Ettercap and Switches</a></li>
</ul>
<h2>VLAN Setup and Configuration for virtual VLAN device</h2>
<h4>802.1Q VLAN implementation for Linux</h4>
<p>
To get started, you will want to download the latest vlan.X.X.tar.gz file (to your $HOME directory.) Unpack it with your favorite commands, for example: tar -xvzf vlan.1.6.tar.gz Alternatively, you can get it from the CVS Repository using something like this:
</p>
<ol>
<li>Install and configure on your machine.</li>
<li>Specify the vlan repository:<br />
<code>export CVSROOT=:pserver:anonymous@cvs.candelatech.com:/home/cvs_user/vlan</code></li>
<li>Log in to the repository:<br />
<code>cvs login&nbsp;&nbsp;&nbsp;&nbsp; (PASSWORD: anonymous)</code></li>
<li>Check out the source:<br />
<code>mkdir vlan; cd vlan; cvs -z3 checkout vlan</code></li>
</ol>
<p>Now, you should have a vlan directory in your home directory. You only have to patch the kernel if you are using Linux 2.4.14 or earlier. Now, read the README or other docs to figure out what kernel it patches against. A list of mirrors are kept at www.kernel.org. Unzip and un-tar this in your home directory as well, which should create a linux directory in your $HOME directory. Example: tar -xvzf linux-2.2.14.tar.gz</p>
<p>Now add the VLAN kernel changes to the kernel if your kernel requires it. I finally figured out how to do patches that diff can handle (I think I did it right at least!). You will find the patch in the vlan directory. It will be called: vlan.patch, or something equally straight-foward. Apply the patch to your kernel:</p>
<pre>
cd $HOME/linux
patch -p 1 &lt; $HOME/vlan/[vlan.patch]
</pre>
<p>
Your new, patched, kernel should be in your INCLUDE path before trying to compile the vconfig program. One way to get things working is to link $HOME/linux to the &#8216;linux&#8217; directory that you just un-zipped and patched. A command might be something like: cd $HOM