Threat Hunting

APT:

DragonFly as defined by MITRE "Dragonfly is a cyber espionage group that has been attributed to Russia's Federal Security Service (FSB) Center 16. Active since at least 2010, Dragonfly has targeted defense and aviation companies, government entities, companies related to industrial control systems, and critical infrastructure sectors worldwide through supply chain, spearphishing, and drive-by compromise attacks"

TTPs:

  • Schedule Tasks Creation

  • Brute Force Attack

  • Phishing Email

Detection and Prevention:

Schedule Task Creation:

Installing Sysmon:

Windows:

  1. Now in the downloads folder run in an admin Powershell prompt

Contents of the XML:

Wazuh Server config for Sysmon:

  1. In the /var/ossec/etc/shared/default/agent.conf Add the lines below

  1. Next we must add the rule to the /var/ossec/etc/rules/local_rules.xml

Creating an Active Response Script:

  1. Create the file C:\Program Files (x86)\ossec-agent\active-response\bin\analyze-scheduled-task.cmd and add the code below.

Configure Wazuh Agent to Monitor Response Log:

  1. In the wazuh manager webui go to groups.

  1. Edit the windows group

  1. Add the lines below

If you don't have a windows group can add the lines below to /var/ossec/etc/shared/default/agent.conf on the wazuh server.

Now test to see if the scheduled-tasks.log is created

Run the command below to create a test task

Now the file C:\Program Files (x86)\ossec-agent\logs\scheduled-tasks.log should be created. It will look something like:

Now delete the task

Creating the Rule:

On the Wazuh server add the lines below into /var/ossec/etc/rules/local_rules.xml inside the <group name="windows,sysmon,">

Now restart wazuh manager on the wazuh server

Finished Product

In the webui it should show up as below:

Brute Force Attacks:

Wazuh Server setup:

  1. In the /var/ossec/etc/ossec.conf file make sure the lines below are not commented

  1. Now in the same file add the lines. There is a section towards the middle of the file that has <active-response> commented out and you can add this right below that.

  1. Now restart the Wazuh manager service:

Testing:

  1. Run commands below to install hydra and trigger active response.

  1. Now hydra usage:

Final Output:

Phishing Emails:

The file below is a document I made as a proof of concept for a set of instructions that could be given out to a corporation.

Last updated