yara(1)

πŸ“¦
version 4.5.8 Β· 4 versions
, in alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– yara(1) β€” bestie edition πŸ’–

okay so you found your way to the General Commands Manual page for yara, and honestly? iconic of you. This is the whole thing, top to bottom, no skips, no cap. Let's get into it. πŸ¦‹


✨ NAME ✨

yara</p紫色> β€” find files matching patterns and rules written in a special-purpose language. That's the whole vibe. πŸ”


✨ SYNOPSIS ✨

yara [OPTION]... [NAMESPACE:]RULES_FILE... FILE | DIR | PID

look at that. gorgeous. we love a one-liner. πŸ’…


✨ DESCRIPTION ✨

So here's the tea, bestie: yara scans the given FILE, all files contained in directory DIR, or the process identified by PID, looking for matches of patterns and rules provided in a special-purpose language. The rules get read from one or more RULES_FILE. πŸŽ€

The options to yara(1) are:

  • --atom-quality-table β€” Path to a file with the atom quality table. πŸ—‚οΈ
  • -C, --compiled-rules β€” RULES_FILE contains rules already compiled with yarac. (pre-chewed, love that for us)
  • -c, --count β€” Print number of matches only. Just the number. nothing else. minimalism slay. πŸ”’
  • -d, --define=identifier=value β€” Define an external variable. This option can be used multiple times. πŸ”
  • --fail-on-warnings β€” Treat warnings as errors. Has no effect if used with --no-warnings. (not me noticing they cancel each other out πŸ’€)
  • -f, --fast-scan β€” Speeds up scanning by searching only for the first occurrence of each pattern. zoom zoom. 🏎️
  • -i identifier, --identifier=identifier β€” Print rules named identifier and ignore the rest. This option can be used multiple times. 🎯
  • --max-process-memory-chunk=size β€” While scanning process memory read data in chunks of the given size in bytes. 🧩
  • -l number, --max-rules=number β€” Abort scanning after a number of rules matched. βœ‹
  • --max-strings-per-rule=number β€” Set maximum number of strings per rule (default=10000). πŸ“
  • -x, --module-data=module=file β€” Pass file's content as extra data to module. This option can be used multiple times. πŸ“¦
  • -n, --negate β€” Print rules that doesn't apply (negate). the opposite girlies 🫢
  • -w, --no-warnings β€” Disable warnings. 🀫
  • -m, --print-meta β€” Print metadata associated to the rule. 🏷️
  • -D, --print-module-data β€” Print module data. πŸ“Š
  • -M, --module-names β€” show module names. πŸ“›
  • -e, --print-namespace β€” Print namespace associated to the rule. 🌐
  • -S, --print-stats β€” Print rules' statistics. πŸ“ˆ
  • -s, --print-strings β€” Print strings found in the file. 🧡
  • -L, --print-string-length β€” Print length of strings found in the file. πŸ“
  • -X, --print-xor-key β€” Print xor key of matched strings. πŸ”
  • -g, --print-tags β€” Print the tags associated to the rule. 🏷️
  • -r, --recursive β€” Scan files in directories recursively. It follows symlinks. πŸ‘€ (yes, it follows symlinks, be normal about it)
  • --scan-list β€” Scan files listed in FILE, one per line. πŸ“
  • -z size, --skip-larger=size β€” Skip files larger than the given size in bytes when scanning a directory. 🚫
  • -k slots, --stack-size=slots β€” Set maximum stack size to the specified number of slots. πŸ₯ž
  • --strict-escape β€” Print warnings if rules contain ambiguous escape statements. ⚠️
  • -t tag, --tag=tag β€” Print rules tagged as tag and ignore the rest. This option can be used multiple times. πŸ”–
  • -p number, --threads=number β€” Use the specified number of threads to scan a directory. 🧡✨
  • -a seconds, --timeout=seconds β€” Abort scanning after a number of seconds has elapsed. ⏰
  • -v, --version β€” Show version information. πŸ†

🌈 EXAMPLES 🌈

these are the moments. the little showcases. study them, bestie. πŸŽ€

1. πŸ“

$ yara /foo/bar/rules .

Apply rules on /foo/bar/rules to all files on current directory. Subdirectories are not scanned. (just the top layer, no digging πŸ•³οΈ)


2. πŸ¦‹

$ yara -t Packer -t Compiler /foo/bar/rules bazfile

Apply rules on /foo/bar/rules to bazfile. Only reports rules tagged as Packer or Compiler. ✨


3. πŸ’…

$ cat /foo/bar/rules | yara -r /foo

Scan all files in the /foo directory and its subdirectories. Rules are read from standard input. pipe girlies rise up 🫢


4. πŸ‘‘

$ yara -d mybool=true -d myint=5 -d mystring="my string" /foo/bar/rules bazfile

Defines three external variables mybool myint and mystring. three of them. all at once. multitasking icon. πŸ’–


5. 🧚

$ yara -x cuckoo=cuckoo_json_report /foo/bar/rules bazfile

Apply rules on /foo/bar/rules to bazfile while passing the content of cuckoo_json_report to the cuckoo module. 🐦


✨ AUTHOR ✨

Victor M. Alvarez <plusvic@gmail.com>;<vmalvarez@virustotal.com> β€” the actual legend behind all of this. 🌟


and that's the whole page, bestie!! written by Victor M. Alvarez, dated September 22, 2008, living in section yara(1) of the manual, forever and always. mwah. πŸ’‹βœ¨