ROOTPLOIT
Server: Apache
System: Linux node6122.myfcloud.com 6.14.3-x86_64-linode168 #1 SMP PREEMPT_DYNAMIC Mon Apr 21 19:47:55 EDT 2025 x86_64
User: bashacomputer (1004)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib64/nagios/plugins/check_backups.php
#!/usr/local/bin/php

<?php

$decoded = json_decode(shell_exec('sudo /usr/bin/jetbackup5api -F listAlerts -O json'), 1);

$critical = array_filter($decoded['data']['alerts'], function($level) {
    return $level['level'] === 4;
});

if(empty($critical)) {
    echo "No critical alerts." . PHP_EOL;
    exit(0);
}

foreach ($critical as $c) {
    if(preg_match("/\b(connecting|aborted|destination)\b/", $c['message'])) {
        $response[] = $c;
    }
}

if(!empty($response)) {
    print_r(yaml_emit($response));
    exit(2);
}

echo "No critical alerts.". PHP_EOL;
exit(0);