EDU 262 X36 LabGuide - Consigas
EDU 262 X36 LabGuide - Consigas
Cortex XDR:
Investigation and Response
Lab Guide
EDU-262
Cortex XDR 3.6
Courseware Version A
June 2023
Consolas font Text that you enter and Run cytool to stop the Cortex XDR agent:
coding examples cytool runtime stop
Calibri gray font Lab step results, Note that the start option does not
explanations, and warnings require the supervisor password.
Click Click the left mouse button Click the Alerts Table link at the upper
right, near the Filter button.
Right-click Click the right mouse Right-click anywhere on the profile, and
button then select Save As New.
Lab Environment
The following diagram provides a basic overview of the lab environment. The login to the lab
environment will give you access to the Desktop of winpoint1 as user PAN\Student from where
you will reach all other devices:
Browser Recommendation
We strongly recommend that you use the Google Chrome browser to complete the lab exercises.
Other browsers may function equally well for most activities. However, we have found the
Chrome browser to consistently provide the best experience across all tasks.
Menu Paths
In Cortex XDR UI v3.6, the top menu bar in the management console is moved to the left
navigation pane. To shorten the menu paths (breadcrumb trails) and to make the page name
independent of the menu types, only the page names are listed in the task steps. For example:
● Go to Configurations in the (Cortex XDR) management console.
● Go to Action Center in the (Cortex XDR) management console.
When it is not clear, use the following table to resolve the page names in such task steps to
find the full menu path in the Cortex XDR left navigation pane:
Lab Objective
At the end of this lab session, you should be able to:
● Rename your Windows endpoint hostname
● Access the Cortex XDR management console
● Create a Cortex XDR agent installation package for Windows
● Install a Cortex XDR agent on your Windows endpoint
● Clone the default Agent Settings profile and modify the settings
● Clone the default policy rule and modify the settings
Activities
Activity 0.1 Change Windows Endpoint Hostname
Activity 0.2 Access Cortex XDR Management Console
Activity 0.3 Deploy Your Cortex XDR Agent
Activity 0.4 Create an Agent Settings Profile and a Policy Rule
Tasks
Task 1: Demo: Accessing Your Endpoints
Task 2: Get Your Student ID and Change the Windows Hostname
Tasks
Task 1: Get Your CSP Username and Cortex XDR Instance
Task 2: Verify Access to Your Cortex XDR Instance
Tasks
Task 1: Create an Agent Installation Package for Windows
Task 2: Install the Cortex XDR Agent and Verify Installation
Task 3: Verify Cytool Functionality
Tasks
Task 1: Create an Agent Settings Profile
Task 2: Create a Policy Rule
Task 3: Verify the Applied Profiles on Endpoints
6. To also verify the associated profiles, right-click ####-winpoint1 and then select
Endpoint Data > View Endpoint Policy.
7. Review the Policy Details dialog and ensure that the name of the Agent Settings Profile
is ####-AgtPF01.
Lab Objective
At the end of this lab session, you should be able to:
● Configure upload of the EED
● Analyze alerts with and without EED and compare the results
● Manage (stop, start, and query) the EED from the endpoint
● Trace the agent log for the EED uploads
Activities
Activity 1.1 Analyze Alerts Stitched with Enhanced Endpoint Data
Activity 1.2 Manage Enhanced Endpoint Data Monitoring from Endpoints
Tasks
Task 1: View Default EED Collection Settings
Task 2: Analyze Non-Stitched Alerts
Task 3: Enable EED Collection on Endpoints
Task 4: Analyze Stitched Alerts
Task 5: Debug Alerts in the Management Console
4. Find the alert with ALERT NAME: Behavioral Threat and INITIATED BY: wscript.
5. Scroll right to the CGO columns and verify that for this row all columns beginning with
CGO are blank.
CGO stands for Causality Group Owner, which refers to a process. In a multistage attack
that involves multiple processes, the main process initiates the attack and is therefore
responsible for the attack. This main process is named CGO.
In the Alerts table, CGO fields are not populated for non-stitched alerts. In the absence
of EED, the alerts aren’t stitched and these fields are therefore blank.
6. Right-click the alert and verify that the Investigate Causality Chain > Open Card
actions are enabled whereas Open Timeline actions are disabled.
As you will see later in the course, full Open Card and Open Timeline actions are
dependent upon alert stitching. For un-stitched alerts, the Open Card feature is still
enabled, but the analysis is very limited.
Although this attack involved multiple processes, the Causality Instance graph shows
only one process wscript.exe because EED collection is disabled.
7. When the CGO data is available, right-click the alert. Notice that now, Open Timeline
actions are also enabled in the submenu Investigate Causality Chain, besides the Open
Card actions.
8. Select Investigate Causality Chain > Open Card in new tab to open the alert’s
Causality View page.
9. Review the Causality Instance graph and examine the other processes involved in the
attack:
Tasks
Task 1: Stop EED Monitoring
Task 2: View EDR-Related Settings
Task 3: View EDR Folder and Files
Task 4: Trace Agent Log for EED Uploads
Task 5: Check If Heartbeats Initiate EDR Upload
Note: All items in the State column should be Disabled now, whereas they were not all
disabled early.
4. Note that unlike the screenshot shown above, your Edr folder does not contain the
"archive" subfolder and is unlikely to include any files either.
What does the archive folder do? During uploading, the XDR agent archives and then
compresses all the files in Edr into a single .xz file. It is this file that the agent uploads as
the EDR data log. Also, after this process the files directly in the Edr folder are deleted
for the next cycle.
5. Open the agent console and click Check In Now twice to force two successive
heartbeats. Wait until the first heartbeat completes before initiating the next.
6. When you see the Notepad++ Reload dialog, click Yes to reload trapsg.log.
Lab Objective
At the end of this lab session, you should be able to:
● Manage incidents, including changing status and assigning investigators
● Prioritize and close incidents
● View incident details, including its alert breakdown, key assets, and key artefacts
● Investigate files using Hash View
Activities
Activity 2.1 Work with the Advanced Incident View
Activity 2.2 Score Your Incidents
Activity 2.3 Investigate Files Using Hash View
Tasks
Task 1: Explore the Table view Mode
Task 2: Explore Incident View Types
Task 3: Explore Fields in the Header of Advanced View
Task 4: Work with Advanced View Tabs
4. Hover over the icon to see the description: Switch to table view.
9. Notice that the page is divided horizontally into left and right panes.
10. Hover over the splitter between two panes, and then resize the panes by dragging the
splitter left and right.
11. Notice that the left pane shows a list of incidents and is scrollable.
12. Notice that each incident in the list is separated by a horizontal line.
3. Click the menu dropdown near Advanced View to toggle between Legacy view then
back to Advanced view to see how the right pane returns to the default setting.
2. Go to Incidents and ensure that Page layout is Table view. Navigate to Page Layout by
clicking on the three vertical dots in the top right corner of the screen and then selecting
Restore Default Layout.
Note: Your incident may differ in some details from the one shown here.
By default, the pinned tab is shown. Your pinned tab may vary. For instance, in the
above example, it would start in Timeline.
2. Notice the pin icon next to the tab names while hovering the mouse over the tab names.
Does it show up for all the options?
3. In the Key Assets & Artifacts tab, click its pin icon to pin this tab.
a. Notice that the artifacts are listed in a scrollable list, and that you can also search for an
artifact.
b. Click the three-dot menu on an artifact to see actions available for artifacts.
Tasks
Task 1: Add a Scoring Rule
Task 2: Create an Alert and Find Its Incident ID
Task 3: Review Score Distribution of the Incident
Task 4: Move Your Alert to a New Incident
Task 5: Set Incident Score Manually
Task 6: Clean Up: Delete Your Scoring Rule
The Bulleted numbers are added here to aid the student in identifying how to achieve
this effect.
4. Click the +Add Scoring Rule button on the upper right.
5. Review the content of the Create New Scoring Rule dialog box.
6. Enter the following rule details in the fields:
Rule Name: ####B (#### is your ID and B is for Base)
Score: Give any score from the interval 1-10.
Base Rule: Root
Comment: ####B
Apply score only to first alert of incident: Uncheck this option.
Hint: Unchecking means that not only the first, but also subsequent alerts matching the
alert condition will receive a score of your choice.
7. To create the rule condition, perform the followings in the filter area:
a. Click Select field and select Host.
b. Click Contains and replace it with (=).
c. Click Value and enter ####-winpoint1, your endpoint hostname.
d. Click the enter icon or press the Enter key.
9. Click Create.
Note that the Create action does not save rules. Don’t click Save until instructed to do
so.
10. View the rules in the Scoring Rules table. Find your newly created rule.
11. Click Save. Do you see your CSP username in Created By now?
12. Note the Rule ID of your rule for reference in subsequent tasks.
Note: In the dialog that opens, the Rule based score option is selected. The other option
Set score manually is to manually change the score of an incident.
7. Find your scoring rule in the table using the Rule Id or Rule Name column.
8. Check the score your alert added in the Total Score column.
Question: Does Total Score change when you reproduce the same alert?
It depends on whether you have selected the option Apply score only to first alert of
incident in the rule. You can edit the scoring rules and change this setting.
9. Click Cancel to exit.
6. Notice the two options under Define Destination Incident for specifying destination
incident.
7. Select Create new Incident:
Tasks
Task 1: Open Artifacts in Hash View
Task 2: Get Started With Hash View
Task 3: Review the Hash View Graphic
Task 4: Change Clustering Options
2. Review the graphic and note how the graphic visualizes the search results.
You do not see the search results directly. Instead, you see the interactive graph that
shows the results.
3. Notice that in the graphic:
a. The file hash node is displayed in blue. This is the file hash we searched for.
Information about color coding: The examined file is displayed in blue or red,
corresponding Benign or Malware. For example, the file shown below is malicious.
b. The file wcript.exe (5954…d9eb) was called by cmd.exe. This is the primary
(Initiating Process) node.
Lab Objective
At the end of this lab session, you should be able to:
● Investigate alerts in Causality View
Activities
Activity 3.1 Analyze Alerts in Causality View
WScript.Sleep(2000)
objShell.Exec("mshta.exe")
WScript.Sleep(4000)
objShell.Exec("powershell -ep bypass -windowstyle hidden -e ZABp...")
Tasks
Task 1: Simulate a Behavioral Attack
Task 2: Open the Alert in Causality View
Task 3: Open the Alert in Causality View: Details Section
Task 4: Open the Alert in Causality View: Events Section
a. There are three nodes in the graph: two process nodes, and an alert node (the red
exclamation mark).
Note: Depending on your client environment setup, you may also see a client terminal
session node.
b. The wscript.exe node is labeled CGO.
c. Only the wscript.exe node created some alerts.
d. The mshta.exe node has a single child, indicated by the number inside the icon.
e. The icon of a selected node changes its background color to blue.
f. Depending on your node selection in the graph, the data in the Details and Events
sections (Sections 3 and 4) changes.
5. Check if there is the icon in front of the process names.
The PROCESS INFORMATION dialog summarizes data shown in the Details section.
7. Right-click the mshta.exe node and perform the following steps:
a. Review the applicable actions on this node.
b. Verify that Terminate is disabled (because the process is not running).
c. You have already found that mshta.exe had only one child process. To add it to the
graph, click the View Children action.
8. Right-click the wscript.exe node and perform the following steps:
a. Review the applicable actions for this node.
b. Click Show Parent to add a node to the graph for the parent process of wscript.exe.
c. Compare your graph with the following:
5. Now click on the File tab in the pane and view all file actions performed by wscript.exe.
This includes creating, modifying and reading files.
6. Answer the question: How many different file operations can you see in the table,
including File Write Path in DESCRIPTION?
7. Open File Explorer to C:\Lab\Malware\Views\ and then open VirLockViews.vbs in
Notepad++ and locate the related script statements about these file operations, such as:
Lab Objective
At the end of this lab session, you should be able to:
● Upload custom Python scripts to the management console
● Remotely execute scripts on endpoints
Activities
Activity 4.1 Execute Scripts on Endpoints
Tasks
Task 1: Verify Sign-In User’s Role
Task 2: Create a Script Library Entry
Task 3: Run Your Script
Task 4: Clean Up: Delete Your Script
The cnt parameter is the number of echo requests to send. It is the option -n in the
Windows ping command.
11. Click Output and verify that Output Type is set to Auto Detect.
12. Click Create in the lower-right corner.
3. Click Next.
4. Select your endpoint ####-winpoint1 as the targeted endpoint, and then click Next.
5. Review Summary and click Run.
6. To track how the script is progressing, click All Actions in the ACTION CENTER
pane.
7. Using either DESCRIPTION or CREATED BY, find your script action.
8. Right-click the action and click Additional data to open the Detailed results dialog box.
9. Review the header:
Lab Objective
At the end of this lab session, you should be able to:
● Build search queries of any type
● Work on the results table
● Manage queries in the Query Center
● Work with scheduled queries
Activity
Activity 5.1 Build and Manage Search Queries
Tasks
Task 1: Build a File Search Query
Task 2: Work on the Results Table
Task 3: Manage Queries in Query Center
Task 4: Work with Scheduled Queries
Task 5: Clean Up: Delete Your Scheduled Query
12. Notice the options on the lower right of the page for when to run the query:
13. Click the calendar icon , to review the scheduling options, then click Cancel.
14. Click Run to run the query at once.
Cortex XDR starts running your query as a foreground task; until it completes the search,
you cannot navigate in the management console.
5. To modify query criteria, click the icon at the end of the query definition.
6. In FILE, change NAME to virlock*.vbs, then click Run, and then perform the following
steps in the Results table:
a. Check the number of entities found.
b. Find one row where SRC_PROCESS_NAME is wscript.exe.
c. Right-click the row to open the shortcut menu and verify that you can pivot to the
Investigate Causality Chain actions Open Card and Open Timeline are available.
Note that when you change the query definition and run it, Cortex XDR creates a new
query with the same name but different Query ID. In the next task, you will review the
queries in the Query Center of the management console.
Query Center displays all queries, including all executions of scheduled queries.
Therefore, it is the Execution ID that uniquely identifies queries in Query Center, as
shown in the following:
12. Notice the message that says Query execution completed, and then click View to open
the Results page.
Lab Objective
At the end of this lab session, you should be able to:
● Create and manage IOC rules
● Create and manage BIOC rules
● Create rules exceptions
Activities
Activity 6.1 Managing IOC Rules
Activity 6.2 Managing BIOC Rules
Activity 6.3 Custom Prevention Rules
Tasks
Task 1: Import a List of Indicators as IOC Rules
Task 2: Trigger Your Rule
Tasks
Task 1: Explore the BIOC Rules Table
Task 2: Create a BIOC Rule
Task 3: Trigger Your Rule
Note that the EED is loaded every 5 minutes. So, it can take up to 5 minutes after
running PowerShell for the alert to show.
5. After you locate the alert, verify that:
a. The alert Name is equal to the BIOC rule name.
b. The alert Severity is High as specified in the rule definition.
c. The alert Category is Tampering as specified in the rule definition.
Tasks
Task 1: Explore the BIOC Rules Table
Task 2: Test Your BIOC Rule
Task 3: Create a Restrictions Profile
Task 4: Create a Custom Prevention Rule
Task 5: Test Your Custom Prevention Rule
Task 6: Delete Your Custom Prevention Rule
4. Click Add.
Lab Objective
At the end of this lab session, you should be able to:
● Investigate files using their hash values in the Hash View
● Investigate IP addresses in the IP View
Activities
Activity 7.1 (*) Activate and Register a Broker VM
Activity 7.2 Scan IP Ranges with Network Mapper
Activity 7.3 Investigate Assets Using IP View
Tasks
Task 1: Generate an Authentication Token
Task 2: Register Your Broker VM
Task 3: Verify Activation of Your Broker VM
4. Read the warning: “Notice! This token will not be accessible once you close this
window.”
5. To copy the token, click the icon next to the token .
6. Make sure that the icon changed to .
7. Open a text file and paste the token.
8. Click Done to close the dialog box.
9. Click Save.
10. Go to the section Proxy Server and read the introduction: “Define a proxy server address
to route broker communication.”
11. Check the settings in Proxy Server, but do not make any changes. Your Broker VM can
connect directly to the internet.
Note: Do not confuse this section with the proxy service provided to Cortex XDR agents
by a Broker VM. The settings here are for a proxy server needed by a Broker VM if the
VM must connect to the internet through a proxy.
12. Skip all the other sections, including NTP and SSH Access, and scroll down to the
bottom of the page.
13. Find the Register button at the bottom and click Register.
14. Copy and paste the authentication token that you created earlier to the TOKEN field.
15. Click Register and wait until you see the confirmation message Registration Complete.
Note: Registration of your Broker VM can take up to 30 seconds.
Where the blurred text is the unique ID of your Broker VM assigned by the Cortex XDR
instance.
3. Go to the Broker VM table in the management console at Settings > Configurations >
Broker VM.
4. Find your Broker VM in the table by finding your Broker VM ID in the Device Name
column.
5. Check the APPS column and notice that no applets have been activated yet.
Tasks
Task 1: Create New IP Address Ranges
Task 2: Activate Network Mapper
10. Hover the mouse over your Network Mapper and review the pop-up dialog. Do you see
any detected hosts?
Note: Your table may differ from this table depending on your lab environment IP
configuration. Also, because all student endpoints have the same IP network
configuration, it is impossible to determine which Network Mapper in the classroom is
reporting unmanaged assets. Remember that a Network Mapper primarily reports
unmanaged assets; therefore, you may not see XDR Agent in the Source column for your
endpoint even though its IP address is in the range you defined.
Tasks
Task 1: Open IP View
Task 2: Change Clustering Options
192.168.1.10 is the gateway. But, depending on the actual lab implementation in your
case, you may see a different IP for the gateway.
4. In CLUSTER DATA BY:
a. Change the options as follows, click Apply, and review the graph:
Lab Objective
At the end of this lab session, you should be able to:
● Become familiar with the XQL development environment in the management console
● Become familiar with XQL language syntax
● Write simple XQL queries
● Become familiar with the schema of the default dataset
● Visualize results tables
Activities
Activity 8.1 Get Started with XQL Development Environment
Activity 8.2 Create XQL Queries with Multiple Stages
Activity 8.3 Visualize Query Results
Tasks
Task 1: Get Started with XQL Editor
Task 2: Run Your Query
11. To get an error description, hover the mouse over the icon :
An “operator” is missing. The dataset stage expects a dataset name.
12. Type a dummy dataset name, myset1, after an equal sign (=) with spaces on either side.
13. Notice that this time, myset1 is underlined to indicate that it is not a valid dataset:
A dataset name is invalid, it doesn’t exist. A valid dataset must be provided before the
underline and error indicator disappears.
14. Delete myset1, and then click Ctrl + Space to see if a suggestion list is provided:
16. Note the color coding; for example, XQL keywords are displayed in green.
There should no longer be an “X” indicating an error, nor should there be a red
underline.
Tasks
Task 1: Create a Query With Config and Filter Stages
Task 2: Focus on Specific Fields Using Fields Stage
Task 3: Shape the Results Table
Task 4: Save Your Query
Tasks
Task 1: View Results Table as a Histogram
Task 2: View Results Table as a Graph
Lab Objective
At the end of this lab session, you should be able to:
● Create datasets using XQL
● Create datasets by importing files
● Manage datasets, including changing the default dataset
● Create Cortex XDR API keys
● Use the Cortex XDR API to insert alerts externally to Cortex XDR
Activities
Activity 9.1 Create and Manage Datasets
Activity 9.2 Insert External Alerts Using XDR API
Tasks
Task 1: Create a Dataset Using XQL
Task 2: Manage Your Datasets
Task 3: Create a Dataset by Importing
Task 4: Clean Up: Delete Your Datasets
c. Click the link Use In Query in the lower-right corner of the right pane.
3. Run the query to test and check the results table.
4. Click the Schema tab to open.
5. Verify that there are 940 fields in the dataset.
Note: Next to the word Schema, the console will say “Found # results.” This number
represents the number of schema currently in the Cortex XDR console and may be
different in later Cortex XDR versions.
Tasks
Task 1: Create Your API Key
Task 2: Enter Communication Parameters
Task 3: Review the External Alert
Task 4: Run the Script to Insert the Alert
Task 5: Debug the External Alert
11. Click Save, and then review the Generated Key dialog. Read the message: “Notice! This
key will not be accessible once you close this window.”
12. To copy your newly generated key, perform either of the following:
a. Highlight the entire key using your mouse, and then press Ctrl + C.
b. Click the icon .
13. Go to the newly created file in Notepad++, paste the key (Ctrl + V), and save the file.
14. Return to the management console and click Close to close the dialog box.
15. In the API Keys table, find your key using Created By and look for your name or
possibly the Comment column looking for ####.
16. Verify the role as Instance Administrator and note the key ID. You’ll need this Key ID
later, so either remember it or write it down.
Note: Your studentId, keyId and key will vary from the example above.
6. Save the file mySettings.txt.
8. To open the incident that contains this alert, right-click the alert and select Pivots to
views > View related incident in the shortcut menu.
You may need to wait for this action to be available; check the Incident ID column.
9. Now click the Key Assets & Artifacts tab if it is not opened by default:
10. Notice that the IP address shown as an artifact is the IP address in the JSON file:
"remote_ip": "192.168.2.25"
You can also see this IP address as an artifact under "Additional artifacts found" in the
Timeline tab.
11. Rerun the script from the command line as follows, and then open and refresh the Alerts
table in the management console:
4. Scroll down until you see "original_alert_json" in the JSON content. Review and
compare the content under this key, as follows: