Hi Alvaro,
I’m having a
similar issue. But I’m using the latest version of Wazuh virtual
appliance (4.1) in a small environment, and I have two windows 2016 different releases, for
the first one, agent id 001 the vulnerability report works ok, but
for the second agent id 003 I'm only getting "There are no results for selected time range. Try another one."
Here is the output of ossec.log with debug=1:
2021/04/08 21:07:19 wazuh-modulesd:vulnerability-detector[8710] wm_vuln_detector.c:2078 at wm_vuldet_check_agent_vulnerabilities(): INFO: (5450): Analyzing agent '003' vulnerabilities.
2021/04/08 21:07:19 wazuh-modulesd:vulnerability-detector[8710] wm_vuln_detector.c:4352 at wm_vuldet_get_software_info(): DEBUG: (5437): Collecting agent '003' software.
2021/04/08 21:07:19 wazuh-modulesd:vulnerability-detector[8710] wm_vuln_detector.c:4370 at wm_vuldet_get_software_info(): DEBUG: (5439): A partial scan will be run on agent '003'
2021/04/08 21:07:19 wazuh-modulesd:vulnerability-detector[8710] wm_vuln_detector.c:4583 at wm_vuldet_get_software_info(): DEBUG: (5445): No changes have been found with respect to the last package inventory or no packages have been indexed for agent '003'
2021/04/08 21:07:19 wazuh-modulesd:vulnerability-detector[8710] wm_vuln_detector.c:2119 at wm_vuldet_check_agent_vulnerabilities(): INFO: (5471): Finished vulnerability assessment for agent '003'
2021/04/08 21:07:19 wazuh-modulesd:vulnerability-detector[8710] wm_vuln_detector.c:2120 at wm_vuldet_check_agent_vulnerabilities(): DEBUG: (5470): It took '0' seconds to 'scan' vulnerabilities in agent '003'
2021/04/08 21:07:19 wazuh-modulesd:vulnerability-detector[8710] wm_vuln_detector.c:7038 at wm_vuldet_run_scan(): INFO: (5472): Vulnerability scan finished.
Hi, Giorgio Solari
Thank you for posting in our community! It's always rewarding to hear from users who enjoy using Wazuh.
The first thing to do in order to identify if you are experiencing a bug in your Vulnerability Detector is to check both your agent's hotfixes and installed packages inventory. You can get said information from the GUI, inside the inventory data section of your agent.

There, you should find a list of installed packages that you can download as a CSV, and a list of your system's updates. Sharing this information from both your 001 and 003 agents would be incredibly helpful.


If you prefer to get said information without accessing the user interface, you can run these next commands:
# sqlite3 /var/ossec/queue/db/00X.db "select * from sys_programs;"
# sqlite3 /var/ossec/queue/db/00X.db "select * from sys_hotfixes;"
Being 'X' the ID number of your agent. Mind that, though highly improbable, this option could introduce unexpected information inside your database, so it's always more secure to get this data from the GUI. Once we have this information, we can compare both agent's packages and updates to check either if there's a bug in your vulnerability detector, or if your agent 001 just has vulnerable packages or programs that 003 doesn't have.
One last thing! Our Window's MSU feed has been updated just some hours ago, which should considerably improve the vulnerability detection accuracy in Windows agents. By default, the Wazuh manager is configured to download and use the new feed automatically, but in case you are using the offline update functionality, you can get the feed from this link.
I hope this helps!
Hi again, Giorgio
First of all, thank you for sharing your agent 001 vulnerabilities! I'm still working on this issue, but I'm having some difficulties trying to replicate your lack of vulnerabilities. I've been scanning a Windows Server 2016 in a testing environment with the same hotfixes as your agent, and my vulnerability detector is reporting several vulnerability-related alerts, especially ones related to the patch KB5000803 and the other patches it supersedes, which your agent 003 seems to lack.
Have you checked if your manager has downloaded our latest MSU feed? To check this, search in your ossec.log a line like this next one:
2021/04/15 17:15:38 wazuh-modulesd:vulnerability-detector: INFO: (5430): The update of the 'Microsoft Security Update' feed finished successfully.
Mind that our MSU feed was last updated two days ago, so the lack of a log like this in the last few days would mean that your manager is not updated with the latest vulnerability information. As I said, this feed is automatically downloaded by default. Another question, has your agent been scanned since you reported your lack of vulnerabilities? If it's possible, you can manually trigger a vulnerability scan by restarting your manager with systemctl restart wazuh-manager if you have the <run_on_start> section in your ossec.conf enabled.
I hope this helps! We are sorry for the inconvenience and as I said, I'll reach to you whenever I find something relevant. Any additional information that you could share (ossec.log most recent vulnerability-related logs, your vulnerability detector configuration in your ossec.conf, etc.) could be helpful.
Best regards,
Alvaro Romero.
Following your recommendations, I made the installation of Firefox 61.0. After that I decided to reboot the manager, now the vulnerability report has information, but all about Firefox.
Please let me know
any additional file or screenshot that you need.
Attached is a new
ossec.log file the report and a screenshot of the vulnerabilities.
Hello Giorgio,
Thank you very much for providing this information about your agent 003. It has been very helpful while studying your issue.
I think I've finally found the reason why your agent is reporting zero vulnerabilities, in contrast to both your agent 001 and my own testing environment. As I told you, all the testing I've done so far has been made on a Windows Server 2016 environment. However, after checking your agent 003's report, It seems that said agent operating system is Windows Server 2012 R2. Considering that I was testing your hotfixes in a newer operating system, that should explain the incredibly high amount of vulnerabilities that were being reported in my environment.
With this in mind, I've tested from scratch in a Windows server 2012 R2 testing environment and I've ended up with drastically different vulnerability diagnoses: There are hardly any vulnerabilities with the hotfixes you've shared! The only vulnerabilities (apart from the Firefox 61.0 that I installed for testing purposes) I've found are those related to the patch KB5001382
2021/04/19 18:21:06 wazuh-modulesd:vulnerability-detector[64494] wm_vuln_detector.c:1525 at wm_vuldet_send_cve_report() : DEBUG: (5467): Agent '142' is vulnerable to 'CVE-2021-26415'. Condition: 'KB5001382 patch is not installed'.
The information for this patch may have probably been included in our latest MSU feed, meaning that your scan from last week was probably accurate.
That being said, if you want to do a final check to discard any possibility of an error, you can enable increase the debug mode of wazuh-modulesd to 2 in local_internal_options.conf (as I explained in my second message) and wait for the full scan of agent 003 to happen (you can also disable the ignore_time value). In this way, you should find in your logs highly detailed information about both your agent vulnerability status and fixes.
If your agent still lacks the KB5001382 patch, your MSU is updated to the latest version, and your agent still does not report the mentioned vulnerability, we could be talking about a false negative related to the mentioned patch. You can find more information about this patch here (it seems that it only affects x64 systems). That being said, your vulnerability detector seems to be working perfectly fine and It's very likely that your manager is reporting the right amount of vulnerabilities, as your agents 001 and 003 differ quite drastically in both hotfixes and packages (and even operating system!).
Thank you very much for your patience and I hope I helped you!
Best regards,
Álvaro Romero.
Best regards,
Giorgio Solari