Skip to content

Latest commit

 

History

History
133 lines (66 loc) · 5.06 KB

File metadata and controls

133 lines (66 loc) · 5.06 KB

Elastic Part 2: Configure Elastic

Summary

We will configure Elastic and install agents on our Windows VM so that we can parse logs and other Windows artifiacts using Elastic (hosted on Kali Purple) as our SIEM.

Background

We have already installed Elastic on Kali Purple and built a Windows VM. The next step in our lab is to configure the SIEM.

Steps

Using a browser navigate to your SIEM dashboard by typing in https://:5601.

Log into Elastic with the username “elastic” and the password you recorded during installation.

Open Integrations and select Elastic Defend.

Untitled

Select add Elastic Defend

Untitled

Name the integration. I used “Windows Elastic Defend”, as seen below.

Untitled

Scroll down and select Complete EDR and give a name to the new agent policy. I named it Windows Agent policy 1. The select “Save and continue”

Untitled

Before we can add an agent to our hosts, we need to enroll in Fleet. Select “Add Fleet Server”

Untitled

Name the Fleet Server and provide the URL (https://:8220). Be sure to include the port number 8220.

Untitled

Once the Fleet Server policy has been created, we must install the Fleet Server to the Kali purple host. Copy the Linux Tar script and paste it into the Kali Purple terminal.

Untitled

Untitled

Select “Add Agent” and then open the Windows tab and copy the PowerShell command.

Untitled

Paste the PowerShell command into Notepad on the Windows VM. Add the text --insecure  at the end of the PowerShell script. 

Untitled

Then copy the script from Notepad and paste into an Administrator PowerShell terminal.

Untitled

Select “Y” to install.

When installed successfully, a message will state “Successfully enrolled the Elastic Agent”

Untitled

As seen below, the VMsd should be listed in Fleet.

Untitled

To add anothe integration, go to Integrations and search for the Windows integration.

Untitled

Select add Windows.

Untitled

Name the integration “windows-1” and select Save and continue.

Untitled

Select “Save and deploy”. The deployed agent will be automatically be updated with this integration.

Untitled

The screenshot below shows the added integrations.

Untitled

Testing the Elastic Defend Integration

Download Atomic Red Team Attack Script from one of these links:

https://drive.google.com/file/d/1LGFSmarbZL5NqlLQhQbWODPXu04eZ68Z/view?usp=sharing

https://drive.google.com/file/d/1sw_lJgCIfamAwsN1MPvIF5FBQJS9V0tu/view?usp=sharing

Download Atomic Red Team Cleanup Script from one of these links:

https://drive.google.com/file/d/1NrA17kdN0NjB14gqlsqEp9Q_RoT7GOQk/view?usp=sharing

https://drive.google.com/file/d/1SexqRAO2yiUp1IxSJ4rZ9Gya8F6dk_94/view?usp=sharing

Create a snapshot on the VM called malware staged.

Untitled

After launching the Atomic Red Team PowerShell script on our Windows VM.

Untitled

Untitled

Note that the emulated malware was prevented. Prevention is the default setting for Elastic Defend. However, we can change it to detection by editing the integration. This demonstrates that the Elastic Defend integration is performing correctly.

Untitled

Untitled

Test Elastic Discover

A quick query for PowerShell script block (event code 4104) shows PowerShell importing the Atomic Red Team module.

Untitled

Conclusion

We have successfully deployed an Elastic agent to our victim VM and installed two integrations, Elastic Defend and Windows. These integrations will record suspicious behavour and ingest key logs from our victim PC to our SIEM. We are now ready to test our ability to respond to incidents and conduct threat hunt operations within our labs.