AlessandroZ / LaZagne

Credentials recovery project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KeyError: 'APPDATA' in mRemoteNG.py", line 181, in get_configuration_files

muelli opened this issue · comments

commented
PS C:\temp> .\LaZagne.exe all
[920] Failed to execute script laZagne
Traceback (most recent call last):
  File "laZagne.py", line 24, in <module>
  File "lazagne\config\run.py", line 32, in create_module_dic
  File "lazagne\config\manage_modules.py", line 102, in get_modules
  File "lazagne\config\manage_modules.py", line 102, in <listcomp>
  File "lazagne\softwares\sysadmin\mRemoteNG.py", line 35, in __init__
  File "lazagne\softwares\sysadmin\mRemoteNG.py", line 181, in get_configuration_files
  File "os.py", line 679, in __getitem__
KeyError: 'APPDATA'
PS C:\temp> 

https://github.com/AlessandroZ/LaZagne/blob/0cc15633bf05425303aafa8e194df42a8798d681/Windows/lazagne/softwares/sysadmin/mRemoteNG.py#L181C21-L181C21

it should probably fall back to a safe default when the environment variable does not exist.

Hello,

Thanks for reporting this problem. I didn't check it but the rest of the tools does it. Here is how these env variables are defined:

'APPDATA': u'{drive}:\\Users\\{user}\\AppData\\Roaming\\',

And here is how it is used ont other modules:

_path = os.path.join(constant.profile['APPDATA'], one_dir)

I will fix it when I have some time.

Why not create a try catch in it? Or you could use it more. If something fail, it don't need to block all the program.