Skip to content

Instantly share code, notes, and snippets.

View snxraven's full-sized avatar

Raven Scott snxraven

View GitHub Profile
@snxraven
snxraven / brute-fix.sh
Created April 6, 2020 20:47
DirectAdmin CSF BruteForce AutoBlock Via Bash - Clean and Reset List
#!/bin/bash
#Properly Pull all IP's from BruteForce Log!\
echo "Starting Proccess to block IP's in bruteForce Log from DA"
echo "==============="
echo "DUMPING LOG IPS"
exec cat /usr/local/directadmin/data/admin/brute_log_entries.list | cut -d= -f5 | sed 's/\&.*//' | sed -e's/%\([0-9A-F][0-9A-F]\)/\\\\\x\1/g' | xargs echo -e | sed 's/ /\n/g' | uniq > bruteforce.txt
echo "==============="
# Extra Filter of BruteForce List | Uniq
echo "Filtering the IP's so there are no duplicates"
/* Usage:
*
* coolerInterval( func, interval, triggerOnceEvery);
*
* - func : the function to trigger
* - interval : interval that will adjust itself overtime checking the clock time
* - triggerOnceEvery : trigger your function once after X adjustments (default to 1)
* - This script uses fs.stat to check the last modified time for a file
* - stats.mtime gives us the last modified time in miliseconds
* - We compare current time, date1 - and now, date 2 getting the time difference

Keybase proof

I hereby claim:

  • I am snxraven on github.
  • I am snxraven (https://keybase.io/snxraven) on keybase.
  • I have a public key ASD_RUSvQ5qUTZY-vLWLsr_uYx9enHfLJX8Gb8SgS_gu1Qo

To claim this, I am signing this object: