mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 09:38:19 +00:00
FileAnalysis: separating IRC/FTP data analyzers.
It simplifies the file handle string callbacks.
This commit is contained in:
parent
59ed5c75f1
commit
661677d452
37 changed files with 156 additions and 95 deletions
|
@ -2,10 +2,11 @@
|
|||
@load base/utils/conn-ids
|
||||
@load base/frameworks/file-analysis/main
|
||||
|
||||
redef FileAnalysis::service_handle_callbacks += {
|
||||
["ftp-data"] = function(c: connection, is_orig: bool): string
|
||||
redef FileAnalysis::handle_callbacks += {
|
||||
[ANALYZER_FTP_DATA] = function(c: connection, is_orig: bool): string
|
||||
{
|
||||
if ( is_orig ) return "";
|
||||
return fmt("%s ftp-data: %s", c$start_time, id_string(c$id));
|
||||
return fmt("%s %s %s", ANALYZER_FTP_DATA, c$start_time,
|
||||
id_string(c$id));
|
||||
},
|
||||
};
|
||||
|
|
|
@ -228,7 +228,8 @@ event ftp_request(c: connection, command: string, arg: string) &priority=5
|
|||
{
|
||||
c$ftp$passive=F;
|
||||
ftp_data_expected[data$h, data$p] = c$ftp;
|
||||
expect_connection(id$resp_h, data$h, data$p, ANALYZER_FILE, 5mins);
|
||||
expect_connection(id$resp_h, data$h, data$p, ANALYZER_FTP_DATA,
|
||||
5mins);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -281,7 +282,8 @@ event ftp_reply(c: connection, code: count, msg: string, cont_resp: bool) &prior
|
|||
data$h = id$resp_h;
|
||||
|
||||
ftp_data_expected[data$h, data$p] = c$ftp;
|
||||
expect_connection(id$orig_h, data$h, data$p, ANALYZER_FILE, 5mins);
|
||||
expect_connection(id$orig_h, data$h, data$p, ANALYZER_FTP_DATA,
|
||||
5mins);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue