Imported Upstream version 2.3
[ossec-hids.git] / etc / rules / web_rules.xml
1 <!-- @(#) $Id: web_rules.xml,v 1.25 2009/09/25 14:35:20 dcid Exp $
2   -
3   -  Official Web access 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 3) as published by the FSF - Free Software
11   -  Foundation.
12   -
13   -  License details: http://www.ossec.net/en/licensing.html
14   -->
15   
16   
17 <group name="web,accesslog,">
18   <rule id="31100" level="0">
19     <category>web-log</category>
20     <description>Access log messages grouped.</description>
21   </rule>
22
23   <rule id="31101" level="5">
24     <if_sid>31100</if_sid>
25     <id>^4</id>
26     <description>Web server 400 error code.</description>
27   </rule>
28
29   <rule id="31102" level="0">
30     <if_sid>31101</if_sid>
31     <id>^403|^404</id>
32     <url>.jpg$|.gif$|favicon.ico$|.png$|robots.txt$|.css$</url>
33     
34     <!-- Add any other url to be ignored in here
35          (to avoid too many false positives from your site)
36     <url>|.html$|.jpe$</url>
37     -->
38     
39     <description>Ignored extensions on 400 error codes.</description>
40   </rule>
41   
42   <rule id="31103" level="6">
43     <if_sid>31100</if_sid>
44     <url>='|select%20|select+|insert%20|%20from%20|%20where%20|union%20|</url>
45     <url>union+|where+|null,null|xp_cmdshell</url>
46     <description>SQL injection attempt.</description>
47     <group>attack,sql_injection,</group>
48   </rule>
49   
50   <rule id="31104" level="6">
51     <if_sid>31100</if_sid>
52     
53     <!-- Attempt to do directory transversal, simple sql injections,
54       -  or access to the etc or bin directory (unix). -->
55     <url>%027|%00|%01|%7f|%2E%2E|%0A|%0D|../..|..\..|echo;|..</url>
56     <url>cmd.exe|root.exe|_mem_bin|msadc|/winnt/|</url>
57     <url>/x90/|default.ida|/sumthin|nsiislog.dll|chmod%|wget%|cd%|</url>
58     <url>cat%|exec%|rm%20</url>
59     <description>Common web attack.</description>
60     <group>attack,</group>
61   </rule>
62
63   <rule id="31105" level="6">
64     <if_sid>31100</if_sid>
65     <url>%3Cscript|%2Fscript|script>|script%3E|SRC=javascript|IMG%20|</url>
66     <url>%20ONLOAD=|INPUT%20|iframe%20</url>
67     <description>XSS (Cross Site Scripting) attempt.</description>
68     <group>attack,</group>
69   </rule>
70   
71   <rule id="31106" level="12">
72     <if_sid>31103, 31104, 31105</if_sid>
73     <id>^200</id>
74     <description>A web attack returned code 200 (success).</description>
75     <group>attack,</group>
76   </rule>
77
78   <!-- If your site have a search engine, you may need to ignore
79     - it in here.
80     -->
81   <rule id="31107" level="0">
82     <if_sid>31103, 31104, 31105</if_sid>
83     <url>^/search.php?search=|^index.php?searchword=</url>
84     <description>Ignored URLs for the web attacks</description>
85   </rule>
86
87   <rule id="31115" level="13" maxsize="2900">
88     <if_sid>31100</if_sid>
89     <description>URL too long. Higher than allowed on most </description>
90     <description>browsers. Possible attack.</description>
91     <group>invalid_access,</group>
92   </rule>
93
94   <!-- 500 error codes, server error
95     - http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
96     -->
97   <rule id="31120" level="5">
98     <if_sid>31100</if_sid>
99     <id>^50</id>
100     <description>Web server 500 error code (server error).</description>
101   </rule>
102
103   <rule id="31121" level="4">
104     <if_sid>31120</if_sid>
105     <id>^501</id>
106     <description>Web server 501 error code (Not Implemented).</description>
107   </rule>
108
109   <rule id="31122" level="5">
110     <if_sid>31120</if_sid>
111     <id>^500</id>
112     <options>alert_by_email</options>
113     <description>Web server 500 error code (Internal Error).</description>
114     <group>system_error,</group>
115   </rule>
116   
117   <rule id="31123" level="4">
118     <if_sid>31120</if_sid>
119     <id>^503</id>
120     <options>alert_by_email</options>
121     <description>Web server 503 error code (Service unavailable).</description>
122   </rule>
123   
124   <rule id="31151" level="10" frequency="10" timeframe="120">
125     <if_matched_sid>31101</if_matched_sid>
126     <same_source_ip />
127     <description>Mutiple web server 400 error codes </description>
128     <description>from same source ip.</description>
129     <group>web_scan,recon,</group>
130   </rule>
131
132   <rule id="31152" level="10" frequency="6" timeframe="120">
133     <if_matched_sid>31103</if_matched_sid>
134     <same_source_ip />
135     <description>Multiple SQL injection attempts from same </description>
136     <description>souce ip.</description>
137     <group>attack,sql_injection,</group>
138   </rule>
139   
140   <rule id="31153" level="10" frequency="8" timeframe="120">
141     <if_matched_sid>31104</if_matched_sid>
142     <same_source_ip />
143     <description>Multiple common web attacks from same souce ip.</description>
144     <group>attack,</group>
145   </rule>
146
147   <rule id="31154" level="10" frequency="8" timeframe="120">
148     <if_matched_sid>31105</if_matched_sid>
149     <same_source_ip />
150     <description>Multiple XSS (Cross Site Scripting) attempts </description>
151     <description>from same souce ip.</description>
152     <group>attack,</group>
153   </rule>
154   
155   <rule id="31161" level="10" frequency="8" timeframe="120">
156     <if_matched_sid>31121</if_matched_sid>
157     <same_source_ip />
158     <description>Multiple web server 501 error code (Not Implemented).</description>
159     <group>web_scan,recon,</group>
160   </rule>
161   
162   <rule id="31162" level="10" frequency="5" timeframe="120">
163     <if_matched_sid>31122</if_matched_sid>
164     <same_source_ip />
165     <description>Multiple web server 500 error code (Internal Error).</description>
166     <group>system_error,</group>
167   </rule>
168   
169   <rule id="31163" level="10" frequency="8" timeframe="120">
170     <if_matched_sid>31123</if_matched_sid>
171     <same_source_ip />
172     <description>Multiple web server 503 error code (Service unavailable).</description>
173     <group>web_scan,recon,</group>
174   </rule>
175 </group> <!-- Web access log -->