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