Imported Upstream version 2.7
[ossec-hids.git] / etc / rules / squid_rules.xml
1 <!-- @(#) $Id: ./etc/rules/squid_rules.xml, 2011/09/08 dcid Exp $
2
3   -  Official Squid rules for OSSEC.
4   -
5   -  Copyright (C) 2009 Trend Micro Inc.
6   -  All rights reserved.
7   -
8   -  This program is a free software; you can redistribute it
9   -  and/or modify it under the terms of the GNU General Public
10   -  License (version 2) as published by the FSF - Free Software
11   -  Foundation.
12   -
13   -  License details: http://www.ossec.net/en/licensing.html
14   -
15   -  Contributed by: Ahmet Ozturk
16   -->
17   
18
19 <!-- More information about squid codes below:
20    - http://www.uniar.ukrnet.net/tools/Squid-FAQ/FAQ-6.html
21   -->
22
23   
24 <!-- Squid frequency -->
25 <var name="SQUID_FREQ">8</var>
26
27   
28 <group name="squid,">
29   <rule id="35000" level="0">
30     <category>squid</category>
31     <description>Squid messages grouped.</description>
32   </rule>    
33
34   <!-- Pre-rule with all the 400 error codes.
35      - This will make searching faster for most
36      - of the traffic.
37     --> 
38      
39   <rule id="35002" level="4">
40     <if_sid>35000</if_sid>
41     <id>^4|^5|^6</id>
42     <description>Squid generic error codes.</description>
43   </rule>
44     
45   <rule id="35003" level="5">
46     <if_sid>35002</if_sid>
47     <id>^400</id>
48     <description>Bad request/Invalid syntax.</description>
49   </rule>
50
51   <rule id="35004" level="5">
52     <if_sid>35002</if_sid>
53     <id>^401</id>
54     <description>Unauthorized: Failed attempt to access </description>
55     <description>authorization-required file or directory.</description>
56   </rule>
57
58   <rule id="35005" level="5">
59     <if_sid>35002</if_sid>
60     <id>^403</id>
61     <description>Forbidden: Attempt to access forbidden file </description>
62     <description>or directory.</description>
63   </rule>
64
65   <rule id="35006" level="5">
66     <if_sid>35002</if_sid>
67     <id>^404</id>
68     <description>Not Found: Attempt to access non-existent </description>
69     <description>file or directory.</description>
70   </rule>
71
72   <rule id="35007" level="5">
73     <if_sid>35002</if_sid>
74     <id>^407</id>
75     <description>Proxy Authentication Required: User is not </description>
76     <description>authorized to use proxy.</description>
77   </rule>
78
79   <rule id="35008" level="5">
80     <if_sid>35002</if_sid>
81     <id>^4</id>
82     <description>Squid 400 error code (request failed).</description>
83   </rule>
84
85   <rule id="35009" level="5">
86     <if_sid>35002</if_sid>
87     <id>^5|^6</id>
88     <description>Squid 500/600 error code (server error).</description>
89   </rule>
90   
91   <rule id="35010" level="4">
92     <if_sid>35009</if_sid>
93     <id>^503</id>
94     <description>Squid 503 error code (server unavailable).</description>
95   </rule>
96   
97   <!-- Special rules for 403/404 errors -->
98   <rule id="35021" level="6">
99     <if_sid>35006</if_sid>
100     <url>blst.php|xxx3.php|ngr7.php|ngr2.php|/nul.php$|/mul.php$|/444.php</url>
101     <description>Attempt to access a Beagle worm (or variant) </description>
102     <description>file.</description>
103     <info type="link">http://www.symantec.com/avcenter/venc/data/w32.beagle.dp.html</info>
104     <info type="text">W32.Beagle.DP is a Worm that drops Trojan.Lodear and opens a back door on the compromised computer.</info>
105     <group>automatic_attack,</group>
106   </rule>
107   
108   <!-- Other worms -->
109   <rule id="35022" level="6">
110     <if_sid>35006</if_sid>
111     <url>/jk/exp.wmf$|/PopupSh.ocx$</url>
112     <description>Attempt to access a worm/trojan related site.</description>
113     <group>automatic_attack,</group>
114   </rule>
115   
116   <!-- Ignoring google earth, ms web site access and some other
117     -  common extensions to cause false positives (specially anti virus).
118     -  It includes most of the time bugs on IE that always
119     -  access these pages (causing 403/404 errors).
120     -->
121   <rule id="35023" level="0">
122     <if_sid>35004, 35005, 35006, 35009</if_sid>
123     <url>.jpg|.gif|favicon.ico$|.png$|.swf|.txt$|.zip|.css|.xml|.js|.bmp$|</url>
124     <url>windowsupdate/redir/wuredir.cab|</url>
125     <url>^http://codecs.microsoft.com/isapi/ocget.dll|</url>
126     <url>^http://activex.microsoft.com/objects/ocget.dll|</url>
127     <url>^http://webmessenger.msn.com/session/null|</url>
128     <url>^http://sqm.msn.com/sqm/wmp/sqmserver.dll|</url>
129     <url>^http://config.messenger.msn.com/Config/MsgrConfig.asmx|</url>
130     <url>kaspersky-labs.com/|</url>
131     <url>^http://liveupdate.symantecliveupdate.com/|</url>
132     <url>_vti_bin/owssvr.dll|MSOffice/cltreq.asp|</url>
133     <url>google.com/mt?|</url>
134     <url>google.com/kh?|</url>
135     <url>^http://kh.google.com/flatfile</url>
136
137     <!-- Add more extensions to be ignored in here.
138     <url>|.html$|.htm</url>
139       -->
140
141     <description>Ignored files on a 40x error.</description>
142   </rule>                        
143   
144   <!-- Context relevant rules (correlated) -->
145   <rule id="35051" level="10" frequency="$SQUID_FREQ" timeframe="120">
146     <if_matched_sid>35005</if_matched_sid>
147     <same_source_ip />
148     <different_url />
149     <description>Multiple attempts to access forbidden file </description>
150     <description>or directory from same source ip.</description>
151   </rule>
152
153   <rule id="35052" level="10" frequency="$SQUID_FREQ" timeframe="120">
154     <if_matched_sid>35007</if_matched_sid>
155     <same_source_ip />
156     <description>Multiple unauthorized attempts to use proxy.</description>
157   </rule>
158
159   <rule id="35053" level="10" frequency="$SQUID_FREQ" timeframe="120">
160     <if_matched_sid>35003</if_matched_sid>
161     <same_source_ip />
162     <different_url />
163     <description>Multiple Bad requests/Invalid syntax.</description>
164   </rule>
165
166   <rule id="35054" level="12" frequency="$SQUID_FREQ" timeframe="240">
167     <if_matched_sid>35021</if_matched_sid>
168     <same_source_ip />
169     <description>Infected machine with W32.Beagle.DP.</description>
170     <info type="link">http://www.symantec.com/avcenter/venc/data/w32.beagle.dp.html</info>
171     <info type="text">W32.Beagle.DP is a Worm that drops Trojan.Lodear and opens a back door on the compromised computer.</info>
172   </rule>
173   
174   <rule id="35055" level="10" frequency="$SQUID_FREQ" timeframe="90">
175     <if_matched_sid>35006</if_matched_sid>
176     <same_source_ip />
177     <different_url />
178     <description>Multiple attempts to access a non-existent file.</description>
179   </rule>
180
181   <rule id="35056" level="12" frequency="$SQUID_FREQ" timeframe="240">
182     <if_matched_sid>35022</if_matched_sid>
183     <same_source_ip />
184     <description>Multiple attempts to access a worm/trojan/virus </description>
185     <description>related web site. System probably infected.</description>
186   </rule>
187   
188   <rule id="35057" level="10" frequency="$SQUID_FREQ" timeframe="240">
189     <if_matched_sid>35008</if_matched_sid>
190     <same_source_ip />
191     <different_url />
192     <description>Multiple 400 error codes (requests failed).</description>
193   </rule>
194
195   <rule id="35058" level="10" frequency="$SQUID_FREQ" timeframe="240">
196     <if_matched_sid>35009</if_matched_sid>
197     <same_source_ip />
198     <different_url />
199     <description>Multiple 500/600 error codes (server error).</description>
200   </rule>
201
202   <rule id="35095" level="0" frequency="2" timeframe="360">
203     <if_matched_sid>35055</if_matched_sid>
204     <same_source_ip />
205     <description>Ignoring multiple attempts from same source ip</description>
206     <description> (alert only once).</description>
207   </rule>
208
209 </group> <!-- ACCESSLOG,SQUID -->
210
211 <!-- EOF -->
212