Home

Awesome

CyLR

Build Status

CyLR — Live Response Collection tool by Alan Orlikoski and Jason Yegge

Please Read

Open Letter to the users of Skadi, CyLR, and CDQR

Videos and Media

What is CyLR

The CyLR tool collects forensic artifacts from hosts with NTFS file systems quickly, securely and minimizes impact to the host.

The main features are:

CyLR uses .NET Core and runs natively on Windows, Linux, and MacOS. Self contained applications for the following are included in releases for version 2.0 and higher.

SYNOPSIS

Below is the output of CyLR:

$ CyLR -h
CyLR Version 2.2.0.0

Usage: CyLR [Options]... [Files]...

The CyLR tool collects forensic artifacts from hosts with NTFS file systems
quickly, securely and minimizes impact to the host.

The available options are:
-od
        Defines the directory that the zip archive will be created in.
        Defaults to current working directory.
        Usage: -od <directory path>
-of
        Defines the name of the zip archive will be created. Defaults to
        host machine's name.
        Usage: -of <archive name>
-c
        Optional argument to provide custom list of artifact files and
        directories (one entry per line). NOTE: Please see
        CUSTOM_PATH_TEMPLATE.txt for sample.
        Usage: -c <path to config file>
-d
        Same as '-c' but will collect default paths included in CyLR in
        addition to those specified in the provided config file.
        Usage: -d <path to config file>
-u
        SFTP username
        Usage: -u <sftp-username>
-p
        SFTP password
        Usage: -p <password>
-s
        SFTP Server resolvable hostname or IP address and port. If no port
        is given then 22 is used by default.  Format is <server name>:<port>
        Usage: -s <ip>:<port>
-os
        Defines the output directory on the SFTP server, as it may be a
        different location than the ZIP generate on disk. Can be full or
        relative path.
        Usage: -os <directory path>
-zp
        If specified, the resulting zip file will be password protected
        with this password.
        Usage: -zp <password>
-zl
        Uses a number between 1-9 to change the compression level
        of the archive file. Defaults to 3
        Usage: -zl <0-9>
--no-sftpcleanup
        Disables the removal of the .zip file used for collection after
        uploading to the SFTP server. Only applies if SFTP option is enabled.
        Usage: --no-sftpcleanup
--dry-run
        Collect artifacts to a virtual zip archive, but does not send
        or write to disk.
--force-native
        Uses the native file system instead of a raw NTFS read. Unix-like
        environments always use this option.
--usnjrnl
        Enables collecting $UsnJrnl
-l
        Sets the file path to write log messages to. Defaults to ./CyLR.log
        Usage: -l CyLR_run.log
-q
        Disables logging to the console and file.
        Usage: -q
-v
        Increases verbosity of the console log. By default the console
        only shows information or greater events and the file log shows
        all entries. Disabled when `-q` is used.
        Usage: -v

Default Collection Paths

CyLR tool collects forensic artifacts from hosts with NTFS file systems quickly, securely and minimizes impact to the host. All collection paths are case-insensitive.

Note: See CollectionPaths.cs for a full list of default files collected and for the underlying patterns used for collection. You can easily extend this list through the use of patterns as shown in CUSTOM_PATH_TEMPLATE.txt or by opening a pull request.

The standard list of collected artifacts are as follows.

Windows

System Root (ie C:\Windows):

Program Data (ie C:\ProgramData):

Drive Root (ie C:\)

User Profiles (ie C:\Users\*):

macOS

Note: Modern macOS systems have functionality that will prompt the user to approve on a per-application basis, access to sensitive locations on a system. This can be overridden through modifying the System Preferences to give the CyLR binary and it's parent process (such as Terminal) full disk access.

System paths:

Libraries paths:

User paths:

Other Paths:

Linux

System Paths:

User paths:

DEPENDENCIES

In general: some kind of administrative rights on the target (root, sudo, administrator,...).

CyLR now uses .NET Core and now runs natively on Windows, Linux, and MacOS as a .NET Core app or a self contained executable through the warp packer As a note, the package script will download the warp packer to generate a single binary with the CyLR resources and full CLR runtime for portability. This means that the binary will unpack in a temporary location for execution. According to the warp documentation, these locations are:

Packages cache location:

Runners cache location:

These caches are only created on first execution or when the packed binary is updated.

EXAMPLES

Standard collection

CyLR.exe

Linux/macOS collection

./CyLR

Collect artifacts and store data in "C:\Temp\LRData"

CyLR.exe -od "C:\Temp\LRData"

Collect artifacts and store data in ".\LRData"

CyLR.exe -od LRData

Disable log file

CyLR.exe -q

Collect artifacts and send data to SFTP server 8.8.8.8

CyLR.exe -u username -p password -s 8.8.8.8

Collect to another folder and filename

CyLR -od data -of important-data.zip

Collect USN $J Journal

CyLR --usnjrnl

Collect custom list of artifacts from a file containing paths

The sample custom.txt, requires a tab delimiter between pattern definition and pattern. Lines starting with # will be ignored:

# Static paths are fixed, case-insensitive paths to compare
# against files found on a system. This is the fastest search
# method available, please use when possible.
#
static  C:\Windows\System32\Config\SAM
#
# Glob paths leverage glob patterns specified at
# `https://github.com/dazinator/DotNet.Glob`. This is faster than RegEx and
# should be favored unless more complex patterns are required. Useful for
# scanning for files by name or extension recursively. Also useful for
# collecting a folder recursively.
#
glob    **\malware.exe
#
# Regex paths leverage the .NET Regex capabilities and will search for
# specified patterns across accessible files. This is the slowest option and
# should be saved for unique use cases that are not supported by globbing.
#
regex   .*\Windows\Temp\[a-z]{8}\+*

This can then be supplied to CyLR for a custom collection of just these paths:

CyLR.exe -c custom.txt

Collection of custom paths in addition to the default paths

CyLR -d custom.txt

Custom collection paths

CyLR allows for the specification of custom collection paths with the use of a configuration file provided after -c or -d at the command line. A brief summary of the format is below, though full details are available within the CUSTOM_PATH_TEMPLATE.txt provided in the repository.

The custom collection path file allows for the specification of files to collect from a target system. The format is tab delimited, where the first field is a pattern type indicator and the second field is the pattern to collect.

Pattern Types

There are 4 pattern types, summarized below:

Building

CyLR binaries are available for download, prebuilt for use on macOS, Linux, and Windows operating systems. The following operating systems were tested against:

To build CyLR yourself, follow the below steps:

  1. Install dotnet core on your platform
  2. Clone this repository
  3. Run the following scripts in order:
    1. Linux/macOS: ./scripts/test.sh or Windows: .\scripts\test_win.ps1
    2. Linux/macOS: ./scripts/build.sh or Windows: .\scripts\build_win.ps1
    3. Linux/macOS: ./scripts/package.sh or Windows: .\scripts\package_win.ps1

As a note, the package script will download the warp packer to generate a single binary with the CyLR resources and full CLR runtime for portability. This means that the binary will unpack in a temporary location for execution. According to the warp documentation, these locations are:

Packages cache location:

Runners cache location:

These caches are only created on first execution or when the packed binary is updated.

AUTHORS