wazuh / wazuh

Wazuh - The Open Source Security Platform. Unified XDR and SIEM protection for endpoints and cloud workloads.
https://wazuh.com/
Other
9.44k stars 1.49k forks source link

Exploratory debug symbols & crash dump analysis (Windows) #23456

Closed ncvicchi closed 2 days ago

ncvicchi commented 2 weeks ago
Related issue
https://github.com/wazuh/wazuh/issues/21736
https://github.com/wazuh/wazuh/issues/21739

Description

This issue aims to make a exploratory session of current https://github.com/wazuh/wazuh/issues/9913 phase 1 development for the Agent instance of the Windows package.

Verifications should be performed on the following issues to check end to end the process from generation of symbols to crash dump analysis with them.

These verifications must be performed by a different collaborator than the originally assigned to the issue, and a full detail of procedures, logs and results must be provided. Evidence of success must be provided as well.

Goals

DoD

Approval DRI Name: @ncvicchi Objective: Generate debug symbols

ncvicchi commented 2 weeks ago

Blocked by https://github.com/wazuh/wazuh/issues/22947

aritosteles commented 5 days ago

Test completed:

Cloned repo:

Cloned wazuh/wazuh repository and checked out branch

enhancement/9913-generate-debug-symbols-epic-CP

Generated compiled windows agent:

sudo ./generate_compiled_windows_agent.sh --output wazuh_agent_test

1-generate-compiled-windows-agent

Copied resulting zip file to Windows host and generated msi file and debug symbols zip:

.\generate_wazu_msi.ps1

9-msi-creation-output

Run msi as administrator and verify registry key is created:

2-registry-key-created

Cleared registry key:

According to Windows documentation a crash dump is not generated if there is a default debugger configured. Manually cleared the appropriate registry key.

3-registry-key-cleared

Generated crash dump:

Modified executable to crash on startup and generate a crash dump in the designated location.

4-generated-crash-dump

Analyzed dump file with WinDbg:

10-windbg-output

Dwordcito commented 5 days ago

@jotacarma90 will check if the debug symbols are uploaded to s3

Dwordcito commented 2 days ago

LGTM.