Skip to content

Instantly share code, notes, and snippets.

@kyhwana
Created August 19, 2017 03:36
Show Gist options
  • Save kyhwana/8ce9275bc64a22963e0cb814b465e7b5 to your computer and use it in GitHub Desktop.
Save kyhwana/8ce9275bc64a22963e0cb814b465e7b5 to your computer and use it in GitHub Desktop.
inotifywait -m /opt/dionaea/var/dionaea/binaries/ -e create |
while read path action file; do
if [[ "$file" != *"smb"* ]]; then
if [[ "$file" != *"httpupload"* ]]; then
date=`date`
echo "The file '$file' appeared in directory '$path' via '$action' at '$date'"
firejail --quiet yara -w /opt/dionaea/rules-master/malware_index.yar $path$file
firejail --quiet clamscan $path$file --no-summary
fi
fi
# do something with the file
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment