mIRC Homepage
Posted By: Garou Ban my Wi-Fi clones - 18/05/07 06:42 PM
I want to kick ban my Wi-Fi clones if my ip dont match with my nick and identh. Is this possible to code?
Posted By: NaquadaServ Re: Ban my Wi-Fi clones - 18/05/07 06:46 PM
Huh? Please provide more details about what you are trying to do...

Edit: Servers do not usually show the full hostname of other clients unless you start a DCC connection to them. From what you have described, I'd say it is possible if the server allows it.
Posted By: Garou Re: Ban my Wi-Fi clones - 18/05/07 06:54 PM
Ok exemple:Joins: nick1 (dalnet@222.222.222.222)
if someone else use my ip on my Wi-Fi network then he would login using this: Joins: nick2 (watever@222.222.222.222)
So if its not my nick matching my identh using this ip I want to auto kick ban it.
Posted By: chiram Re: Ban my Wi-Fi clones - 18/05/07 07:29 PM
If unauthorized people are using your wifi i'd think it's unlikely theyd join same irc channel as you but it sounds like you have a unique situation.
Code:
ON *:JOIN:#:{
  if ($gettok($address($nick,2),2,64) == $gettok($address($me,2),2,64)) {
    if (mynick !isin $nick) || ($gettok($gettok($address($nick,5),2,33),1,64) != $gettok($gettok($address($me,5),2,33),1,64)) { ban -k # $nick 1 Unauthorized clone. }
  }
}


Should do what your asking just change the "mynick" thing to the string that you require in your nickname. If a user joins with your ip that doesnt share same ident or have that string in nickname they will be kick banned.
Posted By: Garou Re: Ban my Wi-Fi clones - 18/05/07 07:33 PM
Thx very much chiram.
Posted By: Riamus2 Re: Ban my Wi-Fi clones - 18/05/07 10:54 PM
Garou, if your IP/DNS doesn't change, then just hardcode the info into the script to avoid problems.

Code:
on !*:join:#: {
  if ($wildsite == *!*@222.222.222.222 || $wilsite == *!*@yourhost.com) ban -k $chan $nick 6
}


Otherwise, use:
Code:
on !*:join:#: {
  if ($wildsite == $address($me,2)) ban -k $chan $nick 6
}


The problem with that is that it won't work if the person joining shows the IP and you show the DNS or vice versa.


chiram, trolling posts don't help anyone. Kick/Ban scripts are fine here. War scripts are not. There is a difference.
Posted By: RusselB Re: Ban my Wi-Fi clones - 18/05/07 11:29 PM
Please note that in Riamus' codes, $wilsite should be $wildsite
Posted By: chiram Re: Ban my Wi-Fi clones - 18/05/07 11:35 PM
Isn't that script going to ban everyone who joins using his IP? I believe he only wanted people banned that match his ip but dont match both his nickname string and ident.
Posted By: maroon Re: Ban my Wi-Fi clones - 19/05/07 12:36 AM
If you forward port 113 to your pc, then all mIRC pc's behind your router will all have their identd handshake talking to your pc. So, if you check the box in mIRC-options/identd/enable-only-when-connecting, then your pc will have identd enabled, but everyone else will be disabled. If that box isn't checked, then everyone else gets your same identd value.

I tried leaving that box unchecked, and then changing my identd value after i connected, but i've found that it doesn't work right if a 2nd mirc connects soon after the 'main' mIRC owning identd changes the value. However, if you wait long enough, you can then control whatever identd value the other pc's get.

They can avoid being given your identd value only by disabling identd in their own pc, which almost always adds the "~" to their address. However, you must be careful to use address masks that discern the difference between someone who has identd and one who doesn't. ie, $address($nick,3) does *!*userid@isp because it's trying to match someone whether they have identd or not.
Posted By: Riamus2 Re: Ban my Wi-Fi clones - 19/05/07 03:35 AM
From his example, he wants all connections from his WiFi to be banned except for himself (ie. they don't match the nick/ident of the client with the script). The code provided does exactly that.
Posted By: chiram Re: Ban my Wi-Fi clones - 19/05/07 04:00 AM
yours doesnt check ident or nick though only hostname.. or am i missing something
Posted By: maroon Re: Ban my Wi-Fi clones - 19/05/07 10:06 AM
Originally Posted By: chiram
yours doesnt check ident or nick though only hostname.. or am i missing something


It doesn't need to. It's banning any nick having your same host mask - that isn't you. The "!" prefix prevents it from matching your own join, though since you join without OP you couldn't ban yourself. The @ prefix would probably be better since you could only be OP if the join weren't yourself.

This code would also ban a 2nd nick joining from your own PC.
Posted By: NaquadaServ Re: Ban my Wi-Fi clones - 19/05/07 01:22 PM
Originally Posted By: Garou
Ok exemple:Joins: nick1 (dalnet@222.222.222.222)
if someone else use my ip on my Wi-Fi network then he would login using this: Joins: nick2 (watever@222.222.222.222)
So if its not my nick matching my identh using this ip I want to auto kick ban it.


Are you saying you have people using your WiFi, that you do not want them to use your WiFi? Enable security on your router, problem solved?
Posted By: Riamus2 Re: Ban my Wi-Fi clones - 19/05/07 02:29 PM
Originally Posted By: maroon
Originally Posted By: chiram
yours doesnt check ident or nick though only hostname.. or am i missing something


It doesn't need to. It's banning any nick having your same host mask - that isn't you. The "!" prefix prevents it from matching your own join, though since you join without OP you couldn't ban yourself. The @ prefix would probably be better since you could only be OP if the join weren't yourself.

This code would also ban a 2nd nick joining from your own PC.


Exactly. And good point about the @. I wasn't even thinking about needing that. Replace the ! with the @ and the code will be better.
Posted By: Garou Re: Ban my Wi-Fi clones - 19/05/07 09:07 PM
After testing chiram codes, its exacly what I needed and its working fine so thx chiram and to all trying to help.
Posted By: chiram Re: Ban my Wi-Fi clones - 19/05/07 09:55 PM

Quote:
It doesn't need to. It's banning any nick having your same host mask - that isn't you. The "!" prefix prevents it from matching your own join, though since you join without OP you couldn't ban yourself. The @ prefix would probably be better since you could only be OP if the join weren't yourself.

This code would also ban a 2nd nick joining from your own PC.

My point exactly.. he doesn't want people banned that match both his ident/nickname string even if they are on his same ip. He only wants people that log on using his ip but don't share his ident and also share a string that will be common in all his nicknames. You are assuming he only wants a single client matching his IP in the channel, when I believe he only wants unauthorized users on his IP to be banned.
Posted By: Garou Re: Ban my Wi-Fi clones - 20/05/07 02:20 AM
If I dont want to kick my 2 nicks and my bot is this how to exempt them?

ON *:JOIN:#:{
if ($gettok($address($nick,2),2,64) == $gettok($address($me,2),2,64)) {
if (cobra !isin $nick) || (cobra1 !isin $nick) || (cobrabot !isin $nick) || ($gettok($gettok($address($nick,5),2,33),1,64) != $gettok($gettok($address($me,5),2,33),1,64)) { ban -k # $nick 1 Unauthorized Wi-Fi Clone }
}
}
Posted By: maroon Re: Ban my Wi-Fi clones - 20/05/07 03:03 AM
depending on what kind of channel you're trying to keep other clones out of, perhaps you could just give the channel a key, then only give the key to those that belong.
Posted By: Garou Re: Ban my Wi-Fi clones - 20/05/07 03:06 AM
the code is working find but i want to exempt those 3 nicks in the code. Just want to know how to exempt cause its not.
Posted By: RoCk Re: Ban my Wi-Fi clones - 20/05/07 03:14 AM
Code:
if ((!$istok(cobra cobra1 cobrabot,$nick,32)) && ($address($nick,3) !iswm $address($me,5))) ban -k # $nick 3 Unauthorized Wi-Fi Clone


?
Posted By: Garou Re: Ban my Wi-Fi clones - 20/05/07 03:58 AM
Thx working fine.
Posted By: chiram Re: Ban my Wi-Fi clones - 20/05/07 09:23 AM
Originally Posted By: RoCk
Code:
if ((!$istok(cobra cobra1 cobrabot,$nick,32)) && ($address($nick,3) !iswm $address($me,5))) ban -k # $nick 3 Unauthorized Wi-Fi Clone


?


would be cleaner and shorter but I believe the !iswm needs to be iswm, and I believe it is going to match too many users.. the ($address($nick,3) iswm $address($me,5)) as i believe it needs to be is going to match anyone sharing his ident and isp or similar subnet if no rdns..

like say his ident is admin and his hostname is *.dyn.optonline.net anyone else who joins with 'admin' as ident and using dyn.optonline.net is going to cause the $address($nick,3) (*!*admin@*.dyn.optonline.net) to match his $address($me,5) (cobra!admin@hidden-whatever.dyn.optonline.net) probably not too common depending on his ident and size of channels he's in

and to answer your earlier post to exclude those nicks.. no point in checking if 'cobra' 'cobra1' 'cobra2' etc are all in nick using "isin" since 'cobra' isin each one.. this should do what you want
Code:
ON *:JOIN:#:{
  if ($gettok($address($nick,2),2,64) == $gettok($address($me,2),2,64)) {
    if (cobra !isin $nick) || ($gettok($gettok($address($nick,5),2,33),1,64) != $gettok($gettok($address($me,5),2,33),1,64)) { ban -k # $nick 1 Unauthorized clone. }
  }
}
or if you wanted to allow only those nicks exactly.. change it to
Code:
ON *:JOIN:#:{
  if ($gettok($address($nick,2),2,64) == $gettok($address($me,2),2,64)) {
    if (!$istok(cobra cobra1 cobrabot,$nick,32)) || ($gettok($gettok($address($nick,5),2,33),1,64) != $gettok($gettok($address($me,5),2,33),1,64)) { ban -k # $nick 1 Unauthorized clone. }
  }
}


but yeah.. let me know if im missing something because he said the code works for him?
© mIRC Discussion Forums