mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 23:28:20 +00:00

Notable differences: - Removed SMTP::MD5 notice. - Removed ability to specify mime entity excerpt length per mime-type.
34 lines
891 B
Text
34 lines
891 B
Text
@load base/frameworks/intel
|
|
@load base/protocols/smtp/file-analysis
|
|
@load base/utils/urls
|
|
@load ./where-locations
|
|
|
|
event intel_mime_data(info: FileAnalysis::Info, data: string)
|
|
{
|
|
if ( ! info?$conns ) return;
|
|
|
|
for ( cid in info$conns )
|
|
{
|
|
local c: connection = info$conns[cid];
|
|
local urls = find_all_urls_without_scheme(data);
|
|
for ( url in urls )
|
|
{
|
|
Intel::seen([$str=url,
|
|
$str_type=Intel::URL,
|
|
$conn=c,
|
|
$where=SMTP::IN_MESSAGE]);
|
|
}
|
|
}
|
|
}
|
|
|
|
hook FileAnalysis::policy(trig: FileAnalysis::Trigger, info: FileAnalysis::Info)
|
|
&priority=5
|
|
{
|
|
if ( trig != FileAnalysis::TRIGGER_NEW ) return;
|
|
if ( ! info?$source ) return;
|
|
if ( info$source != "SMTP" ) return;
|
|
|
|
FileAnalysis::add_action(info$file_id,
|
|
[$act=FileAnalysis::ACTION_DATA_EVENT,
|
|
$stream_event=intel_mime_data]);
|
|
}
|