Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for the log format in proftpd 1.3.5, and add a test. #599

Merged
merged 2 commits into from
Jun 25, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions contrib/ossec-testing/tests/proftpd.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@ log 1 pass = Jan 04 22:51:57 valhalla proftpd[15181]: valhalla (crawl-66-249-66-
rule = 11206
alert = 5
decoder = proftpd

[Login failed accessing the FTP server]
log 1 pass = 2015-04-16 21:51:02,805 zuse proftpd[26189] zuse.domain.com (182.100.67.115[182.100.67.115]): USER root (Login failed): Incorrect password
rule = 11204
alert = 5
decoder = proftpd

12 changes: 12 additions & 0 deletions src/analysisd/cleanevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ int OS_CleanMSG(char *msg, Eventinfo *lf)
* ( ex: Dec 29 10:00:01
* or 2007-06-14T15:48:55-04:00 for syslog-ng isodate
* or 2009-05-22T09:36:46.214994-07:00 for rsyslog )
* or 2015-04-16 21:51:02,805 (proftpd 1.3.5)
*/
if (
(
Expand All @@ -89,6 +90,17 @@ int OS_CleanMSG(char *msg, Eventinfo *lf)
(pieces[15] == ' ') && (lf->log += 16)
)
||
(
(loglen > 24) &&
(pieces[4] == '-') &&
(pieces[7] == '-') &&
(pieces[10] == ' ') &&
(pieces[13] == ':') &&
(pieces[16] == ':') &&
(pieces[19] == ',') &&
(lf->log += 23)
)
||
(
(loglen > 33) &&
(pieces[4] == '-') &&
Expand Down