mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Merge remote-tracking branch 'security/topic/awelzel/196-ftp-timeout-smaller-fix'
* security/topic/awelzel/196-ftp-timeout-smaller-fix: Update baselines ftp: Do not base seq on number of pending commands
This commit is contained in:
commit
d9534f687a
6 changed files with 10 additions and 6 deletions
|
@ -64,6 +64,9 @@ export {
|
|||
## to are tracked here.
|
||||
pending_commands: PendingCmds;
|
||||
|
||||
## Sequence number of previous command.
|
||||
command_seq: count &default=0;
|
||||
|
||||
## Indicates if the session is in active or passive mode.
|
||||
passive: bool &default=F;
|
||||
|
||||
|
|
|
@ -165,7 +165,7 @@ function set_ftp_session(c: connection)
|
|||
Conn::register_removal_hook(c, finalize_ftp);
|
||||
|
||||
# Add a shim command so the server can respond with some init response.
|
||||
add_pending_cmd(c$ftp$pending_commands, "<init>", "");
|
||||
add_pending_cmd(c$ftp$pending_commands, ++c$ftp$command_seq, "<init>", "");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -270,7 +270,7 @@ event ftp_request(c: connection, command: string, arg: string) &priority=5
|
|||
|
||||
# Queue up the new command and argument
|
||||
if ( |c$ftp$pending_commands| < max_pending_commands )
|
||||
add_pending_cmd(c$ftp$pending_commands, command, arg);
|
||||
add_pending_cmd(c$ftp$pending_commands, ++c$ftp$command_seq, command, arg);
|
||||
else
|
||||
Reporter::conn_weird("FTP_too_many_pending_commands", c,
|
||||
cat(|c$ftp$pending_commands|), "FTP");
|
||||
|
|
|
@ -78,9 +78,9 @@ export {
|
|||
};
|
||||
}
|
||||
|
||||
function add_pending_cmd(pc: PendingCmds, cmd: string, arg: string): CmdArg
|
||||
function add_pending_cmd(pc: PendingCmds, seq: count, cmd: string, arg: string): CmdArg
|
||||
{
|
||||
local ca = [$cmd = cmd, $arg = arg, $seq=|pc|+1, $ts=network_time()];
|
||||
local ca = [$cmd = cmd, $arg = arg, $seq=seq, $ts=network_time()];
|
||||
pc[ca$seq] = ca;
|
||||
|
||||
return ca;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue