AlessandroZ / LaZagne

Credentials recovery project
GNU Lesser General Public License v3.0
9.43k stars 2.02k forks source link

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

Closed muelli closed 10 months ago

muelli commented 11 months ago
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.

AlessandroZ commented 11 months ago

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: https://github.com/AlessandroZ/LaZagne/blob/0cc15633bf05425303aafa8e194df42a8798d681/Windows/lazagne/config/constant.py#L27

And here is how it is used ont other modules: https://github.com/AlessandroZ/LaZagne/blob/0cc15633bf05425303aafa8e194df42a8798d681/Windows/lazagne/softwares/chats/psi.py#L25

I will fix it when I have some time.

rodrigozanatta commented 9 months ago

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.