RDP: Instantiate SSL analyzer instead of PIA

This commit is contained in:
Tim Wojtulewicz 2023-03-24 11:05:33 -07:00
parent a9d3245e80
commit 943b8b0b42
2 changed files with 6 additions and 9 deletions

View file

@ -13,7 +13,7 @@ RDP_Analyzer::RDP_Analyzer(Connection* c) : analyzer::tcp::TCP_ApplicationAnalyz
interp = new binpac::RDP::RDP_Conn(this); interp = new binpac::RDP::RDP_Conn(this);
had_gap = false; had_gap = false;
pia = nullptr; ssl = nullptr;
} }
RDP_Analyzer::~RDP_Analyzer() RDP_Analyzer::~RDP_Analyzer()
@ -54,19 +54,15 @@ void RDP_Analyzer::DeliverStream(int len, const u_char* data, bool orig)
// 0x03-0x04 is CredSSP which is effectively SSL/TLS // 0x03-0x04 is CredSSP which is effectively SSL/TLS
if ( interp->encryption_method() > 0x00 ) if ( interp->encryption_method() > 0x00 )
{ {
if ( ! pia ) if ( ! ssl )
{ {
pia = new analyzer::pia::PIA_TCP(Conn()); ssl = new analyzer::ssl::SSL_Analyzer(Conn());
if ( ! AddChildAnalyzer(ssl) )
if ( ! AddChildAnalyzer(pia) )
{ {
reporter->AnalyzerError(this, "failed to add TCP child analyzer " reporter->AnalyzerError(this, "failed to add TCP child analyzer "
"to RDP analyzer: already exists"); "to RDP analyzer: already exists");
return; return;
} }
pia->FirstPacket(true, nullptr);
pia->FirstPacket(false, nullptr);
} }
ForwardStream(len, data, orig); ForwardStream(len, data, orig);

View file

@ -3,6 +3,7 @@
#include "zeek/analyzer/protocol/pia/PIA.h" #include "zeek/analyzer/protocol/pia/PIA.h"
#include "zeek/analyzer/protocol/rdp/events.bif.h" #include "zeek/analyzer/protocol/rdp/events.bif.h"
#include "zeek/analyzer/protocol/rdp/rdp_pac.h" #include "zeek/analyzer/protocol/rdp/rdp_pac.h"
#include "zeek/analyzer/protocol/ssl/SSL.h"
#include "zeek/analyzer/protocol/tcp/TCP.h" #include "zeek/analyzer/protocol/tcp/TCP.h"
namespace zeek::analyzer::rdp namespace zeek::analyzer::rdp
@ -30,7 +31,7 @@ protected:
binpac::RDP::RDP_Conn* interp; binpac::RDP::RDP_Conn* interp;
bool had_gap; bool had_gap;
analyzer::pia::PIA_TCP* pia; analyzer::ssl::SSL_Analyzer* ssl;
}; };
} // namespace zeek::analyzer::rdp } // namespace zeek::analyzer::rdp