Software uninstallation with password? Wapt script

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
Thierry83
Messages: 5
Registration: Nov. 22, 2020 - 8:05 p.m.

November 22, 2020 - 8:16 PM

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! :)
Attachments
Untitled.png
Untitled.png (41.86 KB) Viewed 7743 times
User avatar
Gaetan
Messages: 169
Registration: August 8, 2019 - 10:16
Location: Toulouse

November 23, 2020 - 2:36 PM

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
Yoann
Messages: 51
Registration: July 24, 2019 - 09:39

November 23, 2020 - 3:55 PM

Hello,

uninstallation of KES is possible using the KLLOGIN and KLPASSWD.
However, the username and password will be in plain text...

Regards.
WAPT Community 1.8
User avatar
vcardon
WAPT Expert
Messages: 278
Registration: Oct 06, 2017 - 10:55 p.m.
Location: Nantes, France

November 23, 2020 - 5:18 PM

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.
Vincent CARDON
Tranquil IT
Thierry83
Messages: 5
Registration: Nov. 22, 2020 - 8:05 p.m.

November 23, 2020 - 7:40 PM

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! :)
User avatar
vcardon
WAPT Expert
Messages: 278
Registration: Oct 06, 2017 - 10:55 p.m.
Location: Nantes, France

November 23, 2020 - 8:08 PM

Let us know if it works and if so, don't forget to mark the topic as resolved.
Vincent CARDON
Tranquil IT
Thierry83
Messages: 5
Registration: Nov. 22, 2020 - 8:05 p.m.

November 24, 2020 - 6:28 AM

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! :)
Thierry83
Messages: 5
Registration: Nov. 22, 2020 - 8:05 p.m.

November 26, 2020 - 12:30

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! :?
Locked