Code: Select all
bind join - "*" badident
proc badident {nick host hand chan} {
if {![isbotnick $nick] && [botisop $chan]} {
if {[regexp {^~[a-z]{1}[0-9]{2,5}$} [lindex [split $host @] 0]]} {
newchanban $chan *!*@[lindex [split $host @] 1] $::botnick "bad ident"
}
}
}
Code: Select all
scan $host {%[^@]} ident
set nick_digits [llength [regexp -all -inline -- {[0-9]} $nick]]
set ident_digits [llength [regexp -all -inline -- {[0-9]} $ident]]
set no_vowels [regexp {[aeiouy]} $nick]
if {$no_vowels && $nick_digits >= 3 && $ident_digits >= 3} {
# ban it
}
Code: Select all
scan $host {%[^@]} ident
set nick_digits [llength [regexp -all -inline -- {[0-9]} $nick]]
set ident_digits [llength [regexp -all -inline -- {[0-9]} $ident]]
set vowels [regexp {[aeiouy]} $nick]
if {!$vowels && $nick_digits >= 3 && $ident_digits >= 3} {
# ban it
}
Code: Select all
proc sb:score {str} {
set score 0
set vowel "aeiouy"
set cnant "bcdfghjklmnpqrstvwxz"
set other "{}\\\[\\\]-_^`|\\\\"
set digit "0123456789"
set str [string tolower $str]
incr score [llength [regexp -all -inline \[$vowel\]{3,} $str]] ;# 3 and more adjacent vowels
incr score [llength [regexp -all -inline \[$cnant\]{3,} $str]] ;# 3 and more adjacent consonants
incr score [llength [regexp -all -inline \[$other\]{2,} $str]] ;# 2 and more adjacent punctuation chars
incr score [llength [regexp -all -inline \[$digit\]{2,} $str]] ;# 2 and more adjacent digits
incr score [llength [regexp -all -inline \[$vowel$other\]{4,} $str]] ;# 4 or more adjacent vowel/punctuation chars
incr score [llength [regexp -all -inline \[$cnant$other\]{4,} $str]] ;# 4 or more adjacent consonant/punctuation chars
incr score [llength [regexp -all -inline \[$vowel$digit\]{4,} $str]] ;# 4 or more adjacent vowel/digits
incr score [llength [regexp -all -inline \[$cnant$digit\]{4,} $str]] ;# 4 or more adjacent consonant/digits
incr score [llength [regexp -all -inline \[$other$digit\]{3,} $str]] ;# 3 or more adjacent puncuation/digits
incr score $score ;# double the score
}
Code: Select all
set threshold 18
bind join - * check_drone
proc check_drone {nick uhost hand chan} {
if [matchattr $hand of|of $chan] return ;# it's an op/friend, skip the check
scan $uhost {%[^@]} ident ;# obtain ident
if {[sb:score $nick!$ident] > $::threshold} {
newchanban $chan [maskhost $nick!$uhost] checker "possible drone"
putkick $chan $nick "possible drone; if you are not, contact mm for unban"
}
}
Code: Select all
set threshold 18
bind join - * check_drone
proc check_drone {nick uhost hand chan} {
if [matchattr $hand of|of $chan] return ;# it's an op/friend, skip the check
scan $uhost {%[^@]@%s} ident host ;# obtain ident & host
if {[sb:score $nick!$ident] > $::threshold} {
newchanban $chan *!*@$host checker "possible drone"
putkick $chan $nick "possible drone; if you are not, contact mm for unban"
}
}
Code: Select all
scan $host {%[^@]} ident
set nick_digits [llength [regexp -all -inline -- {[0-9]} $nick]]
set ident_digits [llength [regexp -all -inline -- {[0-9]} $ident]]
set vowels [regexp {[aeiouy]} $nick]
if {!$vowels && $nick_digits >= 3 && $ident_digits >= 3} {
# ban it
}