mIRC Homepage
Posted By: Lenooox trojan scan - 09/11/11 07:38 PM
What do you think about the script? does it work?

Code:
on *:TEXT:!trojanscan*:#:{
  alias trojan 
  .unset %virus
  msg $chan  4Starting the scan on $2
  var %i = 1
  while (%i <= $nick($1,0) ) {
    if ($right($nick($1, %i),1) isnum 0-9) { 
      if ($left($right($nick($1, %i),2),1) isnum 0-9 ) {
        if ($me !isop $chan) {
          if (%virus) { .inc %virus }
          if (!%virus) { .set %virus 1 }
          msg $chan  4Trojan found on $1 ( $+ $nick($1, %i) $+ )
        }
        if ($me isop $chan) {
          if (!%tro) { .set %tro 1 }
          if (%tro) { .inc %tro }
          .ban -u60 $chan $nick($1, %i) 1 
          .kick # $nick($1, %i) 4Possible trojan client - nr. %tro 
          if (%virus) { .inc %virus }
          if (!%virus) { .set %virus 1 }
          msg $chan 4Trojan found on $1 ( $+ $nick($1, %i) $+ )
        }
      } 
    }
    inc %i
  }

  if (!%virus) { .set %virus 0 }
  msg $chan 4Found ( $+ %virus $+ )
  msg $chan 4End of scan
}
Posted By: Riamus2 Re: trojan scan - 09/11/11 07:49 PM
Just because someone has 2 numbers at the end of their nick doesn't in any way indicate any kind of trojan. Besides, you're using $nick($1,*)... $1 is !trojanscan in your script. That's not going to work too well.

And even if numbers really did indicate a trojan and even if the $1 was fixed, there are a variety of things in here that could be greatly improved. Things like an IF/ELSE to increment a variable. If the variable is $null, then /inc will set it to 1. So there's no reason to use an IF/ELSE. There's also no reason to use $left($right()). You can use $mid() instead. And then, of course, if you had a lot of people with numbers at the end of their nicks, you'd be sending a lot of /msg's to the channel, which would flood the channel.

In short, this isn't going to do anything useful and currently won't even work because of using $1.
Posted By: Lenooox Re: trojan scan - 09/11/11 07:54 PM
aww i understand frown I just wanted a script which
detected and kicking the infected users frown
Posted By: Riamus2 Re: trojan scan - 09/11/11 09:31 PM
There isn't any reliable way to detect anyone with a trojan. Some networks attempt it through checking various things like your identd response and ident username, but in the end, these don't really point out anyone with a trojan. Some people like using numbers. Others like random characters. That doesn't mean they are infected with anything.

If you have a specific problem in your channel, you can prevent the problem from occurring or at least limit it, but you have to script something that is specific to your exact problem for it to be much use. And if it's really a problem, you can contact the ircops there and they may take steps.
Posted By: Lenooox Re: trojan scan - 10/11/11 01:06 PM
I understand! thank you for the information!
© mIRC Discussion Forums