Created
May 12, 2014 10:19
-
-
Save gdugas/704cfe4d8e2c9875cc65 to your computer and use it in GitHub Desktop.
modsecurity clamav + findbot scanner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # modsecurity scanner | |
| echo "SecRule FILES_TMPNAMES "@inspectFile /opt/modsecurity_clamdscan.sh" phase:2,t:none,log,deny" >> /etc/modsecurity/modsecurity.conf | |
| # clamav scan script | |
| cat >> /opt/modsecurity_clamdscan.sh << EOF | |
| #! /bin/bash | |
| if [ ! $1 ]; then | |
| echo "No file to scan" | |
| exit 1 | |
| fi | |
| RES=`clamdscan --no-summary $1` | |
| if [[ $RES == *OK ]]; then | |
| echo 1 | |
| elif [[ $RES == *FOUND ]]; then | |
| echo 0 $RES | |
| fi | |
| echo "" | |
| EOF | |
| chmod +x /opt/modsecurity_clamdscan.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment