Created
June 23, 2022 11:11
-
-
Save michelep/7b66029e0d46edb080d34b3b7599aecc to your computer and use it in GitHub Desktop.
Wazuh 4.3.x active response script
This file contains 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
#!/bin/sh | |
LOCAL=`dirname $0` | |
ME=`basename "$0"` | |
read -r LINE | |
cd $LOCAL | |
cd ../ | |
PWD=`pwd` | |
# Logging the call | |
MYALERT=$(mktemp --suffix ".log") | |
echo ${LINE} > $MYALERT | |
RESULT=`/usr/bin/python3 /var/ossec/active-response/bin/ip-block.py ${MYALERT} 2>&1` | |
echo "`date` ${ME} ${MYALERT}: ${RESULT}" >> ${PWD}/../logs/active-responses.log | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
and, in ip-block.py, i have: