
We can also use osquery to log socket connections for each process, performing network communications as shown below: The two lines below the PowerShell command above are the script texts that we get once the PowerShell command above gets decoded. Exposing PowerShell scripts used during malware execution Select time, script_text from powershell_events įigure 1. Once the malware is run in our sandbox environment, we can view the PowerShell events using the following osquery command: We will also need to enable script block logging in order to read the PowerShell event log channel. We will then make osquery queries to retrieve the events generated by PowerShell from the powershell_events table.
Fleet osquery windows 7#
We will create a Windows 7 environment on VirtualBox and intentionally infect it with Emotet. You can also find the VirusTotal malware summary here. The sandbox report detailing the activities of Emotet can be found here. The way Emotet spreads is by email, where the malicious dropper runs and downloads the virus through a malicious Word macro. In this case, we will be working with the famous Emotet banking Trojan. We will need to obtain a malware sample to work with. We will also, where necessary, leverage on other tools to support osquery. For us to bring to perspective the power of osquery, we will need to analyze the activities of a malware sample and look at how various malicious activities such as persistence and the installation of root certificates are achieved.
