forked from shaba/openuds
Final fix for no check redirections
This commit is contained in:
parent
d1bb018dff
commit
8120ae5c92
@ -19,17 +19,17 @@ 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)
|
||||
|
||||
filename = tools.saveTempFile(theFile)
|
||||
executable = tools.findApp('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)
|
||||
|
||||
|
@ -40,7 +40,7 @@ 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'])
|
||||
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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user