From easy@wiaraa.pl Wed Dec 1 15:36:13 1999 Path: spawn!polsl.gliwice.pl!news.man.poznan.pl!news.icm.edu.pl!not-for-mail From: Easy_R Newsgroups: pl.irc Subject: Re: Spammerzy jest na nich sposob ? Date: Wed, 01 Dec 1999 09:53:44 +0100 Organization: MatriX Lines: 352 Message-ID: <3844E218.FDB6C06A@wiaraa.pl> References: NNTP-Posting-Host: mamba.polbox.pl Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit X-Trace: sunsite.icm.edu.pl 944038455 3389 195.116.6.76 (1 Dec 1999 08:54:15 GMT) X-Complaints-To: abuse@news.icm.edu.pl NNTP-Posting-Date: 1 Dec 1999 08:54:15 GMT X-Accept-Language: en X-Mailer: Mozilla 4.5 [en] (Win98; I) Xref: spawn pl.irc:39520 Papik wrote: > > Czesc :) > Chcialem zapytac,czy jest sposob na spamerow z tzw. zwiadowca .. > Np. Wychodzi sie z # i dostaje 4 linijkowego mesga... wracasz na kanal, > stawiasz bana na goscia i .. nic... stawiasz bana na domene np. *!*@*.it.. > i tez nic ... jak znalezc tego zwiadowce ? > (mozna poslac maila do ircop@irc.pl i powiedziec o co chodzi ? Ciekawe,czy > bedzie jakas reakcja.) Taki zwiadowca "spy bot" siedzi zawsze na wielu kanalach na raz. Jesli jestes OPem duzego kanalu to znalezienie go recznie jest bardzo uciazliwe, musialbys wszystkicg sprawdzac /whois Jest na to dobry sposob (script tcl). Sprawdza automatycznie kazdego na ilu siedzi kanalach i jak jest ponad ustawiony limit to gostek dostaje bana. Np. na #sexpl i #wiaraa jesli ktos siedzi na wiecej niz 4 kanalach dostaje bana (z zalozenia jest spammer :)) hhehehe Oczywiscie OPY moga siedziec na wiekszej ilosci kanalow i nie dostana bana. Script sprawuje sie znakomicie, zero spamerow :)))) #################################################################### # tmcak.tcl (too many channels auto kick) # this tcl was written by [-Scorp-] 1999 # version 1.4.2 ######### # 10-8-99 # version 1.5.1 # had a few bugs to fix with someone joining when someone else # was getting banned , the other person would get banned also =8^( # -- # made it so that the bans strip the ~ off of the ident (if there was one) # and strip the first char off of the ident even if there was a ~ or not # so that a ban would take : dadeo!~dadeo@too.lame.too.know.any.better.org # and set the ban as : *!*adeo@*.too.know.any.better.org # -- # TO DO : # # try to add support for more than one channel # but if do add that and the tcl is used in a lot of large channels # the eggdrop might get lagged and start to use # more cpu and mem than what is called for # so if and when i add support for more channels # i will test and reconfigure this tcl to do the best job it can do ######### # # comments or suggestions can be sent to me at : bikini.team@sweden.com # please send me any bugs you might find # or suggestions on ways to improve this tcl # or additions i can make # # This thing basically checks to find out if users are in too many channels, # and bans them. # I modified the original tcl : banchan.tcl by: Per JoHansson # I'd like to say thank you to the gang in #mp3-80's on Efnet # for helping me find bugs , and helping me come up with ideas to improve this tcl ##################################################################### # A little about this tcl : # Mainly , it will not whois anyone with the +o & +f flags, # Or any other bots that have the +b flag # and if you turn on the channel scanner , and someone is opped in your channel, # and that person is not on the userfile of the bot, he will not get whois'd # you can set how ever many channels you want to say is enough , 8 is the default # there is a channel scanner that when turned on , will scan the channel # at a set time (that you set(10 minutes is the default)) and will # ban anyone that has joined more channels after joining yours # new in this version is a second whois that is delayed # at a set time that you choose (45sec default) # this will help to stop spammers that have a large preset list of channels that they spam # for when they join , and the first whois does not get all the channel the spammer has # not joined yet , the second whois will pick it up , and ban them # ### SETTINGS ### ## in what channel(s) should this script be enabled in "#mychan" ## i think you can set it to "*" to do all channels, but im not sure tho set banchan1 "#sexpl" ## Do you want the bot to scan the channel every so often? ## This will set the looping channel checker to be turned on(1) or off(0). set scan_chan 1 ## If you set then channel scanner to 1 (on) ## How often do you want the bot to scan the channel. 5 would mean 5 minutes. ## I recommend 10 minutes for a nice sized channel of like 70-100 users set chan_timer 15 ## I just added a new feature : a delayed second whois ## this is for some spammers that auto join a large amount of channels ## and this will do a second whois on the persom joining, ## set this to the amount of time to wait for the second whois in seconds ## the default recommended time is set at 45 seconds set scndwhois "45" ## Often it takes time to get a whois response, this is the amount of time ## you want to have the bot to wait between each of the whois requests ## 4 is a good solid number. Also use your math, if you are reading this ## I assume you know how to do math as well. If you have an average of ## 20 users, that would mean a 80 second check for the whole channel,which ## would mean you should have the bot check at least every 2 minutes to be ## safe 2 minutes = 120 seconds. set check_lag 16 ## Table for people who don't know how to do math. ## This table is for a 4 second check_lag ## number of people seconds in check suggested chan_timer setting ## 5 20 1 ## 10 40 2 ## 15 60 3 ## 20 80 4 ## 25 100 5 ## 30 120 6 ## 40 160 8 ## 50 200 10 ## 60 240 12 ## 80 320 16 ## 100 400 20 ## BTW if you have over 50 or so people on your channel, chances are you have ## more than one bot, so you should try to just get the timing right so that ## the bots check at different times. ## How many channels someone is in that you do not want to be allowed in your channel ## the default is set at 8 , that means that if someone joins your channel, ## and they are in 8 or more other channels, they will be banned automaticly set maxchan "5" # # ######## this is the end of user settings ######### # (no need to edit below this point) # bind join - * mbdw:bchan set doingcheck 1 set checknicklist "" set delnicklist "" set tmcakver "1.5.1" proc mbdw:bchan {ni uh ha chan} { global banchan1 niuhch doingcheck checknicklist check_lag botnick timesaver delnicklist scndwhois set ch [string tolower $chan] set banchan [string tolower $banchan1] if {$ch == "$banchan"} { set timesaver [unixtime] set op [matchattr $ha o|o $ch] set fnd [matchattr $ha f|f $ch] set bot [matchattr $ha b] if {$op || $fnd || $bot || ($ni == $botnick)} {return 0} if {$doingcheck == 2} { append checknicklist "$ni $uh $ch " append delnicklist "$ni $uh $ch " utimer $scndwhois delay:whois if {![string match "*mbdw:bcrpi*" [utimers]]} { utimer $check_lag mbdw:bcrpi return 0 } } set doingcheck 2 bind raw - "319" mbdw:bcrpk bind raw - "401" mbdw:bcrpp bind raw - "441" mbdw:bcrpp bind raw - "318" mbdw:bcrpp append delnicklist "$ni $uh $ch " utimer $scndwhois delay:whois set niuhch "$ni $uh $ch" putserv "WHOIS $ni" } } proc delay:whois {} { global delnicklist checknicklist check_lag if { $delnicklist == ""} {return 0} set nii [lindex $delnicklist 0] set uhh [lindex $delnicklist 1] set chh [lindex $delnicklist 2] append checknicklist "$nii $uhh $chh " set pnn 3 set wsx 0 set tmpchecklist "" while {[lindex $delnicklist $pnn] != ""} { set nextnii [lindex $delnicklist $pnn] incr pnn set nextuhh [lindex $delnicklist $pnn] incr pnn set nextchh [lindex $delnicklist $pnn] if [onchan $nextnii $nextchh] { append tmpchecklist "$nextnii $nextuhh $nextchh " incr wsx } incr pnn } set delnicklist $tmpchecklist if {![string match "*mbdw:bcrpi*" [utimers]]} { utimer $check_lag mbdw:bcrpi return 0 } return 0 } proc mbdw:bcrpp {from key text} { global doingcheck set doingcheck 1 unbind raw - "401" mbdw:bcrpp unbind raw - "441" mbdw:bcrpp unbind raw - "318" mbdw:bcrpp } if {[info exists check_chan_timer]} {killtimer $check_chan_timer} if {$scan_chan == 1} { set check_chan_timer [timer $chan_timer do_check_chan] } proc do_check_chan {args} { global botnick chan_timer check_chan_timer check_lag checknicklist banchan1 testdebug putlog "Scanning $banchan1 and doing the whois's" set testdebug "" set channick [chanlist $banchan1] set ni_tot [llength $channick] for {set loopni 0} {$loopni < $ni_tot} {incr loopni} { set ni [lindex $channick $loopni] if { $ni != $botnick } { set nicker [lindex $channick $loopni] set chaner "$banchan1" set uhoster [getchanhost $nicker $chaner] set trr [nick2hand $nicker $chaner] set ops [isop $nicker $banchan1] set op [matchattr $trr o|o $chaner] set fnd [matchattr $trr f|f $chaner] set bot [matchattr $trr b] if {!($ops || $op || $fnd || $bot)} { append checknicklist "$nicker $uhoster $chaner " append testdebug "$nicker " } } } if {![string match "*mbdw:bcrpi*" [utimers]]} {utimer $check_lag mbdw:bcrpi} set check_chan_timer [timer $chan_timer do_check_chan] putlog "Scanned $loopni users in $banchan1" } proc mbdw:bcrpi {} { global niuhch doingcheck botnick checknicklist check_lag if { $checknicklist == ""} {return 0} set ni [lindex $checknicklist 0] set uh [lindex $checknicklist 1] set ch [lindex $checknicklist 2] set pnn 3 set newchecklist "" while {[lindex $checknicklist $pnn] != ""} { set nextni [lindex $checknicklist $pnn] incr pnn set nextuh [lindex $checknicklist $pnn] incr pnn set nextch [lindex $checknicklist $pnn] if [onchan $nextni $nextch] { append newchecklist "$nextni $nextuh $nextch " } incr pnn } set checknicklist $newchecklist if ![onchan $botnick $ch] { set checknicklist "" return 0 } if ![onchan $ni $ch] { if {![string match "*mbdw:bcrpi*" [utimers]]} {utimer $check_lag mbdw:bcrpi} return 0 } if {$doingcheck == 2} { if {![string match "*mbdw:bcrpi*" [utimers]]} {utimer $check_lag mbdw:bcrpi} return 0 } set doingcheck 2 if ![onchan $ni $ch] { set doingcheck 1 if {$checknicklist == ""} {return 0;} if {![string match "*mbdw:bcrpi*" [utimers]]} {utimer $check_lag mbdw:bcrpi} return 0 } bind raw - "319" mbdw:bcrpk bind raw - "401" mbdw:bcrpp bind raw - "441" mbdw:bcrpp bind raw - "318" mbdw:bcrpp set niuhch "$ni $uh $ch" putserv "WHOIS $ni" if {$checknicklist == ""} {return 0;} if {![string match "*mbdw:bcrpi*" [utimers]]} {utimer $check_lag mbdw:bcrpi} } proc mbdw:bcrpk {from key text} { global banchan1 niuhch check_lag maxchan doingcheck checknicklist set ni [lindex $niuhch 0] ; set uh [lindex $niuhch 1] ; set ch [lindex $niuhch 2] set count 0 set onchans [string tolower [string trimleft [lrange $text 2 end] :]] foreach x $onchans { incr count if { $count == "$maxchan" } { putserv "KICK $banchan1 $ni :Access Violation \[Too Many Channels\] (Auto Kick)" putserv "MODE $banchan1 -o+b $ni *!*[string range [string trimleft [maskhost $ni!$uh] *!~] 1 end]" set count 0 unbind raw - "319" mbdw:bcrpk set doingcheck 1 return 0 } } set count 0 unbind raw - "319" mbdw:bcrpk set doingcheck 1 } putlog "Access Violation (Too Many Channels) autokick version $tmcakver by \[-Scorp-\] 1999 Loaded"