Fenrir IOC Scanner

repository·master·Indexed 21 days ago

https://github.com/neo23x0/fenrir

A lightweight Bash-based Indicator of Compromise (IOC) scanner for Linux, Unix, and OSX. It uses standard system tools like grep, md5sum, and stat to scan for hashes, file names, strings, C2 servers, and files within specific time frames. Configuration is managed via the fenrir.sh script header, and it supports deployment via Ansible using RAM drives to minimize filesystem traces.

Tokens
492
Snippets
1
Records
4
Agent score
23%

What's inside Fenrir

  1. What Fenrir scans for (IOC types)

    master

    Fenrir scans for the following Indicators of Compromise (IOCs):

    • Hashes: MD5, SHA1, and SHA256 (utilizing md5sum, sha1sum, and sha -a 256).
    • File Names: Performs substring matching against the full path (e.g., searching for temp/p.exe will match /var/temp/p.exe).
    • Strings: Uses grep to search for specific strings within files.
    • C2 Servers: Checks for Command and Control (C2) server strings within the output of lsof -i and lsof -i -n.
    • Hot Time Frame: Uses stat to identify files created within a specific epoch time stamp range (min and max).
  2. Deploy Fenrir using Ansible

    master

    To maintain a low footprint on remote systems, Fenrir can be deployed using an Ansible playbook. The deployment pattern involves:

    1. Creating a RAM drive on the remote system.
    2. Copying the Fenrir binary to the remote system.
    3. Executing the scan.
    4. Retrieving the logs from the RAM drive.

    This approach ensures that the tool leaves minimal traces on the target filesystem.

  3. Run the Fenrir IOC scanner

    master

    Fenrir is a Bash script used to scan Linux, Unix, and OSX systems for Indicators of Compromise (IOCs). To run a scan, execute the script and provide the starting directory for the recursive scan as a positional argument.

    All scan settings (such as exclusions and IOC files) are configured directly within the header of the fenrir.sh script.

    ./fenrir.sh DIRECTORY
  4. Configure Fenrir scan settings

    master

    Fenrir is designed to be lightweight and requires no installation or agent. You can customize the scan behavior by modifying the configuration variables located in the header of the fenrir.sh script.

    Configurable parameters include:

    • Directory Exclusions: Directories to skip during the recursive walk.
    • File Extensions: Specific extensions to include or target for scanning.
    • File Size Exclusions: Limits to skip files that are too large/small to optimize scan speed.
    • IOC Files: The source files containing the hashes, names, and strings to look for.