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_vm_status.sh
#!/bin/bash

OK=0
WARNING=1
CRITICAL=2
UNKNOWN=3

VMS=$(pvesh get nodes/$(hostname -s)/qemu --output-format json |jq -r '.[]|select(.uptime != 0)|select(.template != 1)|select(.tags | contains("suspended") or contains("cancelled") or contains("delete") or contains("fraud")) | .name' | paste -sd ',' 2>/dev/null)

if [ $? -ne 0 ]; then
    echo "Failed to execute pvesh command"
    exit $UNKNOWN
fi

if [ -n "$VMS" ]; then
    echo "Found running VMs with suspended/cancelled/delete/fraud tags: $VMS"
    #exit $CRITICAL
    exit $WARNING
else
    echo "No running VMs found with suspended/cancelled/delete/fraud tags"
    exit $OK
fi