Page 1 of 1
Software uninstallation with password? Wapt script
Published: November 22, 2020 - 8:16 PM
by Thierry83
Hello,
Great tool, but while trying to create an uninstallation package I ran into a problem: Kaspersky antivirus is password protected, preventing its uninstallation.
Question: Does Wapt allow managing a password for software uninstallation?
I have a password required to uninstall Kaspersky, and I wanted to include it in the Python script without it being visible, perhaps by importing an encrypted file or something similar (note that this is not the Wapt access password).
How can I do this? Thank you in advance!

Re: Software uninstallation with password? Wapt script
Published: November 23, 2020 - 2:36 PM
by Gaetan
Hello,
I had the same problem but couldn't find a solution.
Since we have a KES console to manage our fleet and it handles uninstallation via WAPT,
this might be a lead:
https://support.kaspersky.com/fr/14674#block4
Re: Software uninstallation with password? Wapt script
Published: November 23, 2020 - 3:55 PM
by Yoann
Hello,
uninstallation
of KES is possible using the
KLLOGIN and
KLPASSWD.
However, the username and password will be in plain text...
Regards.
Re: Software uninstallation with password? Wapt script
Published: November 23, 2020 - 5:18 PM
by vcardon
https://www.wapt.fr/fr/doc/wapt-create- ... aquet.html
to encrypt your sensitive data such as usernames and passwords in your WAPT packets for confidentiality purposes.
Re: Software uninstallation with password? Wapt script
Published: November 23, 2020 - 7:40 PM
by Thierry83
Thanks Gaetan and Vincent,
I had indeed seen the script to encrypt the password, but I didn't know about the Kasp login and password.
Thanks to both of you for this answer which confirms this lead, I'm going to experiment!

Re: Software uninstallation with password? Wapt script
Published: November 23, 2020 - 8:08 PM
by vcardon
Let us know if it works and if so, don't forget to mark the topic as resolved.
Re: Software uninstallation with password? Wapt script
Published: November 24, 2020 - 06:28
by Thierry83
I need to test it because, from what I read in your script (assuming I've read it correctly...):
Code: Select all
encryptlist = json.loads(open('encrypt-txt.json','r').read())
if WAPT.host_uuid in encryptlist:
host_key = WAPT.get_host_key()
encrypttxt = host_key.decrypt(encryptlist[WAPT.host_uuid].decode('base64')).decode('utf-8')
either
Code: Select all
print(value['computer_fqdn'] + ' : ' + value['uuid'] + ' : ' + encryptlist[value['uuid']])
I need to decode a password using the machine's UUID. Does this mean I need to pre-encode the UUID of all the machines with the password beforehand in a list? That's not easy given the number of machines...
Another question: I need to enter this password as an argument to the key in the uninstallation program. It's not specific to any particular software, so there may or may not be a password required for uninstallation
Code: Select all
for soft in installed_softwares(software):
run(WAPT.uninstall_cmd(soft['key']))
Can we add a password argument to WAPT.uninstall_cmd(soft['key']) and specify an optional password (used or not during uninstallation...)?
Is this feasible? Thank you for your feedback!

Re: Software uninstallation with password? Wapt script
Published: November 26, 2020 - 12:30 PM
by Thierry83
Hello,
I'm testing
https://www.wapt.fr/fr/doc/wapt-create- ... aquet.html.
I'm getting the machine UUIDs in the Wapt console, but where is the
encrypt-text.json
? It's generating an error as if the file doesn't exist:
FATAL ERROR: IOError: [Errno 2] No such file or directory: 'encrypt-txt.json' Wapt.
Thanks!
