1 <!-- @(#) $Id: web_rules.xml,v 1.25 2009/09/25 14:35:20 dcid Exp $
3 - Official Web access rules for OSSEC.
5 - Copyright (C) 2009 Trend Micro Inc.
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
13 - License details: http://www.ossec.net/en/licensing.html
17 <group name="web,accesslog,">
18 <rule id="31100" level="0">
19 <category>web-log</category>
20 <description>Access log messages grouped.</description>
23 <rule id="31101" level="5">
24 <if_sid>31100</if_sid>
26 <description>Web server 400 error code.</description>
29 <rule id="31102" level="0">
30 <if_sid>31101</if_sid>
32 <url>.jpg$|.gif$|favicon.ico$|.png$|robots.txt$|.css$</url>
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>
39 <description>Ignored extensions on 400 error codes.</description>
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>
50 <rule id="31104" level="6">
51 <if_sid>31100</if_sid>
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>
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>
71 <rule id="31106" level="12">
72 <if_sid>31103, 31104, 31105</if_sid>
74 <description>A web attack returned code 200 (success).</description>
75 <group>attack,</group>
78 <!-- If your site have a search engine, you may need to ignore
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>
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>
94 <!-- 500 error codes, server error
95 - http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
97 <rule id="31120" level="5">
98 <if_sid>31100</if_sid>
100 <description>Web server 500 error code (server error).</description>
103 <rule id="31121" level="4">
104 <if_sid>31120</if_sid>
106 <description>Web server 501 error code (Not Implemented).</description>
109 <rule id="31122" level="5">
110 <if_sid>31120</if_sid>
112 <options>alert_by_email</options>
113 <description>Web server 500 error code (Internal Error).</description>
114 <group>system_error,</group>
117 <rule id="31123" level="4">
118 <if_sid>31120</if_sid>
120 <options>alert_by_email</options>
121 <description>Web server 503 error code (Service unavailable).</description>
124 <rule id="31151" level="10" frequency="10" timeframe="120">
125 <if_matched_sid>31101</if_matched_sid>
127 <description>Mutiple web server 400 error codes </description>
128 <description>from same source ip.</description>
129 <group>web_scan,recon,</group>
132 <rule id="31152" level="10" frequency="6" timeframe="120">
133 <if_matched_sid>31103</if_matched_sid>
135 <description>Multiple SQL injection attempts from same </description>
136 <description>souce ip.</description>
137 <group>attack,sql_injection,</group>
140 <rule id="31153" level="10" frequency="8" timeframe="120">
141 <if_matched_sid>31104</if_matched_sid>
143 <description>Multiple common web attacks from same souce ip.</description>
144 <group>attack,</group>
147 <rule id="31154" level="10" frequency="8" timeframe="120">
148 <if_matched_sid>31105</if_matched_sid>
150 <description>Multiple XSS (Cross Site Scripting) attempts </description>
151 <description>from same souce ip.</description>
152 <group>attack,</group>
155 <rule id="31161" level="10" frequency="8" timeframe="120">
156 <if_matched_sid>31121</if_matched_sid>
158 <description>Multiple web server 501 error code (Not Implemented).</description>
159 <group>web_scan,recon,</group>
162 <rule id="31162" level="10" frequency="5" timeframe="120">
163 <if_matched_sid>31122</if_matched_sid>
165 <description>Multiple web server 500 error code (Internal Error).</description>
166 <group>system_error,</group>
169 <rule id="31163" level="10" frequency="8" timeframe="120">
170 <if_matched_sid>31123</if_matched_sid>
172 <description>Multiple web server 503 error code (Service unavailable).</description>
173 <group>web_scan,recon,</group>
175 </group> <!-- Web access log -->