Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- setudef flag dnsbl
- bind join - * dnsbl:join
- proc dnsbl:join { nick host hand chan } {
- if {![channel get $chan dnsbl] || [string match *users.undernet.org $host]} {
- return 0
- }
- set host [lindex [split $host @] 1]
- if {[testip $host]} {
- dnsbl:dns $host $host 1 $host $nick
- } else {
- dnslookup $host dnsbl:dns $host $nick
- }
- }
- proc dnsbl:dns { ip host status host nick } {
- if {$status == 0} { return 0 }
- set a [lindex [split $ip .] 0]
- set b [lindex [split $ip .] 1]
- set c [lindex [split $ip .] 2]
- set d [lindex [split $ip .] 3]
- foreach dns "dnsbl.dronebl.org rbl.efnet.org dnsbl.njabl.org list.dsbl.org" {
- dnslookup $d.$c.$b.$a.$dns dnsbl:reply $host $nick $ip $dns
- }
- }
- proc dnsbl:reply { ip host status host nick userip dnsbl} {
- global botnick
- if {$status == 0} { return 0 }
- set reason "Your host is listed in $dnsbl - Goodbye"
- foreach chan [channels] {
- if {[channel get $chan dnsbl]} {
- if {![matchban $host $chan]} {
- if {[onchan X $chan]} {
- if {[botisop $chan] || [botisvoice $chan]} {
- putserv "CPRIVMSG X :ban $chan *!*@${host} 1d 100 $reason"
- } else {
- putserv "PRIVMSG X :ban $chan *!*@${host} 1d 100 $reason"
- }
- } elseif {[botisop $chan]} {
- newchanban *!*@${host} $chan dnsbl $reason
- }
- }
- }
- }
- }
- putlog "dnsBL TCL Loaded"
Add Comment
Please, Sign In to add comment