# Viv's OperStuff.irc (v1.80) -- the stuff I use to manage my server and # stuff # Define this as the amount of hosts you want to allow before you detect # as a clone @ ch4clnz_amount_to_clone = 3 # Define this as your mass kill message @ ch4massmsg = [Mass Kill] alias osecho echo =+= # whokill with jb's stuff added alias whokill if ([$1]) { ^assign who.kill.user $mid(${index(! $0) + 1} ${rindex(@ $0) - index(! $0) + 1} $0) ^assign who.kill.host $mid(${rindex(@ $0) + 1} 999 $0) @ who.kill.cnt = 0 ^assign -who.kill.nickz ^on ^who "*" { if (([$1]!=[$N])&&(rmatch($3\@$4 $who.kill.user\@$who.kill.host))) { ^assign who.kill.nickz $encode($1 $decode($who.kill.nickz)) } } if ([$who.kill.user]!=[*]) { if ([$who.kill.host]!=[*]) { //who -name $who.kill.user -host $who.kill.host }{ //who -name $who.kill.user } }{ if ([$host]!=[*]) { //who -host $who.kill.host } } @ who.kill.why = [$1-] ^on ^315 * { ^on ^who -"*" ^on ^315 -* while ([$word($who.kill.cnt $decode($who.kill.nickz))]!=[]) { //kill $word($who.kill.cnt $decode($who.kill.nickz)) $who.kill.why \(Mask: $who.kill.user\@$who.kill.host\) \(${who.kill.cnt+1}\) @ who.kill.cnt = who.kill.cnt + 1 } osecho Killed the following users: osecho $decode($who.kill.nickz) foreach who.kill xx { ^assign -who.kill[$xx] } } } alias wkhelp { echo =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= echo =+= Usage for whokill is: /whokill USER@HOSTMASK REASON =+= echo =+= For instance, if you wanted to kill cloner@clonez.lamurz.org =+= echo =+= /whokill cloner@clonez.lamur.org Drop dead lame ass cloner =+= echo =+= Or, you wanted to kill *@dumbass.cloner.com =+= echo =+= /whokill *@dumbass.cloner.com Go away =+= echo =+= And so on... =+= echo =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= } alias ch4clnz { @ ch4clnzcnt = 0 @ ch4clnztype = [$0] @ ch4clnzstarttime = time() if (([$0]!=[USER])&&([$0]!=[BOTH])&&([$0]!=[SPOOF])||([$0]==[HOST])) { ^on ^who * { if ([$ch4clnz[$encode($4)]]) { @ ch4clnz[$encode($4)] = ch4clnz[$encode($4)] + 1 }{ @ ch4clnz[$encode($4)] = 1 } @ ch4clnz_total_count = ch4clnz_total_count + 1 } } if ([$0]==[USER]) { ^on ^who * { if ([$ch4clnz[$encode($3)]]) { @ ch4clnz[$encode($3)] = ch4clnz[$encode($3)] + 1 }{ @ ch4clnz[$encode($3)] = 1 } @ ch4clnz_total_count = ch4clnz_total_count + 1 } } if ([$0]==[BOTH]) { ^on ^who * { if ([$ch4clnz[$encode($4)][$encode($3)]]) { @ ch4clnz[$encode($4)][$encode($3)] = ch4clnz[$encode($4)][$encode($3)] + 1 }{ @ ch4clnz[$encode($4)][$encode($3)] = 1 } @ ch4clnz_total_count = ch4clnz_total_count + 1 } } if ([$0]==[SPOOF]) { } ^on ^315 * { echo =+= All visible users accounted for, beginning user quantity check... @ ch4clnzendwhotime = time() if ([$ch4clnztype]==[BOTH]) { foreach ch4clnz ii { foreach ch4clnz.$ii jj { if (ch4clnz[$ii][$jj] >= ch4clnz_amount_to_clone) { echo =+= Clones detected from $decode($jj)\@$decode($ii)\ \(Count: $ch4clnz[$ii][$jj]\) @ ch4clnz_detected = 1 } ^assign -ch4clnz.$ii\.$jj } } }{ foreach ch4clnz ii { if (ch4clnz[$ii] >= ch4clnz_amount_to_clone) { osecho Clones detected from $decode($ii)\ \(Count: $ch4clnz[$ii]\) @ ch4clnz_detected = 1 } ^assign -ch4clnz.$ii } } @ ch4clnzdonetime = time() if ( ch4clnz_detected > 0) { osecho Clone check complete. \(You may now use /who again\) ^assign -ch4clnz_detected }{ osecho No clones were detected. \(You may now use /who again\) } osecho Total users accounted for: $ch4clnz_total_count\ if (ch4clnz_clock_time) { osecho Total elapsed clone check time: $tdiff(${ch4clnzdonetime - ch4clnzstarttime}) osecho Time spent gathering who information: $tdiff(${ch4clnzendwhotime - ch4clnzstarttime}) osecho Time spent checking userhost quantities: $tdiff(${ch4clnzdonetime - ch4clnzendwhotime}) } ^on ^who -* ^on ^315 -* ^assign -ch4clnz_total_count } osecho Gathering /who information on all users -- this could take awhile. //who ** $1- } alias ch4help { osecho Usage: osecho /ch4clnz osecho USER -- This causes the script to sort by user name. osecho HOST -- This causes the script to sort by internet address. osecho BOTH -- This causes the script to sort by both criteria. osecho Note: This technique will take more time as more osecho information is sorted. osecho The default search criteria is by HOST. } alias ch4spoof { if ([$N]) { ^on ^who * { if (isip($4)) { @ ch4spoof[$encode($1)] = [$3\@$4] } } ^on ^315 * { osecho All visible users accounted for, beginning user quantity check... foreach ch4spoof xx { osecho IP Address :=: $[-15]decode($xx) :=: $ch4spoof[$xx] ^assign -ch4spoof.$xx } ^on ^who -* ^on ^315 -* } osecho Gathering /who information on all users -- this could take awhile. //who -host *.*.*.* } } alias masskill { if ([$0]) { //kill $0 $ch4massmsg if ([$1]) { masskill $1- } } } alias killchan { if (([$[1]0]==[#])||([$[1]0]==[&])) { ^on ^names * { //masskill $strip(@ $1-) } ^on ^366 * { ^on ^names -* ^on ^366 -* } } } alias isip { if ([$strip(1234567890. $0)]==[]) { @ FUNCTION_RETURN = 1 }{ @ FUNCTION_RETURN = 0 } } alias reroute { if ([$2]) { //squit $0 Rerouting if ([$S]==[$2]) { wait -cmd //connect $0 $1 }{ wait -cmd //connect $0 $1 $2 } }{ if ([$1]) { //squit $0 if ([$S]==[$1]) { wait -cmd //connect $0 6667 }{ wait -cmd //connect $0 6667 $1 } }{ osecho Usage is: /reroute osecho or : /reroute osecho -- Please note that sometimes this alias won't work due to osecho timing conflicts... I'm looking for fixes as we speak :) } } } alias snotice //notice \$*.fef.net [Global Notice] $0- [No Need to Respond] alias lnotice //notice \$$S [Local Notice] $0- [No Need to Respond] alias operhelp { echo +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ echo + OperStuff -- neato nifty irc oper tools to aid in every day + echo + nasty abusive bastard removal :\) + echo +-----------------------------------------------------------------+ echo + /wkhelp -- Help on /whokill usage... USE WITH EXTREME CAUTION + echo + /ch4help -- Help on /ch4clnz usage... Clone detection aid for + echo + ircII. + echo + /ch4spoof -- This command will isolate all the IP addresses, + echo + and hopefully help to isolate spoofed clones. + echo + /masskill -- Add a string of nicknames to this, and this will + echo + send out a kill for each of them. Be carefull \;\) + echo + /reroute -- Type /reroute for more information + echo + /snotice -- Global notice -- /snotice Hi!!! + echo + /lnotice -- Local notice -- /snotice Hi!!! + echo + /servcount -- Count users on servers \(accepts arguements\) + echo + /sping -- Pings a server \(per entropy's request\) + echo +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ } alias servcount { ^assign -servcount_servers if ([$0]) { count_users_by_serv $0- }{ ^on ^364 * { ^assign servcount_servers $servcount_servers $1 } ^on ^365 * { ^on ^364 -* ^on ^365 -* osecho Network links accounted for, beginning server checks... count_users_by_serv $servcount_servers } osecho Collecting network links, please wait... //links } } alias count_users_by_serv { @ cnt_usr_by_srv = [$0] @ cnt_usr_by_srv_nxt = [$1-] if ([$1]) { ^on ^who * { if ([$count_user_by_serv[$encode($cnt_usr_by_srv)]]) { @ count_user_by_serv[$encode($cnt_usr_by_srv)] = count_user_by_serv[$encode($cnt_usr_by_srv)] + 1 if ([$strip(GH $[2]2)]==[*]) { @ count_oper_by_serv[$encode($cnt_usr_by_srv)] = count_oper_by_serv[$encode($cnt_usr_by_srv)] + 1 } }{ @ count_user_by_serv[$encode($cnt_usr_by_srv)] = 1 if ([$strip(GH $[2]2)]==[*]) { @ count_oper_by_serv[$encode($cnt_usr_by_srv)] = 1 } } } ^on ^315 * { ^on ^who -* ^on ^315 -* count_users_by_serv $cnt_usr_by_srv_nxt } ^who -server $0 }{ ^on ^who * { if ([$count_user_by_serv[$encode($cnt_usr_by_srv)]]) { @ count_user_by_serv[$encode($cnt_usr_by_srv)] = count_user_by_serv[$encode($cnt_usr_by_srv)] + 1 if ([$strip(GH $[2]2)]==[*]) { @ count_oper_by_serv[$encode($cnt_usr_by_srv)] = count_oper_by_serv[$encode($cnt_usr_by_srv)] + 1 } }{ @ count_user_by_serv[$encode($cnt_usr_by_srv)] = 1 if ([$strip(GH $[2]2)]==[*]) { @ count_oper_by_serv[$encode($cnt_usr_by_srv)] = 1 } } } ^on ^315 * { ^on ^who -* ^on ^315 -* osecho All visible users on servers accounted for, sorting data... osecho Server: Users: foreach count_user_by_serv xx { if ([$count_oper_by_serv[$xx]]==[]) { @ count_oper_by_serv[$xx] = 0 } @ count_serv_current = decode($xx) osecho $[-20]count_serv_current $count_user_by_serv[$xx] \($count_oper_by_serv[$xx] operators\) ^assign -count_oper_by_serv[$xx] if ([$count_user_total]) { @ count_user_total = count_user_total + count_user_by_serv[$xx] }{ @ count_user_total = count_user_by_serv[$xx] } ^assign -count_user_by_serv[$xx] } osecho Data sorting completed, all users accounted for, total users: \$count_user_total\ ^assign -count_user_total } ^who -server $0 } } # From tx-term.irc, ripped from chaos.irc.. blahblahblah (I'm lazy) alias lformat { @ lformat.word = [$1-] if (@lformat.word < [$0]) { @ function_return = [$([$0]lformat.word)] }{ @ function_return = [$lformat.word] } } alias sping if ([$0]) { if (match(*.* $0)) { osecho Awaiting PING Reply From: \[$0\\] . . . ^on ^raw_irc "% PONG $0 *" { ^on ^raw_irc -"% PONG $2 *";^on ^402 -"% $2 *" osecho Server PING Reply From: $lformat(28 \[$2\\]) $lformat(5 [$tdiff(${time() - oslag[$encode($tolower($2))]})\]) ^assign -oslag.$encode($tolower($2)) } ^on ^402 "% $0 *" { ^on ^raw_irc -"% PONG $1 *" ^on ^402 -"% $1 *" ^assign -oslag.$encode($tolower($1)) osecho \[$1\\]: No Such Server. } @ oslag.$encode($tolower($0)) = time() quote ping $0 $0 }{ osecho \[$0\\]: Bad Servername } }{ osecho /SPING <Server> } osecho OperStuff loaded! Type /operhelp for help.