Skip to content
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

Added source port to new connection log message #310

Merged
merged 2 commits into from
Mar 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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