If you have a file with all IPs, you can simply modify it with a good text editor (as notepad++ or pspad), or sed, to create an unrealircd comprehensive file that you'll include in your conf.TimeRider wrote:Also, as you said, the UnrealIRCD ban blocks would be hectic to put all the ips creating the block for each. Or, is there a way to make the UnrealIRCD ban block read the list?
I really thought Eggdrop could do this task at ease as it is one of the powerful IRC bot I have seen so far.
Code: Select all
^(.*)$
Code: Select all
ban user { mask *@$1; reason "Denied IP"; };
Code: Select all
set fi [open "ips.txt" "r"]
set ips [read -nonewline $fi]
close $fi
foreach ip [split $ips "\n"] {
putserv "gzline *@$ip +0 :Denied IP"
}
Code: Select all
ipset create blacklist hash:net
Code: Select all
iptables -I PREROUTING -t raw -m set --match-set blacklist src,dst -j DROP
Code: Select all
ipset flush blacklist
ipset restore -! < blacklist.txt
Code: Select all
create blacklist hash:net family inet hashsize 8192 maxelem 65536
add badips x.x.x.x
add badips x.x.x.x
add badips x.x.x.x
and so on
Code: Select all
proc lookup {str} {
set match 0
set fh [open "blacklist.txt" "r"]
set data [read -nonewline $fh]
close $fh
foreach line $data {
if {[string equal $line $str]} {
incr match
break
}
}
return $match
}
Code: Select all
bind join * join:check
proc join:check {nick uhost hand chan} {
scan $uhost {%[^@]@%s} user host
if {[lookup $host]} {
# add the gline line
}
}