Connor Panso

Questions or suggestions, note to cpanso at outlook dot com

Automated Threat Detection and Response Lab

This page highlights my home cybersecurity lab environment set up using VMware Workstation Pro, along with both Windows and Ubuntu virtual machines (VMs). It provides a detailed overview of the entire setup process, including downloading and installing the required software, configuring the VMs, and deploying essential tools for security testing and analysis.

Summary: This lab focuses on enhancing cybersecurity defenses through the use of tools like LimaCharlie EDR, YARA, Sliver C2, and VMware Workstation Pro. I configured automated detection and response rules to identify and block malicious activities, such as ransomware attempts to delete volume shadow copies. By implementing YARA signatures, I automated malware detection for both files and processes. These improvements enhance the ability to respond quickly to threats and maintain a secure environment. The lab emphasizes the importance of continuous testing, refining detection rules, and adapting capabilities to stay ahead of emerging cyber threats.

Installing VMware Workstation Pro

Windows VM Setup Screenshot

Configure a Windows VM

Windows VM Setup Screenshot Windows VM Setup Screenshot Windows VM Setup Screenshot

Install Ubuntu Server VM

Windows VM Setup Screenshot

Set Up Network Configuration in Ubuntu VM

Windows VM Setup Screenshot

Prepare the Windows VM for Security Testing

Defender Configuration Screenshot

This setup will be the basis for performing various security tests and experiments.

Deploying LimaCharlie EDR on Windows VM

LimaCharlie is a robust SecOps Cloud Platform that provides cross-platform Endpoint Detection and Response (EDR), log management, data ingestion, and threat detection capabilities. This section outlines how to install LimaCharlie on your Windows VM, which is available for free for personal use on up to two systems.

Register for a LimaCharlie Account

Configure Your Organization in LimaCharlie

Windows VM Setup Screenshot

Installing the LimaCharlie Sensor on Your Windows VM

LimaCharlie Installation Screenshot

Set Up LimaCharlie to Collect Sysmon Logs

LimaCharlie Installation Screenshot

With this configuration, LimaCharlie will now collect Sysmon logs alongside its EDR telemetry, providing comprehensive event data for security monitoring and analysis.

Configure the Attack System on the Linux VM

We will set up an attack system using the Linux VM. This will involve accessing the VM via SSH and installing the Sliver Command & Control (C2) framework to carry out cybersecurity operations.

Connecting to the Linux VM via SSH

Installing the Sliver C2 Server

Create and Deploy the C2 Payload

We will now generate a Command & Control (C2) payload using Sliver and deploy it to the Windows VM for testing purposes. This involves creating the payload on the Linux VM, transferring it to the Windows VM, and initiating a command and control session.

Create the C2 Payload

Transfer the C2 Payload to the Windows VM

Initiate the Command and Control Session

Basic Commands for C2 Interaction

These procedures allow you to generate and deploy a C2 payload, establish a control session, and interact with the compromised Windows VM. By examining network connections and active processes, you gain valuable insights into the security status of the target system, including identifying any defensive measures in place.

Monitor EDR Telemetry in LimaCharlie

With the C2 payload running on the Windows VM, we will use the LimaCharlie web UI to monitor telemetry data and gain insights into the activities occurring on the endpoint. This involves exploring various aspects of LimaCharlie, such as process monitoring, network activity, and file system interactions.

LimaCharlie Installation Screenshot

Examining Process Information

Investigating Network Activity

LimaCharlie Installation Screenshot

Inspecting the File System

EDR Telemetry Screenshot

Utilizing the Timeline View

By leveraging LimaCharlie’s detailed views and analysis tools, you can monitor suspicious activities and understand how attackers interact with compromised systems. Knowing the difference between normal and abnormal behaviors is crucial for effectively detecting and responding to security incidents.

Simulating Adversarial Behavior

We will simulate adversarial activities using the Sliver C2 session to perform actions commonly associated with cyber threats. This will help us learn how to detect and respond to such activities using our security tools.

Reconnect to the Sliver C2 Session

Checking Privileges

EDR Telemetry Screenshot

Dumping LSASS Process for Credential Theft

Detecting Adversarial Activity

Switch to the LimaCharlie web UI to detect the LSASS dump attempt:

EDR Telemetry Screenshot EDR Telemetry Screenshot

Creating a Detection and Response (D&R) Rule

EDR Telemetry Screenshot

Configuring the Response Action

Testing and Saving the Rule

EDR Telemetry Screenshot

Simulating these adversarial actions and configuring detection rules provides practical experience in identifying and responding to malicious activities. This exercise demonstrates the use of EDR telemetry and detection logic to monitor sensitive processes like LSASS for unauthorized access attempts.

Testing Detections with Repeated Adversarial Activity

We will repeat the adversarial action to validate the detection rules. By rerunning the LSASS dump, we can verify that our LimaCharlie detection setup correctly identifies this malicious activity.

Re-running the Procdump Command

Reviewing Detections in LimaCharlie

EDR Telemetry Screenshot

Analyzing Detection Results

By repeating the malicious activity and reviewing detection results, you can confirm that your custom detection rules are effectively identifying suspicious actions. This hands-on practice reinforces your understanding of using EDR tools for monitoring and protecting against real-world threats.

In a production environment, it’s crucial to fine-tune detection rules to minimize noise and focus on genuine threats. Regular testing and adjustments will enhance the accuracy and effectiveness of your security monitoring strategy.

Preventing Malicious Activities

Volume Shadow Copies allow for easy restoration of files or entire file systems, making them a vital component in recovering from ransomware attacks. It’s a predictable behavior that one of the first actions of ransomware is to delete these copies to prevent recovery.

The command commonly used to delete volume shadow copies is:

vssadmin delete shadows /all

This command is rarely executed in healthy environments (though some backup or software management tools might occasionally use it), making it a suitable candidate for a blocking rule with low false positives and high threat relevance.

Setting Up Detection

Start your Linux and Windows VMs and return to your Sliver C2 shell.

Reviewing Detection in LimaCharlie

EDR Telemetry Screenshot

Creating a Detection & Response (D&R) Rule

Based on the observed detection, create a D&R rule:

EDR Telemetry Screenshot

Testing the Blocking Rule

Return to your Sliver C2 session and rerun the command to delete volume shadows:

vssadmin delete shadows /all
EDR Telemetry Screenshot

If you see output like “Shell Exited,” it indicates the process was effectively terminated. In a real-world ransomware scenario, this could mean stopping the ransomware payload or lateral movement tool responsible for the attack.

Automating Malware Detection with YARA

This focuses on leveraging the advanced capabilities of our EDR sensor to automatically scan files and processes for malware using YARA signatures.

Setting Up Automated YARA Scans in LimaCharlie

We’ll configure our LimaCharlie instance to automatically detect certain file and process activities and trigger YARA scans.

Adding a YARA Signature for Sliver C2 Payload

Setting Up Detection & Response (D&R) Rules for YARA Detections

EDR Telemetry Screenshot

Testing the YARA Signature

We know there’s a Sliver implant in the Downloads folder on our Windows VM. Let’s manually initiate a YARA scan to verify the setup:

EDR Telemetry Screenshot

Automating YARA Scans on New Executables

Automating YARA Scans on Processes Launched from Downloads

Triggering the New Rules

EDR Telemetry Screenshot

To test our new rules, simulate a new EXE appearing in the Downloads directory by moving the Sliver payload out and back into the Downloads folder:

Conclusion

Throughout this page, we've implemented advanced detection and response strategies to enhance our cybersecurity posture. By deploying LimaCharlie EDR and configuring automated YARA scans, we've gained the ability to identify and react to potential threats swiftly. We've also explored how to block malicious activities effectively, such as the deletion of volume shadow copies, which are common in ransomware attacks. These steps are crucial in building a robust defense against various cyber threats.

Moving forward, the next steps will involve refining these detection rules to reduce false positives and increase efficiency. We'll also explore integrating additional threat intelligence sources and expanding our automated scanning capabilities to cover more types of malicious behavior. By continuously enhancing our detection and response mechanisms, we can better protect our environment from both known and emerging threats, keeping our systems secure and resilient.


Connor Panso