Closed HanesSciarrone closed 1 year ago
Hey team! Please add your planning poker estimate with ZenHub @HanesSciarrone @MiguelazoDS @pereyra-m
After some searches about the keys and values in the HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
registry. I found that only five properties are mandatories for every Windows installation.
The keys that depend on these properties and therefore always have a value are:
Windows Installer Properties for the Uninstall Registry Key
I have tried to compare how some programs get the path but, for example, CCleaner
doesn't get that information.
I have also tested the InstalledPackagesView
program to see how and what information it gets. After some checks, I have been able to validate that the information ti provides is in summary the same that sysInfo
collects with some more keys.
We have 3 possible solutions to fix the way that we are getting path installation packages:
InstallSource
field if it isn't empty and we have to check if the path exists.UninstallString
field. The only thing to note is that the field doesn't always contain the path to the binary because the definition of the registry is the command or binary needed to uninstall the package. If the registry contains an executable the target of the registry is the directory of this binary, we have to parse the registry and keep only the directory.HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Path
and HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\App Paths
with the same name of the registry read in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
and concatenated the .exe string.A more complete analysis was carried out to evaluate the different alternatives and implement a generic solution. For this, five software were analyzed: Chrome, Notepad++, VirtualBox, Wazuh and VMWare.
The following is the information currently being retrieved from the InstallLocation
field:
As can be seen, three of the five software do not have information about the installation folder.
The first proposal is to use the InstallSource
field to get the installation folder information, the results are as follows:
As can be seen, this field has no information indicating where the program is installed.
The second proposal is to use the UninstallString
field to get the destination folder information, the results are as follows:
Only in the case of Notepad++ does it seem to show data of interest.
The third proposal is to look for the information in other registries.
Information is only observed in two of the five programs. In the case of Notepad++, this is the same path that we see in the UninstallString
field.
For some programs, the installation path information cannot be obtained. It is proposed to apply the following search sequence to obtain the most available information:
InstallLocation -- if empty -> UninstallString
Searched for information on how other software resolves the install path and found that the install path is obtained using an MSI functionality that allows the install path to be obtained from the product code. But I understand that this possibility cannot be used and we just have to get the information from the windows logs.
As a conclusion, we close the issue, since there is no feasibility to be able to obtain this information in a reliable and consistent way between the different ways of obtaining the information. Priority is removed, to continue investigating in the future.
Description
Data provider module does not find package path information for specific packages. This was found during a community case analysis (Reference link). During the test, the issue was reproduced following steps mentioned below:
GET /syscollector/009/packages
where 009 should be ID Agent of interest and export JSON resulting.On the test was checked that some package on JSON file has a location field meanwhile another not. An example of this is shown below.