mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
26 lines
863 B
Text
26 lines
863 B
Text
# This tests that the contents of a DCC transfer negotiated with IRC can be
|
|
# correctly extracted. The mime type of the file transferred is normalized
|
|
# to prevent sensitivity to libmagic version being used.
|
|
|
|
# @TEST-EXEC: bro -r $TRACES/irc-dcc-send.trace %INPUT
|
|
# @TEST-EXEC: btest-diff irc.log
|
|
# @TEST-EXEC: btest-diff irc-dcc-item_192.168.1.77:57655-209.197.168.151:1024_1.dat
|
|
# @TEST-EXEC: bro -r $TRACES/irc-dcc-send.trace %INPUT IRC::extraction_prefix="test"
|
|
# @TEST-EXEC: test -e test_192.168.1.77:57655-209.197.168.151:1024_1.dat
|
|
|
|
redef IRC::extract_file_types=/.*/;
|
|
|
|
event bro_init()
|
|
{
|
|
Log::remove_default_filter(IRC::LOG);
|
|
Log::add_filter(IRC::LOG, [$name="normalized-mime-types",
|
|
$pred=function(rec: IRC::Info): bool
|
|
{
|
|
if ( rec?$dcc_mime_type )
|
|
{
|
|
rec$dcc_mime_type = "FAKE_MIME";
|
|
}
|
|
return T;
|
|
}
|
|
]);
|
|
}
|