Slide 1

Slide 1 text

Open Source Malware Hunting Lab Daisuke Arai

Slide 2

Slide 2 text

Who am I? NAME: DAISUKE ARAI Job: Security Engineer/Weekend Researcher X Account: @momomopas Recent joy: Obtaining the Certified CyberDefender certification.

Slide 3

Slide 3 text

Intro ・The reason I wanted to create this LAB is that I suddenly thought I would like to analyze it like THE DFIR Report.

Slide 4

Slide 4 text

This Time's Goal Create an environment that allows for analysis similar to THE DFIR Report.

Slide 5

Slide 5 text

How are they analyzing? ● Analysis tools such as Defender for Endpoint and Splunk are being used, as can be inferred from the report. ● The fact that they are conducting lateral movement analysis suggests that the environment is close to that of an enterprise.

Slide 6

Slide 6 text

Open Source Malware Hunting Lab CAPEv2 Sandbox Fog Security Onion Velociraptor Elastic Defend

Slide 7

Slide 7 text

Points for Consideration ● Consideration of Analysis Environment ○ Virtual Environment vs. Physical Environment ○ Virtual Environment ○ Physical Environment ● Consideration of Detection Environment ○ SIEM, EDR, Sandbox

Slide 8

Slide 8 text

Consideration of the Analysis Environment

Slide 9

Slide 9 text

Virtual vs. Physical

Slide 10

Slide 10 text

Virtual vs. Physical merit demerit Virtual Environment ・Conservation of Resources ・Snapshot and Restore ・Isolation ・Virtual Environment Detection ・Performance Overhead Physical Environment ・Realistic Operating Environment ・Avoidance of Virtual Environment Detection ・Cost ・Difficulties in Environment Setup and Restoration

Slide 11

Slide 11 text

Virtual Environment

Slide 12

Slide 12 text

Which product should you use: Virtual Environment Edition ● Install Windows on each virtual software, use tools designed to detect virtual environments and malware analysis environments to compare the detection results of each tool, and verify which virtual software is most suitable. ● This time, Pafish and al-khaser will be used.

Slide 13

Slide 13 text

Verification environment ■VM Detection Tools ● Pafish:Version 0.6 ● al-khaser:Version 0.81 ■VM Spec ● CPU:4vCPU ● Memory:8192MG ● DISK:128GB ■OS ● Windows10 Enterprise Evalution ● Version:22H2 ● Build :19045.2006 ■Software ● VMware、VirtualBox、KVM/Qemu

Slide 14

Slide 14 text

Number of Detections by Pafish VMware VirtualBox KVM/Qemu Detection Results 10 18 9

Slide 15

Slide 15 text

Number of Detections by al-khaser VMware VirtualBox KVM/Qemu Detection Results 31 45 27

Slide 16

Slide 16 text

Summary VMware VirtualBox KVM/Qemu Pafish 10 18 9 al-khaser 31 45 27

Slide 17

Slide 17 text

Conclusion ● Based on the detection results, KVM/QEMU is the best option when using a virtual environment. ● If using VMware or VirtualBox, the detection of the virtual environment must be taken into account. > >

Slide 18

Slide 18 text

Cho-Physical

Slide 19

Slide 19 text

Which product should you use: Physical Environment Edition ● While the difficulty of restoration has been mentioned as a disadvantage of the physical environment, there are tools available that solve this drawback. Fog Project Clonezilla

Slide 20

Slide 20 text

Which product should you use: Physical Environment Edition merit demerit Fog Project ・Efficient Deployment ・Remote Management ・Open Source Software (OSS) ・Complexity of Setup Clonezilla ・Number of Supported File Systems ・Open Source Software (OSS) ・Booting from Bootable Media ・User Interface

Slide 21

Slide 21 text

Physical Fog Project Clonezilla ○ OSS ▲ ☓ OSS ▲ Sandbox Licensing Setup

Slide 22

Slide 22 text

Conclusion ● FOG, which allows for cloning HDDs and deploying HDDs from a WebUI, is optimal.

Slide 23

Slide 23 text

FOG Project It operates on a Linux-based server and uses PXE (Preboot eXecution Environment) to allow client machines to boot over the network and perform tasks such as image deployment and other tasks.

Slide 24

Slide 24 text

Consideration of the Detection Environment

Slide 25

Slide 25 text

SIEM Tools Description Splunk It is a big data analytics tool that can collect, index, search, analyze, and visualize machine data in real time. Elastic Stack It consists of Elasticsearch, Logstash, and Kibana, and is an integrated platform for searching, analyzing, and visualizing data. Qradar It is IBM's security information and event management (SIEM) solution that assists with threat detection and incident response.

Slide 26

Slide 26 text

SIEM Tools Description Alienvault ossim It is an open-source security information and event management (SIEM) tool that provides threat detection and compliance management. Security Onion A free, open-source platform that provides network security monitoring and logging, supporting threat hunting and incident response. Graylog An open-source log management solution that aggregates, searches, and analyzes logging data to support threat detection and analysis. Opensearch A free and open-source distributed search engine that enables data searching and analysis, forked from Elasticsearch.

Slide 27

Slide 27 text

Consideration of SIEM Splunk Elastic Stack Qradar Alienvault ossim SecurityOnion Graylog Opensearch ○ Commercial / Free ○ ○ ○ Commercial / Free ○ ○ ○ Commercial / Free ○ ○ ▲ Free ▲ ▲ ○ OSS ○ ○ ▲ Free ▲ ▲ ▲ OSS ▲ ▲ Coverage of Data Sources Licensing Setup Analytical Capabilities

Slide 28

Slide 28 text

EDR Tools Description Elastic Defend It provides an integrated security solution to enhance endpoint security and threat hunting as part of the Elastic Stack. OpenEDR An open-source Endpoint Detection and Response (EDR) platform that offers capabilities for collecting, analyzing, and responding to threats on endpoints. Wazuh An open-source platform that provides Security Information and Event Management (SIEM), threat detection, and endpoint security, offering an integrated solution for monitoring and analysis.

Slide 29

Slide 29 text

Consideration of EDR Elastic Defend OpenEDR Wazuh ○ Commercial / Free ○ ○ ▲ OSS ☓ ▲ ▲ OSS ○ ○ Coverage of Data Sources Licensing Setup Analytical Capabilities

Slide 30

Slide 30 text

SandBox Tools Description Cuckoo Sandbox It is an automated malware analysis system capable of analyzing malicious files for Windows, macOS, Linux, and Android. It monitors malware behavior, records malware activity, and reports in a secure environment. CAPEv2 Sandbox Derived from Cuckoo, it is designed to automate the process of malware analysis. It extracts payloads and configurations from malware, detects malware based on payload signatures, and automates the objectives of malware reverse engineering and threat intelligence. DRAKVUF Sandbox An automated black-box malware analysis system utilizing the DRAKVUF engine. It does not require an agent on the guest OS and provides a user-friendly web interface for uploading and analyzing suspicious files. It allows for easy setup and customization and is suitable for experienced users.

Slide 31

Slide 31 text

Consideration of Sandbox Cuckoo Sandbox CAPEv2 Sandbox DRAKVUF Sandbox ▲ OSS ▲ ○ ○ OSS ○ ○ ○ OSS ▲ ○ Frequency of Development Licensing Setup Analytical Capabilities

Slide 32

Slide 32 text

Forensics Tools Tools Description Velociraptor It is an open-source tool for exploring endpoints and collecting artifacts, assisting with tasks in digital forensics and incident response. KAPE (Kroll Artifact Parser and Extractor) A forensic tool aimed at accelerating the collection and analysis of digital artifacts. It is command-line based and extracts and analyzes data from target directories or registries. GRR (Google Rapid Response) An open-source framework for conducting remote forensic operations on live endpoints, supporting data collection and analysis on endpoints, and assisting with incident response.

Slide 33

Slide 33 text

Consideration of Forensics Tools Velociraptor KAPE GRR ○ OSS ○ ○ ○ Commercial / Free ○ ○ ○ OSS ▲ ○ Coverage Licensing Setup Can it be acquired remotely

Slide 34

Slide 34 text

Conclusion ● Detection Environment ○ Security Onion + Elastic Defend ○ Velociraptor ○ CAPEv2 Sandbox

Slide 35

Slide 35 text

SecurityOnion Security Onion is an open-source Linux distribution for network security and incident response. This platform aims to combine a variety of security tools to provide a comprehensive solution. Security Onion is used for network monitoring and log management, as well as for analysis and response when security incidents occur.

Slide 36

Slide 36 text

SecurityOnion Network Endpoint Data Sources Tools Analysis

Slide 37

Slide 37 text

Velociraptor Velociraptor is an advanced open-source tool for digital forensics and incident response (DFIR). This tool is designed for rapid investigations and data collection across a network. Velociraptor is capable of extracting detailed information from endpoints using a complex query language.

Slide 38

Slide 38 text

Velociraptor Collect Data System

Slide 39

Slide 39 text

CAPEv2 Sandbox CAPE is an open-source automated malware analysis system. It’s used to automatically run and analyze files and collect comprehensive analysis results that outline what the malware does while running inside an isolated Windows operating system.

Slide 40

Slide 40 text

CAPEv2 Sandbox ● Traces of win32 API calls that were performed by all processes spawned by the malware. ● Files that were created, deleted, and downloaded by the malware during its execution. ● Memory dumps of the malware processes. ● Network traffic trace in PCAP format. ● Screenshots of Windows desktop taken during the execution of the malware. ● Full memory dumps of the machines.

Slide 41

Slide 41 text

Network Configuration

Slide 42

Slide 42 text

Reference:Money Laptop1:Lenovo ThinkPad E480(About 70,000-80,000 yen at that time) Laptop2:Lenovo ThinkPad x240(Used 20,000~30,000) Mini PC:From an unfamiliar manufacturer(27,980 yen) Switche:TP-Link SG108E(3,544 yen)

Slide 43

Slide 43 text

Flow of Analysis

Slide 44

Slide 44 text

Flow of Analysis No. Action Description 1 Submit Sample Submit the sample to CAPE. Make sure to set a timeout. 2 Wait Wait 3 Collection Before timing out, acquire forensic artifacts with Velociraptor. 4 Restoration Once the timeout period is reached, FOG will execute automatically. 5 Analysis Analyze with Security Onion and Velociraptor.

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

No content

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

Summary ● It is possible to analyze malware even in a physical environment. ● By utilizing OSS tools, an environment can be created that allows for analysis similar to THE DFIR Report. ● In the future, additions such as AD environments and honey files will be made.

Slide 56

Slide 56 text

Thank you.