Fix binpac exception in RFB analyzer.

The RFB analyzer's state machine did not foresee that a server could
send two subsequent messages in one packet. This would result in the
error. Patch by Martin van Hensbergen.
This commit is contained in:
Robin Sommer 2016-06-06 18:06:23 -07:00
parent 17dc28b8a8
commit 83639e9147
2 changed files with 7 additions and 2 deletions

View file

@ -151,6 +151,10 @@ refine connection RFB_Conn += {
if ( msg->sectype() == 2 )
{ // VNC
if ( ${msg.possible_challenge}.length() == 16 )
// Challenge was already sent with this message
state = AWAITING_CLIENT_RESPONSE;
else
state = AWAITING_SERVER_CHALLENGE;
}
return true;

View file

@ -28,6 +28,7 @@ type RFBProtocolVersion (client: bool) = record {
type RFBSecurityTypes = record {
sectype: uint32;
possible_challenge: bytestring &restofdata;
} &let {
proc: bool = $context.connection.handle_security_types(this);
proc2: bool = $context.flow.proc_security_types(this);