Skip to content

Instantly share code, notes, and snippets.

@rohan-molloy
Created March 30, 2018 19:44
Show Gist options
  • Save rohan-molloy/f3d3993fbc13179a56600356abab488f to your computer and use it in GitHub Desktop.
Save rohan-molloy/f3d3993fbc13179a56600356abab488f to your computer and use it in GitHub Desktop.
#! /bin/bash
primary="badnets"
ipset create $primary hash:net &>/dev/null
if [[ -z "$sets" ]]; then
sets=( firehol_level3 firehol_level2 firehol_level1 firehol_webclient );
fi
for s in "${sets[@]}"; do
wget -qO- "https://iplists.firehol.org/files/"$s".netset" | grep -v "^#" |\
while read entry; do
ipset add $primary $entry &>/dev/null
done;
done;
/usr/sbin/ipset save $primary > /tmp/badnets.netset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment