stamparm / ipsum

Daily feed of bad IPs (with blacklist hit scores)
The Unlicense
1.51k stars 136 forks source link

Custom router firmware support? #49

Open ThreeDeeJay opened 7 months ago

ThreeDeeJay commented 7 months ago

How would one go about implementing this IP list into third-party router firmware like Tomato/DD-WRT? I tried the ipset instructions in the ReadMe and https://github.com/stamparm/ipsum/issues/16, but it seems to use a different version, so I tried the command structure it expects (e.g. flush > --flush), but still had issues, 🤔

> #!/bin/sh
--

> ipset --flush ipsum
ipset v4.5: Unknown set

> ipset --create ipsum hash:ip
ipset v4.5: Couldn't load settype `hash:ip':File not found
 
Try `ipset -H' or 'ipset --help' for more information.
> for ip in $(curl --compressed https://raw.githubusercontent.com/stamparm/ipsum/master/levels/8.txt 2>/dev/null \| grep -v "#" \| grep -v -E "\s[1-2]$" \| cut -f 1); do ipset --add ipsum $ip; done
ipset v4.5: Unknown set
***[THIS REPEATS SEVERAL TIMES]***
ipset v4.5: Unknown set

> iptables -D INPUT -m set --match-set ipsum src -j DROP 2>/dev/null                          

> iptables -I INPUT -m set --match-set ipsum src -j DROP                                      
iptables v1.3.8: Unknown arg `(null)'                                                         
Try `iptables -h' or 'iptables --help' for more information.                                  
>                                                                                             
stamparm commented 7 months ago

you should really find some manual on ipset for your firmware. also, this looks like some ancient ipset. maybe you could find something out with ipset -h