yara(1)
π 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_FILEcontains rules already compiled withyarac. (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 inFILE, 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. πβ¨
π¦ where this page comes from
- alpine 3.24: yara-doc 4.5.7-r0 Β· BSD-3-Clause
- arch rolling: yara 4.5.8-1 Β· BSD-3-Clause
- centos-stream 10: yara 4.5.2-2.el10 Β· BSD-3-Clause
- centos-stream 9: yara 4.5.2-1.el9 Β· BSD-3-Clause
- centos-stream 9: yara 4.5.2-1.el9 Β· BSD-3-Clause
- debian trixie: yara 4.5.2-1 Β· BSD-3-Clause
- fedora 43: yara 4.5.4-3.fc43 Β· BSD-3-Clause
- fedora 43: yara 4.5.4-3.fc43 Β· BSD-3-Clause
- fedora 44: yara 4.5.5-2.fc44 Β· BSD-3-Clause
- fedora 44: yara 4.5.5-2.fc44 Β· BSD-3-Clause
- nixos 26.05: yara 4.5.5
- nixpkgs unstable: yara 4.5.7
- opensuse-leap 16.0: yara 4.5.2-bp160.1.4 Β· BSD-3-Clause
- opensuse-leap 16.0: yara 4.5.2-bp160.1.4 Β· BSD-3-Clause
- opensuse-leap 16.0: yara 4.5.2-bp160.1.4 Β· BSD-3-Clause
- opensuse-leap 16.0: yara 4.5.2-bp160.1.4 Β· BSD-3-Clause
- ubuntu questing: yara 4.5.4-1
- ubuntu resolute: yara 4.5.5-1 Β· BSD-3-Clause
- ubuntu stonking: yara 4.5.8-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms