PHP code example of certly / yara

1. Go to this page and download the library: Download certly/yara library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

certly / yara example snippets


$yara = new Certly\YARA\YARA();

$matches = $yara->match('abcdef', [
    '
        rule silent_banker : banker
        {
            meta:
                description = "An example rule."
        
            strings:
                $a = "abc"
        
            condition:
                $a
        }
    ',
]));

foreach ($matches as $match) {
    echo "Matched {$match['rule']}." . PHP_EOL;
    echo "Raw output: {$match['raw']}" . PHP_EOL;
}