I'm starting from scratch here - I've been trying to learn how I can create a script and a hook to notify me when a scan returns any malware.
Pretty much all the websites and help pages (dozens of them) are over my head - please don't just point me to those same places that I don't fully understand.
I finally figured out how to use Windows PowerShell to SSH, then got help from my host to log in when it kept giving me errors.
I eventually figured out how to create a folder off of the root and named it "hooks". So I'm out of the root now.
I think I can figure out how to create a file and add a path to it in the Notifications hosting interface, but I'm not a coder in any language and I'm not sure whether the example I found is even what I want:
If I enable User Scan: Malware Detected, and enter /root/hooks/[filename], I assume it will trigger an email to me following the daily scan I have set up in the General settings for daily at 6 AM.
Is the script right for what I want to do?
When I name it, do I have to give it an extension?
I'm using ImunifyAV+
DirectAdmin is the platform I'm using
I have root access (reseller account).
Thank you,
Ernie
Pretty much all the websites and help pages (dozens of them) are over my head - please don't just point me to those same places that I don't fully understand.
I finally figured out how to use Windows PowerShell to SSH, then got help from my host to log in when it kept giving me errors.
I eventually figured out how to create a folder off of the root and named it "hooks". So I'm out of the root now.
I think I can figure out how to create a file and add a path to it in the Notifications hosting interface, but I'm not a coder in any language and I'm not sure whether the example I found is even what I want:
Code:
!/bin/bashdata=$(cat) event=$(jq -r '.event' <<< ${data}) subtype=$(jq -r '.subtype' <<< ${data})case ${event} in malware-detected) case ${subtype} in critical) path=$(jq -r '.params.path' <<< ${data}) total_malicious=$(jq -r '.params.total_malicious' <<< ${data}) echo "The path $path was scanned and there are $total_malicious malicious files were found" | mail -s malware-detected-dda my.email.com ;; esac esac
Is the script right for what I want to do?
When I name it, do I have to give it an extension?
I'm using ImunifyAV+
DirectAdmin is the platform I'm using
I have root access (reseller account).
Thank you,
Ernie
Comment