|
|
|
@ -31,16 +31,20 @@ pub enum SMBEvent {
|
|
|
|
RequestToClient = 8,
|
|
|
|
RequestToClient = 8,
|
|
|
|
ResponseToServer = 9,
|
|
|
|
ResponseToServer = 9,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// Negotiated max sizes exceed our limit
|
|
|
|
|
|
|
|
NegotiateMaxReadSizeTooLarge = 10,
|
|
|
|
|
|
|
|
NegotiateMaxWriteSizeTooLarge = 11,
|
|
|
|
|
|
|
|
|
|
|
|
/// READ request asking for more than `max_read_size`
|
|
|
|
/// READ request asking for more than `max_read_size`
|
|
|
|
ReadRequestTooLarge = 10,
|
|
|
|
ReadRequestTooLarge = 12,
|
|
|
|
/// READ response bigger than `max_read_size`
|
|
|
|
/// READ response bigger than `max_read_size`
|
|
|
|
ReadResponseTooLarge = 11,
|
|
|
|
ReadResponseTooLarge = 13,
|
|
|
|
ReadResponseQueueSizeExceeded = 12,
|
|
|
|
ReadResponseQueueSizeExceeded = 14,
|
|
|
|
ReadResponseQueueCntExceeded = 13,
|
|
|
|
ReadResponseQueueCntExceeded = 15,
|
|
|
|
/// WRITE request for more than `max_write_size`
|
|
|
|
/// WRITE request for more than `max_write_size`
|
|
|
|
WriteRequestTooLarge = 14,
|
|
|
|
WriteRequestTooLarge = 16,
|
|
|
|
WriteQueueSizeExceeded = 15,
|
|
|
|
WriteQueueSizeExceeded = 17,
|
|
|
|
WriteQueueCntExceeded = 16,
|
|
|
|
WriteQueueCntExceeded = 18,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
impl SMBEvent {
|
|
|
|
impl SMBEvent {
|
|
|
|
@ -56,13 +60,15 @@ impl SMBEvent {
|
|
|
|
7 => Some(SMBEvent::FileOverlap),
|
|
|
|
7 => Some(SMBEvent::FileOverlap),
|
|
|
|
8 => Some(SMBEvent::RequestToClient),
|
|
|
|
8 => Some(SMBEvent::RequestToClient),
|
|
|
|
9 => Some(SMBEvent::ResponseToServer),
|
|
|
|
9 => Some(SMBEvent::ResponseToServer),
|
|
|
|
10 => Some(SMBEvent::ReadRequestTooLarge),
|
|
|
|
10 => Some(SMBEvent::NegotiateMaxReadSizeTooLarge),
|
|
|
|
11 => Some(SMBEvent::ReadResponseTooLarge),
|
|
|
|
11 => Some(SMBEvent::NegotiateMaxWriteSizeTooLarge),
|
|
|
|
12 => Some(SMBEvent::ReadResponseQueueSizeExceeded),
|
|
|
|
12 => Some(SMBEvent::ReadRequestTooLarge),
|
|
|
|
13 => Some(SMBEvent::ReadResponseQueueCntExceeded),
|
|
|
|
13 => Some(SMBEvent::ReadResponseTooLarge),
|
|
|
|
14 => Some(SMBEvent::WriteRequestTooLarge),
|
|
|
|
14 => Some(SMBEvent::ReadResponseQueueSizeExceeded),
|
|
|
|
15 => Some(SMBEvent::WriteQueueSizeExceeded),
|
|
|
|
15 => Some(SMBEvent::ReadResponseQueueCntExceeded),
|
|
|
|
16 => Some(SMBEvent::WriteQueueCntExceeded),
|
|
|
|
16 => Some(SMBEvent::WriteRequestTooLarge),
|
|
|
|
|
|
|
|
17 => Some(SMBEvent::WriteQueueSizeExceeded),
|
|
|
|
|
|
|
|
18 => Some(SMBEvent::WriteQueueCntExceeded),
|
|
|
|
_ => None,
|
|
|
|
_ => None,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -71,24 +77,26 @@ impl SMBEvent {
|
|
|
|
pub fn smb_str_to_event(instr: &str) -> i32 {
|
|
|
|
pub fn smb_str_to_event(instr: &str) -> i32 {
|
|
|
|
SCLogDebug!("checking {}", instr);
|
|
|
|
SCLogDebug!("checking {}", instr);
|
|
|
|
match instr {
|
|
|
|
match instr {
|
|
|
|
"internal_error" => SMBEvent::InternalError as i32,
|
|
|
|
"internal_error" => SMBEvent::InternalError as i32,
|
|
|
|
"malformed_data" => SMBEvent::MalformedData as i32,
|
|
|
|
"malformed_data" => SMBEvent::MalformedData as i32,
|
|
|
|
"record_overflow" => SMBEvent::RecordOverflow as i32,
|
|
|
|
"record_overflow" => SMBEvent::RecordOverflow as i32,
|
|
|
|
"malformed_ntlmssp_request" => SMBEvent::MalformedNtlmsspRequest as i32,
|
|
|
|
"malformed_ntlmssp_request" => SMBEvent::MalformedNtlmsspRequest as i32,
|
|
|
|
"malformed_ntlmssp_response" => SMBEvent::MalformedNtlmsspResponse as i32,
|
|
|
|
"malformed_ntlmssp_response" => SMBEvent::MalformedNtlmsspResponse as i32,
|
|
|
|
"duplicate_negotiate" => SMBEvent::DuplicateNegotiate as i32,
|
|
|
|
"duplicate_negotiate" => SMBEvent::DuplicateNegotiate as i32,
|
|
|
|
"negotiate_malformed_dialects" => SMBEvent::NegotiateMalformedDialects as i32,
|
|
|
|
"negotiate_malformed_dialects" => SMBEvent::NegotiateMalformedDialects as i32,
|
|
|
|
"file_overlap" => SMBEvent::FileOverlap as i32,
|
|
|
|
"file_overlap" => SMBEvent::FileOverlap as i32,
|
|
|
|
"request_to_client" => SMBEvent::RequestToClient as i32,
|
|
|
|
"request_to_client" => SMBEvent::RequestToClient as i32,
|
|
|
|
"response_to_server" => SMBEvent::ResponseToServer as i32,
|
|
|
|
"response_to_server" => SMBEvent::ResponseToServer as i32,
|
|
|
|
"read_request_too_large" => SMBEvent::ReadRequestTooLarge as i32,
|
|
|
|
"negotiate_max_read_size_too_large" => SMBEvent::NegotiateMaxReadSizeTooLarge as i32,
|
|
|
|
"read_response_too_large" => SMBEvent::ReadResponseTooLarge as i32,
|
|
|
|
"negotiate_max_write_size_too_large" => SMBEvent::NegotiateMaxWriteSizeTooLarge as i32,
|
|
|
|
"read_response_queue_size_exceeded" => SMBEvent::ReadResponseQueueSizeExceeded as i32,
|
|
|
|
"read_request_too_large" => SMBEvent::ReadRequestTooLarge as i32,
|
|
|
|
"read_response_queue_cnt_exceeded" => SMBEvent::ReadResponseQueueCntExceeded as i32,
|
|
|
|
"read_response_too_large" => SMBEvent::ReadResponseTooLarge as i32,
|
|
|
|
"write_request_too_large" => SMBEvent::WriteRequestTooLarge as i32,
|
|
|
|
"read_response_queue_size_exceeded" => SMBEvent::ReadResponseQueueSizeExceeded as i32,
|
|
|
|
"write_queue_size_exceeded" => SMBEvent::WriteQueueSizeExceeded as i32,
|
|
|
|
"read_response_queue_cnt_exceeded" => SMBEvent::ReadResponseQueueCntExceeded as i32,
|
|
|
|
"write_queue_cnt_exceeded" => SMBEvent::WriteQueueCntExceeded as i32,
|
|
|
|
"write_request_too_large" => SMBEvent::WriteRequestTooLarge as i32,
|
|
|
|
_ => -1,
|
|
|
|
"write_queue_size_exceeded" => SMBEvent::WriteQueueSizeExceeded as i32,
|
|
|
|
|
|
|
|
"write_queue_cnt_exceeded" => SMBEvent::WriteQueueCntExceeded as i32,
|
|
|
|
|
|
|
|
_ => -1,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|