<!-- @(#) $Id: decoder.xml,v 1.166 2010/06/15 12:52:01 dcid Exp $
  -  OSSEC log decoder.
  -  Author: Daniel B. Cid
  -  License: http://www.ossec.net/en/licensing.html
  -->
        

<!--
   - Allowed fields:
   - location - where the log came from (only on FTS)
   - srcuser  - extracts the source username
   - dstuser  - extracts the destination (target) username
   - user     - an alias to dstuser (only one of the two can be used)
   - srcip    - source ip
   - dstip    - dst ip
   - srcport  - source port
   - dstport  - destination port
   - protocol - protocol
   - id       - event id 
   - url      - url of the event
   - action   - event action (deny, drop, accept, etc)
   - status   - event status (success, failure, etc)
   - extra_data     - Any extra data
  -->


<!-- Pam decoder.
  -  Will extract username and srcip whenever is possible.
  - Examples:
  - su(pam_unix)[23164]: authentication failure; logname= uid=1342 euid=0 tty= ruser=dcid rhost=  user=osaudit
  - su(pam_unix)[2298]: authentication failure; logname= uid=1342 euid=0 tty= ruser=dcid rhost=  user=root
  - vsftpd(pam_unix)[25073]: authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=211.100.27.101
  - vsftpd(pam_unix)[25073]: check pass; user unknown
  - sshd(pam_unix)[16660]: authentication failure; logname= uid=0 euid=0 tty=NODEVssh ruser= rhost=202.110.184.100  user=root
  - su(pam_unix)[14592]: session opened for user news by (uid=0)
  - su(pam_unix)[14592]: session closed for user news
  - sshd(pam_unix)[13025]: authentication failure; logname= uid=0 euid=0 tty=NODEVssh ruser= rhost=210.70.129.207  user=nobody
  - sshd(pam_unix)[18987]: authentication failure; logname= uid=0 euid=0 tty=NODEVssh ruser= rhost=languedoc-2-81-56-82-49.fbx.proxad.net  user=root
  - sshd(pam_unix)[17365]: session opened for user test by (uid=508)
  - sshd(pam_unix)[1345]: authentication failure; logname= uid=0 euid=0 tty=NODEVssh ruser= rhost=222.237.79.237  user=root
  - sshd(pam_unix)[15794]: 2 more authentication failures; logname= uid=0
  euid=0 tty=ssh ruser= rhost=10.0.3.1  user=root
  - Nov 17 21:41:22 localhost su[8060]: (pam_unix) session opened for user root by (uid=0)
  - Nov 11 22:46:29 localhost vsftpd: pam_unix(vsftpd:auth): authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=1.2.3.4
  - Sep 28 15:28:58 server login: pam_unix(login:session): session opened for user carl by LOGIN(uid=0)
  - Sep 28 15:35:18 server sshd[123]: pam_unix(sshd:session): session opened for user carl by (uid=0)
  -->
<decoder name="pam">
  <program_name>(pam_unix)$</program_name>
</decoder>

<decoder name="pam">
  <program_name></program_name>
  <prematch>^pam_unix|^\(pam_unix\)</prematch>
</decoder>

<decoder name="pam-user">
  <parent>pam</parent>
  <prematch>^session \w+ </prematch>
  <regex offset="after_prematch">^for user (\S+)</regex>
  <order>user</order>
</decoder>  

<!--XXXX<decoder name="pam-user2">
  <parent>pam</parent>
  <prematch>^session \S+ </prematch>
  <regex>for user (\S+)</regex>
  <order>user</order>
</decoder>
-->

<decoder name="pam-host-user">
  <parent>pam</parent>
  <prematch>rhost=\S+\s+user=\S+</prematch>
  <regex>rhost=(\S+)\s+user=(\S+)</regex>
  <order>srcip, user</order>
</decoder>

<decoder name="pam-host">
  <parent>pam</parent>
  <prematch> rhost</prematch>
  <regex offset="after_prematch">^=(\S+)</regex>
  <order>srcip</order>
</decoder>

  
<!-- SSH decoder.
  -  Will extract username and srcip from the logs.
  -  Only add to the FTS if the login was successful
  -  If the login failed, just extract the username/srcip for correlation
  -  Examples:
  -  sshd[8813]: Accepted password for root from 192.168.10.1 port 1066 ssh2
  -  sshd[2404]: Accepted password for root from 192.168.11.1 port 2011 ssh2
  -  sshd[21405]: Accepted password for root from 192.1.1.1 port 6023 ssh2
  -  sshd[21487]: Failed password for root from 192.168.1.1 port 1045 ssh2
  -  sshd[8813]: Failed none for root from 192.168.10.161 port 1066 ssh2
  -  sshd[12675]: Failed password for invalid user lala11 from x.x.x.x ..
  -  sshd[12914]: Failed password for invalid user lala6 from ...
  -  sshd[8267]: Failed password for illegal user test from 62.67.45.4 port 39141 ssh2
  -  sshd[11259]: Invalid user abc from 127.0.0.1
  -  "" Failed keyboard-interactive for root from 192.1.1.1 port 1066 ssh2    
  -  sshd[23857]: [ID 702911 auth.notice] User xxx, coming from zzzz,
  -  authenticated. 
  -  sshd[23578]: reverse mapping checking getaddrinfo for pib4.catv-bauer.at failed - POSSIBLE BREAKIN ATTEMPT!
  -  sshd[61834]: reverse mapping checking getaddrinfo for sv.tvcm.ch
  -  failed - POSSIBLE BREAKIN ATTEMPT!
  -  sshd[3251]: User root not allowed because listed in DenyUsers
  -  [Time 2006.12.28 15:53:55 UTC] [Facility auth] [Sender sshd] [PID 483] [Message error: PAM: Authentication failure for username from 192.168.0.2] [Level 3] [UID -2] [GID -2] [Host Hostname]
  -  [Time 2006.11.02 11:41:44 UTC] [Facility auth] [Sender sshd] [PID 800] [Message refused connect from 51.124.44.34] [Level 4] [UID -2] [GID -2] [Host test2-emac]
  -  Apr 23 07:03:53 machinename sshd[29961]: User root from 12.3.4.5
  not allowed because not listed in AllowUsers
  -  sshd[9815]: scanned from 127.0.0.1 with SSH-1.99-AKASSH_Version_Mapper1.  Don't panic.
  -  Sep  4 23:58:33 junction sshd[9351]: fatal: Write failed: Broken pipe
  -  Sep 18 14:58:47 ix sshd[11816]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
  -  Sep 23 10:32:25 server sshd[25209]: pam_ldap: error trying to bind as user "uid=user123,ou=People,dc=domain,dc=com" (Invalid credentials)
  -  Aug 10 08:38:40 junction sshd[20013]: error: connect_to 192.168.179 port 8080: failed
  -  Jun  9 00:00:01 ix sshd[9815]: scanned from 127.0.0.1 with SSH-1.99-AKASSH_Version_Mapper1.  Don't panic.
  -  Jan 26 11:57:26 ix sshd[14879]: error: connect to ix.example.com port 7777 failed: Connection refused
  -  Oct  8 10:07:27 y sshd[7644]: debug1: attempt 2 failures 2
  -  Oct  8 08:58:37 y sshd[6956]: fatal: PAM: pam_setcred(): Authentication service cannot retrieve user credentials
  -  Oct  8 08:48:33 y sshd[6856]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
  -  Oct  8 11:18:26 172.16.51.132 sshd[7618]: error: PAM: Module is unknown for ddp from 172.16.51.1
  -  Jun 19 20:56:00 tiny sshd[11605]: fatal: Write failed: Host is down
  -  Jun 11 06:32:17 gorilla sshd[28293]: fatal: buffer_get_bignum2: buffer error
  -  Jun 11 06:32:17 gorilla sshd[28293]: error: buffer_get_bignum2_ret: negative numbers not supported
  -  Apr 14 19:28:21 gorilla sshd[31274]: Connection closed by 192.168.1.33
  -  Jun 22 12:01:13 junction sshd[11283]: Received disconnect from 212.14.228.46: 11: Bye Bye
  -  Nov  9 07:40:25 ginaz sshd[5973]: error: setsockopt SO_KEEPALIVE: Connection reset by peer
  -  Nov  2 12:08:27 192.168.17.7 sshd[9665]: fatal: Cannot bind any address.
  -  Nov  2 12:11:40 192.168.17.7 sshd[9814]: pam_loginuid(sshd:session): set_loginuid failed opening loginuid
  -  Nov  6 09:53:38 hagal sshd[697]: error: accept: Software caused connection abort
  -  Nov  9 11:36:55 ecaz sshd[26967]: pam_succeed_if(sshd:auth): error retrieving information about user _z9xxbBW
  -->

<decoder name="sshd">
  <program_name>^sshd</program_name>
</decoder>

<decoder name="sshd-success">
  <parent>sshd</parent>
  <prematch>^Accepted</prematch>
  <regex offset="after_prematch">^ \S+ for (\S+) from (\S+) port </regex>
  <order>user, srcip</order>
  <fts>name, user, location</fts>
</decoder>

<decoder name="ssh-denied">
  <parent>sshd</parent>
  <prematch>^User \S+ from </prematch>
  <regex offset="after_parent">^User (\S+) from (\S+) </regex>
  <order>user, srcip</order>
</decoder>

<decoder name="sshd-success-solaris">
  <parent>sshd</parent>
  <prematch>^User </prematch>
  <regex offset="after_prematch">^(\S+), coming from (\S+), </regex>
  <order>user, srcip</order>
  <fts>name, user, location</fts>
</decoder>

<decoder name="ssh-invfailed">
  <parent>sshd</parent>
  <prematch>^Failed \S+ for invalid user|^Failed \S+ for illegal user</prematch>
  <regex offset="after_prematch">from (\S+) port \d+ \w+$</regex>
  <order>srcip</order>
</decoder>

<decoder name="ssh-failed">
  <parent>sshd</parent>
  <prematch>^Failed \S+ </prematch>
  <regex offset="after_prematch">^for (\S+) from (\S+) port \d+ \w+$</regex>
  <order>user, srcip</order>
</decoder>

<decoder name="ssh-error">
  <parent>sshd</parent>
  <prematch>^error: PAM: Authentication \w+ </prematch>
  <regex offset="after_prematch">^for (\S+) from (\S+)$</regex>
  <order>user, srcip</order>
</decoder>

<decoder name="ssh-reverse-mapping">
  <parent>sshd</parent>
  <prematch>^reverse mapping checking </prematch>
  <regex offset="after_prematch">^\w+ for \S+ [(\S+)] |^\w+ for (\S+) </regex>
  <order>srcip</order>
</decoder>       

<decoder name="ssh-invalid-user">
  <parent>sshd</parent>
  <prematch>^Invalid user|^Illegal user</prematch>
  <regex offset="after_prematch"> from (\S+)$</regex>
  <order>srcip</order>
</decoder>

<decoder name="ssh-scan">
  <parent>sshd</parent>
  <prematch>^scanned from</prematch>
  <regex offset="after_prematch"> (\S+) </regex>
  <order>srcip</order>
</decoder>

<decoder name="ssh-scan2">
  <parent>sshd</parent>
  <prematch>^Did not receive identification|^Bad protocol version</prematch>
  <regex offset="after_prematch"> from (\S+)$</regex>
  <order>srcip</order>
</decoder>

<decoder name="ssh-osx-refuse">
  <parent>sshd</parent>
  <prematch>^refused connect </prematch>
  <regex offset="after_prematch">^from (\S+)$</regex>
  <order>srcip</order>
</decoder>

<decoder name="ssh-closed">
  <parent>sshd</parent>
  <prematch>^Connection closed </prematch>
  <regex offset="after_prematch">^by (\S+)$</regex>
  <order>srcip</order>
</decoder>

<decoder name="ssh-disconnect">
  <parent>sshd</parent>
  <prematch>^Received disconnect </prematch>
  <regex offset="after_prematch">^from (\S+):</regex>
  <order>srcip</order>
</decoder>

<!--XXX
<decoder name="ssh-pam">
  <parent>sshd</parent>
  <prematch>PAM: Module</prematch>
  <regex>for (\S+) from (\S+)$</regex>
  <order>user, srcip</order>
</decoder>

<decoder name="ssh-connect-to">
  <parent>sshd</parent>
  <prematch>connect_to</prematch>
  <regex>connect_to: (\S+) port (\d+):</regex>
  <order>dstip,dstport</order>
</decoder>
-->

<decoder name="sshd-ldap">
  <parent>sshd</parent>
  <prematch>^pam_ldap: </prematch>
  <regex>user "uid=(\S+),ou=\w+,dc=\w+,dc=\w+"</regex>
  <order>user</order>
</decoder>


<!-- Dropbear rules -->
<decoder name="dropbear">
  <program_name>^dropbear</program_name>
</decoder>

<decoder name="dropbear-from">
  <parent>dropbear</parent>
  <regex>for '(\S+)' from (\S+):\d+$</regex>
  <order>dstuser,srcip</order>
</decoder>



<!--
 - Telnet decoder
 - Will extract the srcip
 - Examples:
 - May 31 12:33:44 queen telnetd[9876]: warning: can't verify hostname: 
   gethostbyname(131.1.satis-tl.ru) failed
 - May 29 21:12:18 queen telnetd[6474]: refused connect from 81.215.42.27
 - Jun  1 23:02:07 queen telnetd[62948]: connect from external.example.net
 - Jun  1 23:02:07 queen telnetd[62948]: ttloop:  read: A connection with a remote socket was reset by that socket.
 - Jun  2 09:54:28 valhalla in.telnetd[19723]: [ID 927837 local2.info] connect from external.example.net
 - Jun  2 09:54:28 valhalla telnetd[19723]: [ID 485252 daemon.info] ttloop:  peer died: Error 0
 -->
<decoder name="telnetd">
  <program_name>^telnetd|^in.telnetd</program_name>
</decoder>

<decoder name="telnetd-ip">
  <parent>telnetd</parent>
  <regex>from (\d+.\d+.\d+.\d+)$</regex>
  <order>srcip</order>
</decoder>



<!--
 - rshd decoder
 - Example message:
 - Dec 17 10:49:23 hostname rshd[347339]: Connection from 10.217.223.31 on illegal port
 -->
<decoder name="rshd">
  <program_name>^rshd$</program_name>
</decoder>
                          
<decoder name="rshd-illegal-connection">
  <parent>rshd</parent>
  <regex>^Connection from (\S+) on illegal port$</regex>
  <order>srcip</order>
</decoder>



<!--
 - cimserver decoder
 - Example messages:
 - Dec 18 18:06:28 hostname cimserver[18575]: PGS17200: Authentication failed for user jones_b.
 - Dec 18 18:06:29 hostname cimserver[18575]: PGS17200: Authentication failed for user domain\jones_b.
 -->
<decoder name="cimserver">
  <program_name>^cimserver$</program_name>
</decoder>

<decoder name="cimserver-failed-authentication">
  <parent>cimserver</parent>
  <prematch>^\w+: Authentication failed for user </prematch>
  <regex offset="after_prematch">^(\S+).$</regex>
  <order>user</order>
</decoder>



<!--
 - Samba decoder.
 - Will extraxt the username/srcip
 - Examples:
 - smbd[832]: Denied connection from (192.168.3.23)
 - smbd[832]: Connection denied from 0.0.0.0
 - smbd[17535]: Permission denied\-\- user not allowed to delete, 
   pause, or resume print job. User name: ahmet. Printer name: prnq1.
  -->

<decoder name="smbd">
  <program_name>^smbd</program_name>
</decoder>

<decoder name="smbd-user">
  <parent>smbd</parent>
  <prematch>User name:</prematch>
  <regex offset="after_prematch">^ (\S+).</regex>
  <order>user</order>
</decoder>

<decoder name="smbd-ip">
  <parent>smbd</parent>
  <regex> from \((\d+.\d+.\d+.\d+)\)</regex>
  <order>srcip</order>
</decoder>

<decoder name="smbd-from">
  <parent>smbd</parent>
  <prematch> from (\S+)$</prematch>
  <regex> from (\S+)$</regex>
  <order>srcip</order>
</decoder>

<decoder name="smbd-client">
  <parent>smbd</parent>
  <prematch>to client \S+.</prematch>
  <regex>to client (\S+). </regex>
  <order>srcip</order>
</decoder>

<decoder name="nmbd">
  <program_name>^nmbd</program_name>
</decoder>


<!-- Sudo decoder.
  -  Will extract the username
  -  Examples:
  -  Apr 27 15:22:23 niban sudo:     dcid : TTY=pts/4 ; PWD=/home/dcid ; USER=root ; COMMAND=/usr/bin/tail /var/log/snort/alert.fast
  -  Apr 27 15:25:08 niban sudo:     dcid : TTY=pts/4 ; PWD=/home/dcid ; USER=root ; COMMAND=/usr/bin/tail /var/log/snort/alert.fast
  -  Apr 14 10:59:01 enigma sudo:     dcid : TTY=ttyp3 ; PWD=/home/dcid/ossec-hids.0.1a/src/analysisd ; USER=root ; COMMAND=/bin/cp -pr ../../bin/addagent ../../bin/osaudit-logaudit ../../bin/ossec-execd ../../bin/ossec-logcollector ../../bin/ossec-maild ../../bin/ossec-remoted /var/ossec/bin
  -  Apr 19 14:52:02 enigma sudo:     dcid : TTY=ttyp3 ; PWD=/var/www/alex ; USER=root ; COMMAND=/sbin/chown dcid.dcid .
  -->
<decoder name="sudo">
  <program_name>^sudo</program_name>
  <regex>^\s+(\S+)\s:</regex>
  <order>user</order>
  <fts>name,user,location</fts>
  <ftscomment>First time user executed the sudo command</ftscomment>
</decoder>  


<!-- Su decoder.
  -  Will extract the username.
  -  Examples:
  -  su[2921936]: failed: ttyq4 changing from ldap to root
  -  su[234]: BAD SU ger to fwmaster on /dev/ttyp0
  -  su(pam_unix)[23164]: authentication failure; logname= uid=1342 euid=0 tty= ruser=dcid rhost=  user=osaudit
  -  su(pam_unix)[2298]: authentication failure; logname= uid=1342 euid=0 tty= ruser=dcid rhost=  user=root
  -  Jul  5 12:17:38 lili su[2702]: - pts/5 ab-dc-root
  -  Jul  5 12:13:15 lili su[2614]: - pts/6 dcid-root
  -  su[29149]: + pts/5 dcid:root
  -  SU 07/23 01:24 + pts/4 lcid-root
  -  Apr 22 17:51:51 enigma su: dcid to root on /dev/ttyp1
  - 'su root' failed for chapman on /dev/pts/1
  -->
<decoder name="su">
  <program_name>^su$</program_name>
</decoder>

<decoder name="su-detail">
  <parent>su</parent>  
  <prematch>^'su </prematch>
  <regex>^'su (\S+)' \S+ for (\S+) on \S+$</regex>
  <order>dstuser, srcuser</order>
  <fts>name, srcuser, location</fts>
</decoder>

<decoder name="su-ldap">
  <parent>su</parent>
  <prematch>pam_ldap</prematch>                                                                                                                                        
  <regex>user "uid=(\S+),</regex>
  <order>user</order>
</decoder>

<decoder name="su-detail2">
  <parent>su</parent>  
  <regex>^BAD SU (\S+) to (\S+) on|</regex>
  <regex>^failed: \S+ changing from (\S+) to (\S+)|</regex>
  <regex>^\S \S+ (\S+)\p(\S+)$|^(\S+) to (\S+) on </regex>
  <order>srcuser, dstuser</order>
  <fts>name, srcuser, location</fts>
</decoder>

<decoder name="su">
  <prematch>^SU \S+ \S+ </prematch>
  <regex offset="after_prematch">^\S \S+ (\S+)-(\S+)$</regex>
  <order>srcuser, dstuser</order>
  <fts>name, srcuser, location</fts>
</decoder>



<!-- ProFTPD decoder.
  - Will extract the username/srcip
  - Examples:
  - proftpd[26916]: hayaletgemi (85.101.218.135[85.101.218.135]) - ANON anonymous: Login successful.
  - proftpd[12564]: juf01 (pD9EE35B1.dip.t-dialin.net[217.238.53.177]) - USER jufu: Login successful
  - proftpd[30362] xx.yy.zz (aa.bb.cc[aa.bb.vv.dd]): USER backup: Login successful.
  - proftpd[2344]: refused connect from 192.168.1.2 (192.168.1.2)
  - proftpd[15181]: valhalla (crawl-66-249-66-80.googlebot.com[66.249.66.80]) - Connection from crawl-66-249-66-80.googlebot.com [66.249.66.80] denied.
  -->
<decoder name="proftpd">  
  <program_name>^proftpd</program_name>
</decoder>

<decoder name="proftpd-success">
  <parent>proftpd</parent>  
  <prematch>: Login successful</prematch>
  <regex>^\S+ \(\S+[(\S+)]\)\s*\S \w+ (\S+): </regex>
  <regex>Login successful</regex>
  <order>srcip, user</order>
  <fts>name, user, srcip, location</fts>
</decoder>

<decoder name="proftpd-ip">
  <parent>proftpd</parent>
  <regex>^\S+ \(\S+[(\S+)]\)</regex>
  <order>srcip</order>
</decoder>



<!-- Pure-FTPd decoder.
  - Will extract the username/srcip whenever possible.
  - Samples by Peter Ahlert <peter@ifup.de> (thanks!)
  - Examples:
  - pure-ftpd-wrapper[926]: connect from 1.1.0.1 (1.1.0.1)
  - pure-ftpd: (?@1.1.0.1) [INFO] New connection from 1.1.0.1
  - pure-ftpd: (abcde@1.1.0.1) [INFO] Can't change directory to /.test: Permission denied
  - pure-ftpd: (abcde@1.1.0.1) [INFO] Logout.
  - pure-ftpd: (?@59.150.14.54) [WARNING] Authentication failed for user [newuser]
  -->
<decoder name="pure-ftpd">
  <program_name>^pure-ftpd</program_name>
</decoder>

<decoder name="pure-ftpd-login">
  <parent>pure-ftpd</parent>
  <prematch>^\S+ [INFO] \S+ is now logged in</prematch>
  <regex>^\(?@(\S+)\) [INFO] (\S+) is now logged in</regex>
  <order>srcip, user</order>
  <fts>name, user, srcip, location</fts>
</decoder>

<decoder name="pure-ftpd-generic">
  <parent>pure-ftpd</parent>
  <regex>^\((\S+)@(\S+)\) [</regex>
  <order>user,srcip</order>
</decoder>  



<!-- vsftpd decoder.
  - Will extract the srcip.
  - Examples:
  - Sun Jun  4 22:08:04 2006 [pid 21612] CONNECT: Client "192.168.2.10"
  - Sun Jun  4 22:08:39 2006 [pid 21611] [dcid] OK LOGIN: Client "192.168.2.10"
  - Sun Jun  4 22:09:22 2006 [pid 21622] CONNECT: Client "192.168.2.10"
  - Sun Jun  4 22:09:24 2006 [pid 21621] [lalal] FAIL LOGIN: Client "192.168.2.10"
  - Sat Jun  3 07:51:42 2006 [pid 25073] [Administrator] FAIL LOGIN: Client
  "211.100.27.101"
  - Sun Aug 27 16:28:20 2006 [pid 13962] [xx] OK UPLOAD: Client "1.2.3.4", "/a.php", 8338 bytes, 18.77Kbyte/sec
  - Jul 13 12:31:20 www vsftpd: Sun Jul 13 10:31:20 2008 [pid 27528] [anonymous] FAIL LOGIN: Client "84.140.234.76"
  -->
<decoder name="vsftpd">
  <prematch>^\w\w\w \w\w\w\s+\d+ \S+ \d+ [pid \d+] </prematch>
  <regex offset="after_prematch">Client "(\d+.\d+.\d+.\d+)"$</regex>
  <order>srcip</order>
</decoder>

<decoder name="vsftpd">
  <program_name>^vsftpd</program_name>
  <prematch>^\w\w\w \w\w\w\s+\d+ \S+ \d+ [pid \d+] </prematch>
  <regex offset="after_prematch">Client "(\d+.\d+.\d+.\d+)"$</regex>
  <order>srcip</order>
</decoder>



<!-- FTPD decoder - Solaris, MacOS and Wu-ftpd).
  - Examples:
  - ftpd[811166]: refused connect from 88.225.42.182
  - in.ftpd[18561]: [ID 484914 daemon.notice] gethostbyaddr: nameservices.net. != 216.117.134.168
  - ftpd[31918]: FTPD: EXPORT file local , remote
  - Dec 21 12:21:20 hostname ftpd[323115]: login jones_b from client.example.org failed.
  -->
<decoder name="ftpd">
  <program_name>^ftpd|^in.ftpd</program_name>
</decoder>

<decoder name="ftpd-mac-failure">
  <parent>ftpd</parent>
  <prematch>^Failed authentication from: \S+ |</prematch>
  <prematch>^repeated login failures from </prematch>
  <!--<regex offset="after_prematch">(\S+)</regex>-->
  <regex offset="after_prematch">^\S+ [(\d+.\d+.\d+.\d+)]$|^(\S+)</regex>
  <order>srcip</order>
</decoder>

<decoder name="ftpd-refused">
  <parent>ftpd</parent>
  <prematch>^FTP LOGIN REFUSED </prematch>
  <regex offset="after_prematch">[(\d+.\d+.\d+.\d+)]$</regex>
  <order>srcip</order>
</decoder>

<decoder name="ftpd-ip">
  <parent>ftpd</parent>
  <regex>from (\d+.\d+.\d+.\d+)$</regex>
  <order>srcip</order>
</decoder>

<decoder name="ftpd-tru64">
  <parent>ftpd</parent>
  <prematch>^login \S+ from \S+ failed.</prematch>
  <regex>^login (\S+) from (\S+) failed.$</regex>
  <order>user, srcip</order>
</decoder>



<!-- Arpwatch decoder.
  - Will extract srcip/mac for "new station" messages.
  - Examples:
  - arpwatch: new station 192.168.1.103 0:11:43:5e:5d:80 eth0
  - arpwatch: bogon 172.16.150.149 0:2:b3:d6:e5:68 eth0
  - arpwatch: new station 192.168.2.10 0:c0:4f:78:32:be
  - arpwatch: pcap open re0: /dev/bpf0: Permission denied
  - arpwatch: reused old ethernet address 192.168.17.248 0:e:3b:a:cb:67 (0:1e:8c:72:b0:d0)
  -->
<decoder name="arpwatch">
  <program_name>^arpwatch</program_name>
</decoder>

<decoder name="arpwatch-new">
  <parent>arpwatch</parent>
  <prematch>^new station |^bogon </prematch>
  <regex offset="after_prematch">^(\d+.\d+.\d+.\d+) (\S+)</regex>
  <order>srcip, extra_data</order>
  <fts>name, srcip, extra_data</fts>
</decoder>



<!-- MySQL decoder.
  - Examples:
  - MySQL log: 060516 22:38:46 mysqld started
  - MySQL log: 060516 22:38:46 mysqld ended
  - MySQL log: 070823 21:23:08 2 Query       INSERT INTO signature(id, rule_id, level, description) VALUES (NULL, '18103','5','Windows error event.') ON DUPLICATE KEY UPDATE level='5'
  - 070824 11:33:51       6 Connect     Access denied for user 'roota'@'localhost' (using password: YES)
  -->
<decoder name="mysql_log">
  <prematch>^MySQL log:</prematch>
</decoder>



<!-- PostgreSQL decoder.
  - Examples:
  - [2007-08-31 18:37:09.454 ADT] 192.168.2.99: LOG:  connection authorized: user=ossec_user database=ossecdb
  - [2007-08-31 18:37:15.525 ADT] 192.168.2.99: ERROR:  relation "alert2" does not exist
  -->
<decoder name="postgresql_log">
  <prematch>^[\d\d\d\d-\d\d-\d\d \S+ \w+] </prematch>
  <regex offset="after_prematch">^\S+ (\w+): </regex>
  <order>status</order>
</decoder>  



<!-- Imapd decoder.
  - Will extract the username/srcip
  - Examples:
  - imapd[26888]: Login failed user=babadosfashion auth=babadosfashion host=bahiana.resenet.com.br [200.255.5.8]
  - imapd[21040]: Login failed user=root domain=(null) auth=root host=host29-141.poo
    l8249.interbusiness.it [82.49.141.29]
  - imapd[27113]: Authenticated user=badyy host=a.resenet.com.br [1.2.3.4]
  - imapd[27113]: Logout user=badyy host=a.resenet.com.br [1.2.3.4]  
  -->
<decoder name="imapd">
  <program_name>^imapd</program_name>
  <regex offset="after_prematch">user=(\S+) \.+ [(\d+.\d+.\d+.\d+)]$</regex>    
  <order>user,srcip</order>
</decoder>



<!-- Vpopmail decoder. (by Ceg Ryan <cegryan ( at ) gmail.com>)
  - Examples:
  - vpopmail[32485]: vchkpw-pop3: password fail abc@xxx.com:x.x.x.x
  - vpopmail[32485]: vchkpw-2110 password fail abc@xxx.com:x.x.x.x
  -                  vchkpw-pop3: password fail (pass: 'test') user@my_domain:1.2.3.4
  - vpopmail[2100]: vchkpw-pop3: vpopmail user not found abc@xxx.com:x.x.x.x
  - vpopmail[4162]: vchkpw-pop3: vpopmail user not found support@:69.3.64.3
  -->
<decoder name="vpopmail">
  <program_name>^vpopmail</program_name>
</decoder>

<decoder name="vpopmail-fail">
  <parent>vpopmail</parent>
  <prematch>^vchkpw-\S+: password fail</prematch>
  <regex offset="after_prematch"> (\S+)@\S+:(\d+.\d+.\d+.\d+)$</regex>
  <order>user, srcip</order>
</decoder>

<decoder name="vpopmail-notfound">
  <parent>vpopmail</parent>
  <prematch>^vchkpw-\S+: vpopmail user not </prematch>
  <regex offset="after_prematch">^found (\S+):(\d+.\d+.\d+.\d+)$</regex>
  <order>user, srcip</order>
</decoder>

<decoder name="vpopmail-empty">
  <parent>vpopmail</parent>
  <prematch>^vchkpw-\S+: null password </prematch>
  <regex offset="after_prematch">^given (\S+):(\d+.\d+.\d+.\d+)$</regex>
  <order>user, srcip</order>
</decoder>

<decoder name="vpopmail-success">
  <parent>vpopmail</parent>
  <prematch>^vchkpw-\S+: \(\S+\) login </prematch>
  <regex offset="after_prematch">^success (\S+):(\d+.\d+.\d+.\d+)$</regex>
  <order>user, srcip</order>
</decoder>



<!-- VM-POP3 - Virtual Mail Pop3
  - Examples:
  -->
<decoder name="vm-pop3d">
  <program_name>^vm-pop3d</program_name>
</decoder>

<decoder name="vm-pop3d-fail">
  <parent>vm-pop3d</parent>
  <prematch>^User '</prematch>
  <regex offset="after_prematch">^(\S+)' - \w+ auth, </regex>
  <regex>from=(\d+.\d+.\d+.\d+)$</regex>
  <order>user, srcip</order>
</decoder>



<!-- Courier decoder
  - Examples:
  - pop3d-ssl: LOGIN FAILED, ip=[::ffff:192.168.0.200]
  - courierpop3login: LOGIN, user=web10_mauricio, ip=[::ffff:192.168.0.100]
  - courierpop3login: LOGIN FAILED, ip=[::ffff:192.168.0.188]
  - imaplogin: DISCONNECTED, ip=[::ffff:127.0.0.1], time=0
  - Nov 24 18:18:28 gandalf pop3d: LOGIN FAILED, ip=[::ffff:1.2.3.4]
  -->
<decoder name="courier">
  <program_name>^pop3d|^courierpop3login|^imaplogin</program_name>
</decoder>

<decoder name="courier-login">
  <parent>courier</parent>
  <prematch>^LOGIN, </prematch>
  <regex offset="after_prematch">^user=(\S+), ip=[(\S+\d)]$</regex>
  <order>user, srcip</order>
</decoder>

<decoder name="courier-generic">
  <parent>courier</parent>
  <regex>, ip=[(\S+\d)]$</regex>
  <order>srcip</order>
</decoder>



<!-- Dovecot Decoder
  - Will extract username, srcip and dstip when available.
  - Jun 17 10:15:24 hostname dovecot: Dovecot v1.2.rc3 starting up (core dumps disabled)
  - Jun 17 10:15:24 hostname dovecot: Fatal: auth(default): Support not compiled in for passdb driver 'ldap'
  - Jun 17 10:15:24 hostname dovecot: Fatal: Auth process died too early - shutting down
  - dovecot: Jun 23 15:04:05 Info: imap-login: Login: user=<username>, method=PLAIN, rip=1.2.3.4, lip=1.2.3.5 Authentication Failure:
  - Jan 11 03:42:09 hostname dovecot: auth-worker(default): sql(user@example.com,1.2.3.4): Password mismatch
  - dovecot: Jan 07 14:46:28 Warn: auth(default): userdb(username,::ffff:127.0.0.1): user not found from userdb
  - dovecot: Mar 13 15:25:07 Info: auth(default): pam(user@example.com,::ffff:1.2.3.4): pam_authenticate() failed: User not known to the underlying authentication module
  - dovecot: Mar 13 15:25:07 Info: auth(default): passwd-file(user@example.com,::ffff:1.2.3.4): unknown user
  - Jan 11 03:45:09 hostname dovecot: auth-worker(default): sql(username,1.2.3.4): unknown user 
  - Jan 11 03:42:09 hostname dovecot: auth(default): pam(user@example.com,1.2.3.4): pam_authenticate() failed: User not known to the underlying authentication module
  - Jul  4 17:30:51 hostname dovecot[2992]: pop3-login: Disconnected: rip=1.2.3.4, lip=1.2.3.5
  - dovecot: Jun 23 15:04:06 Info: IMAP(username): Disconnected: Logged out bytes=59/566
  - dovecot: May 31 09:43:57 Info: pop3-login: Aborted login (1 authentication attempts): user=<username>, method=PLAIN, rip=::ffff:1.2.3.4, lip=::ffff:1.2.3.5, secured
  - Jan 30 09:37:55 hostname dovecot: pop3-login: Aborted login: user=<username>, method=PLAIN, rip=::ffff:1.2.3.4, lip=::ffff:1.2.3.5
-->

<decoder name="dovecot">
  <program_name>^dovecot</program_name>
</decoder>

<decoder name="dovecot-success">
  <parent>dovecot</parent>
  <prematch offset="after_parent">^\w\w\w\w-login: Login: </prematch>
  <regex offset="after_prematch">^user=\p(\S+)\p, method=\S+, rip=\S*(\d+.\d+.\d+.\d+), lip=\S*(\d+.\d+.\d+.\d+), (\S*)$</regex>
  <order>user, srcip, dstip, protocol</order>
</decoder>

<decoder name="dovecot-aborted">
  <parent>dovecot</parent>
  <prematch offset="after_parent">^\w\w\w\w-login: Aborted login</prematch>
  <regex offset="after_prematch">: user=\p(\S+)\p, method=\S+, rip=::ffff:(\d+.\d+.\d+.\d+), lip=::ffff:(\d+.\d+.\d+.\d+)$</regex>
  <order>user, srcip, dstip</order>
</decoder> 

<decoder name="dovecot-fail">
  <parent>dovecot</parent>
  <prematch offset="after_parent">^auth\(default\)|auth-worker\(default\)</prematch>
  <regex offset="after_prematch">^: \S+\((\S+),(\d+.\d+.\d+.\d+)\)</regex>
  <order>user, srcip</order>
</decoder>

<decoder name="dovecot-disconnect">
  <parent>dovecot</parent>
  <prematch offset="after_parent">^\w\w\w\w-login: Disconnected: </prematch>
  <regex offset="after_prematch">^rip=(\S+), lip=(\d+.\d+.\d+.\d+)</regex>
  <order>srcip, dstip</order>
</decoder>



<!-- Named decoder.
  - Will extract the srcip
  - Examples:
  -  valhalla named[7885]: client 192.168.1.231#1142: update 'hayaletgemi.edu/IN' denied
  - named[12637]: client 1.2.3.4#32769: query (cache) 'somedomain.com/MX/IN' denied
  -  Oct 22 10:12:33 junction named[31687]: /etc/blocked.slave:9892: syntax error near ';'
  -  Oct 22 10:12:33 junction named[31687]: reloading configuration failed: unexpected token
 -->           
<decoder name="named">
  <program_name>^named</program_name>
</decoder>

<decoder name="named-query">
  <parent>named</parent>
  <prematch>: query: </prematch>
  <regex>client (\S+)#\d+: query: (\S+) IN </regex>
  <order>srcip,url</order>
</decoder>


<decoder name="named_client">
  <parent>named</parent>  
  <prematch>^client </prematch>
  <regex offset="after_prematch">^(\d+.\d+.\d+.\d+)#</regex>
  <order>srcip</order>
</decoder>

<decoder name="named_from">
  <parent>named</parent>  
  <regex offset="after_parent"> from [(\d+.\d+.\d+.\d+)]</regex>
  <order>srcip</order>
</decoder>

<decoder name="named-master">
  <parent>named</parent>
  <prematch> for master</prematch>
  <regex>for master (\d+.\d+.\d+.\d+):(\d+) \S+ \(source (\d+.\d+.\d+.\d+)#d+\)$</regex>
  <order>dstip,dstport,srcip</order>
</decoder>


<!-- Postfix  decoder.
  - Will extract the srcip
  - Examples: 
  - postfix/smtpd[32297]: NOQUEUE: reject: RCPT from unknown[213.255.237.245]: 554 
    <ce101@ce.metu.edu.tr>: Relay access denied; from=<kryonomm@yahoo.com> 
    to=<e10445@jubiipost.dk> proto=SMTP helo=<SM01.net>
  - postfix/smtpd[27712]: NOQUEUE: reject: MAIL from localhost[127.0.0.1]: 452 Insufficient system storage
 -->

<decoder name="postfix">
  <program_name>^postfix</program_name>
</decoder>

<decoder name="postfix-reject">
  <use_own_name>true</use_own_name>
  <parent>postfix</parent>  
  <prematch>^NOQUEUE: reject: \w\w\w\w from </prematch>
  <regex offset="after_prematch">[(\d+.\d+.\d+.\d+)]: (\d+) </regex>
  <order>srcip,id</order>
</decoder>

<decoder name="postfix-sasl">
  <parent>postfix</parent>  
  <prematch>^warning: \S+: SASL </prematch>
  <regex>^warning: \S+[(\d+.\d+.\d+.\d+)]:</regex>
  <order>srcip</order>
</decoder>


<!-- Sendmail decoder.
  - Will extract the srcip
  - Examples: 
  - sendmail[15806618]: k1SN9pkK15806618: ruleset=check_mail, arg1=<rtreter@qffff.com>, 
  - relay=dsl.static81215198185.ttnet.net.tr [81.215.198.185] (may be forged), reject=553 5.1.8 
  - <rtreter@qffff.com>... Domain of sender address rtreter@qffff.com does not exist
  - sm-msp-queue[13484]: k5TKj6L5012934: to=root, ctladdr=root (0/0), delay=00:04:00, xdelay=00:00:00, mailer=relay, pri=120112, relay=[127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
  - sendmail[7735]: [ID 801593 mail.notice] k856Hah0007735: ruleset=check_rcpt, arg1=<sc@sd.com>, relay=[216.22.33.7], reject=553 5.3.0 <sc@sd.com>... Spammer 216.22.33.7 usergl@displaytoward.net rejected by RBL:http://www.spamhaus.org/
  - sm-mta[23868]: k9BEQK0c023868: rejecting commands
  from [200.121.73.169] [200.121.73.169] due to pre-greeting traffic
  - sendmail[7818]: j6KKHo2d007818: rejecting commands from sv.e103gng.com [66.62.19.10] due to pre-greeting traffic
 -->
<decoder name="sendmail-reject">
  <program_name>^sendmail|^sm-mta|^sm-msp-queue</program_name>
</decoder>  

<decoder name="sendmail-pre-greeting">
  <parent>sendmail-reject</parent>
  <prematch>^\S+: rejecting commands from</prematch>
  <regex offset="after_prematch">^ \S+ [(\d+.\d+.\d+.\d+)]</regex>
  <order>srcip</order>
</decoder>

<decoder name="sendmail-reject-nodns">
  <parent>sendmail-reject</parent>
  <prematch>relay=[</prematch>
  <regex offset="after_prematch">^(\d+.\d+.\d+.\d+)]</regex>
  <order>srcip</order>
</decoder>

<decoder name="sendmail-reject-dns">
  <parent>sendmail-reject</parent>
  <prematch>relay=\S+ [</prematch>
  <regex offset="after_prematch">^(\d+.\d+.\d+.\d+)]</regex>
  <order>srcip</order>
</decoder>




<!-- SMF-SAV Sendmail Milter decoder.
  - Will extract the srcip
  - Examples:
  - smf-sav[513]: [ID 987462 mail.notice] sender check failed: <xkyjywqvophshu@mypersonalemail.com>, 125.133.22.112, [125.133.22.112], [00:00:01]
  - smf-sav[513]: [ID 407019 mail.info] sender check succeeded (cached): <asterisk-users-bounces@lists.digium.com>, 216.207.245.17, lists.digium.com
  - smf-sav[513]: [ID 987894 mail.notice] sender check tempfailed: <31363****-org@targetedpages.com>, 69.8.190.101, smtp101.tramailer.info, [00:00:05]
  - smf-sav[1883]: sender check tempfailed (cached): <k@vooC7b>, 87.103.236.97, [87.103.236.97]
  - smf-sav[1883]: sender check failed (cached): <clahaiclahai@email.iis.com.br
   >, 91.146.176.140, pool176-140.cable.tolna.net
  -->
<decoder name="smf-sav-reject">
  <program_name>^smf-sav</program_name>
  <prematch>^sender check failed|</prematch>
  <prematch>^sender check tempfailed</prematch>
  <regex offset="after_prematch">^ \(cached\): \S+, (\d+.\d+.\d+.\d+),|</regex>
  <regex>^: \S+, (\d+.\d+.\d+.\d+),</regex>
  <order>srcip</order>
</decoder>



<!-- Mail scanner
  - Will extract the srcip/action
  - Examples:
  - MailScanner[24112]: Message k7B9Mc6b015925 from 
  68.171.145.34 (nilsenator@hotmail.com) to yyyyy.no is spam, SpamAssassin
  - May  3 16:28:40 jarjar MailScanner[4732]: Message k436SX2M005191 from  
  111.222.111.222 (david@our.domain.org) to our.domain.org is spam
  , SpamAssassin
  - MailScanner[5317]: Message k436dCIW005370 from  
  111.222.111.222 (david@our.domain.org) to another.domain.org is not s
  pam, SpamAssassin
  - MailScanner[29107]: Message j0EMandY027564 from xxx.xxx.xxx.xxx(xxxxx@xxxxx.ie) to xxxxx.ie is not spam
  -->
<decoder name="mailscanner">
  <program_name>^MailScanner</program_name>
</decoder>

<decoder name="mailscanner-ip">
  <parent>mailscanner</parent>
  <prematch>^Message \S+ from </prematch>
  <regex offset="after_prematch">^(\d+.\d+.\d+.\d+) \S+ to \S+ is (\w+)</regex>
  <order>srcip, action</order>
</decoder>


<!-- OpenBSD smtpd decoders -->

<decoder name="smtpd">
  <program_name>smtpd</program_name>
</decoder>

<decoder name="smtpd-client">
  <parent>smtpd</parent>
  <prematch offset="after_parent">^client</prematch>
  <regex>^client (\S+) </regex>
  <order>srcip</order>
</decoder>

<decoder name="smtpd-relay">
  <parent>smtpd</parent>
  <prematch>relay=</prematch>
  <regex>relay=\S+ [(\S+)], </regex>
  <order>srcip</order>
</decoder>



<!-- Iptables decoder.
  - Will extract the srcip, dstip, srcport, dstport, protocol
  - Examples:
  - kernel: FIREWALL_OUT IN= OUT=eth0
    SRC=192.168.6.57 DST=216.161.248.225 LEN=40 TOS=0x00 PREC=0x00 TTL=64
    ID=18547 DF PROTO=TCP SPT=46388 DPT=37628 WINDOW=6930 RES=0x00 ACK RST
    URGn=0
  - kernel: IPTABLE IN=eth0 OUT= MAC=ff:ff:ff:ff:ff:ff:00:03:93:db:2e:b4:08:00 
    SRC=10.4.11.40 DST=255.255.255.255 LEN=180 TOS=0x00 PREC=0x00 TTL=64 
    ID=4753 PROTO=UDP SPT=49320 DPT=2222 LEN=160
  - kernel: [4475569.016000] IN= OUT=lo SRC=192.168.2.11 DST=192.168.2.11 
    LEN=52 TOS=0x10 PREC=0x00 TTL=64 ID=49546 DF PROTO=TCP SPT=43068 
    DPT=22 WINDOW=8192 RES=0x00 ACK URGP=0     
  - Aug 17 10:03:37 myhostname kernel: SFW2-INext-DROP-DEFLT IN=eth0 OUT= MAC=00:08:02:da:c8:51:00:0f:f7:74:31:8a:08:00 SRC=1.2.3.36 DST=1.2.3.194 LEN=28 TOS=0x00 PREC=0x00 TTL=44 ID=60200 PROTO=ICMP TYPE=8 CODE=0 ID=10466 SEQ=21229   
  -->
<decoder name="iptables">
   <program_name>^kernel</program_name>
</decoder>
     
<decoder name="iptables-1">
   <parent>iptables</parent>
   <type>firewall</type>
   <prematch>^[\d+.\d+] \S+ IN=</prematch>
   
   <regex>^[\d+.\d+] (\S+) \.+ SRC=(\S+) DST=(\S+)</regex>
   <regex> \.+ PROTO=(\w+) </regex>
   <order>action,srcip,dstip,protocol</order>
</decoder>

<decoder name="iptables-1">
   <parent>iptables</parent>
   <type>firewall</type>
   <regex offset="after_regex">^SPT=(\d+) DPT=(\d+) </regex>
   <order>srcport,dstport</order>
</decoder>

<decoder name="iptables-2">
   <parent>iptables</parent>
   <type>firewall</type>
   <prematch>^\S+ IN=</prematch>
   
   <regex>^(\S+) \.+ SRC=(\S+) DST=(\S+) \.+ </regex>
   <regex>PROTO=(\w+) </regex>
   <order>action,srcip,dstip,protocol</order>
</decoder>

<decoder name="iptables-2">
   <parent>iptables</parent>
   <type>firewall</type>
   <regex offset="after_regex">^SPT=(\d+) DPT=(\d+) </regex>
   <order>srcport,dstport</order>
</decoder>

<decoder name="iptables-shorewall">
   <parent>iptables</parent>
   <type>firewall</type>
   <prematch>^Shorewall:\S+:</prematch>
   
   <regex offset="after_prematch">^(\S+):\.+ SRC=(\S+) DST=(\S+) \.+ </regex>
   <regex>PROTO=(\w+) </regex>
   <order>action,srcip,dstip,protocol</order>
</decoder>

<decoder name="iptables-shorewall">
   <parent>iptables</parent>
   <type>firewall</type>
   <regex offset="after_regex">^SPT=(\d+) DPT=(\d+) </regex>
   <order>srcport,dstport</order>
</decoder>   

<decoder name="iptables-shorewall2">
  <parent>iptables</parent>
  <type>firewall</type>
  <prematch>^\p\S+\p Shorewall:\S+:</prematch>
  <regex offset="after_prematch">^(\S+):\.+ SRC=(\S+) DST=(\S+) \.+ </regex>
  <regex>PROTO=(\w+) </regex>
  <order>action,srcip,dstip,protocol</order>
</decoder>


<!-- Solaris IPFilter decoder.
  - Will extract the action, srcip, srcport, dstip, dstport
  - Examples:
  - ipmon[11523]: [ID 702911 local0.warning] 09:30:39.300795 3x ce0 @0:1
    b 10.4.0.25,43873 -> 10.4.122.243,22 PR tcp len 20 100 -AP IN
  - ipmon[11523]: [ID 702911 local0.warning] 09:31:53.285032 hme0 @0:1
    b 10.4.122.243,138 -> 255.255.255.255,138 PR udp len 20 229 IN mbcast
  - ipmon[11523]: [ID 702911 local0.notice] 09:30:40.398290 ce0 @0:14
    p 10.4.122.243,123 -> 10.4.122.16,123 PR udp len 20 76 K-S OUT
  -->
<decoder name="ipfilter">
   <type>firewall</type>
   <program_name>^ipmon</program_name>
   <regex> (\w) (\d+.\d+.\d+.\d+),(\d+) -> </regex>
   <regex>(\d+.\d+.\d+.\d+),(\d+) PR (\w+) </regex>
   <order>action,srcip,srcport,dstip,dstport,protocol</order>
</decoder>
  

<!-- AIX IPSec decoder.
  - Will extract the action,srcip,dstip,protocol,srcport,dstport
  - Examples:
  - ipsec_logd: #:3 R:p  I:10.0.0.99 S:10.0.0.82 D:10.0.0.99 
    P:tcp/ack SP:50349 DP:22 R:l I:en0 F:n T:0 L:88
  - ipsec_logd: #:1 R:p  O:10.0.0.99. S:10.0.0.99 D:10.0.0.25 
    P:udp SP:2063 DP:53 R:l I:en0 F:n T:0 L:81 
 -->
<decoder name="aix-ipsec">
   <type>firewall</type>
   <program_name>^ipsec_logd</program_name>
   <regex> R:(\w)  \w:\S+ S:(\d+.\d+.\d+.\d+) </regex>
   <regex>D:(\d+.\d+.\d+.\d+) P:(\S+) SP:(\d+) DP:(\d+) </regex>
   <order>action,srcip,dstip,protocol,srcport,dstport</order>
</decoder>



<!-- OpenBSD pf decoder (as a plugin - compiled).
  - Will extract the action,srcip,dstip,protocol,srcport,dstport
  - Examples:
  - Mar 30 15:33:26 enigma pf: Mar 30 15:32:33.483712 rule 2/(match) pass in on xl0: 140.211.166.3.6667 > 192.168.2.10.16290: P 7408:7677(269) ack 1773 win 2520 <nop,nop,timestamp 3960674784 2860123562> (DF)
  - Mar 30 15:47:05.522341 rule 4/(match) block in on lo0: 127.0.0.1.48784 > 127.0.0.1.23: S 1381529123:1381529123(0) win 16384 <mss 33184,nop,nop,sackOK,nop,wscale 0,[|tcp]> (DF) [tos 0x10]
  - Mar 30 15:54:22.171929 rule 3/(match) pass out on xl0: 192.168.2.10.1514 > 192.168.2.190.1030:  udp 73
  - Mar 30 15:54:22.174412 rule 3/(match) pass out on xl0: 192.168.2.10.1514 > 192.168.2.190.1030:  udp 89
  
  -->
<decoder name="pf">
   <type>firewall</type>
   <program_name>^pf$</program_name>
   <plugin_decoder>PF_Decoder</plugin_decoder>
</decoder>

  

<!-- SonicWall decoder.
  - Will extract action, srcip, dstip, protocol, srcport and dstport
  - Examples:
  - Jan  3 13:45:36 192.168.5.1 id=firewall sn=000SERIAL time="2007-01-03 14:48:06" fw=1.1.1.1 pri=6 c=262144 m=98 msg="Connection Opened" n=23419 src=2.2.2.2:36701:WAN dst=1.1.1.1:50000:WAN proto=tcp/50000
  - Jan  3 13:45:36 192.168.5.1 id=firewall sn=000SERIAL time="2007-01-03 14:48:07" fw=1.1.1.1 pri=1 c=32 m=30 msg="Administrator login denied due to bad credentials" n=7 src=2.2.2.2:36701:WAN dst=1.1.1.1:50000:WAN
  - id=firewall sn=00301E0526B1 time="2004-04-01 10:39:35"
  fw=67.32.44.2 pri=5 c=64 m=36 msg="TCP connection dropped" n=2686 src=67.101.200.27:4507:WAN dst=67.32.44.2:445:LAN rule=0
  -->
<decoder name="sonicwall">
  <type>firewall</type>
  <prematch>^id=\w+ sn=\w+ time=\S+ \S+ fw=\S+ pri=\d </prematch>
  <plugin_decoder>SonicWall_Decoder</plugin_decoder>
</decoder>



<!-- Netscreen Firewall decoder.
  - Will extract the action,srcip,dstip,protocol,srcport,dstport
  - Examples:
  - Jan  1 10:02:11 xx ns5gt: NetScreen device_id=ns5gt  [No Name]system-notification-00257(traffic): start_time="2006-01-01 10:09:38" duration=0 policy_id=310101 service=tcp/port:1526 proto=6 src zone=Null dst zone=self action=Deny sent=0 rcvd=38 src=10.1.2.3 dst=10.1.1.1 src_port=51350 dst_port=1426
  - <13>Mar 16 15:27:56 192.168.2.1 ns5gt: NetScreen device_id=ns5gt  [No Name]system-notification-00257(traffic): start_time=\"2004-03-16 16:31:22\" duration=0 policy_id=310001 service=tcp/port:120 proto=6 src zone=Null dst zone=self action=Deny sent=0 rcvd=60 src=10.1.1.1 dst=10.1.2.1 src_port=32047 dst_port=22
  - Jun  2 11:24:16 fire00 sav00: NetScreen device_id=sav00  [Root]system-critical-00436: Large ICMP packet! From 210.232.20.7 to 148.100.114.126, proto 1 (zone Untrust, int ethernet1/2). Occurred 1 times. (2006-06-02 11:24:16)
  -  NetScreen device_id=ns5gt [Root]system-critical-00027: Multiple login failures occurred for user netscreen from IP address 1.2.3.4:1567 (2004-10-07)
  - 
  - ** Program name for netscreen is empty, since it is the hostname.
  -->
<decoder name="netscreenfw">
  <program_name />
  <prematch>^NetScreen device_id</prematch>
</decoder>  

<decoder name="netscreenfw-traffic">
  <parent>netscreenfw</parent>
  <type>firewall</type>
  
  <prematch offset="after_parent">system-notification-00257</prematch>
  <prematch>\(traffic\): </prematch>
  
  <regex offset="after_prematch"> proto=(\w+) \.+action=(\w+) </regex>
  <regex>\.+src=(\S+) dst=(\S+) src_port=(\d+) dst_port=(\d+)</regex>
  <order>protocol, action, srcip, dstip, srcport, dstport</order>
</decoder>

<decoder name="netscreenfw-critical">
  <parent>netscreenfw</parent>
  <prematch offset="after_parent">system-critical-\.+ from |</prematch>
  <prematch>system-alert-\.+ from </prematch>
  
  <regex offset="after_parent">system-(\w+)-(\d+): \.+ </regex>
  <regex>from\.+(\d+.\d+.\d+.\d+)</regex>
  <order>action, id, srcip</order>
</decoder>

<decoder name="netscreenfw-admin">
  <parent>netscreenfw</parent>
  <regex offset="after_parent">system-(\w+)-(\d+):</regex>
  <order>action, id</order>  
</decoder>


<!-- Pix decoder.
  - Will extract the srcip, srcport, dstip and dstport whenever possible.
  - Examples:
  - %PIX-6-106015: Deny TCP (no connection) from 161.58.238.151/110 to a.b.c.d/3782 flags RST ACK
  - %PIX-2-106001: Inbound TCP connection denied from 165.139.46.7/3854 to 165.189.27.70/139 flags
  - %PIX-3-106010: Deny inbound tcp src outside:213.98.79.233/2620 dst dmz:213.98.254.145/135
  - %PIX-3-106011: Deny inbound (No xlate) udp src outside:192.168.2.1/137
  dst outside:192.168.2.14/137
  - %PIX-3-106011: Deny inbound (No xlate) tcp src inside:10.100.7.43/80 dst 
  inside:10.100.4.71/2285
  - %PIX-3-710003: TCP access denied by ACL from 216.39.220.130/54065 to outside:62.192.113.98/ssh
  - %PIX-7-710001: TCP access requested from X.X.X.X/1292 to outside:Y.Y.Y.Y/ssh
  - %PIX-7-710002: UDP access permitted from 33.33.33.4/943 to inside:33.33.33.15/snmp
  - %PIX-7-710005: UDP request discarded from <public IP of 525>/4500 to outside:192.168.69.137/4500
  - %PIX-2-106002   protocol Connection denied by outbound list acl_ID src inside_address dest outside_address
  - %PIX-2-106002: udp connection denied by outbound list 30 src 216.53.120.62 138 dest 169.132.10.82 138
  -  %PIX-4-106023: Deny tcp src inside:111.11.11.1/2143 dst YYY:172.11.1.11/139 by access-group "inside_inbound"
  - %PIX-4-400013 IDS:2003 ICMP redirect from 10.4.1.2 to 10.2.1.1 on interface dmz
  - %PIX-2-106006: Deny inbound UDP from ***/20031 to ***/20031 on  
  interface vpn
  - %PIX-7-710002: TCP access permitted from 10.0.0.1/60749 to db:10.0.0.2/ssh
  - %PIX-6-305012: Teardown dynamic UDP translation from inside:1.1.1.1/12 to outside:1.2.1.2/11 duration 0:00:11.
  - %PIX-3-305005: No translation group found for icmp src outside:x.x.x.x dst inside:x.x.x.x (type 3, code 0)
  - %ASA-2-106001: Inbound TCP connection denied from 1.2.3.4/1234 to 213.207.99.248/445 flags SYN on interface outside (Message repeated 2 times)
  - %PIX-6-605005: Login permitted from 192.168.1.2/2953 to inside:192.168.1.1/telnet for user ""
  - %PIX-6-605004: Login denied from 192.168.2.10/32597 to outside:192.168.2.14/ssh for user "root"
  - %PIX-6-305011: Built dynamic UDP translation from inside:192.168.1.2/1026 to outside:192.168.2.14/1163
  - %PIX-6-305011: Built dynamic TCP translation from inside:192.168.1.3/54946 to outside:192.168.2.14/1033
  - %PIX-6-302015: Built outbound UDP connection 156 for outside:192.168.2.10/1514 (192.168.2.10/1514) to inside:192.168.1.2/1026 (192.168.2.14/1163)
  -->
<decoder name="pix">
  <prematch>^%PIX-|^\w\w\w \d\d \d\d\d\d \d\d:\d\d:\d\d: %PIX-|</prematch>
  <prematch>^%ASA-|^\w\w\w \d\d \d\d\d\d \d\d:\d\d:\d\d: %ASA-|</prematch>
  <prematch>^%FWSM-|^\w\w\w \d\d \d\d\d\d \d\d:\d\d:\d\d: %FWSM-</prematch>
</decoder>

<decoder name="pix-fw1">
  <parent>pix</parent>
  <type>firewall</type>
  <prematch offset="after_parent">^2-106001</prematch>
  <regex offset="after_parent">^(\S+): \w+ (\w+) \S+ (\S+) from </regex>
  <regex>(\S+)/(\S+) to (\S+)/(\S+)</regex>
  <order>id, protocol, action, srcip, srcport, dstip, dstport</order>
</decoder>

<decoder name="pix-fw2">
  <parent>pix</parent>
  <type>firewall</type>
  <prematch offset="after_parent">^3-710003|^7-710002|^7-710005</prematch>
  <regex offset="after_parent">^(\S+): (\S+) \w+ (\w+)\.+from </regex>
  <regex>(\S+)/(\S+) to \w+:(\S+)/(\S+)</regex>
  <order>id, protocol, action, srcip, srcport, dstip, dstport</order>
</decoder>

<decoder name="pix-fw3">
  <parent>pix</parent>
  <type>firewall</type>
  <prematch offset="after_parent">^4-106023</prematch>
  <regex offset="after_parent">^(\S+): (\w+) (\w+) src \w+:</regex>
  <regex>(\S+)/(\S+) dst \w+:(\S+)/(\S+)</regex>
  <order>id, action, protocol, srcip, srcport, dstip, dstport</order>
</decoder>

<decoder name="pix-fw4">
  <parent>pix</parent>
  <type>firewall</type>
  <prematch offset="after_parent">^4-106019</prematch>
  <regex offset="after_parent">^(\S+): IP packet from (\S+) to </regex>
  <regex>(\S+), protocol (\w+) (\w+) </regex>
  <order>id, srcip, dstip, protocol, action</order>
</decoder>

<decoder name="pix-fw5">
  <parent>pix</parent>
  <type>firewall</type>
  <prematch offset="after_parent">^2-106006|^2-106007</prematch>
  <regex offset="after_parent">^(\S+): (\w+) \S+ (\w+) from </regex>
  <regex>(\d+.\d+.\d+.\d+)/(\d+) to (\d+.\d+.\d+.\d+)/(\d+) </regex>
  <order>id, action, protocol, srcip, srcport, dstip, dstport</order>
</decoder>

<decoder name="pix-fw6">
  <parent>pix</parent>
  <type>firewall</type>
  <prematch offset="after_parent">^6-106015</prematch>
  <regex offset="after_parent">^(\S+): (\w+) (\w+) \S+ \S+ (\S+) from </regex>
  <regex>(\S+)/(\S+) to (\S+)/(\S+)</regex>
  <order>id, action, protocol, srcip, srcport, dstip, dstport</order>
</decoder>

<decoder name="pix-fw7">
  <parent>pix</parent>
  <type>firewall</type>
  <prematch offset="after_parent">^6-305012</prematch>
  <regex offset="after_parent">^(\S+): (\w+) \w+ (\w+) translation </regex>
  <regex>from \w+:(\S+)/(\d+) to \w+:(\S+)/(\d+) </regex>
  <order>id, action, protocol, srcip, srcport, dstip, dstport</order>
</decoder>

<decoder name="pix-fw8">
  <parent>pix</parent>
  <type>firewall</type>
  <prematch offset="after_parent">^3-106011|^3-106010</prematch>
  <regex offset="after_parent">^(\S+): (\w+) \.+ (\w+) src </regex>
  <regex>\w+:(\S+)/(\d+) dst \w+:(\S+)/(\d+)</regex>
  <order>id, action, protocol, srcip, srcport, dstip, dstport</order>
</decoder>

<decoder name="pix-attacks">
  <parent>pix</parent>
  <prematch offset="after_parent">^2-106012: |^2-106017: |</prematch>
  <prematch>^2-106020|^1-106021|^1-106022|</prematch>
  <prematch>^4-4000</prematch>
  <regex offset="after_parent">^(\S+): \.+ from (\d+.\d+.\d+.\d+) </regex>
  <order>id, srcip</order>
</decoder>

<decoder name="pix-srcip">
  <parent>pix</parent>
  <prematch offset="after_parent">^6-605004|^6-308001|^6-605005</prematch>
  <regex offset="after_parent">^(\S+): \.+ (\d+.\d+.\d+.\d+)</regex>
  <order>id, srcip</order>
</decoder>

<decoder name="pix-generic">
  <parent>pix</parent>
  <regex offset="after_parent">^(\S+): </regex>
  <order>id</order>
</decoder>



<!-- Cisco VPN Concentrator
  - Will exatract srcip and username.
  - Examples:
  -
  - Jan 8 09:10:37 vpn.example.com 11504 01/08/2007 09:10:37.780 SEV=3 AUTH/5 RPT=124 192.168.0.1 Authentication rejected: Reason = Unspecified handle = 805, server = auth.example.com, user = testuser, domain = <not specified>
  11504 01/08/2007 09:10:37.780 SEV=3
  -->
<decoder name="cisco-vpn-concentrator">
  <prematch>^\d+ \d\d/\d\d/\d\d\d\d \S+ SEV=\d </prematch>
  <regex offset="after_prematch">^(\S+) RPT=\d+ (\d+.\d+.\d+.\d+) </regex>
  <order>id, srcip</order>
</decoder> 



<!-- Snort decoder.
  - Will extract the id, srcip and dstip
  - Examples:
  - snort: [1:469:3] ICMP PING NMAP [Classification: Attempted Information 
    Leak] [Priority: 2]: {ICMP} 10.4.12.26 -> 10.4.10.231
  - snort: [1:1420:11] SNMP trap tcp [Classification: Attempted Information 
    Leak] [Priority: 2]: {TCP} 10.4.12.26:37020 -> 10.4.10.231:162
  - [**] [1:1054:7] WEB-MISC weblogic/tomcat .jsp view source attempt [**]
    [Classification: Web Application Attack]
    [Priority: 1]  10.4.12.26:34041 -> 66.179.53.37:80
  - [**] [1:1421:11] SNMP AgentX/tcp request [**]
    [Classification: Attempted Information Leak] [Priority: 2]
    10.4.3.20:626 -> 10.4.10.161:705              
  - [**] [1:1882:10] ATTACK-RESPONSES id check returned userid [**]
    [Classification: Potentially Bad Traffic] [Priority: 2]
    {UDP} 192.168.20.32 -> 192.168.20.2  
  -->

<decoder name="snort">
  <program_name>^snort</program_name>
</decoder>

<decoder name="snort">
  <type>ids</type>
  <prematch>^[**] [\d+:\d+:\d+] </prematch>
</decoder>
  
<decoder name="snort2">
   <parent>snort</parent>
   <type>ids</type>
   <prematch>^[**] |^[\d+:\d+:\d+] </prematch>
   <regex>^[**] [(\d+:\d+:\d+)] \.+ (\d+.\d+.\d+.\d+)\p*\d* -> </regex>
   <regex>(\d+.\d+.\d+.\d+)|^[(\d+:\d+:\d+)] \.+ </regex>
   <regex>(\d+.\d+.\d+.\d+)\p*\d* -> (\d+.\d+.\d+.\d+)</regex>
   <order>id,srcip,dstip</order>
   <fts>name,id,srcip,dstip</fts>
</decoder>



<!-- OpenBSD isakmpd decoders -->

<decoder name="isakmpd">
  <program_name>^isakmpd</program_name>
</decoder>

<decoder name="isakmpd-from">
  <parent>isakmpd</parent>
  <prematch>message from </prematch>
  <regex>from (\S+) port (\d+)</regex>
  <order>srcip,srcport</order>
</decoder>

<decoder name="isakmpd-peer">
  <parent>isakmpd</parent>
  <prematch>from peer</prematch>
  <regex>from peer (\S+):(\d+)$</regex>
  <order>srcip,srcport</order>
</decoder>



<!-- Suhosin decoder.
  - Will extract the attack name and srcip.
  - Examples:
  - suhosin[76366]: ALERT - canary mismatch on efree() - heap overflow detected (attacker '200.139.164.149', file 'xyz')
  - suhosin[24239]: ALERT - configured request variable value length limit exceeded - dropped variable 'introtext' (attacker '192.168.1.2', file '/var/www/site/administrator/index2.php')
  - suhosin[32150]: ALERT - configured POST variable limit exceeded - dropped variable 'setting[sg_allow_delete_empty_group]' (attacker '32.104.x.y', file '/home/htdocs/admincp/options.php') 
  -->
<decoder name="suhosin">
  <program_name>^suhosin</program_name>
  <type>ids</type>
  <regex>^ALERT - (\.+) \(attacker '(\d+.\d+.\d+.\d+)', </regex>
  <order>id, srcip</order>
  <fts>name, location, id</fts>
</decoder>



<!-- Dragon Decoder
  - Will extract srcip, dstip and id
  - Examples:
  - 2007-02-24 00:07:30|xx-ids|MS:MDTC-DOS|1.2.3.4|5.6.7.8|123|456|I||6|tcp,xx
  -
  -->
<decoder name="dragon-nids">
   <type>ids</type>
   <prematch>^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d\|</prematch>
   <regex offset="after_prematch">^\S+\|(\S+)\|</regex>
   <regex>(\d+.\d+.\d+.\d+)\|(\d+.\d+.\d+.\d+)\|</regex>
   <order>id, srcip, dstip</order>
   <fts>name, id, srcip, dstip</fts>
</decoder>
                        
   
   
<!-- Horde decoder
  - Will extract: username and srcip.
  - Examples:
  - [notice] [imp] Login success for raphaelv@xx [100.121.170.41] to {a.b.c:143} [on line 92 of "/home/webmail/horde/imp/redirect.php"]
  - [error] [imp] FAILED LOGIN 210.179.154.213 to xxx:143[imap] as mala1
  -->
<decoder name="horde_imp">
  <prematch>^[\w+] [imp] |^[\w+] [horde] </prematch>
</decoder>  

<decoder name="horde_imp_success">
  <parent>horde_imp</parent>
  <prematch offset="after_parent">^Login success </prematch>
  <regex offset="after_prematch">^for (\S+) [(\d+.\d+.\d+.\d+)] </regex>
  <order>user, srcip</order>
</decoder>

<decoder name="horde_imp_failed">
  <parent>horde_imp</parent>
  <prematch offset="after_parent">^FAILED LOGIN</prematch>
  <regex offset="after_prematch">^ (\d+.\d+.\d+.\d+) to \S+ as (\S+) </regex>
  <order>srcip, user</order> 
</decoder>



<!-- Wordpress decoder.
  -  It needs the WPsyslog2 plugin.
  - Examples:
  - WPsyslog[14382]: [127.0.0.1 na] Info: User authentication failed. User name: lala
  - WPsyslog[14382]: [127.0.0.1 na] Info: User logged in. User name: admin (admin).
  -->
<decoder name="wordpress">
  <program_name>^WPsyslog</program_name>
  <prematch>^[</prematch>
  <regex offset="after_prematch">^(\d+.\d+.\d+.\d+) </regex>
  <order>srcip</order>
</decoder>



<!-- Roundcube decoder
 - Will extract username and src IP from the logs, when available.
   Examples:
 - Apr 10 22:45:20 hostname roundcube: [10-Apr-2009 22:45:20 -0500] IMAP
   Error: Authentication for username failed (LOGIN): "a001 NO Authentication
   failed." (POST /roundcube/?_task=&_action=login)
 - Apr 10 23:01:23 hostname roundcube: [10-Apr-2009 23:01:23 -0500]:
   Successful login for username (id 1) from 127.0.0.1
-->
<decoder name="roundcube">
  <program_name>^roundcube</program_name>
  <prematch>^[\d\d-\w\w\w-\d\d\d\d \d\d:\d\d:\d\d \S+]</prematch>
</decoder>

<decoder name="roundcube-success">
  <parent>roundcube</parent>
  <prematch>^: Successful login for </prematch>
  <regex offset="after_prematch">^(\S+) \(id \d+\) from (\d+.\d+.\d+.\d+)$</regex>
  <order>user, srcip</order>
</decoder>

<decoder name="roundcube-denied">
  <parent>roundcube</parent>
  <prematch>^ \w+ Error: Authentication </prematch>
  <regex offset="after_prematch">^for (\.+) failed</regex>
  <order>user</order>
</decoder>



<!-- Apache decoder.
  - Will extract the srcip
  - Examples:
  - [error] [client 80.230.208.105] Directory index forbidden by rule: /home/
  - [error] [client 64.94.163.159] Client sent malformed Host header
  - [error] [client 66.31.142.16] File does not exist: /var/www/html/default.ida
  - [notice] Apache configured  
  - httpd[18660]: [error] [client 12.34.56.78] File does not exist: /usr/local/htdocs/cache
  - httpd[23745]: [error] [client 12.34.56.78] PHP Notice:
  -->
<decoder name="apache-errorlog">
  <program_name>^httpd</program_name>
</decoder>  

<decoder name="apache-errorlog">
  <prematch>^[warn] |^[notice] |^[error] </prematch>
</decoder>  

<decoder name="apache-errorlog-ip">
  <parent>apache-errorlog</parent>
  
  <prematch offset="after_parent">^[client</prematch>
  <regex offset="after_prematch">^ (\d+.\d+.\d+.\d+)] </regex>
  <order>srcip</order>
</decoder> 




<!-- Nginx error log decoder.
  - Will extract the srcip.
  - Examples:
  - 2009/09/15 20:55:40 [error] 63858#0: *3663 open() "/srv/www/ossec.net/robots.txt" failed (2: No such file or directory), client: 1.2.3.4, server: ossec.net, request: "GET /robots.txt HTTP/1.1", host: "www.ossec.net"
  - 2009/09/15 19:51:07 [error] 37992#0: accept() failed (53: Software caused connection abort)
  -->
<decoder name="nginx-errorlog">
  <prematch>^20\d\d/\d\d/\d\d \d\d:\d\d:\d\d [</prematch>
</decoder>

<decoder name="nginx-errorlog-ip">
  <parent>nginx-errorlog</parent>
  <prematch offset="after_parent">, client: \S+, server: \S+, request: "\S+ </prematch>
  <regex offset="after_parent">, client: (\d+.\d+.\d+.\d+), </regex> 
  <order>srcip</order>
</decoder>




<!-- NCSA common log decoder (used by apache, Lotus Domino and IIS NCSA).
  -  Will extract the srcip, url and id.
  -  Every web access log must use "web-log" as their
  -  type if they want to be matched against the web rules.
  - Examples:
  -  63.91.167.39 - - [03/Aug/2001:21:56:18 -0700] "GET /default.ida?NNNN
  -  206.78.62.16 - - [06/Aug/2001:08:57:08 -0700] "GET /default.ida?XX
  -  5.211.112.6 - - [04/Feb/2003:16:17:30 -0500] "GET /mod_ssl:error: 
  -  192.168.2.190 - - [18/Jan/2006:13:10:06 -0500] "GET /xxx.html HTTP/1.1"
     200 1732
  -  1.1.1.1 - username [18/Jan/2006:13:10:06 -0500] "GET /xxx.html HTTP/1.1"   
  -  123.4.5.6 aa.xx.com - [05/Nov/2006:00:46:56 -0500] "GET / HTTP/1.1" 302 -
  - ::ffff:202.194.15.192 190.7.138.180 - [18/Oct/2010:10:48:55 -0500] "GET //php-my-admin/config/config.inc.php?p=phpinfo(); HTTP/1.1" 404 345 "-"  "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)"
  -->
<decoder name="web-accesslog">
  <type>web-log</type>
  <prematch>^\d+.\d+.\d+.\d+ |^::ffff:\d+.\d+.\d+.\d+ </prematch>
  <regex>^(\d+.\d+.\d+.\d+) \S+ \S+ [\S+ \S\d+] </regex>
  <regex>"\w+ (\S+) HTTP\S+ (\d+) </regex>
  <order>srcip, url, id</order>
</decoder>


<!-- Windows date format.
  -  Pre match for windows date format. Used on Windows firewall,
  -  IIS, etc.
  -  Examples:
  -  2006-07-23 04:40:02 xxx
  -->
<decoder name="windows-date-format">
  <prematch>^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d </prematch>
</decoder>
 


<!-- Windows firewall decoder.
  - Will extract action, protocol, srcip, dstip, srcport and dstport.
  - Examples:
  - 2006-09-18 22:25:30 OPEN TCP 11.12.72.10 12.252.71.6 3311 445 - - - - - - - - -
  - 2006-09-18 22:26:23 DROP UDP 11.152.183.14 239.255.255.250 65299 1900 310 - - - - - - - RECEIVE
  - 2006-09-18 22:26:23 DROP UDP 11.152.183.14 239.255.255.250 65299 1900 310 - - - - - - - RECEIVE
  - 2006-09-18 22:26:23 DROP UDP 11.152.183.14 239.255.255.250 65298 1900 319 - - - - - - - RECEIVE
  -->
<decoder name="windows-firewall">
  <parent>windows-date-format</parent>
  <type>firewall</type>
  <use_own_name>true</use_own_name>
  <prematch offset="after_parent">^OPEN|^CLOSE|^DROP</prematch>
  <regex offset="after_parent">^(\w+) (\w+) </regex>
  <regex>(\S+) (\S+) (\d+) (\d+) </regex>
  <order>action, protocol, srcip, dstip, srcport, dstport</order>
</decoder>
 
 
<!-- IIS 5 WWW W3C log format.
  - #Fields: date time c-ip cs-username s-sitename s-computername s-ip s-port cs-method cs-uri-stem cs-uri-query sc-status cs-host cs(User-Agent) cs(Referer)
  - Examples:
  - 2006-07-23 04:40:02 1.2.3.4 - W3SVC3 CIN1WEB03 1.2.3.4 443 GET /Default.asp - 200 hiden.com Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+Avant+Browser;+Avant+Browser;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727) -
  -->
<decoder name="web-accesslog-iis5">
  <parent>windows-date-format</parent>
  <type>web-log</type>
  <use_own_name>true</use_own_name>
  <prematch offset="after_parent">^\d+.\d+.\d+.\d+ \S+ W3SVC</prematch>
  <regex offset="after_parent">^(\d+.\d+.\d+.\d+) \S+ \S+ \S+ \S+ </regex>
  <regex>\d+ \S+ (\S+ \S+) (\d+) </regex>
  <order>srcip,url,id</order>
</decoder>


<!-- IIS6 WWW W3C log format.
  - #Fields: date time s-sitename s-computername s-ip cs-method cs-uri-stem
  cs-uri-query s-port cs-username c-ip cs-version cs(User-Agent)
  cs(Cookie) cs(Referer) cs-host sc-status sc-substatus sc-win32-status
  sc-bytes cs-bytes time-taken
  - Examples:
  - 2007-01-22 05:00:11 W3SVC1 HOSTNAME 1.1.1.1 POST /SimpleAuthWebService/SimpleAuth.asmx - 80 - 2.2.2.2 HTTP/1.1 Windows-Update-Agent - - hostname 200 0 0 1467 841 31
  -->
<decoder name="web-accesslog-iis6">
  <parent>windows-date-format</parent>
  <type>web-log</type>
  <use_own_name>true</use_own_name>
  <prematch offset="after_parent">^W3SVC\d+ \S+ \S+ \S+ </prematch>
  <regex offset="after_prematch">^(\S+ \S+) \d+ \S+ (\d+.\d+.\d+.\d+) </regex>
  <regex>\S+ \S+ \S+ \S+ \S+ (\d+) </regex>
  <order>url, srcip, id</order>
</decoder>


<!-- IIS 5 W3C FTP log format.
  - Examples:
  - #Fields: date time c-ip cs-username s-sitename s-computername s-ip s-port cs-method cs-uri-stem cs-uri-query sc-status sc-win32-status sc-bytes cs-bytes time-taken cs-version cs-host cs(User-Agent) cs(Cookie) cs(Referer)
  - 2006-07-23 17:57:59 192.168.3.64 Administrator MSFTPSVC1 HAIJO2 192.168.1.12 21 [144]USER Administrator - 331 0 0 0 0 FTP - - - -
  - 2006-07-23 17:57:59 192.168.3.64 Administrator MSFTPSVC1 HAIJO2 192.168.1.12 21 [144]PASS - - 230 0 0 0 16 FTP - - - -
  -->
<decoder name="msftp">
  <parent>windows-date-format</parent>
  <use_own_name>true</use_own_name>
  <prematch offset="after_parent">^\d+.\d+.\d+.\d+ \S+ MSFTPSVC</prematch>
  <regex offset="after_parent">^(\d+.\d+.\d+.\d+) (\S+) \S+ \S+ \S+ </regex>
  <regex>\d+ [\d+](\S+) \S+ \S+ (\d+) </regex>
  <order>srcip,user,action,id</order>
</decoder>  



<!-- IIS 5 W3C SMTP log format (Exchange).
  - Examples:
  - #Fields: date time c-ip cs-username s-sitename s-computername s-ip s-port cs-method cs-uri-stem cs-uri-query sc-status sc-win32-status sc-bytes cs-bytes time-taken cs-version cs-host cs(User-Agent) cs(Cookie) cs(Referer)
  - 2006-10-09 14:04:46 69.217.186.117 - SMTPSVC1 MEE-PDC 192.168.X.X 0 xxxx -
  > +hupylaw.hupy.local 500 0 32 23 0 SMTP - - - -
  -->
<decoder name="msexchange">
  <parent>windows-date-format</parent>
  <use_own_name>true</use_own_name>
  <prematch offset="after_parent">^\d+.\d+.\d+.\d+ \S+ SMTPSVC</prematch>
  <regex offset="after_parent">^(\d+.\d+.\d+.\d+) \S+ \S+ \S+ \S+ </regex>
  <regex>\d+ (\S+) \S+ \S+ (\d+) </regex>
  <order>srcip, action, id</order>
</decoder>



<!-- Racoon VPN.
  - Extract id (error or info) and ip address whenever possible.
  - 2006-08-08 01:42:09: ERROR: couldn't find the pskey for 222.155.15.88.
  - 
  -->
<decoder name="racoon">
  <prematch>^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d: </prematch>
</decoder>

<decoder name="racoon-failed">
  <parent>racoon</parent>
  <use_own_name>true</use_own_name>
    
  <prematch offset="after_parent">^ERROR: couldn't find the pskey </prematch>
  <regex offset="after_prematch">^for (\d+.\d+.\d+.\d+)</regex>
  <order>srcip</order>
</decoder>

<decoder name="racoon-action">
  <parent>racoon</parent>
  <regex offset="after_parent">^(\w+): </regex>
  <order>action</order>
</decoder>

            

<!-- Squid access log decoder.
  - Will extract the srcip.
  - Author: Ahmet Ozturk
  - Examples:
  - 1140701044.525   1231 192.168.1.201 TCP_DENIED/400 1536
    GET ahmet - NONE/- text/html
  - 1140701230.827    781 192.168.1.210 TCP_DENIED/407 1785
    GET http://www.ossec.net oahmet NONE/- text/html
  -->
<decoder name="squid-accesslog">
  <type>squid</type>
  <prematch>^\d+ \d+.\d+.\d+.\d+ </prematch>
  <regex>^\d+ (\d+.\d+.\d+.\d+) (\w+)/(\d+) \d+ \w+ (\S+) </regex>
  <order>srcip,action,id,url</order>
</decoder>  


<!-- Windows decoder
  - Will extract extra_data (as win source),action (as win category), id,
  - username and computer name (as system_name).
  - Examples:
  - WinEvtLog: Application: INFORMATION(0x00000064): ESENT: 
    (no user)(no domain): 
  - WinEvtLog: Security: AUDIT_FAILURE(0x000002A9): Security: 
    SYSTEM: NT AUTHORITY: The logon to account: xyz    by: 
    MICROSOFT_AUTHENTICATION_PACKAGE_V1_0    from workstation: la    failed. 
    The error code was: 3221225572
  - WinEvtLog: Security: AUDIT_FAILURE(0x00000211): Security: 
    SYSTEM: NT AUTHORITY: Logon Failure:      Reason:     Unknown user 
    name or bad password       User Name:  ab      Domain:     cd      
    Logon Type: 2       Logon Process:  User32          Authentication 
    Package: Negotiate       Workstation Name:   ad
  - WinEvtLog: Security: AUDIT_SUCCESS(538): Security: lac: OSSEC-HM: OSSEC-HM: User Logoff:        User Name:      lac     Domain:         OSSEC-HM        Logon ID:               (0x0,0x7C966E)          Logon Type:     2  
  -->
<decoder name="windows">
  <type>windows</type>
  <prematch>^WinEvtLog: </prematch>
  <regex offset="after_prematch">^\.+: (\w+)\((\d+)\): (\.+): </regex>
  <regex>(\.+): \.+: (\S+): </regex>
  <order>status, id, extra_data, user, system_name</order>
  <fts>name, location, user, system_name</fts>
</decoder>    


<!-- Windows decoder -NTsyslog format
  - Will extract extra_data (as win source),action (as win category), id,
  - username and computer name (as url).
  - Examples:
  - security[failure] 577 IBM17M\Jeremy Lee  Privileged Service Called:  Server:Security  Service:-  Primary User Name:IBM17M$  Primary Domain:LEETHERNET  Primary Logon ID:(0x0,0x3E7)  Client User Name:Jeremy Lee  Client Domain:IBM17M  Client Logon ID:(0x0,0x1447F)  Privileges:SeSecurityPrivilege
  - security[success] 528 IBM17M\Jeremy Lee  Successful Logon:  User Name:Jeremy Lee  Domain:IBM17M  Logon ID:(0x0,0x3A2E471)  Logon Type:2  Logon Process:User32    Authentication Package:Negotiate  Workstation Name:IBM17M  Logon GUID: {00000000-0000-0000-0000-000000000000}
  -->
<decoder name="windows-ntsyslog">
  <type>windows</type>
  <prematch>^security[\w+] \d+ </prematch>
  <regex>^(\w+)[(\w+)] (\d+) </regex>
  <order>extra_data, status, id</order>
</decoder>


<!-- Windows decoder - Snare format. 
  - Will extract extra_data (as win source), action (as category), id,
  - username and computer name (as system_name).
  -
  - These logs must be tab-separated (as specified in the Snare format)
  -
  - Examples:
  - Aug 11 11:11:11 xx.org MSWinEventLog  1       System 59221    Thu Aug 11 01:11:11 2006        17      Windows Update Agent    Unknown User
  - Jan 16 05:52:15 hostname.xx.org MSWinEventLog 1
  Security        13049   Tue Jan 16 05:52:15 2007        680     Security
  SYSTEM  User    Success Audit   ACTUATE Account Logon
  Account Used for Logon by: MICROSOFT_AUTHENTICATION_PACKAGE_V1_0
  Account Name:     IUSR_HOSTNAME    Workstation:      ACTUATE
  12653
  - Jan 16 13:02:24 hostname.yy.org MSWinEventLog 1
  Application     14539   Tue Jan 16 13:02:24 2007        1704    SceCli
  Unknown User    N/A     Information     ACTUATE None      Security
  policy in the Group policy objects are applied successfully.    67
  - Jan 16 15:41:37 hostname.zz.org MSWinEventLog 1       System
  15059   Tue Jan 16 15:41:37 2007        10      Print   username User
  Information     HOSTNAME None            Document 76,
  /directory/directory/directory/directory/directory/date/Afilename owned
  by username was printed on hostname_duplex via port hostname_duplex.
  Size in bytes: 19543296; pages printed: 162        361
  -->
<decoder name="windows-snare">
  <type>windows</type>
  <prematch>^MSWinEventLog\t\d\t\.+\t\d+\t\w\w\S+ \w\w\w \d\d \d\d</prematch>
  <regex offset="after_prematch">^:\d\d:\d\d \d\d\d\d\t(\d+)\t(\.+)</regex>
  <regex>\t(\.+)\t\.+\t(\.+)\t(\.+)\t</regex>
  <order>id, extra_data, user, status, system_name</order>
  <fts>name, id, location, user, system_name</fts>
</decoder>


<!-- Symantec AV decoder.
  - Source: http://www.ossec.net/wiki/index.php/Symantec_Antivirus
  - Examples:
  - 24090D00000A,4,3,7,ACMELABS-SRV2,SYSTEM,,,,,,,16777216,"Update to computer ACMELABS-LU2K3 of virus definition file 81011r succeeded.",0,,0,,,,,0,,,,,,,,,,,,,(IP)-192.168.49.66,ACMELABSav,ACMELABS,,8.1.825
  - 24090D00000F,4,3,7,ACMELABS-SRV2,SYSTEM,,,,,,,16777216,"Update to computer ACMELABS-APPS-BOX4 of virus definition file 81011r succeeded.",0,,0,,,,,0,,,,,,,,,,,,,(IP)-192.168.49.66,ACMELABSav,ACMELABS,,8.1.825
  - 240801012128,5,1,720997,RBLWAP,SYSTEM,Trojan.Zlob,C:\WINDOWS\system32\ld100.tmp,5,4,4,256,570441764,"",0,,0,,0,4254,0,0,0,0,0,0,20060830.022,58100,2,4,0,acme-AVSRV,{579642AA-5A5E-46E1-8613-2289349D1F27},,(IP)-192.168.100.237,acmeav,acme,,8.1.825
  -->
<decoder name="symantec-av">
  <prematch>^\w\w\w\w\w\w\w\w\w\w\w\w,</prematch>
  <regex offset="after_prematch">^(\d+),\d+,\d+,(\S+),(\.+),</regex>
  <order>id, system_name, extra_data</order>
  <fts>name, location, id, system_name, extra_data</fts>
</decoder>


<!-- Symantec Web Security.
  - Source: http://www.ossec.net/wiki/index.php/Symantec_Websecurity
  - Examples:
  - 20070717,30517,1=3,41=SWS-3.0.1.86/vendor-config,100=Version 3.0.6,3=7,2=29
  - 20070717,73556,1=5,100=Logoff due to timeout.,11=1.2.3.4,10=usera,3=1,2=2
    20070717,73559,1=5,11=2.3.4.5,10=userb,3=2,2=1
  -->
<decoder name="symantec-websecurity">
  <prematch>^\d\d\d\d\d\d\d\d,\d\d\d+,</prematch>
  <plugin_decoder>SymantecWS_Decoder</plugin_decoder>
</decoder>



<!-- Trend Micro OSCE (Office Scan) decoder.
  - 20090716<;>948<;>TROJ_Generic.DIT<;>25<;>3<;>0<;>C:\Documents and Settings\Administrator\Desktop\HyperSnap 6.02.01_EN\HprSnap6Man.chm<;>
  - 20090716<;>950<;>WORM_DOWNAD.A<;>1<;>3<;>0<;>C:\Documents and Settings\DCS_VM-ICRC-WFBS6\Local Settings\Temporary Internet Files\Content.IE5\9JK3DN67\sitb[1].jpg<;>
  - 20090716<;>951<;>WORM_DOWNAD.A<;>1<;>3<;>0<;>C:\Documents and Settings\Default User\Local Settings\Temporary Internet Files\Content.IE5\9JK3DN67\sitb[1].jpg<;>
  - Date<;>Time<;>Virus name<;>Scan result<;>Scan type<;>Seen<;>Filename<;>
  - We are only extracting the scan result right now.
  -->
<decoder name="trend-osce">
  <prematch>^20\d\d\d\d\d\d\<;></prematch>
  <regex offset="after_prematch">^\d+\<;>\S+\<;>(\d+)\<;</regex>
  <order>id</order>
</decoder>



<!-- ossec decoder.
  - Deals with ossec internal messages.
  -->
<decoder name="ossec">
  <prematch>^ossec: </prematch>
  <type>ossec</type>
</decoder>  

<decoder name="ossec-agent">
  <parent>ossec</parent>
  <type>ossec</type>
  <prematch offset="after_parent">^Agent started:</prematch>
  <regex offset="after_prematch">^ '(\S+)'</regex>
  <order>extra_data</order>
  <fts>name, location, extra_data</fts>
</decoder>

<decoder name="ossec-alert">
  <program_name>^ossec$</program_name>
  <plugin_decoder>OSSECAlert_Decoder</plugin_decoder>
</decoder>  

<!-- decoder for active responses as logged by an OSSEC agent or server 
- Examples
Sat May  7 03:17:27 CDT 2011 /var/ossec/active-response/bin/host-deny.sh add - 172.16.0.1 1304756247.60385 31151
Sat May  7 03:17:27 CDT 2011 /var/ossec/active-response/bin/firewall-drop.sh add - 172.16.0.1 1304756247.60385 31151
Sat May  7 03:27:57 CDT 2011 /var/ossec/active-response/bin/host-deny.sh delete - 172.16.0.1 1304756247.60385 31151
Sat May  7 03:27:57 CDT 2011 /var/ossec/active-response/bin/firewall-drop.sh delete - 172.16.0.1 1304756247.60385 31151
-->

<decoder name="ar_log"> 
        <prematch>^Mon|^Tue|^Wed|^Thu|^Fri|^Sat|^Sun \S+\s+\d+ \d\d:\d\d:\d\d \S+ \d+ /\.+/active-response</prematch>
        <regex offset="after_prematch">/bin/(\S+) (\S+) - (\S+) (\d+.\d+) (\d+)</regex> 
        <order>action, status, srcip, id, extra_data</order> 
</decoder>

<!-- Zeus decoder.
  - Will extract the severity and the srcip/username when available.
  - Examples:
  - [08/Aug/2006:22:32:12 +0100] WARN:admin:Authentication failure, url=/index.cgi, host=xx.yy.com, user=admin
  - [10/Dec/2006:16:59:26 +0000] INFO:Zeus Admin Server running
  -->
<decoder name="zeus">
  <prematch>^[\d\d/\w\w\w/\d\d\d\d:\d\d:\d\d:\d\d \S+] </prematch>
  <regex offset="after_prematch"> host=(\S+), </regex>
  <order>srcip</order>
</decoder>



<!-- Vmware ESX logs.
  - Will extract the severity and username/ip when availavle.
  - Examples:
  - [2008-03-09 22:43:35.924 'ha-eventmgr' 84503472 info] Event 2053 : User root@127.0.0.1 logged in
  - [2008-02-05 02:13:18.112 'ha-eventmgr' 95833272 info] Event xyz : User m@1.2.3.4 logged in
  -  [2008-08-26 11:06:16.359 'ha-eventmgr' 20532144 info] Event 285 : Failed login attempt for root@127.0.0.1
  - Aug 25 06:01:10 hostname vmware-hostd[1863]: Accepted password for user root from 127.0.0.1
  - Aug  7 11:05:34 localhost vmware-authd[9709]: login from 172.16.129.78 as 523b717c-4542-f5fc-c006-1644eb8f4330
  - Aug 26 11:42:29 localhost vmware-hostd[1863]: Rejected password for user blablabla from 127.0.0.1
  -->
<decoder name="vmware">
  <prematch>^[\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d.\d\d\d '\S+' \d+ </prematch>
</decoder>  

<decoder name="vmware-extra">
  <parent>vmware</parent>
  <regex offset="after_parent">^(\w+)] \S+ \S+ </regex>
  <order>status</order>
</decoder>  

<decoder name="vmware-extra">
  <parent>vmware</parent>
  <regex offset="after_regex">^: User (\w+)@(\d+.\d+.\d+.\d+)</regex>
  <regex> logged |^: Failed login \w+ for (\w+)@(\d+.\d+.\d+.\d+)</regex>
  <order>user, srcip</order>
</decoder>  

<decoder name="vmware-syslog">
  <program_name>vmware</program_name>
</decoder>

<decoder name="vmware-success">
  <parent>vmware-syslog</parent>
  <prematch>^Accepted|^Rejected</prematch>
  <regex offset="after_prematch">^ \S+ for user (\S+) from (\S+)$</regex>
  <order>user, srcip</order>
</decoder>
          
<decoder name="vmware-login">
  <parent>vmware-syslog</parent>
  <prematch>^login from </prematch>
  <regex offset="after_prematch">^(\S+) as</regex>
  <order>srcip</order>
</decoder>



<!-- Solaris BSM
  - Examples:
  - Nov 21 15:12:56 unknown audit: [ID 905220 audit.notice] system booted
    text booting kernel
  - Nov 21 15:16:22 unknown audit: [ID 984917 audit.notice] login - telnet
    failed session 2740580090 by root as root:root from 1.254.168.192
  - failed session 2740580090 by root as root:root from 1.254.168.192
  - ok session 347344759 by 500959152 as root:root from 3.11.8.4 obj   
  -->
<decoder name="solaris_bsm">
  <program_name>^audit$</program_name>
</decoder>

<decoder name="solaris_bsm_session">
  <parent>solaris_bsm</parent>
  <prematch> \w+ session \d+ by </prematch>
  <regex> (\w+) session \d+ by</regex>
  <order>status</order>
</decoder>

<decoder name="solaris_bsm_session">
  <parent>solaris_bsm</parent>
  <regex offset="after_regex">^ \S+ as \S+:\S+ from (\S+)</regex>
  <order>srcip</order>
</decoder>



<!-- Asterisk logs
  - Examples:
  - Dec 16 18:02:04 asterisk1 asterisk[31774]: NOTICE[31787]:
  chan_sip.c:11242 in handle_request_register: Registration from
  '"503"<sip:503@192.168.1.107>' failed for '192.168.1.137' - Wrong
  password
  -->
<decoder name="asterisk">
  <program_name>^asterisk</program_name>
</decoder>

<decoder name="asterisk-hijacking">
  <parent>asterisk</parent>
  <prematch>^WARNING[\d+]: \S+ in \S+: Don't know </prematch>
  <regex offset="after_prematch">^\S+ how to respond via '(\w+/\d.\d/\w+)'</regex>
  <order>user</order>
</decoder>

<decoder name="asterisk-denied">
  <parent>asterisk</parent>
  <prematch>^NOTICE[\d+]: \S+ in \S+: Registration from </prematch>
  <regex offset="after_prematch">^\S+ failed for '(\d+.\d+.\d+.\d+)'</regex>
  <order>srcip</order>
</decoder>

<decoder name="asterisk-denied2">
  <parent>asterisk</parent>
  <prematch>Registration from </prematch>
  <regex offset="after_prematch">failed for '(\d+.\d+.\d+.\d+)'</regex>
  <order>srcip</order>
</decoder>

<decoder name="asterisk-iax-authentication-denied">
  <parent>asterisk</parent>
  <prematch>^NOTICE[\d+]: \S+ in \S+: Host </prematch>
  <regex offset="after_prematch">^(\d+.\d+.\d+.\d+) failed MD5 authentication for (\S+)</regex>
  <order>srcip, user</order>
</decoder>

<!-- Cisco IOS
  - Group for Cisco IOS messages.
  - We would need to support multiple formats, but currently we require
  - no service time stamp and no sequence-numbers.
  -
  - Aug 17 17:41:26 xyz.com 681: Aug 17 17:41:24.776 AEST: %SEC-6-IPACCESSLOGS: list 30 denied 124.254.75.141 1 packet
  - Aug 20 11:33:41 RouterName 696: %SYS-5-CONFIG_I: Configured from
  console by admin on vty0 (210.x.x.12)
  - 681: Aug 17 17:41:24.776 AEST: %SEC-6-IPACCESSLOGS:
  - 1348: .Jun 12 18:22:22 UTC: %SYS-5-CONFIG_I:
  - 1348: *Jun 12 18:22:22 UTC: %SYS-5-CONFIG_I:
  - 23: May  3 05:15:25.217 UTC: %SEC-6-IPACCESSLOGP:
  - Possible regex:
  "^%\w+-\d-\w+: |^\S\w\w+ \.\d \d\d:\S+ \w+: %\w+-\d-\w+:"
  -->
<decoder name="cisco-ios">
  <prematch>^%\w+-\d-\w+: </prematch>
</decoder>

<decoder name="cisco-ios">
  <program_name />
  <prematch>^%\w+-\d-\w+: </prematch>
</decoder>
  
  
<!-- Cisco IOS
  - Will extract the action, srcip, srcport, dstip and dstport
  - Samples:
  -
  - %SEC-6-IPACCESSLOGP: list 102 denied tcp 10.0.6.56(3067) -> 172.36.4.7(139), 1 packet
  - %SEC-6-IPACCESSLOGP: list 199 denied tcp 10.0.61.108(1477) -> 10.0.127.20(445), 1 packet
  -->
<decoder name="cisco-ios-acl">
  <parent>cisco-ios</parent>
  <type>firewall</type>
  <prematch>^%SEC-6-IPACCESSLOGP: </prematch>
  <regex offset="after_prematch">^list \S+ (\w+) (\w+) </regex>
  <regex>(\S+)\((\d+)\) -> (\S+)\((\d+)\),</regex>
  <order>action, protocol, srcip, srcport, dstip, dstport</order>
</decoder>


<!-- Cisco IOS IDS/IPS module 
  - Will extract the id, srcip, srcport, dstip and dstport
  - Sep  1 10:25:29 10.10.10.1 %IPS-4-SIGNATURE: Sig:3051 Subsig:1 Sev:4 TCP Connection Window Size DoS [192.168.100.11:51654 -> 10.10.10.10:4444]
  - Sep  1 10:25:29 10.10.10.1 %IPS-4-SIGNATURE: Sig:3051 Subsig:1 Sev:4 TCP Connection Window Size DoS [192.168.100.11:60797 -> 10.10.10.10:80]
  - Sep  1 10:25:29 10.10.10.1 %IPS-4-SIGNATURE: Sig:5123 Subsig:2 Sev:5 WWW IIS Internet Printing Overflow [192.168.100.11:60797 -> 10.10.10.10:80]
  -->
<decoder name="cisco-ios-ids">
  <parent>cisco-ios</parent>
  <type>ids</type>
  <prematch>^%IPS-4-SIGNATURE: </prematch>
  <regex offset="after_prematch">^Sig:(\d+) \.+[(\S+):(\d+) -> </regex>
  <regex>(\S+):(\d+)]</regex>
  <order>id, srcip, srcport, dstip, dstport</order>
  <fts>name, id, srcip, dstip</fts>
  <ftscomment>First time Cisco IOS IDS/IPS module rule fired.</ftscomment>
</decoder>


<!-- Cisco IOS
  - Extracts the ID of cisco ios messages.
  -->
<decoder name="cisco-ios-generic">
  <parent>cisco-ios</parent>
  <regex>^(%\w+-\d-\w+): </regex>
  <order>id</order>
</decoder>



<!-- Checkpoint via syslog decoder.
  - Does not currently handle all types of Checkpoint events.
  - Checkpoint NG(X)/FW-1 logs via (Linux) syslog
  - Ex. fw log -ftnp fw.log | logger -t Checkpoint
  -
  - fw log :
  -         -f select current log file
  -         -t tail file
  -         -n use ip instead of name
  -         -p use port number instead of name
  -
  -         -l add date before timestamp
  -            Use of -l changes log format slightly
  -
  -         -g without : and ; delimiters
  -            use of -g significantly changes log format
  -            this decoder is incompatible with -g
  -
  - logger :
  -         -t <tag> prepends "tag: " to log entry
  -        the tag here must match "program name" in the decoder
  -            
  - Examples:
  -
  - Checkpoint: 21Aug2007 12:00:00 accept 10.10.10.2 >eth0 rule: 100; rule_uid:
{00000000-0000-0000-0000-000000000000}; service_id: nbdatagram; src:
10.10.10.3; dst: 10.10.10.255; proto: udp; product: VPN-1 & FireWall-1;
service: 138; s_port: 138;
  -
  - Checkpoint: 13:00:00 accept 10.10.10.2 >eth0 rule: 101; rule_uid:
{00000000-0000-0000-0000-000000000000}; service_id: http; src: 10.10.10.3; dst:
10.1.2.3; proto: tcp; product: VPN-1 & FireWall-1; service: 80; s_port: 1111;
  -
  - Checkpoint: 21Aug2007 14:49:26 drop   10.10.10.1 >eth4 rule: 102; rule_uid:
{00000000-0000-0000-0000-000000000000}; ICMP: Echo Request; src: 10.10.10.2;
dst: 10.10.10.3; proto: icmp; ICMP Type: 8; ICMP Code: 0; product: VPN-1 &
FireWall-1;
  -
  - Checkpoint:  3Apr2008 15:02:15 monitor 10.10.10.3 >eth2 Attack Info: Line 
in HTTP request too long; attack: Malformed HTTP; src: 10.10.10.4; dst: 
10.10.10.5; proto: tcp; product: SmartDefense; service: 111; s_port: 222;
  -->

<!-- \s+\S+ \d\d:\d\d:\d\d (\w+) \d+.\d+.\d+.\d+ \p\S+ rule: -->
<decoder name="checkpoint-syslog">
  <program_name>^Checkpoint</program_name>
  <prematch>^\s+\S+ \d\d:\d\d:\d\d </prematch>
</decoder>

<decoder name="checkpoint-syslog-fw">
  <parent>checkpoint-syslog</parent>
  <type>firewall</type>
  <prematch offset="after_parent">^drop|^accept|^reject</prematch>
  <regex offset="after_parent">^(\w+)\s+\S+ \p\S+ rule:\.+</regex>
  <regex>src: (\d+.\d+.\d+.\d+); dst: (\d+.\d+.\d+.\d+); proto: (\S+);</regex>
  <order>action,srcip,dstip,protocol</order>
</decoder>  

<decoder name="checkpoint-syslog-fw">
  <parent>checkpoint-syslog</parent>
  <type>firewall</type>
  <regex offset="after_regex">service: (\d+); s_port: (\d+);</regex>
  <order>dstport,srcport</order>
</decoder>
            
<decoder name="checkpoint-syslog-ids">
  <parent>checkpoint-syslog</parent>
  <type>ids</type>
  <prematch offset="after_parent">^monitor|^drop</prematch>
  <regex offset="after_prematch">attack: (\.+); </regex>
  <regex>src: (\d+.\d+.\d+.\d+); dst: (\d+.\d+.\d+.\d+); </regex>
  <regex>proto: (\S+);</regex>
  <order>extra_data, srcip, dstip, protocol</order>
  <fts>name, extra_data, srcip, dstip</fts>
  <ftscomment>First time Checkpoint rule fired.</ftscomment>
</decoder>



<!-- Microsoft Windows 2003 ipv4, 2008 ipv4/ipv6 DHCP decoder for OSSEC
  -  Author: phishphreek@gmail.com
  -->
  
<!--
  -  Server 2008 DHCP IPv4 Decoder (must go first)
  -  ID,Date,Time,Description,IP Address,Host Name,MAC Address,User Name, TransactionID, QResult,Probationtime, CorrelationID.
  -  24,3/10/2009,0:00:46,Database Cleanup Begin,,,,
  -  0,3/10/2009,0:00:46,DNS Update Request,201.10.168.192,OPS03W034.,,
-->

<decoder name="ms-dhcp-ipv4">
  <prematch>^\d\d,\d+/\d+/\d\d\d\d,\d+:\d+:\d+,</prematch>
  <regex>^(\d\d),</regex>
  <order>id</order>
</decoder>

<!--
  -  Server 2008 DHCP IPv6 Decoder (must go second)
  -  ID,Date,Time,Description,IPV6 Address,Host Name,Error Code, Duid Length, Duid Bytes(Hex),User Name.
-->
<decoder name="ms-dhcp-ipv6">
  <prematch>^\d\d\d\d\d,\d\d/\d\d/\d\d,\d\d:\d\d:\d\d,</prematch>
  <regex>^(\d\d\d\d\d),</regex>
  <order>id</order>
</decoder>


<!-- OpenBSD kernel messages -->
<decoder name="bsd_kernel">
  <program_name>^/bsd</program_name>
</decoder>

<decoder name="bsd_arp">
  <parent>bsd_kernel</parent>
  <prematch offset="after_parent">^arp </prematch>
  <regex offset="after_prematch"> for (\S+) by (\S+) on \S+</regex>
  <order>dstip, extra_data</order>
</decoder>


<!-- OpenBSD mountd decoder
- Apr 11 20:01:02 ix mountd[11618]: Refused mount RPC from host 192.168.17.10 port 45659
-->

<decoder name="mountd">
  <program_name>^mountd</program_name>
</decoder>

<decoder name="mountd-host">
  <parent>mountd</parent>
  <prematch>from host </prematch>
  <regex offset="after_prematch">(\S+) port \d+$</regex>
  <order>srcip</order>
</decoder>


<!-- bro-ids decoders
  - Aug 25 08:52:10 junction bro: no=PortScanSummary na=NOTICE_ALARM_ALWAYS es=bro sa=192.168.17.8 num=988 msg=192.168.17.8\\\\ scanned\\\\ a\\\\ total\\\\ of\\\\ 988\\\\ ports tag=@ef-24ad-af
  - Aug 26 12:34:27 junction bro: no=PortScan na=NOTICE_ALARM_ALWAYS es=bro sa=192.168.17.8 p=17/tcp num=250 msg=192.168.17.8\\ has\\ scanned\\ 250\\ ports\\ of\\ 192.168.17.17 tag=@11-68e9-5
  - junction bro: Starting incremental serialization...
  - junction bro: Finished incremental serialization.
  - ix bro: no=NoticeTally na=NOTICE_ALARM_ALWAYS es=bro num=307 msg=AckAboveHole\\ (307\\ times) tag=@81-2fd-1f9
  - ix bro: no=NoticeTally na=NOTICE_ALARM_ALWAYS es=bro num=7 msg=ContentGap\\ (7\\ times) tag=@81-2fd-1fa
  - ix bro: no=ResourceSummary na=NOTICE_ALARM_ALWAYS es=bro msg=elapsed\\ time\\ \\=\\ 376.0\\ msecs\\ 174.0\\ usecs,\\ total\\ CPU\\ \\=\\ 390.0\\ msecs,\\ maximum\\ memory\\ \\=\\ 0\\ KB,\\ peak\\ connections\\ \\=\\ 0,\\ peak\\ timers\\ \\=\\ 84,\\ peak\\ fragments\\ \\=\\ 0 tag=@69-1f25-1
  - junction bro: no=PortScanSummary na=NOTICE_ALARM_ALWAYS es=bro sa=192.168.17.8 num=988 msg=192.168.17.8\\\\ scanned\\\\ a\\\\ total\\\\ of\\\\ 988\\\\ ports tag=@ef-24ad-af
  - junction bro: no=ZoneTransfer na=NOTICE_ALARM_ALWAYS es=bro sa=192.168.1.9 sp=4175/tcp da=192.168.1.17 dp=53/tcp p=53/tcp msg=transfer\\ of\\example.com\\ requested\\ by\\ 192.168.1.9 tag=@61-3a46-d
  - ix bro: no=SensitivePortmapperAccess na=NOTICE_ALARM_ALWAYS es=bro sa=192.168.17.8 sp=2957/tcp da=192.168.17.9 dp=111/tcp p=111/tcp msg=rpc:\\ 192.168.17.8/2957\\ >\\ 192.168.17.9/portmap\\ pm_dump:\\ (done) tag=@46-764d-5d
  - junction bro: no=PortScan na=NOTICE_ALARM_ALWAYS es=bro sa=192.168.17.8 p=17/tcp num=250 msg=192.168.17.8\\ has\\ scanned\\ 250\\ ports\\ of\\ 192.168.17.17 tag=@11-68e9-5
-->

<decoder name="bro-ids">
  <program_name>^bro</program_name>
</decoder>

<decoder name="bro-portscan">
  <parent>bro-ids</parent>
  <prematch>no=PortscanSummary</prematch>
  <regex>sa=(\S+) num=(\d+) msg=</regex>
  <order>srcip,extra_data</order>
</decoder>

<decoder name="bro-portscan2">
  <parent>bro-ids</parent>
  <prematch>no=PortScan </prematch>
  <regex>sa=(\S+) p=(\d+)/(\S+) num=(\d+)</regex>
  <order>srcip,srcport,protocol,extra_data</order>
</decoder>

<decoder name="bro-typical">
  <parent>bro-ids</parent>
  <prematch>na=NOTICE</prematch>
  <regex>sa=(\S+) sp=(\d+)/(\S+) da=(\S+) dp=(\d+)/\S+</regex>
  <order>srcip,srcport,protocol,dstip,dstport</order>
</decoder>



<!-- nss ldap decoders
- Jun 26 08:19:25 servername sh: nss_ldap: reconnecting to LDAP server (sleeping 32 seconds)...
- Aug 16 10:58:12 client nscd: nss_ldap: failed to bind to LDAP server ldap://ldap.example.com: Can't contact LDAP server
-->
<!--
<decoder name="nss-ldap">
  <program_name>^sh$|^nscd$</program_name>
  <prematch>^nss_ldap</prematch>
</decoder>

<decoder name="ldap-server">
  <parent>nss-ldap</parent>
  <prematch> server </prematch>
  <regex offset="after_prematch">ldap://(\S+):</regex>
  <order>system_name</order>
</decoder>
-->



<!-- OpenBSD groupdel
  - May 28 09:15:43 ix groupdel[25984]: group deleted: name=_dbus
-->
<decoder name="groupdel">
  <program_name>groupdel</program_name>
  <regex>^group deleted: name=(\S+)$</regex>
  <order>extra_data</order>
</decoder>


<!-- Portsentry -->
<decoder name="portsentry">
  <program_name>^portsentry</program_name>
</decoder>

<decoder name="portsentry-attackalert">
  <parent>portsentry</parent>
  <prematch>attackalert: Connect from host: </prematch>
  <regex offset="after_prematch">(\S+)/\S+ to (\S+) port: (\d+)$</regex>
  <order>srcip,protocol,dstport</order>
</decoder>

<decoder name="portsentry-blocked">
  <parent>portsentry</parent>
  <prematch>is already blocked. Ignoring$</prematch>
  <regex>Host: (\S+) is</regex>
  <order>srcip</order>
</decoder>


<!-- Clamav and Freshclam decoder
  -  Nov  5 22:59:19 ix freshclam[32349]: Incremental update failed, trying to download daily.cvd
-->
<decoder name="clamd">
  <program_name>^clamd</program_name>
</decoder>

<decoder name="freshclam">
  <program_name>^freshclam</program_name>
</decoder>


<!-- OpenLDAP decoder.
  - Jan 11 09:26:57 hostname slapd2.4[20872]: conn=999999 fd=64 ACCEPT from IP=10.10.248.27:33957 (IP=10.10.241.77:389)
  -->
<decoder name="openldap">
   <program_name>^slapd</program_name>
   <regex>^conn=(\d+) </regex>
   <order>id</order>
</decoder>



<!-- NTP decoder 
  - gorilla ntpd[27379]: bad sensor nmea0
  - tiny ntpd[25875]: bad peer 192.168.1.233 (192.168.1.233)
  - gorilla ntpd[29719]: bind on 192.168.1.233 failed, skipping: Can't assign requested address
  - ix ntpd[8392]: bind on 192.168.17.9 failed, skipping: Address already in use
  - ix ntpd[11685]: bad peer from pool pool.ntp.org (64.73.32.135)
  - richese ntpd[3465]: bad peer ix (192.168.17.9)
  - ix ntpd[11685]: bad peer from pool pool.ntp.org (69.50.219.51)
  - ix ntpd[7045]: recvmsg 192.168.17.17: Connection refused
  - ix ntpd[29411]: 2 out of 3 peers valid
  - bridge ntpd[5877]: logconfig: illegal argument  - ignored
  - bridge ntpd[5902]: offset 0.000000 sec freq 0.000 ppm error 0.000011 poll 6
-->
<decoder name="ntpd">
  <program_name>^ntpd</program_name>
</decoder>

<decoder name="ntpd-bad-peer">
  <parent>ntpd</parent>
  <prematch offset="after_parent">^bad peer </prematch>
  <regex>^bad peer \S+ \p(\S+)\p$|^bad peer from pool \S+ \p(\S+)\p$</regex>
  <order>srcip</order>
</decoder>


<!-- EOF -->
