Skip to content

Instantly share code, notes, and snippets.

marzn

Block or report user

Report or block marzn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@marzn
marzn / create-fail2ban-samba.conf-antiransomware.sh
Created Oct 27, 2017
Create filterlist for fail2ban / samba / ransomware
View create-fail2ban-samba.conf-antiransomware.sh
#!/bin/sh
wget https://fsrm.experiant.ca/api/v1/combined
sed 's/^.*"filters":\["//g; s/"\]}$//g; s/","/\n/g; s/ /\\ /g; s/\./\\./g; s/\#/\\#/g; s/\+/\\+/g; s/\-/\\-/g; s/\;/\\;/g; s/\~/\\~/g; s/\!/\\!/g; s/\$/\\$/g; s/\@/\\@/g; s/\[/\\[/g; s/\]/\\]/g; s/\*/\.*/g;' combined > samba.conf
sed -i 's/^\.\*//; s/^/ smbd.*\\:\\ IP=<HOST>\\|.*/; s/$/\$/;' samba.conf
CONTENT=`cat samba.conf`
echo -e "[Definition]\nfailregex =${CONTENT}\n\nignoreregex = \n" > samba.conf
You can’t perform that action at this time.