06d7dc9c3bbf0b82baba8e18f3f0916a1b9e19e1
[ossec-hids.git] / debian / ossec-hids / var / ossec / rules / sshd_rules.xml
1 <!-- @(#) $Id: sshd_rules.xml,v 1.22 2010/12/19 14:50:14 ddp Exp $
2   -  Official SSHD rules for OSSEC.
3   -
4   -  Copyright (C) 2009-2011 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   
15
16 <!-- SSHD messages -->
17 <group name="syslog,sshd,">
18   <rule id="5700" level="0" noalert="1">
19     <decoded_as>sshd</decoded_as>
20     <description>SSHD messages grouped.</description>
21   </rule>
22               
23   <rule id="5701" level="8">
24     <if_sid>5700</if_sid>
25     <match>Bad protocol version identification</match>
26     <description>Possible attack on the ssh server </description>
27     <description>(or version gathering).</description>
28   </rule>
29
30   <rule id="5702" level="5">
31     <if_sid>5700</if_sid>
32     <match>^reverse mapping</match>
33     <regex>failed - POSSIBLE BREAK</regex>
34     <description>Reverse lookup error (bad ISP or attack).</description>
35   </rule>
36
37   <rule id="5703" level="10" frequency="4" timeframe="360">
38     <if_matched_sid>5702</if_matched_sid>
39     <description>Possible breakin attempt </description>
40     <description>(high number of reverse lookup errors).</description>
41   </rule>
42
43   <rule id="5704" level="4">
44     <if_sid>5700</if_sid>
45     <match>fatal: Timeout before authentication for</match>
46     <description>Timeout while logging in (sshd).</description>
47   </rule>
48
49   <rule id="5705" level="10" frequency="4" timeframe="360">
50     <if_matched_sid>5704</if_matched_sid>
51     <description>Possible scan or breakin attempt </description>
52     <description>(high number of login timeouts).</description>
53   </rule>
54
55   <rule id="5706" level="6">
56     <if_sid>5700</if_sid>
57     <match>Did not receive identification string from</match>
58     <description>SSH insecure connection attempt (scan).</description>
59     <group>recon,</group>
60   </rule>
61
62   <rule id="5707" level="14">
63     <if_sid>5700</if_sid>
64     <match>fatal: buffer_get_string: bad string</match>
65     <description>OpenSSH challenge-response exploit.</description>
66     <group>exploit_attempt,</group>
67   </rule>
68
69   <rule id="5709" level="0">
70     <if_sid>5700</if_sid>
71     <match>error: Could not get shadow information for NOUSER|</match>
72     <match>fatal: Read from socket failed: |error: ssh_msg_send: write|</match>
73     <match>^syslogin_perform_logout: |^pam_succeed_if(sshd:auth): error retrieving information about user|can't verify hostname: getaddrinfo</match>
74     <description>Useless SSHD message without an user/ip and context.</description>
75   </rule>
76   
77   <rule id="5710" level="5">
78     <if_sid>5700</if_sid>
79     <match>illegal user|invalid user</match>
80     <description>Attempt to login using a non-existent user</description>
81     <group>invalid_login,authentication_failed,</group>
82   </rule>
83
84   <rule id="5711" level="0">
85     <if_sid>5700</if_sid>
86     <match>authentication failure; logname= uid=0 euid=0 tty=ssh|</match>
87     <match>input_userauth_request: invalid user|</match>
88     <match>PAM: User not known to the underlying authentication module for illegal user|</match>
89     <match>error retrieving information about user</match>
90     <description>Useless/Duplicated SSHD message without a user/ip.</description>
91   </rule>
92
93   <rule id="5712" level="10" frequency="6" timeframe="120" ignore="60">
94     <if_matched_sid>5710</if_matched_sid>
95     <description>SSHD brute force trying to get access to </description>
96     <description>the system.</description>
97     <same_source_ip />
98     <group>authentication_failures,</group>
99   </rule>
100
101   <rule id="5713" level="6">
102     <if_sid>5700</if_sid>
103     <match>Corrupted check bytes on</match>
104     <description>Corrupted bytes on SSHD.</description>  
105   </rule>
106   
107   <rule id="5714" level="14" timeframe="120" frequency="1">
108     <if_matched_sid>5713</if_matched_sid>
109     <match>Local: crc32 compensation attack</match>
110     <description>SSH CRC-32 Compensation attack</description>
111     <info type="cve">2001-0144</info>
112     <info type="link">http://www.securityfocus.com/bid/2347/info/</info>
113     <group>exploit_attempt,</group>
114   </rule>  
115
116   <rule id="5715" level="3">
117     <if_sid>5700</if_sid>
118     <match>^Accepted|authenticated.$</match>
119     <description>SSHD authentication success.</description>
120     <group>authentication_success,</group>
121   </rule>
122
123   <rule id="5716" level="5">
124     <if_sid>5700</if_sid>
125     <match>^Failed|^error: PAM: Authentication</match>
126     <description>SSHD authentication failed.</description>
127     <group>authentication_failed,</group>
128   </rule>  
129
130   <rule id="5717" level="4">
131     <if_sid>5700</if_sid>
132     <match>error: Bad prime description in line</match>
133     <description>SSHD configuration error (moduli).</description>
134   </rule>
135
136   <rule id="5718" level="5">
137     <if_sid>5700</if_sid>
138     <match>not allowed because</match>
139     <description>Attempt to login using a denied user.</description>
140     <group>invalid_login,</group>
141   </rule>
142                       
143   <rule id="5719" level="10" frequency="6" timeframe="120" ignore="60">
144     <if_matched_sid>5718</if_matched_sid>
145     <description>Multiple access attempts using a denied user.</description>
146     <group>invalid_login,</group>
147   </rule>
148   
149   <rule id="5720" level="10" frequency="6">
150     <if_matched_sid>5716</if_matched_sid>
151     <same_source_ip />
152     <description>Multiple SSHD authentication failures.</description>
153     <group>authentication_failures,</group>
154   </rule>                                       
155
156   <rule id="5721" level="0">
157     <if_sid>5700</if_sid>
158     <match>Received disconnect from</match>
159     <description>System disconnected from sshd.</description>
160   </rule>
161
162   <rule id="5722" level="0">
163     <if_sid>5700</if_sid>
164     <match>Connection closed</match>
165     <description>ssh connection closed.</description>
166   </rule>
167
168   <rule id="5723" level="0">
169     <if_sid>5700</if_sid>
170     <match>error: buffer_get_bignum2_ret: negative numbers not supported</match>
171     <info>This maybe a bad key in authorized_keys.</info>
172     <description>SSHD key error.</description>
173   </rule>
174
175   <rule id="5724" level="0">
176     <if_sid>5700</if_sid>
177     <match>fatal: buffer_get_bignum2: buffer error</match>
178     <info>This error may relate to ssh key handling.</info>
179     <description>SSHD key error.</description>
180   </rule>
181
182   <rule id="5725" level="0">
183     <if_sid>5700</if_sid>
184     <match>fatal: Write failed: Host is down</match>
185     <description>Host ungracefully disconnected.</description>
186   </rule>
187
188   <rule id="5726" level="5">
189     <if_sid>5700</if_sid>
190     <match>error: PAM: Module is unknown for</match>
191     <description>Unknown PAM module, PAM misconfiguration.</description>
192   </rule>
193
194   <rule id="5727" level="0">
195     <if_sid>5700</if_sid>
196     <match>failed: Address already in use.</match>
197     <description>Attempt to start sshd when something already bound to the port.</description>
198   </rule>
199
200   <rule id="5728" level="4">
201     <if_sid>5700</if_sid>
202     <match>Authentication service cannot retrieve user credentials</match>
203     <info>May be related to PAM module errors.</info>
204     <description>Authentication services were not able to retrieve user credentials.</description>
205     <group>authentication_failed</group>
206   </rule>
207
208   <rule id="5729" level="0">
209     <if_sid>5700</if_sid>
210     <match>debug1: attempt</match>
211     <description>Debug message.</description>
212   </rule>
213
214   <rule id="5730" level="4">
215     <if_sid>5700</if_sid>
216     <regex>error: connect to \S+ port \d+ failed: Connection refused</regex>
217     <description>SSHD is not accepting connections.</description>
218   </rule>
219
220   <rule id="5731" level="6">
221     <if_sid>5700</if_sid>
222     <match>AKASSH_Version_Mapper1.</match>
223     <description>SSH Scanning.</description>
224     <group>recon,</group>
225   </rule>
226
227   <rule id="5732" level="0">
228     <if_sid>5700</if_sid>
229     <match>error: connect_to </match>
230     <description>Possible port forwarding failure.</description>
231   </rule>
232
233   <rule id="5733" level="0">
234     <if_sid>5700</if_sid>
235     <match>Invalid credentials</match>
236     <description>User entered incorrect password.</description>
237     <group>authentication_failures,</group>
238   </rule>
239
240   <rule id="5734" level="0">
241     <if_sid>5700</if_sid>
242     <match>Could not load host key</match>
243     <description>sshd could not load one or more host keys.</description>
244     <info>This may be related to an upgrade to OpenSSH.</info>
245   </rule>
246
247   <rule id="5735" level="0">
248     <if_sid>5700</if_sid>
249     <match>Write failed: Broken pipe</match>
250     <description>Failed write due to one host disappearing.</description>
251   </rule>
252
253   <rule id="5736" level="0">
254     <if_sid>5700</if_sid>
255     <match>^error: setsockopt SO_KEEPALIVE: Connection reset by peer$|</match>
256     <match>^error: accept: Software caused connection abort$</match>
257     <description>Connection reset or aborted.</description>
258   </rule>
259
260   <rule id="5737" level="5">
261     <if_sid>5700</if_sid>
262     <match>^fatal: Cannot bind any address.$</match>
263     <description>sshd cannot bind to configured address.</description>
264   </rule>
265
266   <rule id="5738" level="5">
267     <if_sid>5700</if_sid>
268     <match>set_loginuid failed opening loginuid$</match>
269     <description>pam_loginuid could not open loginuid.</description>
270     <group>authentication_failed,</group>
271   </rule>
272
273   <rule id="5739" level="4">
274     <if_sid>5700</if_sid>
275     <match>^error: Could not stat AuthorizedKeysCommand</match>
276     <description>SSHD configuration error (AuthorizedKeysCommand)</description>
277   </rule>
278
279   <rule id="5740" level="4">
280     <if_sid>5700</if_sid>
281     <match>Connection reset by peer$</match>
282     <description>ssh connection reset by peer</description>
283   </rule>
284
285   <rule id="5741" level="4">
286     <if_sid>5700</if_sid>
287     <match>Connection refused$</match>
288     <description>ssh connection refused</description>
289   </rule>
290
291   <rule id="5742" level="4">
292     <if_sid>5700</if_sid>
293     <match>Connection timed out$</match>
294     <description>ssh connection timed out</description>
295   </rule>
296
297   <rule id="5743" level="4">
298     <if_sid>5700</if_sid>
299     <match>No route to host$</match>
300     <description>ssh no route to host</description>
301   </rule>
302
303   <rule id="5744" level="4">
304     <if_sid>5700</if_sid>
305     <match>failure direct-tcpip$</match>
306     <description>ssh port forwarding issue</description>
307   </rule>
308
309   <rule id="5745" level="4">
310     <if_sid>5700</if_sid>
311     <match>Transport endpoint is not connected$</match>
312     <description>ssh transport endpoint is not connected</description>
313   </rule>
314
315   <rule id="5746" level="4">
316     <if_sid>5700</if_sid>
317     <match>get_remote_port failed$</match>
318     <description>ssh get_remote_port failed</description>
319   </rule>
320   
321   <!-- http://www.gossamer-threads.com/lists/openssh/users/47438 -->
322   <rule id="5747" level="6">
323     <if_sid>5700</if_sid>
324     <match>bad client public DH value</match>
325     <description>ssh bad client public DH value</description>
326   </rule>
327
328   <!-- log sample with context:
329        Nov 22 19:24:52 server sshd[4045]: Connection from 117.117.198.5 port 60304
330        Nov 22 19:24:55 server sshd[4046]: Corrupted MAC on input.
331        Nov 22 19:25:15 server sshd[4046]: Connection closed by 117.117.198.5
332   -->
333   <rule id="5748" level="6">
334     <if_sid>5700</if_sid>
335     <match>Corrupted MAC on input.</match>
336     <description>ssh corrupted MAC on input</description>
337   </rule>
338
339   <rule id="5749" level="4">
340     <if_sid>5700</if_sid>
341     <match>^Bad packet length</match>
342     <description>ssh bad packet length</description>
343   </rule>
344
345   <rule id="5750" level="0">
346     <decoded_as>sshd</decoded_as>
347     <if_sid>5700</if_sid>
348     <match>Unable to negotiate with |Unable to negotiate a key</match>
349     <description>sshd could not negotiate with client.</description>
350   </rule>
351
352   <rule id="5751" level="1">
353     <decoded_as>sshd</decoded_as>
354     <if_sid>5700</if_sid>
355     <match>no hostkey alg [preauth]</match>
356     <description>No hostkey alg.</description>
357   </rule>
358
359   <rule id="5752" level="2">
360     <if_sid>5750</if_sid>
361     <match>no matching key exchange method found.|Unable to negotiate a key exchange method</match>
362     <description>Client did not offer an acceptable key exchange method.</description>
363   </rule>
364
365   <rule id="5753" level="2">
366     <if_sid>5750</if_sid>
367     <match>no matching cipher found.</match>
368     <description>sshd could not negotiate with client, no matching cipher.</description>
369   </rule>
370
371   <rule id="5754" level="1">
372     <if_sid>5700</if_sid>
373     <match>Failed to create session: </match>
374     <description>sshd failed to create a session.</description>
375   </rule>
376
377   <rule id="5755" level="2">
378     <if_sid>5700</if_sid>
379     <match>bad ownership or modes for file</match>
380     <description>Authentication refused due to owner/permissions of authorized_keys.</description>
381     <group>authentication_failed,</group>
382   </rule>
383
384   <rule id="5756" level="0">
385     <if_sid>5700</if_sid>
386     <match> failed, subsystem not found$</match>
387     <description>sshd subsystem request failed.</description>
388   </rule>
389
390   <rule id="5757" level="0">
391     <decoded_as>sshd</decoded_as>
392     <match>but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!$</match>
393     <description>Bad DNS mapping.</description>
394   </rule>
395
396   <rule id="5758" level="8">
397     <decoded_as>sshd</decoded_as>
398     <match>^error: maximum authentication attempts exceeded </match>
399     <description>Maximum authentication attempts exceeded.</description>
400     <group>authentication_failed,</group>
401   </rule>
402
403 </group> <!-- SYSLOG, SSHD -->
404
405 <!-- EOF -->