Kraken
Kraken collects forensic data from a running Windows system: volatile data such as network connections and processes first, then persistent traces such as auto-start entries, execution artifacts, event logs and the USN journal. It runs as a single executable without installation and saves the results as an SQLite database or as JSON, for analysis in your own tools.
Highlights
- Data sets: Collected in the order of volatility (RFC 3227). The most volatile data first.
- File data for referenced files: MD5, SHA-1, SHA-256 and SHA-512 hashes, entropy, version information, PE header data, import hash and the Authenticode signature, embedded or from a catalog.
- No installation: Single executable without dependencies, no .NET runtime required. Runs from a USB stick or a network share.
- Two editions, one engine: Console edition for scripts and remote shells, and a graphical edition for interactive use.
- Time limits: For large data sets (event log, Prefetch, browser history, USN journal).
- Open output: SQLite database for queries, one JSON file, or one JSON file per data set, several at once and optionally compressed.
Requirements and editions
| Edition | File | Use |
|---|---|---|
| Console | cysirt.kraken.console.exe | Command line, scripts, remote shells |
| UI | cysirt.kraken.ui.exe | Configuring and running a collection with an user interface |
- Windows 10 / 11: Both editions are available for 64-bit (x64) and 32-bit (x86) Windows. Use the 32-bit edition only on 32-bit Windows: on 64-bit Windows, a 32-bit program sees a redirected view of the registry and the system folder.
- Administrator rights: Recommended. Without them, some data sets are skipped and others are incomplete.
- Traces on the system: The console edition writes only to the output folder and the log file. The graphical edition additionally unpacks its display libraries (about 8 MB) into the temp folder of the user (%TEMP%\.net\cysirt.kraken.ui). Like any program, both leave the usual traces of a program run, for example a Prefetch entry. For the smallest footprint, use the console edition.
Console edition
-
Unpack
cysirt.kraken.console.exefrom the zip file to a USB stick or a network share, and start it on the system. - Open a command prompt or PowerShell window, preferably started as administrator for complete results:
-
Run e.g.
.\cysirt.kraken.console.exe collect --all --output-directory [directory]
Usage
- Data Sets: At least one data set and the output folder are required.
-
Arguments: Arguments of a data set follow its option, separated by spaces, e.g.
--event-log include-message days=7. -
Complete data set: With
--all, a data set option given in addition only sets the arguments of that data set:--all --usn-journal no-file-object. - Case: Options and arguments are case-insensitive.
-
Help:
cysirt.kraken.console.exe --helporcysirt.kraken.console.exe collect --helplists all options.unleashis the same as collect and available for the nerds among us. - Cancellation: Ctrl+C cancels the collection within seconds and removes its output and log file (exit code 3). A second Ctrl+C stops at once and keeps the output as it is, for example while a step that can't be interrupted takes long.
Examples
Everything as database for the analysis and as JSON file for the archive, compressed, with a log file:
.\cysirt.kraken.console.exe collect --all --output-directory [drive]:\[directory] --output-format sqlite json compressed --log-file [drive]:\[directory]\kraken.log
A quick first look at the volatile data:.\cysirt.kraken.console.exe collect --tcp-connection --udp-connection --process --dns-cache --output-directory [drive]:\[directory] --output-format sqlite
Everything, but only the last 7 days of events and file changes, without the file data of the changed files:.\cysirt.kraken.console.exe collect --all --event-log days=7 --usn-journal no-file-object days=7 --output-directory [drive]:\[directory] --output-format sqlite
On a busy server, with the lowest process priority, one JSON file per data set:.\cysirt.kraken.console.exe collect --all --process-priority idle --output-directory \\[fileserver]\[directory] --output-format json-split Data sets
In the order of the collection. Administrator rights shows what is missing without them.
--all collects all data sets. Information about the collection itself is always saved.| Data set | Content | Administrator rights |
|---|---|---|
TCP connections--tcp-connection |
TCP connections with their processes | For the processes of the system |
UDP endpoints--udp-connection |
UDP endpoints with their processes | For the processes of the system |
Processes--process |
Running processes and their loaded modules | For the processes of the system |
DNS cache--dns-cache |
Recently resolved host names of the DNS client | Required |
Services--service |
Windows services, their executables and service DLLs | For the service processes |
Drivers--driver |
Kernel drivers and their files | Not required |
User accounts--user-account |
Local user accounts and their groups | Not required |
Auto-start entries--auto-start |
Run keys, Winlogon, startup folders, scheduled tasks, WMI subscriptions and further auto-start locations | Not required |
Application Compatibility Cache--application-compatibility-cache |
ShimCache entries of programs | Not required |
AmCache--am-cache |
Installed and executed programs | Required |
Prefetch
--prefetch |
Program runs and the files the programs loaded | Required |
Browser history--browser-history |
Visited URLs, visits and downloads of Chrome, Edge, Brave, Vivaldi, Opera and Firefox for all user profiles | For the profiles of other users |
Event log--event-log |
Forensically relevant events of the live and archived event logs, including all Sysmon events and high volume events such as firewall connections and object access, with the period each log covers and the logging configuration (audit policy, PowerShell logging, Sysmon) | For the Security and Sysmon event logs |
USN journal--usn-journal |
File listing of the NTFS volumes and the change records of their journals | Required |
Arguments of data sets
Without arguments, Kraken collects the whole available period, with the file data of all referenced files.
| Argument | Data sets | Effect |
|---|---|---|
no-file-object |
All data sets with file references | Without the file data (hashes, signature) of the referenced files; their paths stay. Faster, smaller output. |
days=<days> |
Prefetch, browser history, event log, USN journal | Only the last number of days, from 1 to 36500. Prefetch: files with a run in the period. USN journal: only the changes, the file listing stays complete. |
include-message |
Event log | Adds the message text of the events, in the language of the system. |
resolve-hosts |
TCP connections, UDP endpoints | Resolves the host names of the addresses by reverse DNS lookups. This causes network traffic, and the operator of the DNS server responsible for an address may notice the lookup. |
Further options
| Option | Effect |
|---|---|
--output-directory <folder> |
Output folder, created if it doesn’t exist. Required. |
--output-format <formats> |
Output formats, several at once: sqlite, json or json-split (not both JSON formats together), and compressed to zip the files. Required. |
--data <data> |
include-portable-executable-function-export and include-portable-executable-function-import add the exported and imported functions to the data of all collected executables and DLLs. This makes the output considerably larger. |
--log-level <levels> |
Log levels to show: information, warning, error, notice, section, debug. Default: all except debug. |
--log-file <file> |
Writes the log to a file as well; entries are added to an existing file. |
--process-priority <priority> |
idle, normal (default) or high. Idle keeps the system responsive, high finishes sooner. |
--no-progress |
Hides the status line below the log (spinner, current data set, elapsed time). |
Exit codes
| Meaning | |
|---|---|
0 |
All data sets were collected. |
1 |
Invalid command line or fatal error, nothing was collected. |
2 |
At least one data set failed or returned no data. The log names the reason. |
3 |
Cancelled with Ctrl+C. The output and the log file of the run are removed. |
UI edition
-
Unpack
cysirt.kraken.ui.exefrom the zip file to a USB stick or a network share, and start it on the system. - If Kraken isn't running as administrator, a banner offers Restart as administrator.
- Choose the data sets on the Data sets page. All are switched on by default.
- Check the output folder on the Output page.
- Click Start collection. The Collection page shows the progress and the log.
- When the collection has finished, Open output folder shows the results.
Usage
- Data sets: The data sets in four groups (network and processes, system, execution traces, activity), each with a switch. Expanding a data set shows its settings: File data, the Time period (All or Last days) and further arguments, for example the message text of the event log. An Administrator badge marks data sets that can't be collected without administrator rights. Under All data sets, the exported and imported functions of the collected executables and DLLs can be added.
-
Output: The output folder, the formats (SQLite database, JSON as one file or one file per data set, Compress) and the log file. By default, the output folder is created next to Kraken, for example on its USB stick, as
kraken-<computer>-<date>-<time>Z(time in UTC). The log filekraken.logis written into the output folder; entries are added to an existing file. - Collection: The progress with the current data set, Cancel, the result and the log, filtered to All, Warnings and errors or Errors. Cancel stops the collection within seconds and removes the collected data and the log file of the run.
- Settings: The log levels and the process priority.
-
Command line: Copy command line at the bottom left copies the console command with the same settings, for example to run the same collection on other systems via
cysirt.kraken.console
Output
Kraken saves the data in the formats you choose with
--output-format, several at once. All formats contain the same data, with the same names and values.
| Format | Files | Use |
|---|---|---|
sqlite |
kraken.sqlite |
All data sets in one SQLite database, for queries and analysis tools |
json |
kraken.json |
All data sets in one JSON file, each data set under its name |
json-split |
meta.json, process.json, … |
One JSON file per data set, named after the data set |
compressed |
kraken.sqlite.zip, kraken.json.zip, process.json.zip, … |
Each file of the chosen formats in its own ZIP file |
[Drive]:\[Directory]
├── kraken.sqlite
├── kraken.json
└── kraken.log SQLite database
-
One table per data set, named after the data set with underscores, for example
processortcp_connection. Each row is one entry; the columns have the names of the JSON properties. Values of nested objects are columns with the path as prefix, for exampleaccount_user. -
Lists and dictionaries are child tables, for example
process_modulesorevent_log_events._parentIdrefers to the_idof the parent row,_positionkeeps the order, and a column of the parent row holds the number of entries. Lists of plain values, for example the groups of a user, are a column with JSON text, which SQLite can query withjson_each. -
Each file only once: The file data of all data sets is in the table
file_object, one row per file, and the data sets refer to it by its_id._kindtells a module (executable or DLL), a shell link or a plain file apart. A DLL loaded by a hundred processes is stored once. -
The schema describes itself:
schema_versionholds the schema and Kraken version,schema_tableandschema_columnlist every table and column with the JSON property it comes from. - Safe when stopped by force: Each data set is saved in its own transaction. If Kraken is stopped by force, for example by a crash, a closed console window or a second Ctrl+C, the database contains the data sets saved until then. Cancelling removes the output instead.
An example: modules without a valid signature in processes with network connections.
SELECT DISTINCT p.name, f.fileName, f.authenticode_state
FROM tcp_connection t
JOIN process p ON p.id = t.process_id
JOIN process_modules m ON m._parentId = p._id
JOIN file_object f ON f._id = m.fileObject
WHERE f.authenticode_state <> 'Valid'; Data
-
metadescribes the collection: time (UTC), time zone and UTC offset, user, administrator rights and privileges, computer and domain, Windows version and build, Kraken version, and whether Windows updates the last access times of files, which matters when you interpret them. - File data of a referenced file: path, size, attributes and timestamps; MD5, SHA-1, SHA-256 and SHA-512 hashes and the Shannon entropy; version information; for executables and DLLs the binary type, the module type and the import hash; the Authenticode signature with its state, signers and timestamps, embedded or from a catalog.
- Empty values are left out of the JSON and empty in the database. A data set without any entries has no data in JSON and an empty table in the database.
-
Volatile data isn't lost: If a format can't save a data set, for example because the drive is full, Kraken saves it in its own JSON file instead. If a ZIP file can't be written, the file stays uncompressed.
kraken.jsonis put together at the end; after a collection stopped by force, the data sets saved until then are in the folder.kraken-jsonv, one file per data set. - Cancelling removes everything of the run: Cancel in the graphical edition or Ctrl+C in the console removes the output and the log file of the run, and the output folder if the run created it. Files that were in the folder before stay; a log file that existed before keeps its earlier entries.
-
Size: The event log and the processes usually take tens of megabytes; the database is smaller than JSON, because each file is stored only once. The USN journal can take several gigabytes; plan the space on the target drive, or limit it with
days=.
Tips for practice
- Run Kraken as administrator: Without administrator rights, AmCache, Prefetch, the DNS cache and the USN journal are missing, and other data sets are incomplete.
- Write the output to an external drive or a network share, not to the system drive of the examined system: new files can overwrite traces of deleted files.
- Volatile data first: If time is short, collect the network connections, processes and DNS cache in a first run, and the rest in a second.
-
Leave
resolve-hostsoff if an attacker shouldn't notice the investigation: the lookups can reach DNS servers the attacker controls. -
Limit large data sets with
days=, anduse no-file-objectwhere hashes aren't needed. - Keep the log file with the results: it documents the settings and the course of the collection.