44# Licensed under the GPLv3 or later.
55#
66
7- from typing import Callable , Dict , List , Optional
7+ from typing import Dict , List , Optional
88
99from Crypto .PublicKey import RSA
1010
1111from pyrdp .enum import NegotiationProtocols , ParserMode
1212from pyrdp .layer import FastPathLayer , SecurityLayer , TLSSecurityLayer
13- from pyrdp .logging import SessionLogger
1413from pyrdp .parser import createFastPathParser
1514from pyrdp .pdu import ClientChannelDefinition
1615from pyrdp .security import RC4CrypterProxy , SecuritySettings
@@ -22,7 +21,7 @@ class RDPMITMState:
2221 State object for the RDP MITM. This is for data that needs to be shared across components.
2322 """
2423
25- def __init__ (self , config : MITMConfig , sessionID : str , getLog : Callable [[ str ], SessionLogger ] ):
24+ def __init__ (self , config : MITMConfig , sessionID : str ):
2625 self .requestedProtocols : Optional [NegotiationProtocols ] = None
2726 """The original request protocols"""
2827
@@ -94,9 +93,6 @@ def __init__(self, config: MITMConfig, sessionID: str, getLog: Callable[[str], S
9493 self .fakeServer = None
9594 """The current fake server"""
9695
97- self .getLog = getLog
98- """Function to create additional loggers"""
99-
10096 self .securitySettings .addObserver (self .crypters [ParserMode .CLIENT ])
10197 self .securitySettings .addObserver (self .crypters [ParserMode .SERVER ])
10298
@@ -139,9 +135,12 @@ def useRedirectionHost(self):
139135
140136 def useFakeServer (self ):
141137 from pyrdp .mitm .FakeServer import FakeServer
138+
142139 self .fakeServer = FakeServer (
143- self .config .targetHost , self .config .targetPort , self .getLog ("" )
140+ self .config .targetHost ,
141+ targetPort = self .config .targetPort ,
142+ sessionID = self .sessionID ,
144143 )
145144 self .effectiveTargetHost = "127.0.0.1"
146145 self .effectiveTargetPort = self .fakeServer .port
147- self .fakeServer .start ()
146+ self .fakeServer .start ()
0 commit comments