mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
Created the webmail identification script.
This commit is contained in:
parent
789908d182
commit
5aa85cc47a
3 changed files with 35 additions and 4 deletions
|
@ -41,9 +41,6 @@ export {
|
|||
last_reply: string &log &optional;
|
||||
files: set[string] &log &optional;
|
||||
path: vector of addr &log &optional;
|
||||
## Boolean indicator of if the message was sent through a webmail
|
||||
## interface. This is not being set yet.
|
||||
is_webmail: bool &log &default=F;
|
||||
user_agent: string &log &optional;
|
||||
|
||||
## Indicate if this session is currently transmitting SMTP message
|
||||
|
|
35
policy/smtp/webmail-ident.bro
Normal file
35
policy/smtp/webmail-ident.bro
Normal file
|
@ -0,0 +1,35 @@
|
|||
##! Identify webmail interfaces. This identification will be solely done
|
||||
##! with the USER-AGENT (or other) header unless not possible and will resort
|
||||
##! to heuristics if necessary.
|
||||
##!
|
||||
##! TODO::
|
||||
##! * Find some heuristic to determine if email was sent through
|
||||
##! a MS Exhange webmail interface as opposed to a desktop client.
|
||||
##!
|
||||
|
||||
module SMTP;
|
||||
|
||||
redef record Info += {
|
||||
## Boolean indicator of if the message was sent through a webmail
|
||||
## interface.
|
||||
is_webmail: bool &log &default=F;
|
||||
};
|
||||
|
||||
export {
|
||||
## A regular expression to match USER-AGENT-like headers to find if a
|
||||
## message was sent with a webmail interface.
|
||||
const webmail_user_agents =
|
||||
/^iPlanet Messenger/
|
||||
| /^Sun Java\(tm\) System Messenger Express/
|
||||
| /\(IMP\)/ # Horde Internet Messaging Program
|
||||
| /^SquirrelMail/
|
||||
| /^NeoMail/ &redef;
|
||||
}
|
||||
|
||||
|
||||
event smtp_data(c: connection, is_orig: bool, data: string) &priority=4
|
||||
{
|
||||
if ( c$smtp$current_header == "USER-AGENT" &&
|
||||
webmail_user_agents in c$smtp$user_agent )
|
||||
c$smtp$is_webmail = T;
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
##! Identify webmail interfaces.
|
Loading…
Add table
Add a link
Reference in a new issue