Anti cloned nicks

By simo on Aug 02, 2017

this will ban and kick out cloned nicks like:

nick123
nick893
nick982
nick165
nick672
nick98387
nickjhe98

also it checks for cloned hosts/ips

use this code with the enforce ban code i posted to make it kick out clones faster:

http://hawkee.com/snippet/18594/

i tested it and this is an example of its working
http://dpaste.com/2P53DJM.txt

on *:JOIN:#: {
  if ($nick(#,$me,@&~%)) {  
  if (%Netsplit-Detected. [ $+ [ %netsplitchan ] $+ . $+ [ $network ] ]) { halt }
    var %Clone.join.flood2 = $+(*!*@*.,$gettok($address($nick,2),-2,46),.,$gettok($address($nick,2),-1,46))  
    if (%clone-join. [ $+ [ # ] $+ . $+ [ %Clone.join.flood2 ] ] == $null) {
      set -u3 %clone-join. [ $+ [ # ] $+ . $+ [ %Clone.join.flood2 ] ] 1 
    }
    else { inc %clone-join. [ $+ [ # ] $+ . $+ [ %Clone.join.flood2 ] ] }
    if (%clone-join. [ $+ [ # ] $+ . $+ [ %Clone.join.flood2 ] ] >= 2) {
      if (%modechanx7 != $true) {
        .raw mode  $chan +b %Clone.join.flood2
        set -u3 %modechanx7 $true
      }
    }

    var %Clone.join.flood = $+(*!*@,$remove($gettok($address($nick,2),1-2,46),*!*@),.*)    
    if (%clone-join. [ $+ [ # ] $+ . $+ [ %Clone.join.flood ] ] == $null) {
      set -u3 %clone-join. [ $+ [ # ] $+ . $+ [ %Clone.join.flood ] ] 1 
    }
    else { inc %clone-join. [ $+ [ # ] $+ . $+ [ %Clone.join.flood ] ] }
    if (%clone-join. [ $+ [ # ] $+ . $+ [ %Clone.join.flood ] ] >= 2) {
      if (%modechan1MR76567 != $true) {
        .raw mode  $chan +b %Clone.join.flood
        set -u3 %modechan1MR76567 $true
      }
    }

    var %join.flood.ident = $left($remove($gettok($address($nick,3),1,$asc(@)),*!*),4)
    if (%join. [ $+ [ # ] $+ . $+ [ %join.flood.ident ] ] == $null) {
      set -u3 %join. [ $+ [ # ] $+ . $+ [ %join.flood.ident ] ] 1 
    }
    else { inc %join. [ $+ [ # ] $+ . $+ [ %join.flood.ident ] ] }
    if (%join. [ $+ [ # ] $+ . $+ [ %join.flood.ident ] ] >= 2) {
      if (%modechan1MR541 != $true) {
        .raw mode  $chan +b $+(*!,$left($gettok($gettok($address($nick,5),1,64),2,33),5),*@*)    
        set -u3 %modechan1MR541 $true
      }
    }

    var %join.flood = $+($left($nick,4),*!*@*)
    if (%join. [ $+ [ # ] $+ . $+ [ %join.flood ] ] == $null) {
      set -u3 %join. [ $+ [ # ] $+ . $+ [ %join.flood ] ] 1 
    }
    else { inc %join. [ $+ [ # ] $+ . $+ [ %join.flood ] ] }
    if (%join. [ $+ [ # ] $+ . $+ [ %join.flood ] ] >= 2) {
      if (%modechan1MR != $true) {
        set -u3 %clnicks2 1
        .raw mode  $chan +b %join.flood   
        set -u3 %modechan1MR $true
      }
    }
  }
}

ON !^*:QUIT: {
  var %netsplit2 1
  while ($comchan($nick,%netsplit2)) {
    var %netsplitchan $v1
    if (*.* *.*  iswm $1-2) && !$3 && (!%Netsplit-Detected. [ $+ [ %netsplitchan ] $+ . $+ [ $network ] ])  { 
      set -z %Netsplit-Detected. [ $+ [ %netsplitchan ] $+ . $+ [ $network ] ]  300
    }
    inc %netsplit2
  }
  halt
}

Comments

Sign in to comment.
Cheiron   -  Mar 11, 2019

Nice idea and script. Have you allowed for things like netsplits (where services go down) and folks rejoin on mass to find they all change by default to a fixed "Default1234" nick ?

simo  -  Mar 12, 2019

somehow hawkee wont allow changes to posts i wanted to update it but i get weird replies about adding code while code is there and already posted

but its a good thing to think about the netsplit scenario

Cheiron  -  Mar 12, 2019

It was more of an observation more than anything.. alot of clients dont use auto-id .. and on netsplits or if services go down.. its an all too familiar sight lol .. en-mass nick change to server default

simo  -  Nov 15, 2021

edited with netsplit check

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.