# 1. Setting up a testing environment

#### The EDR usually consists of two elements:

* A web console where the data from the endpoints is visualized. This could be self hosted or it could be a cloud based application. This really depends on the provider.&#x20;
* The Endpoint Agent that feeds the data to the central database. The agent itself has multiple components such as kernel drivers, dlls, services etc. OpenEDR consists of [these components](https://github.com/ComodoSecurity/openedr?af=7639).

#### There are various options when it comes to setting up a testing lab:

* OpenEDR - offers a free EDR solution. Also the management console is cloud hosted so no additional VMs are required to start testing. The process is literally sign up > Install agent and you are good to go.&#x20;
* Elastic - offers a free EDR solution. You do however have to setup the a linux host running the monitoring console and database of the EDR. A great walkthrough (by [IppSec](https://www.youtube.com/@ippsec)) on how to set it up can be found on YouTube *"*[*Setting Up Elastic 8 with Kibana, Fleet, Endpoint Security, and Windows Log Collection*](https://www.youtube.com/watch?v=Ts-ofIVRMo4)*"*
* Microsoft Defender for Endpoint. I have never tried it myself but Microsoft offers a 30-day trial of their [business solution](https://www.microsoft.com/en-gb/security/business/endpoint-security/microsoft-defender-business-b?). This is great if you are trying to match a target environment and want to test payloads in advance. A 30-day trial however, is not great to have as a long term playground.

### [OpenEDR](https://www.openedr.com/)

For the sake of simplicity I will write quick walk through on how to set up OpenEDR.

* To get started all we have to do is visit [OpenEDR's ](https://www.openedr.com/)website, click on "Get Started for Free".

<figure><img src="https://1525675160-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1BtmYYGIbNqDCOEq0YOj%2Fuploads%2FNlkHfOuxubvX4GQ6CaxM%2Fimage.png?alt=media&#x26;token=73f53a32-918a-4c02-9d96-65736073355f" alt=""><figcaption><p>OpenEDR landing page</p></figcaption></figure>

* We then get redirected to the following site. All we have to do is fill in the page and create an account. &#x20;

<figure><img src="https://1525675160-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1BtmYYGIbNqDCOEq0YOj%2Fuploads%2FB51xhwBp2FHLE454Tyfw%2Fimage.png?alt=media&#x26;token=bfd18a30-149b-40b0-83c3-35cdf90790e6" alt=""><figcaption><p>Fill In the Form</p></figcaption></figure>

* You will then be prompted to set up a 2FA. That's highly recommended&#x20;

<figure><img src="https://1525675160-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1BtmYYGIbNqDCOEq0YOj%2Fuploads%2FWKMdyKTy3iYvc3KSLJSg%2Fimage.png?alt=media&#x26;token=f6a09a90-b88c-4783-9180-f052a195c2da" alt=""><figcaption><p>2FA setup</p></figcaption></figure>

* After setting the 2FA up (or not) it will take a while for the account to be up and running. Be patient don't refresh halfway through the process.

&#x20;

<figure><img src="https://1525675160-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1BtmYYGIbNqDCOEq0YOj%2Fuploads%2FjAC0BPHdR1m0WXG2SqKY%2Fimage.png?alt=media&#x26;token=73e0120d-74df-4bef-a4e4-a22b4326264e" alt=""><figcaption><p>Waiting for the Portal privisioning</p></figcaption></figure>

* Once all is ready we are greeted with the following window

<figure><img src="https://1525675160-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1BtmYYGIbNqDCOEq0YOj%2Fuploads%2FWAwvgexq6a2WpYdth3yQ%2Fimage.png?alt=media&#x26;token=36973ba0-54b6-4bdf-a285-ed0bdc0e3421" alt=""><figcaption><p>Install the Agent</p></figcaption></figure>

* All we have to do at this point is to download the MSI  to the endpoint using the provided link and install it. This will enrol the endpoint to the portal.

<figure><img src="https://1525675160-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1BtmYYGIbNqDCOEq0YOj%2Fuploads%2F8vytjVxUQUfrNqcyBTaZ%2Fimage.png?alt=media&#x26;token=5516f9a8-914f-4a41-8f4e-a40c667232c9" alt=""><figcaption><p>Enrol using the installer</p></figcaption></figure>

* The endpoint will appear in the device list on the portal if it's enrolled successfully. &#x20;

<figure><img src="https://1525675160-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1BtmYYGIbNqDCOEq0YOj%2Fuploads%2FPXH3DK5TaLfMM7PpiX4j%2Fimage.png?alt=media&#x26;token=7c5776b0-1801-491e-9914-b33b21720de5" alt=""><figcaption><p>Host EDR_Test enrolled in the portal</p></figcaption></figure>

* Once enrolled we can then install the AV and EDR capabilities. That's done by selecting the asset and click the menu "Install or Manage Packages" > Install Additional Xcitium Packages

<figure><img src="https://1525675160-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1BtmYYGIbNqDCOEq0YOj%2Fuploads%2FgF4v8EpRfOpod29oRBs2%2Fimage.png?alt=media&#x26;token=b306a7ac-3891-4f9b-bde7-6098409166cd" alt=""><figcaption><p>Install Additional Xcitium Packages</p></figcaption></figure>

* We will be prompted with the following window. Both Security and EDR packages should be installed. I found this part to be a bit unstable and multiple restarts were required:

<figure><img src="https://1525675160-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1BtmYYGIbNqDCOEq0YOj%2Fuploads%2FN0RjLinwXcqVhcH39e0p%2Fimage.png?alt=media&#x26;token=06faa769-4a80-497a-92ec-f0a2ddd0aacd" alt=""><figcaption><p>Install packages</p></figcaption></figure>

* The final step to activate all the EDR features is to click on the asset name and navigate to "Manage Profiles" on the top left

<figure><img src="https://1525675160-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1BtmYYGIbNqDCOEq0YOj%2Fuploads%2FZlmAelFKARY433XSHlzQ%2Fimage.png?alt=media&#x26;token=48695653-9d9b-4bd5-8820-32277f845d03" alt=""><figcaption><p>Manage Profiles</p></figcaption></figure>

We hen click on "Add Profiles" select all of them and click on save.

<figure><img src="https://1525675160-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1BtmYYGIbNqDCOEq0YOj%2Fuploads%2FYrfwByuqC7vjo5QqD17e%2Fimage.png?alt=media&#x26;token=3fe1fd8a-9584-459e-a8b1-7be6601e1d7f" alt=""><figcaption><p>Profiles assigned to the asset</p></figcaption></figure>

We now have a free lab with an EDR agent running where we could test our payloads.
