1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-01-08 21:18:00 +03:00

Added "no warning for redirections' to remote connection

This commit is contained in:
Adolfo Gómez García 2018-11-23 11:07:58 +01:00
parent 43cb02b177
commit d1bb018dff
2 changed files with 11 additions and 0 deletions

View File

@ -19,6 +19,12 @@ except Exception:
logger.info('Cannot encrypt for user, trying for machine')
password = win32crypt.CryptProtectData(thePass, None, None, None, None, 0x05).encode('hex')
try:
subprocess.call([r'c:\windows\system32\reg.exe', 'ADD', r'HKCU\Software\Microsoft\Terminal Server Client\LocalDevices', '/v', '127.0.0.1', '/t', 'REG_DWORD', '/d', '255', '/f'])
except Exception as e:
logger.warn('Exception invoking reg.exe : %s', e)
pass
# The password must be encoded, to be included in a .rdp file, as 'UTF-16LE' before protecting (CtrpyProtectData) it in order to work with mstsc
theFile = '''{m.r.as_file}'''.format(password=password)

View File

@ -39,6 +39,11 @@ executable = tools.findApp('mstsc.exe')
if executable is None:
raise Exception('Unable to find mstsc.exe')
try:
subprocess.call([r'c:\windows\system32\reg.exe', 'ADD', r'HKCU\Software\Microsoft\Terminal Server Client\LocalDevices', '/v', '{m.ip}', '/t', 'REG_DWORD', '/d', '255', '/f'])
except Exception as e:
logger.warn('Exception invoking reg.exe : %s', e)
subprocess.Popen([executable, filename])
tools.addFileToUnlink(filename)