<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Web on Inliniac</title>
    <link>https://inliniac.net/blog/category/web/</link>
    <description>Recent content in Web on Inliniac</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Mon, 27 Aug 2007 15:06:22 +0000</lastBuildDate>
    <atom:link href="https://inliniac.net/blog/category/web/feed.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>ModSecurity rule for Tikiwiki XSS</title>
      <link>https://inliniac.net/blog/2007/08/27/modsecurity-rule-for-tikiwiki-xss/</link>
      <pubDate>Mon, 27 Aug 2007 15:06:22 +0000</pubDate>
      <guid>https://inliniac.net/blog/2007/08/27/modsecurity-rule-for-tikiwiki-xss/</guid>
      <description>&lt;p&gt;I just read about a Tikiwiki XSS here. Since the Vuurmuur wiki runs Tikiwiki I created a ModSecurity rule for it:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;SecDefaultAction &amp;ldquo;log,deny,phase:2,status:403,t:urlDecodeUni,t:lowercase&amp;rdquo;&lt;/p&gt;&#xA;&lt;p&gt;# XSS in remind password field&#xA;SecRule REQUEST_METHOD &amp;ldquo;^post$&amp;rdquo; &amp;ldquo;chain,msg:&amp;lsquo;TIKIWIKI lost password XSS&amp;rsquo;&amp;rdquo;&#xA;SecRule REQUEST_FILENAME &amp;ldquo;tiki-remind_password.php&amp;rdquo; &amp;ldquo;chain&amp;rdquo;&#xA;SecRule ARGS:/s*username/ &amp;ldquo;!^(:?[a-z0-9-_]{1,37})$&amp;rdquo;&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;This allows only valid usernames to be entered.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: Ivan Ristic privately pointed me at some possible problems with the rule:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;the escaping of the - and _ chars is not needed, although it seems to be harmless.&lt;/li&gt;&#xA;&lt;li&gt;the $ at the end of the filename is dangerous, because Apache treats tiki-remind_password.php/xxx as tiki-remind_password.php. In this case the rule is evaded.&lt;/li&gt;&#xA;&lt;li&gt;PHP (which Tikiwiki uses) ignores leading spaces in request arguments. So it treats &amp;rsquo; username&amp;rsquo; the same as &amp;lsquo;username&amp;rsquo;. The rule needs to deal with that.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Thanks for your feedback Ivan!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Using Modsec2sguil for HTTP transaction logging revisited</title>
      <link>https://inliniac.net/blog/2007/08/22/using-modsec2sguil-for-http-transaction-logging-revisited/</link>
      <pubDate>Wed, 22 Aug 2007 20:05:34 +0000</pubDate>
      <guid>https://inliniac.net/blog/2007/08/22/using-modsec2sguil-for-http-transaction-logging-revisited/</guid>
      <description>&lt;p&gt;Recently I wrote about the idea to log all HTTP transactions into Sguil using my Modsec2sguil agent. I&amp;rsquo;ve implemented this in the current &lt;a href=&#34;http://www.inliniac.net/modsec2sguil/&#34;&gt;0.8-dev5&lt;/a&gt; release and it works very well. All events go into Sguil smoothly and I&amp;rsquo;ve not experienced slowdowns on the webserver. I&amp;rsquo;ve been running it for almost a week now, like to share the first experiences here.&lt;/p&gt;&#xA;&lt;p&gt;I find it to be quite useful. When receiving an alert, it is perhaps more interesting to see what else was done from that ipaddress than to see what was blocked (unless you are suspecting a false positive of course). One area I find to be useful is when I&amp;rsquo;m creating rules against comment spam on this blog. By seeing all properties of a spam message I can create better rules. For example on broken user-agents or weird codes inserted into the comment field of Wordpress.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Update on using realtime blacklists with ModSecurity</title>
      <link>https://inliniac.net/blog/2007/03/01/update-on-using-realtime-blacklists-with-modsecurity/</link>
      <pubDate>Thu, 01 Mar 2007 08:04:55 +0000</pubDate>
      <guid>https://inliniac.net/blog/2007/03/01/update-on-using-realtime-blacklists-with-modsecurity/</guid>
      <description>&lt;p&gt;A few days ago I posted a blog article about stopping comment spam with ModSecurity using realtime blacklists (rbl). While the approach was working, I noted having problems with rules when I tried to match on POST methods in HTTP requests.&lt;/p&gt;&#xA;&lt;p&gt;Luckily, ModSecurity creator Ivan Ristic was quick to point out where the problem is. I&amp;rsquo;m using the Core Ruleset for ModSecurity, and one thing that ruleset does is use the &amp;rsquo;lowercase&amp;rsquo; transformation. This converts all text from arguments to lowercase, so my ^POST$ match would never be able to match. So like Ivan suggested, using ^post$ solved this part.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Blocking comment spam using ModSecurity and realtime blacklists</title>
      <link>https://inliniac.net/blog/2007/02/23/blocking-comment-spam-using-modsecurity-and-realtime-blacklists/</link>
      <pubDate>Thu, 22 Feb 2007 22:25:45 +0000</pubDate>
      <guid>https://inliniac.net/blog/2007/02/23/blocking-comment-spam-using-modsecurity-and-realtime-blacklists/</guid>
      <description>Spammers are known to use compromised hosts from all over the world to send their messages. Many people are blocking or scoring email spam based on realtime blacklist (rbl), which contain ipaddresses of these known bad hosts. In my experience this works fairly well for email. A while ago I noticed in the ModSecurity documentation for version 2.0 that ModSecurity features an operator called &lt;a href=&#34;http://modsecurity.org/documentation/modsecurity-apache/2.1.0-rc6/html-multipage/08-operators.html#N11490&#34;&gt;rbl&lt;/a&gt;, that can be used to check the ipaddress of a visitor with a rbl. So I decided to see if I could use the realtime blacklists to prevent comment spam on my blog. Turns out this works great! In this post I&amp;rsquo;ll show how to get it working.</description>
    </item>
    <item>
      <title>Migrating from ModSecurity 1.9.4 to 2.0.4</title>
      <link>https://inliniac.net/blog/2007/01/20/migrating-from-modsecurity-194-to-204/</link>
      <pubDate>Sat, 20 Jan 2007 10:34:05 +0000</pubDate>
      <guid>https://inliniac.net/blog/2007/01/20/migrating-from-modsecurity-194-to-204/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;http://www.modsecurity.org/&#34;&gt;ModSecurity&lt;/a&gt; 2 has been out for a while now, and although I have played with it some, I never found some time to upgrade my own servers. The upgrading generally went quite smooth, even though ModSecurity 2 changed quite a bit.&lt;/p&gt;&#xA;&lt;p&gt;First of all there are now 5 phases where you can filter. Actually, one of them only applies to the logging, so you can filter in 4 phases. The phases are headers and body for both request and response traffic. Filtering on specific URIs can be done in phase 1 (request headers), while inspecting a POST payload requires phase 2 (request body).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Detecting and blocking Phishing with Snort and ClamAV</title>
      <link>https://inliniac.net/blog/2006/11/12/detecting-and-blocking-phishing-with-snort-and-clamav/</link>
      <pubDate>Sun, 12 Nov 2006 18:12:31 +0000</pubDate>
      <guid>https://inliniac.net/blog/2006/11/12/detecting-and-blocking-phishing-with-snort-and-clamav/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;http://www.clamav.net/&#34;&gt;ClamAV&lt;/a&gt; is a great Open Source virusscanner that can be used for detecting virusses from &lt;a href=&#34;http://www.snort.org/&#34;&gt;Snort&lt;/a&gt; or &lt;a href=&#34;http://snort-inline.sf.net/&#34;&gt;Snort_inline&lt;/a&gt; using the &lt;a href=&#34;http://www.bleedingthreats.net/staticpages/index.php?page=snort-clamav&#34;&gt;ClamAV preprocessor&lt;/a&gt;. However, by using the anti-phishing and anti-scam signatures by &lt;a href=&#34;http://www.sanesecurity.com/clamav/&#34;&gt;SaneSecurity&lt;/a&gt;, this combination can also be used to detect and block phishing and scam attempts. Here is how to set it up.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve decided to run this on my gateway, which is a slow machine. Because I don&amp;rsquo;t want all my traffic to slow down to much, I&amp;rsquo;m not going to run the ClamAV defs, only the anti-phishing ones. The default location of the defs on my Debian Sarge system is /var/lib/clamav, so I&amp;rsquo;ve created a new directory called &amp;lsquo;/var/lib/clamav-phish&amp;rsquo;. Next I&amp;rsquo;ve downloaded the defs from &lt;a href=&#34;http://www.sanesecurity.com/clamav/downloads.htm&#34;&gt;SaneSecurity&lt;/a&gt;. After unzipping them and the defs were ready.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rules for reported Tikiwiki vulnerabilities</title>
      <link>https://inliniac.net/blog/2006/11/02/rules-for-reported-tikiwiki-vulnerabilities/</link>
      <pubDate>Thu, 02 Nov 2006 11:02:52 +0000</pubDate>
      <guid>https://inliniac.net/blog/2006/11/02/rules-for-reported-tikiwiki-vulnerabilities/</guid>
      <description>&lt;p&gt;Yesterday there was a mail to the bugtraq mailinglist about two types of vulnerabilties in Tikiwiki 1.9.5. The most serious is a claimed MySQL password disclosure through a special URI. The second is an XSS, also through an special URI. The message can be found &lt;a href=&#34;http://www.securityfocus.com/archive/1/450268/30/0&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I wrote &amp;lsquo;claimed password disclosure&amp;rsquo;, because on the Tikiwiki server I run, I could not reproduce it. With that I mean the password disclosure, since I do see that Tikiwiki gives an error that reveals other information, most notably the location of the website on the local filesystem.&lt;/p&gt;</description>
    </item>
    <item>
      <title>ModSecurity: rule for latest Tikiwiki vulnerability</title>
      <link>https://inliniac.net/blog/2006/09/06/mod_security-rule-for-latest-tikiwiki-vulnerability/</link>
      <pubDate>Wed, 06 Sep 2006 13:02:57 +0000</pubDate>
      <guid>https://inliniac.net/blog/2006/09/06/mod_security-rule-for-latest-tikiwiki-vulnerability/</guid>
      <description>&lt;p&gt;A few days ago a new vulnerability was &lt;a href=&#34;http://isc.sans.org/diary.php?storyid=1672&#34;&gt;reported&lt;/a&gt; in &lt;a href=&#34;http://tikiwiki.org/tiki-index.php&#34;&gt;Tikiwiki&lt;/a&gt; 1.9.x, the software I use for the Vuurmuur Wiki. Luckily, the Snort.org Community rules quickly had &lt;a href=&#34;http://www.snort.org/pub-bin/snortnews.cgi#506&#34;&gt;a rule for detecting&lt;/a&gt; the attack. Because I also run ModSecurity on the webserver, i wanted to have protection there as well. This rule should block the attack:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;SecFilterSelective POST_PAYLOAD &amp;ldquo;jhot.php&amp;rdquo; &amp;ldquo;log,deny,status:403,msg:&amp;lsquo;LOCAL tikiwiki jhot.php attempt&amp;rsquo;&amp;rdquo;&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s see if I ever get a hit on it. An update for Tikiwiki as been released, so that should fix the issue completely.&lt;/p&gt;</description>
    </item>
    <item>
      <title>ModSecurity: rules against comment spam</title>
      <link>https://inliniac.net/blog/2006/08/23/mod_security-rules-against-comment-spam/</link>
      <pubDate>Wed, 23 Aug 2006 08:07:40 +0000</pubDate>
      <guid>https://inliniac.net/blog/2006/08/23/mod_security-rules-against-comment-spam/</guid>
      <description>&lt;p&gt;Lately the &lt;a href=&#34;http://wiki.vuurmuur.org/&#34;&gt;wiki&lt;/a&gt; of my &lt;a href=&#34;http://www.vuurmuur.org/&#34;&gt;Vuurmuur project&lt;/a&gt; has been receiving quite a lot of comment spam. Although removing the spam manually is boring work, i still don&amp;rsquo;t really mind the spam, because it enables me to practice with ModSecurity rules to fight it off. So far, the spam seems to be following a pattern, in which the spam is posted by bots, and has the same general layout for longer periods of time. That makes it worthwhile to spend time on creating rules against it. Yesterday a new type of spam emerged on the wiki. The following audit_log is for one of them. I had to slightly edit it for layout reasons.&lt;/p&gt;</description>
    </item>
    <item>
      <title>ModSecurity: more security by obscurity</title>
      <link>https://inliniac.net/blog/2006/08/17/mod_security-more-security-by-obscurity/</link>
      <pubDate>Thu, 17 Aug 2006 07:27:13 +0000</pubDate>
      <guid>https://inliniac.net/blog/2006/08/17/mod_security-more-security-by-obscurity/</guid>
      <description>&lt;p&gt;Yesterday, Philippe Baumgart showed me that my obscurity setup is not yet perfect. In fact, he could very easily enter an URL that didn&amp;rsquo;t exist and caused the webserver behind my proxy to respond with a 404. In this 404 the name and the version of the webserver were exposed.&lt;/p&gt;&#xA;&lt;p&gt;After some testing i found that adding the following to my config worked very well.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;# enable output scanning in Mod Security.&#xA;SecFilterScanOutput On&lt;/p&gt;</description>
    </item>
    <item>
      <title>ModSecurity: further improvements to the reverse proxy</title>
      <link>https://inliniac.net/blog/2006/08/14/mod_security-further-improvements-to-the-reverse-proxy/</link>
      <pubDate>Mon, 14 Aug 2006 08:52:55 +0000</pubDate>
      <guid>https://inliniac.net/blog/2006/08/14/mod_security-further-improvements-to-the-reverse-proxy/</guid>
      <description>&lt;p&gt;People can reach my webserver in three ways: by my domain inliniac.net, by the hostname connected to my dsl, and by my ipaddress. What i now wanted is setup the proxy in such a way, that only people visiting inliniac.net would be proxied to the webserver.&lt;/p&gt;&#xA;&lt;p&gt;Blocking requests that are IP based instead of name based have an important advantage. IP based requests are mostly used by scantools and other forms of malicious traffic that just attempt connecting to port 80 on large IP-ranges. So this way one should be able to keep a lot of crap like worm traffic out.&lt;/p&gt;</description>
    </item>
    <item>
      <title>ModSecurity: redirection</title>
      <link>https://inliniac.net/blog/2006/08/09/mod_security-redirection/</link>
      <pubDate>Tue, 08 Aug 2006 22:09:50 +0000</pubDate>
      <guid>https://inliniac.net/blog/2006/08/09/mod_security-redirection/</guid>
      <description>&lt;p&gt;Another nice feature of ModSecurity is rule based redirection. Lets say i want to block visitors of my website from opening the login page of wordpress, /blog/wp-login.php. I could of course just deny access to it, so the visitor gets a 403 error. This works fine, however sometimes you might want to use a more userfriendly message, for example: &amp;lsquo;Due to maintainance logins are currently disabled&amp;rsquo;.&lt;/p&gt;&#xA;&lt;p&gt;To do this i first created a very simple html file called nologin.html, and placed it in the webroot of the server. Then i added the following rules to Mod_Security:&lt;/p&gt;</description>
    </item>
    <item>
      <title>ModSecurity: directory hiding a.k.a. security by obscurity</title>
      <link>https://inliniac.net/blog/2006/08/06/mod_security-directory-hiding-aka-security-by-obscurity/</link>
      <pubDate>Sun, 06 Aug 2006 20:24:07 +0000</pubDate>
      <guid>https://inliniac.net/blog/2006/08/06/mod_security-directory-hiding-aka-security-by-obscurity/</guid>
      <description>&lt;p&gt;Ok, that&amp;rsquo;s a bit misleading, because i&amp;rsquo;m not just hiding, but also blocking and logging. What i wanted is this: I&amp;rsquo;m running awstats on my reverse proxy, but i don&amp;rsquo;t want anyone to know. So i just made the entire &amp;lsquo;cgi-bin&amp;rsquo; part forbidden for everyone, so that covers the script. The fact that my webserver has a cgi-bin directory is nothing special and won&amp;rsquo;t tell you i&amp;rsquo;m using awstats. However, awstats also uses icons, and these are by default in /awstats-icon/&lt;/p&gt;</description>
    </item>
    <item>
      <title>ModSecurity: setting up a reverse proxy</title>
      <link>https://inliniac.net/blog/2006/08/05/mod_security-setting-up-a-reverse-proxy/</link>
      <pubDate>Sat, 05 Aug 2006 13:35:49 +0000</pubDate>
      <guid>https://inliniac.net/blog/2006/08/05/mod_security-setting-up-a-reverse-proxy/</guid>
      <description>&lt;p&gt;A few weeks ago i wrote that i wanted to investigate setting up a reverse web proxy with mod_security. I have now finally found a little time to do so. What surprised me was how easy it actually is!&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&amp;lt;IfModule mod_proxy.c&amp;gt;&lt;/p&gt;&#xA;&lt;p&gt;#turning ProxyRequests on and allowing proxying from all may allow&#xA;#spammers to use your proxy to send email.&lt;/p&gt;&#xA;&lt;p&gt;ProxyRequests Off&lt;/p&gt;&#xA;&lt;p&gt;&amp;lt;Proxy *&amp;gt;&#xA;Order deny,allow&#xA;Allow from all&#xA;#Allow from .your_domain.com&#xA;&lt;/Proxy&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>ModSecurity: my first rules</title>
      <link>https://inliniac.net/blog/2006/07/11/mod_security-my-first-rules/</link>
      <pubDate>Tue, 11 Jul 2006 09:37:33 +0000</pubDate>
      <guid>https://inliniac.net/blog/2006/07/11/mod_security-my-first-rules/</guid>
      <description>&lt;p&gt;I have been using ModSecurity for quite some time now to protect a webserver, but i never felt the need to write my own rules. Recently though, my site got quite a lot of spam in the comments of my TikiWiki based site. Since i was not willing to disable the anonymous comment posting i decided to see if i could use Mod_Security to block the spam.&lt;/p&gt;&#xA;&lt;p&gt;The spam all looked alike with the following characteristics. It all contained a list uri&amp;rsquo;s with a pipe | before them. So decided to try the most easy way, by blocking all posts with this characteristic.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Books: Preventing Webattacks with Apache</title>
      <link>https://inliniac.net/blog/2006/07/10/books-preventing-webattacks-with-apache/</link>
      <pubDate>Mon, 10 Jul 2006 21:54:51 +0000</pubDate>
      <guid>https://inliniac.net/blog/2006/07/10/books-preventing-webattacks-with-apache/</guid>
      <description>&lt;p&gt;I just finished Preventing Webattacks with Apache by Ryan C. Barnett. Even though the title says it is about Apache it is really mostly about Mod_Security, and this is why i really love the book.&lt;/p&gt;&#xA;&lt;p&gt;Especially cool is the part of the book where the author challenges the user to setup his &amp;lsquo;Buggy Bank&amp;rsquo; example application to play with the vulnarebilities and with the possible counter measures.&lt;/p&gt;&#xA;&lt;p&gt;This book got me even more exited about Mod_Security, which I use already to protect one webserver. I plan to check out setting up a reverse filtering web proxy soon.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
