Skip to content

Instantly share code, notes, and snippets.

@ejain
Created March 13, 2014 05:28
Show Gist options
  • Save ejain/9522320 to your computer and use it in GitHub Desktop.
Save ejain/9522320 to your computer and use it in GitHub Desktop.
Block all IPs that requested a specific file, temporarily.
sudo grep xmlrpc /var/log/apache2/access.log \
| cut -d' ' -f1 | sort | uniq \
| xargs -I{} sudo iptables -A INPUT -s {} -j DROP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment