tessl install tessl/pypi-yara-python@3.11.0Python interface for YARA, a powerful malware identification and classification tool
Agent Success
Agent success rate when using this tile
85%
Improvement
Agent success rate improvement when using this tile compared to baseline
0.94x
Baseline
Agent success rate without this tile
90%
A command-line tool that scans files for malware patterns using custom detection rules.
Scan individual files on disk for malware patterns using predefined detection rules. The scanner should load YARA rules from a rules file and apply them to target files, reporting any matches found.
Load and compile detection rules from a YARA rules file. The rules file contains pattern definitions that describe malicious characteristics to detect.
Extract and report detailed information about pattern matches, including which rules matched and what specific patterns were found in the scanned files.
Scan multiple files in a single operation, reporting matches for each file individually. This allows efficient batch scanning of multiple suspicious files.
@generates
def compile_rules(rules_path: str):
"""
Compile YARA rules from a file.
Args:
rules_path: Path to the YARA rules file
Returns:
Compiled rules object ready for scanning
Raises:
Exception: If the file doesn't exist or contains invalid rules
"""
pass
def scan_file(rules, file_path: str) -> list:
"""
Scan a single file using compiled rules.
Args:
rules: Compiled YARA rules object
file_path: Path to the file to scan
Returns:
List of match objects (empty list if no matches)
Raises:
Exception: If the file doesn't exist
"""
pass
def scan_files(rules, file_paths: list) -> dict:
"""
Scan multiple files using compiled rules.
Args:
rules: Compiled YARA rules object
file_paths: List of file paths to scan
Returns:
Dictionary mapping file paths to lists of match objects
Raises:
Exception: If any file doesn't exist
"""
pass
def get_match_info(match) -> dict:
"""
Extract information from a match object.
Args:
match: A YARA match object
Returns:
Dictionary containing 'rule_name' and 'string_identifiers' keys
"""
passProvides pattern matching support for malware detection.
@satisfied-by