mIRC Home    About    Download    Register    News    Help

Print Thread
#152860 07/07/06 09:42 PM
Joined: Apr 2004
Posts: 27
P
parvez Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Apr 2004
Posts: 27
The original whois code is
Code:
ON *:SNOTICE:*did a /whois on you.*:/echo -a 0,4=>12,0 $1- 

I was wondering, if someone can make me a code that will kill a user who whois me for 5times repeatedly!

Like for example, this user will whois me 5times and will receive an auto-kill from me with a msg like "DOnt whois me that many times"

Thats all!
thanks

#152861 07/07/06 09:46 PM
Joined: Apr 2006
Posts: 400
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
I'm not an IRC op for too many servers, and I don't use +W, so, I wouldn't know where his name would be, but, you can set his name to a variable, and use inc %variable, once it hits 5, do what you want laugh!


-Kurdish_Assass1n
#152862 07/07/06 10:51 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I tried to test this code, but for some reason (which the network administration is trying to figure out), I'm not getting the snotice when someone does a /whois on me (even though I am an IRCop), so I think this is correct. If I find that it's not correct later, I'll amend or repost as necessary.
Code:
 on *:snotice:*did a /whois on you*:{
  $iif(!$($+(%,whois,.,$1),2),set $+(%,whois,.,$1) 1,.inc $+(%,whois,.,$1))
  if $($+(%,whois,.,$1),2) > 4 {
    kill $1 Don't /whois me that many times
    unset $+(%,whois,.,$1)
  }
}
 

#152863 08/07/06 12:02 AM
Joined: Apr 2004
Posts: 27
P
parvez Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Apr 2004
Posts: 27
hmm i get this message in status window
Quote:
*** No such nick/channel

Last edited by parvez; 08/07/06 12:03 AM.
#152864 08/07/06 12:35 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
OK...in that case, try replacing $1 in the code with $2 (all occurences (sp?))

#152865 08/07/06 01:11 AM
Joined: Apr 2004
Posts: 27
P
parvez Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Apr 2004
Posts: 27
yayy!! lol it worked. THANKS a lot

#152866 08/07/06 01:13 AM
Joined: Apr 2004
Posts: 27
P
parvez Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Apr 2004
Posts: 27
One thing.. what did you mean by (all occurences (sp?)) ?
I didn't get that.

#152867 08/07/06 01:52 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The (sp?) means that I wasn't sure of the spelling of the word before it. You were probably able to figure out the word by just by sounding it out from the spelling I did give (even if it's not the correct spelling)

#152868 08/07/06 02:32 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
You should really put some auto expiring control on the variables, otherwise its open to exploitation

RusselB logs off
DaveC renames to RusselB and whois the ircop 4 times, then renames back
RusselB logs back on
DaveC mentions in channel how IRCops have extra info in there whois, and suggest RusselB does it on said IRCop

maybe...
Code:
on *:snotice:*did a /whois on you*:{
  inc -u21600 $+(%,whois,.,$2)
  if ($($+(%,whois,.,$2),2) > 4) {
    kill $2 Don't /whois me that many times
    unset $+(%,whois,.,$2)
  }
}


still exploitable, but atleats if u dont come back for 6 hours its reset.

#152869 08/07/06 02:42 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
 on *:snotice:*did a /whois on you*:{
  $iif(!$($+(%,whois,.,$2),2),set $+(%,whois,.,$2) 1,.inc $+(%,whois,.,$2))
  if $($+(%,whois,.,$2),2) > 4 {
    kill $1 Don't /whois me that many times
  }
}
on *:snotice:*client exiting*:{
unset $+(%,whois,.,$6)
}
 


What do you think about that alternative, DaveC?

#152870 08/07/06 04:39 AM
Joined: Apr 2004
Posts: 27
P
parvez Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Apr 2004
Posts: 27
hm what exploit are you guys talking about? About this lil code? =\ how is it exploitable?

#152871 08/07/06 06:00 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
What's being referred to as an exploit, is the fact that I didn't have anything in the script to track if Person A was to /whois you 3 times, then leave the network, and Person B change to Person A's nick, /whois you once, then change back to Person B and get Person A to /whois you again. With the original version of my script, that would make the tracker think that Person A had /whois'd you 5 times, when in fact they only did it 4 times.

My second version of the code resets the counter when Person A disconnects from the network (which you, as an IRCop, can monitor via the client exiting snotice).

#152872 08/07/06 03:41 PM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
@ whoever is interested:


How about something like this:
Code:
on *:snotice:*did a /whois on you*:{
  var %nick = $2
  set -u6 %ghlist $addtok(%ghlist,%nick,44)
  .userhost %nick
}

raw 302:*:{
  ; REGEX: (nick)(*=+-)(ident)@(host)
  if ($regex(gh,$2-,/([^*=+]+)([*=+]+)([^*=+]+)@([^*=+]+)/)) {
    if (!$istok(%ghlist,$regml(gh,1),44)) return
    set -u8 %ghlist $remtok(%ghlist,$regml(gh,1),1,44)
    if (* isin $regml(gh,2)) return
    inc -u[color:red]10[/color] $+(%,whois.,$regml(gh,4))
    if ($($+(%,whois.,$regml(gh,4)),2) > 4) { kill $regml(gh,1) Do not /whois me that many times }
    echo 3 -a $regml(gh,1) ( $+ $regml(gh,3) $+ @ $+ $regml(gh,4) $+ ) has /whois'd you $($+(%,whois.,$regml(gh,4)),2) times
  }
  halt
}


This code will keep track of how many times you are /whois'd from the same hostmask (doesn't consider ident at all). If you are /whois'd more than 4 times from the same hostmask, the last person to perform the /whois will be killed. IRCOps are always ignored (it's not a good idea to go killing other IRCOps :tongue: ).

You can adjust how fast the users must /whois you in order to be counted. If the user does a /whois on you with less than 10sec between each /whois, the count will be maintained.

If you want to use the values of the userhost command, they are as follows:

$regml(gh,1) = nick
$regml(gh,2) = *+- (* = IRCOp, + = here, - = away)
$regml(gh,3) = ident (before the @)
$regml(gh,4) = hostmask (after the @)

-genius_at_work


Link Copied to Clipboard