Skip to content

Commit

Permalink
Merge pull request #310 from GoSecure/log-add-src-port
Browse files Browse the repository at this point in the history
Added source port to new connection log message
  • Loading branch information
xshill committed Mar 31, 2021
2 parents afa4a0c + 2e3eafc commit 8eb764d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ For a detailed view of what has changed, refer to the {uri-repo}/commits/master[
* Removed `mapping.json` file since all the information it would contain can be obtained by checking the `pyrdp_output/filesystems` folder
* Added tests for the DeviceRedirectionMITM and FileMapping classes
* Log fields changes: `hash` is now `shasum` ({uri-issue}302[#302])
* Added `clientPort` field to the message when a new client is connected ({uri-issue}310[#310])

=== Bug fixes

Expand Down
4 changes: 3 additions & 1 deletion pyrdp/mitm/TCPMITM.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ def onClientConnection(self):
self.connectionTime = time.time()

ip = self.client.transport.client[0]
self.log.info("New client connected from %(clientIp)s", {"clientIp": ip})
port = self.client.transport.client[1]
self.log.info("New client connected from %(clientIp)s:%(clientPort)i",
{"clientIp": ip, "clientPort": port})

def onClientDisconnection(self, reason):
"""
Expand Down

0 comments on commit 8eb764d

Please sign in to comment.