- 
                Notifications
    You must be signed in to change notification settings 
- Fork 264
WIP: Fake RDP server when NLA is enforced #426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
9f54176    to
    ecd5d15      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very interesting and in a direction I had never thought of. Great work! I would love to see it in action if you can provide a recorded session.
Missing:
- Impact on dependencies outside of python (X11, TK, Fonts, freerdp-shadow-cli, xfreerdp)
- Documentation
- Handle TODOs and FIXMEs
| if self.state.isRedirected(): | ||
| self.log.info( | ||
| "Fetching certificate of the original host %(host)s:%(port)d because of NLA redirection", | ||
| { | ||
| "host": self.state.config.targetHost, | ||
| "port": self.state.config.targetPort, | ||
| }, | ||
| ) | ||
| pem = ssl.get_server_certificate( | ||
| (self.state.config.targetHost, self.state.config.targetPort) | ||
| ) | ||
| cert = crypto.load_certificate(crypto.FILETYPE_PEM, pem) | ||
| else: | ||
| cert = self.server.tcp.transport.getPeerCertificate() | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are issues with this code that are being looked at in #424
        
          
                pyrdp/mitm/FakeServer.py
              
                Outdated
          
        
      | self.entry_password = Entry( | ||
| self.root, | ||
| show="•", | ||
| font=("Segoe UI", 20), | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this add special dependencies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! I'm not sure honestly, it's certainly not on my Kali VM and I never exactly looked at it. Also I'm not a fonts expert 😄.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm switching to DejaVu Sans but that's not available on Windows I think. I also didn't find a way to only specify a font family (e. g. Sans Serif)..
| 
 Here's a quick demo: | 
| Thanks for your feedback! 
 Yes, of course. Using  The CI is currently failing because I added the  | 
      
        
              This comment was marked as outdated.
        
        
      
    
  This comment was marked as outdated.
dc7af31    to
    0116006      
    Compare
  
    a248c27    to
    cad6d09      
    Compare
  
    otherwise checks whether fake server was configured or not fail
This reduces the error message an mstsc client sees from two to one. before: - The server name on the certificate is incorrect - The certificate is not from a trusted certifying authority after: - The certificate is not from a trusted certifying authority

As part of a project at school, I extended the existing redirection functionality with a locally hosted RDP server. It works as follows:
So far it's work in progress and has a lot of rough edges, but feedback would be very much appreciated.
Here's a quick demo: