kraken – Cross-platform Yara scanner written in Go Resources
Kraken is a simple cross-platform Yara scanner that can be built for Windows, Mac, FreeBSD and Linux. It is primarily intended for incident response, research and ad-hoc detections (not for endpoint protection). Following are the core features:
- Scan running executables and memory of running processes with provided Yara rules (leveraging go-yara).
- Scan executables installed for autorun (leveraging go-autoruns).
- Scan the filesystem with the provided Yara rules.
- Report any detection to a remote server provided with a Django-based web interface.
- Run continuously and periodically check for new autoruns and scan any newly-executed processes. Kraken will store events in a local SQLite3 database and will keep copies of autorun and detected executables.
Some features are still under work or almost completed:
- Installer and launcher to automatically start Kraken at startup.
- Download updated Yara rules from the server.
How to use
Once the binaries are compiled you will have a
kraken-launcher and a
kraken in the appropriate platform build folder.
kraken can be launched without any arguments and it will perform a scan of detected autorun entries and running processes and terminate. It will not communicate any results to any remote server.
kraken can also be launched using the following arguments:
Usage of kraken: --backend string Specify a particular hostname to the backend to connect to (overrides the default) --daemon Enable daemon mode (this will also enable the report flag) --debug Enable debug logs --folder string Specify a particular folder to be scanned (overrides the default full filesystem) --no-autoruns Disable scanning of autoruns --no-filesystem Disable scanning of filesystem --no-process Disable scanning of running processes --report Enable reporting of events to the backend --rules Specify a particular path to a file or folder containing the Yara rules to use
kraken --backend example.com will override the default
BACKEND that was provided during build time.
kraken --report will make Kraken report any autoruns or detections to the configured backend server.
kraken --daemon will execute the first scan and then run continuously. In daemon mode, Kraken will monitor any new process creation and scan its binary and memory, as well as check regularly for any new entries registered for autorun. Enabling
--daemon will automatically enable
--report as well, even when not explicitly specified.
--debug will only display all debug log messages, mostly including details on files and processes being scanned.
--no-process will disable the scanning of autoruns, files stored on disk, and running processes, respectively. Note: these flags do not impact the behavior of kraken when running in daemon mode.
If filesystem scanning is enabled, Kraken will recursively scan the entire root folder (
/ on *nix systems and any fixed drive mounted on Windows systems). Using
--folder you can specify a particular folder you want to scan instead.
--rules the option allows you to specify a path to a file or folder containing the Yara rules you want to use for your scanning. If the compilation of any of these rules fails (for example, because they include modules that are not enabled in the default Yara library), the execution will be aborted. If no
--rules the option is specified, Kraken will attempt to load a compiled rules file using the following order:
- It will look for a compiled
rulesfile in the current working directory.
- It will look for a compiled
rulesfile in the local Kraken storage folder, in case it is running in daemon mode.
- It will attempt to extract the compiled
rulesfile from the embedded assets generated at build time (as explained in the Building section).
If no compiled
rules the file is found, Kraken’s Yara scanner will be disabled and execution will continue without it.
kraken is launched in daemon mode it will look for a configuration file in either the current working directory or in the persistent directory. This configuration file is mostly used to look up the hostname of the backend Kraken will have to connect to. If a configuration file does not exist, it will create one using the default parameters provided during build time (primarily
kraken is launched in normal mode, it will still look for any configuration file, but it will not write one to disk in the case there isn’t one. If no configuration file is found, it will use the default parameters provided during build time (again,
To provide it different parameters you can create a
config.yaml file in the same directory as the
kraken binary using the following format:base_domain: <value>
Alternatively, you can specify a custom backend from the command line using
kraken --backend example.com.
For details on how to install, use and build Kraken you should refer to the User Guide. The original source files for the documentation are available here, please open any issue or pull request pertinent to documentation there.