mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 03:28:19 +00:00
Pushing out the new NTLM and GSSAPI analyzers.
I accidentally left these out of the previous commit.
This commit is contained in:
parent
5b5589e167
commit
d6e01b7769
18 changed files with 894 additions and 0 deletions
49
src/analyzer/protocol/gssapi/gssapi-analyzer.pac
Normal file
49
src/analyzer/protocol/gssapi/gssapi-analyzer.pac
Normal file
|
@ -0,0 +1,49 @@
|
|||
refine connection GSSAPI_Conn += {
|
||||
%member{
|
||||
analyzer::Analyzer *ntlm;
|
||||
%}
|
||||
|
||||
%init{
|
||||
ntlm = analyzer_mgr->InstantiateAnalyzer("NTLM", bro_analyzer->Conn());
|
||||
%}
|
||||
|
||||
%cleanup{
|
||||
if ( ntlm )
|
||||
delete ntlm;
|
||||
%}
|
||||
|
||||
function forward_ntlm(data: bytestring, is_orig: bool): bool
|
||||
%{
|
||||
if ( ntlm )
|
||||
ntlm->DeliverStream(${data}.length(), ${data}.begin(), is_orig);
|
||||
return true;
|
||||
%}
|
||||
|
||||
function proc_gssapi_neg_token(val: GSSAPI_NEG_TOKEN): bool
|
||||
%{
|
||||
if ( ${val.is_init} )
|
||||
return true;
|
||||
|
||||
for ( uint i = 0; i < ${val.resp.args}->size(); ++i )
|
||||
{
|
||||
switch ( ${val.resp.args[i].seq_meta.index} )
|
||||
{
|
||||
case 0:
|
||||
if ( ${val.resp.args[i].args.neg_state} == 0 )
|
||||
{
|
||||
BifEvent::generate_gssapi_accepted(bro_analyzer(),
|
||||
bro_analyzer()->Conn());
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
%}
|
||||
}
|
||||
|
||||
refine typeattr GSSAPI_NEG_TOKEN += &let {
|
||||
proc : bool = $context.connection.proc_gssapi_neg_token(this);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue