diff --git a/server/src/uds/transports/RDP/scripts/linux/direct.py b/server/src/uds/transports/RDP/scripts/linux/direct.py index 63551eff..ae941c61 100644 --- a/server/src/uds/transports/RDP/scripts/linux/direct.py +++ b/server/src/uds/transports/RDP/scripts/linux/direct.py @@ -11,13 +11,19 @@ from uds import tools # @UnresolvedImport import six -def execNewXFreeRdp(parent, xfreerdp): +def execUdsRdp(udsrdp): + import subprocess + params = [udsrdp] + {m.r.as_new_xfreerdp_params} + ['/v:{m.r.address}'] # @UndefinedVariable + tools.addTaskToWait(subprocess.Popen(params)) + + +def execNewXFreeRdp(xfreerdp): import subprocess # @Reimport params = [xfreerdp] + sp['as_new_xfreerdp_params'] + ['/v:{}'.format(sp['address'])] # @UndefinedVariable tools.addTaskToWait(subprocess.Popen(params)) -def execRdesktop(parent, rdesktop): +def execRdesktop(rdesktop): import subprocess # @Reimport params = [rdesktop] + sp['as_rdesktop_params'] + [sp['address']] # @UndefinedVariable p = subprocess.Popen(params, stdin=subprocess.PIPE) @@ -26,9 +32,11 @@ def execRdesktop(parent, rdesktop): p.stdin.close() tools.addTaskToWait(p) + # Try to locate a "valid" version of xfreerdp as first option (<1.1 does not allows drive redirections, so it will not be used if found) xfreerdp = tools.findApp('xfreerdp') rdesktop = tools.findApp('rdesktop') +udsrdp = tools.findApp('udsrdp') fnc, app = None, None if rdesktop is not None: @@ -51,10 +59,13 @@ if xfreerdp is not None: except Exception as e: # Valid version not found, pass to check rdesktop pass +if udsrdp is not None: + fnc, app = execUdsRdp, udsrdp + if app is None or fnc is None: raise Exception('''
You need to have installed xfreerdp (>= 1.1) or rdesktop, and have them in your PATH in order to connect to this UDS service.
Please, install the proper package for your system.
Also note that xfreerdp prior to version 1.1 will not be taken into consideration.
''') else: - fnc(parent, app) # @UndefinedVariable + fnc(app) # @UndefinedVariable diff --git a/server/src/uds/transports/RDP/scripts/linux/tunnel.py b/server/src/uds/transports/RDP/scripts/linux/tunnel.py index 8f2c896f..a1e21e0a 100644 --- a/server/src/uds/transports/RDP/scripts/linux/tunnel.py +++ b/server/src/uds/transports/RDP/scripts/linux/tunnel.py @@ -12,13 +12,19 @@ from uds import tools # @UnresolvedImport import six -def execNewXFreeRdp(parent, xfreerdp, port): +def execUdsRdp(udsrdp, port): + import subprocess + params = [udsrdp] + {m.r.as_new_xfreerdp_params} + ['/v:127.0.0.1:{{}}'.format(port)] # @UndefinedVariable + tools.addTaskToWait(subprocess.Popen(params)) + + +def execNewXFreeRdp(xfreerdp, port): import subprocess # @Reimport params = [xfreerdp] + sp['as_new_xfreerdp_params'] + ['/v:127.0.0.1:{}'.format(port)] # @UndefinedVariable tools.addTaskToWait(subprocess.Popen(params)) -def execRdesktop(parent, rdesktop, port): +def execRdesktop(rdesktop, port): import subprocess # @Reimport params = [rdesktop] + sp['as_rdesktop_params'] + ['127.0.0.1:{}'.format(port)] # @UndefinedVariable p = subprocess.Popen(params, stdin=subprocess.PIPE) @@ -27,9 +33,11 @@ def execRdesktop(parent, rdesktop, port): p.stdin.close() tools.addTaskToWait(p) + # Try to locate a "valid" version of xfreerdp as first option (<1.1 does not allows drive redirections, so it will not be used if found) xfreerdp = tools.findApp('xfreerdp') rdesktop = tools.findApp('rdesktop') +udsrdp = tools.findApp('udsrdp') fnc, app = None, None if rdesktop is not None: @@ -53,6 +61,9 @@ if xfreerdp is not None: # QtGui.QMessageBox.critical(parent, 'Notice', six.text_type(e), QtGui.QMessageBox.Ok) # @UndefinedVariable pass +if udsrdp is not None: + fnc, app = execUdsRdp, udsrdp + if app is None or fnc is None: raise Exception('''You need to have installed xfreerdp (>= 1.1) or rdesktop, and have them in your PATH in order to connect to this UDS service.
Please, install apropiate package for your system.
@@ -65,4 +76,4 @@ else: if forwardThread.status == 2: raise Exception('Unable to open tunnel') - fnc(parent, app, port) # @UndefinedVariable + fnc(app, port) # @UndefinedVariable