MCPcopy Index your code
hub / github.com/evilsocket/sauron

github.com/evilsocket/sauron @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
13 symbols 19 edges 5 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Sauron is a minimalistic, YARA based malware scanner with realtime filesystem monitoring written in Rust.

Features

  • Realtime scan of created and modified files supporting Linux inotify, macOS FSEvents, Windows ReadDirectoryChanges and polling for other platforms.
  • YARA engine complete support.
  • Single scan mode to scan a folder, report results and exit.
  • Parallel scanning using a configurable thread pool.
  • Log, text and JSON reporting.

Known Limitations

Due to the filesystem monitoring mechanism, Sauron is extremely lightweight and non invasive as more sophisticated AV solutions, however this comes with the following limitations:

  • Scanning files with an exclusive lock by other processes will likely fail with a Permission Denied error.
  • Malicious files creation and execution won't be blocked but just reported.
  • Fileless malware won't be detected.
  • Detected files won't be linked to originating processes.

Building

cargo build --release

Dependencies

Your system must have libssl-dev installed. For Ubuntu-derivatives this can be installed via sudo apt install libssl-dev.

Running

Assuming you have your YARA rules in ./yara-rules (you can find plenty of free rules online):

sudo ./target/release/sauron --rules ./yara-rules

screenshot

Single Scan

Alternatively you can perform a one-time recursive scan of the specified folder using the --scan argument:

sudo ./target/release/sauron --rules ./yara-rules --scan --root /path/to/scan

You can specify which file extensions to scan (all by default) with the --ext argument:

sudo ./target/release/sauron \
    --rules ./yara-rules \
    --scan \
    --root /path/to/scan \
    --ext exe \
    --ext elf \
    --ext doc \
    --ext docx

Reporting

Various options are available for reporting:

  • --report-clean will also report clean files.
  • --report-errors explicitly report errors (reported as debug logs by default).
  • --report-output <FILENAME> will write scan reports to a file.
  • --report-json if --report-output is passed, write as JSON instead of text.

Other options

Run sauron --help for the complete list of options.

License

This project is made with ♥ by @evilsocket and it is released under the GPL3 license.

Core symbols most depended-on inside this repo

start
called by 2
src/fs_scan.rs
scan
called by 2
src/engine.rs
report
called by 2
src/report.rs
write_to_file_if_needed
called by 1
src/report.rs
main
called by 0
src/main.rs
start
called by 0
src/fs_monitor.rs
new
called by 0
src/engine.rs
setup
called by 0
src/report.rs

Shape

Class 5
Method 5
Function 3

Languages

Rust100%

Modules by API surface

src/engine.rs5 symbols
src/report.rs4 symbols
src/main.rs2 symbols
src/fs_scan.rs1 symbols
src/fs_monitor.rs1 symbols

For agents

$ claude mcp add sauron \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact