Imported Upstream version 2.7
[ossec-hids.git] / etc / rules / web_appsec_rules.xml
1 <!-- @(#) $Id: ./etc/rules/web_appsec_rules.xml, 2012/08/11 dcid Exp $
2
3   -
4   -  Web attacks/vulns specific rules for OSSEC.
5   -
6   -  Copyright (C) 2012 Daniel B. Cid (dcid@dcid.me)
7   -  All rights reserved.
8   -
9   -  This program is a free software; you can redistribute it
10   -  and/or modify it under the terms of the GNU General Public
11   -  License (version 2) as published by the FSF - Free Software
12   -  Foundation.
13   -
14   -  License details: http://www.ossec.net/en/licensing.html
15   -->
16   
17
18 <!-- Collection of rules for common web attacks that we are seeing in the wild.
19   -  The real goal is to stop bots and automated attacks from doing further damage
20   -  on sites that are not updated. 
21   -->  
22 <group name="web,appsec,attack">
23
24
25
26   <!-- Checking POST / requests - WP comment spam coming from fake search engines. 
27     -->
28   <rule id="31501" level="6">
29     <if_sid>31100</if_sid>
30     <match>POST /</match>
31     <url>/wp-comments-post.php</url>
32     <regex>Googlebot|MSNBot|BingBot</regex>
33     <description>WordPress Comment Spam (coming from a fake search engine UA).</description>
34    </rule>
35
36   <!-- Timthumb scans.
37     -->
38   <rule id="31502" level="6">
39     <if_sid>31100</if_sid>
40     <url>thumb.php|timthumb.php</url>
41     <regex> "GET \S+thumb.php?src=\S+.php</regex>
42     <description>TimThumb vulnerability exploit attempt.</description>
43    </rule>
44
45   <!-- osCommerce login.php bypass
46     -->
47   <rule id="31503" level="6">
48     <if_sid>31100</if_sid>
49     <url>login.php</url>
50     <regex> "POST /\S+.php/login.php?cPath=</regex>
51     <description>osCommerce login.php bypass attempt.</description>
52    </rule>
53
54   <!-- osCommerce file manager login.php bypass
55     -->
56   <rule id="31504" level="6">
57     <if_sid>31100</if_sid>
58     <url>login.php</url>
59     <regex> "GET /\S+/admin/file_manager.php/login.php</regex>
60     <description>osCommerce file manager login.php bypass attempt.</description>
61    </rule>
62
63   <!-- Timthumb backdoor access.
64     -->
65   <rule id="31505" level="6">
66     <if_sid>31100</if_sid>
67     <url>/cache/external</url>
68     <regex> "GET /\S+/cache/external\S+.php</regex>
69     <description>TimThumb backdoor access attempt.</description>
70    </rule>
71
72   <!-- Timthumb backdoor access.
73     -->
74   <rule id="31506" level="6">
75     <if_sid>31100</if_sid>
76     <url>cart.php</url>
77     <regex> "GET /\S+cart.php?\S+templatefile=../</regex>
78     <description>Cart.php directory transversal attempt.</description>
79    </rule>
80
81   <!-- MSSQL IIS inject rules -->
82   <rule id="31507" level="6">
83     <if_sid>31100</if_sid>
84     <url>DECLARE%20@S%20CHAR|%20AS%20CHAR</url>
85     <description>MSSQL Injection attempt (ur.php, urchin.js).</description>
86   </rule>
87
88   <!-- BAD/Annoying user agents -->
89   <rule id="31508" level="6">
90     <if_sid>31100</if_sid>
91     <match> "ZmEu"| "libwww-perl/</match>
92     <description>Blacklisted user agent (known malicious user agent).</description>
93   </rule>
94
95   <!-- WordPress wp-login.php brute force -->
96   <rule id="31509" level="3">
97     <if_sid>31108</if_sid>
98     <url>wp-login.php</url>
99     <regex>] "POST \S+wp-login.php</regex>
100     <description>WordPress login attempt.</description>
101   </rule>
102
103   <!-- If we see frequent wp-login POST's, it is likely a bot. -->
104   <rule id="31510" level="6" frequency="4" timeframe="120" ignore="30">
105     <if_matched_sid>31509</if_matched_sid>
106     <same_source_ip />
107     <description>WordPress wp-login.php brute force attempt.</description>
108   </rule>
109
110   <!-- Nothing wrong with wget per se, but it misses a lot of links
111      - that generates many 404s. Blocking it to avoid the noise.
112     -->
113   <rule id="31511" level="6">
114     <if_sid>31100</if_sid>
115     <match>" "Wget/</match>
116     <description>Blacklisted user agent (wget).</description>
117   </rule>
118
119   <!-- Uploadify scans.
120     -->
121   <rule id="31512" level="6">
122     <if_sid>31100</if_sid>
123     <url>uploadify.php</url>
124     <regex> "GET /\S+/uploadify.php?src=http://\S+.php</regex>
125     <description>TimThumb vulnerability exploit attempt.</description>
126    </rule>
127
128   <!-- BBS delete.php skin_path.
129     -->
130   <rule id="31513" level="6">
131     <if_sid>31100</if_sid>
132     <url>delete.php</url>
133     <regex> "GET \S+/delete.php?board_skin_path=http://\S+.php</regex>
134     <description>BBS delete.php exploit attempt.</description>
135    </rule>
136
137   <!-- Anomaly rules - Used on common web attacks -->
138   <rule id="31550" level="6">
139     <if_sid>31100</if_sid>
140     <url>%00</url>
141     <regex> "GET /\S+.php?\S+%00</regex>
142     <description>Anomaly URL query (attempting to pass null termination).</description>
143    </rule>
144
145
146
147
148
149
150
151
152 </group>