UniversalDVC

repository·master·Indexed 42 days ago

https://github.com/earthquake/universaldvc

A tool that leverages Remote Desktop Services' Dynamic Virtual Channels to create communication tunnels (sockets or named pipes) over existing RDP connections. It allows for data transfer and port forwarding in segregated networks by bypassing firewalls. Features include a client-side DLL plugin and a server-side executable with support for socket server, socket client, and named pipe modes.

Tokens
1.5K
Snippets
2
Records
9
Agent score
4%

What's inside UniversalDVC

  1. How UDVC works: Client-Server Architecture

    master

    UDVC leverages Remote Desktop Services' Dynamic Virtual Channels to communicate over an existing RDP connection. This allows data transfer without opening new sockets, ports, or firewall rules on the network.

    • Client Side: A .dll plugin is registered on the client machine. It loads during the RDP connection process.
    • Server Side: An .exe runs on the RDP server.
    • Communication: Once the plugin and server executable connect, they create a communication channel (Socket or Named Pipe). Data sent to the local port/pipe on one end is transmitted through the RDP tunnel to the other end.
  2. Supported UDVC Modes

    master

    UDVC supports three operational modes for both the client and the server:

    1. Socket server mode (0 - default): Sets up a listener on a defined IP address and port.
    2. Socket client mode (1): Initiates a connection towards a listener on a defined IP address and port.
    3. Named Pipe mode (2): Sets up a Named Pipe with a specified name. This is useful for Inter-Process Communication (IPC) over RDP but is slower than socket modes due to disk I/O. For high bandwidth, use socket modes.
  3. Install the UDVC Plugin on the Client

    master

    The UDVC plugin (*.dll) must be installed on the client computer used to connect to the RDP server.

    1. Architecture Match: Ensure you use the correct architecture. If the client is 32-bit and the server is 64-bit, use the 32-bit .dll.
    2. Placement: Place the .dll in any directory (e.g., %SYSROOT%\system32\ or %SYSROOT%\SysWoW64\ for long-term use).
    3. Registration (Administrator): Run the following command as an Administrator: regsvr32.exe UDVC-Plugin.dll
    4. Non-Administrator Setup: If you do not have administrator rights, you must import the registry settings for your user using the provided UDVC-Plugin.reg file.
    5. Uninstallation: To remove the plugin, run: regsvr32.exe /u UDVC-Plugin.dll

    Note: Once installed, the plugin loads automatically every time you initiate an RDP connection and configures itself based on registry settings.

    regsvr32.exe UDVC-Plugin.dll
  4. Run the UDVC Server on the RDP Server

    master
    The UDVC server (*.exe) must be placed on the RDP server and run as any user. It establishes the channel between the client-side plugin and the server-side executable. The server binary reads its configuration from command-line arguments.
  5. Configure the UDVC Client via Registry

    master

    The client .dll reads its configuration from the Windows Registry. The settings are located under the following key:

    HKEY_CURRENT_USER\SOFTWARE\Microsoft\Terminal Server Client\Default\AddIns\UDVC-Plugin

    Available Configuration Keys:

    • enabled: 0 (disabled) or 1 (enabled). Default is 1. When enabled, a warning messagebox appears before every RDP connection to notify the user of the plugin's presence and settings.
    • mode: 0 (listen), 1 (connect), or 2 (Named Pipe).
    • ip: The IP address to connect to or bind to.
    • port: The port to connect to or bind to.
    • namedpipename: The name of the named pipe (used in mode 2).
  6. Configure the UDVC Server via CLI

    master

    The server binary (UDVC-Server.exe) is configured using command-line flags.

    Usage Syntax: UDVC-Server.exe [-s | -c [-p port [-i ip]] | -m [-n name]] [-0 | -1 | -2 | -3]

    Command Flags:

    • -s: Socket server mode (default).
    • -c: Socket client mode.
    • -p <port>: Port to bind the listener (default: 31337).
    • -i <ip>: IP to bind the listener (default: 127.0.0.1).
    • -m: Named pipe mode.
    • -n <name>: Name of the named pipe (default: \\.\pipe\UDVC_{RDP SESSION NUMBER}).

    Priority Flags (Server only):

    • -0: real time (WTS_CHANNEL_OPTION_DYNAMIC_PRI_REAL) - Warning: Can affect session accessibility during intense transfers.
    • -1: high priority (WTS_CHANNEL_OPTION_DYNAMIC_PRI_HIGH) - Default.
    • -2: medium priority (WTS_CHANNEL_OPTION_DYNAMIC_PRI_MED).
    • -3: low priority (WTS_CHANNEL_OPTION_DYNAMIC_PRI_LOW).
    .
    UDVC-Server.exe -h
    Universal Dynamic Virtual Channel server application
    
    Usage: C:\Users\UDVC\UDVC-Server.exe [-s | -c [-p port [-h ip]] | -m [-n name]] [-0 | -1 | -2 | -3]
    Socket server mode -s (default) OR
    Socket client mode -c:
            -p port   port to bind the listener (default: 31337)
            -i ip     ip to bind the listener (default: 127.0.0.1)
    
    Named pipe mode -m:
            -n name   name of the named pipe (by default: "\\.\\pipe\\UDVC_{RDP SESSION NUMBER}")
    
    Data transfer priority parameters:
            -0        real time             (WTS_CHANNEL_OPTION_DYNAMIC_PRI_REAL)
            -1        high priority         (WTS_CHANNEL_OPTION_DYNAMIC_PRI_HIGH) - default
            -2        medium priority       (WTS_CHANNEL_OPTION_DYNAMIC_PRI_MED)
            -3        low priority          (WTS_CHANNEL_OPTION_DYNAMIC_PRI_LOW)