Skip to content

Commit

Permalink
Merge pull request #343 from GoSecure/nla-redirect-samehost-fix
Browse files Browse the repository at this point in the history
NLA-redirection fix for #342: rely on host and port
  • Loading branch information
obilodeau authored Aug 11, 2021
2 parents b40859a + 29a5341 commit 7a295f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ For a detailed view of what has changed, refer to the {uri-repo}/commits/master[
=== Enhancements

* Minor CLI improvements
* Improved type hints

=== Bug fixes

* Fixed NLA redirection problems if original target and NLA redirection target are the same ({uri-issue}342[#342], {uri-issue}343[#343])

=== Infrastructure

Expand Down
6 changes: 3 additions & 3 deletions pyrdp/mitm/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Licensed under the GPLv3 or later.
#

from typing import Dict, Optional
from typing import Dict, List, Optional

from Crypto.PublicKey import RSA

Expand Down Expand Up @@ -34,7 +34,7 @@ def __init__(self, config: MITMConfig, sessionID: str):
self.securitySettings = SecuritySettings()
"""The security settings for the connection"""

self.channelDefinitions: [ClientChannelDefinition] = []
self.channelDefinitions: List[ClientChannelDefinition] = []
"""The channel definitions from the client"""

self.channelMap: Dict[int, str] = {}
Expand Down Expand Up @@ -118,7 +118,7 @@ def canRedirect(self) -> bool:
return None not in [self.config.redirectionHost, self.config.redirectionPort] and not self.isRedirected()

def isRedirected(self) -> bool:
return self.effectiveTargetHost == self.config.redirectionHost
return self.effectiveTargetHost == self.config.redirectionHost and self.effectiveTargetPort == self.config.redirectionPort

def useRedirectionHost(self):
self.effectiveTargetHost = self.config.redirectionHost
Expand Down

0 comments on commit 7a295f3

Please sign in to comment.