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

devel doc update #420

Merged
merged 4 commits into from
Nov 15, 2022
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
2 changes: 1 addition & 1 deletion CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ For a detailed view of what has changed, refer to the {uri-repo}/commits/master[
* Minor CLI improvements
* Improved type hints
* Updated instructions to extract the RDP certificate and private key ({uri-issue}345[#345])
* Documentation updates ({uri-issue}335[#335], {uri-issue}339[#339], {uri-issue}340[#340], {uri-issue}360[#360], {uri-issue}371[#371], {uri-issue}381[#381], {uri-issue}383[#383], {uri-issue}384[#384], {uri-issue}408[#408])
* Documentation updates ({uri-issue}335[#335], {uri-issue}339[#339], {uri-issue}340[#340], {uri-issue}360[#360], {uri-issue}371[#371], {uri-issue}381[#381], {uri-issue}383[#383], {uri-issue}384[#384], {uri-issue}408[#408], {uri-issue}420[#420])
* Replaced unmaintained dependency notify2 with py-notifier ({uri-issue}363[#363], {uri-issue}365[#365])
* Some Python 3.10 compatibility work ({uri-issue}366[#366], {uri-issue}380[#380])
* Enable play/pause replay on the Player by pressing the Space key ({uri-issue}403[#403]).
Expand Down
12 changes: 6 additions & 6 deletions bin/pyrdp-mitm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

#
# This file is part of the PyRDP project.
# Copyright (C) 2018-2021 GoSecure Inc.
# Copyright (C) 2018-2022 GoSecure Inc.
# Licensed under the GPLv3 or later.
#
# Need to install this reactor before importing any other code
import asyncio
from twisted.internet import asyncioreactor
asyncioreactor.install(asyncio.new_event_loop())

import logging
import os
import socket

# Need to install this reactor before importing other twisted code
from twisted.internet import asyncioreactor

asyncioreactor.install(asyncio.get_event_loop())
from twisted.internet import reactor

from pyrdp.core.mitm import MITMServerFactory
from pyrdp.mitm.cli import showConfiguration, configure
from pyrdp.logging import LOGGER_NAMES
import socket


def main():
Expand Down
8 changes: 7 additions & 1 deletion docs/debugging-recipes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,10 @@ Moving `~/.wireshark/` was enough.

Extracting a single VirtualChannel (id 1004 for DeviceRedirection) raw bytes:

-d tls.port==13389,tpkt -T fields -e rdp.virtualChannelData -2 "t124.channelId == 1004"
-d tls.port==13389,tpkt -T fields -e rdp.virtualChannelData -2 "t124.channelId == 1004"


== AsyncIO Debugging

asyncio code is harder to debug.
When you think the bug is related to asyncio, like strange hangs, you can see some strategies here: https://docs.python.org/3/library/asyncio-dev.html
5 changes: 1 addition & 4 deletions pyrdp/mitm/DeviceRedirectionMITM.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ def onDirectoryListingComplete(self, deviceID: int, requestID: int):
class DeviceRedirectionMITM(Subject):
"""
MITM component for the device redirection channel.
It saves files transferred over RDP to a local directory. The files aren't named after their remote name to avoid
conflicts. Rather, they are given a random name, and the mapping to their remote path is given by the mapping.json
file. Each unique file (identified by its hash) is saved only once. Duplicates are removed to avoid filling the drive
with identical files.
It saves files transferred over RDP to a local directory.
"""

FORGED_COMPLETION_ID = 1000000
Expand Down