This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Drone join.

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
r
rt
Voice
Posts: 25
Joined: Fri Jul 08, 2005 4:00 pm

Drone join.

Post by rt »

I'm just wondering if someone could give me some tips/advice on how I could improve this script and more effectivly find trojan drones..

FYI: varin/vardel is a script which helps you write to file.

Code: Select all


proc h:join {nick host hand chan text} { 
set host [lindex [split $host "@"] 1]
     if {[checkexcept $host]} { return 0 }
     if {[string match -nocase *users.quakenet.org* $host]} { 
     return 0 
   } 
   
   if {[string is digit -strict [string range $nick end-1 end]] || [string match -nocase {*[bcdfghjklmnpqrstvxyz]*} "$nick"]} { 
   putserv "NOTICE $nick :You are infected with an IRC trojan, if this is not true, /msg $::botnick delete and change your nickname without two numbers."
   varin /home/rt/stats $host "\002Stats for $host:\002 added by :$::botnick - channel: n/a"
     varin /home/rt/stats $chan "$::botnick [incr [varout /home/rt/stats $chan] 1]"
     dccbroadcast "(\002$host\002)  has been added to the antipjen pjen db."
   }
}
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

thats trojan(pjen) infect users. Not drone's. So the name should be Pjen join :D.
r0t3n @ #r0t3n @ Quakenet
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Read this post.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
r
rt
Voice
Posts: 25
Joined: Fri Jul 08, 2005 4:00 pm

Post by rt »

Tosser^^ wrote:thats trojan(pjen) infect users. Not drone's. So the name should be Pjen join :D.
Be quiet already, take the bloody hint

thanks Alchera for the URL
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

I made a w32.aplore@mm script too, but never released it. It is based on the same logic as the famous mIRC 'OzScript' just converted it into TCL.

Here is also my drone nick remover script, should give it a go:
www.coresynk.net/tclscripts/scripts/dronenick.zip @ www.awyeah.org

Code: Select all

bind join - "*" w32aplore:virus

proc w32aplore:virus {nick uhost hand chan} {
 if {![isbotnick $nick] && [botisop $chan] && ![isop $nick $chan] && ![isvoice $nick $chan] && ![string equal -nocase "#indiahelp" $chan] && [regexp -nocase {^[a-z]{4,}[0-9]{2}$} $nick] && [string equal "~" [string index [lindex [split $uhost @] 0] 0]] && [regexp -all {^[^{}\\\[\\\]-_^`|\\\\]$} $nick] && [string equal "1" [check:ip [lindex [split $uhost @] 1]]] && [string match "*\[0-9\]\[0-9\]*" [string range [string trimleft [lindex [split $uhost @] 0] ~] [expr [string length [string trimleft [lindex [split $uhost @] 0] ~]]-2] end]]} {
  if {[string equal [string trimleft [lindex [split $uhost @] 0] ~] $nick] && [string equal [string length [string trimleft [lindex [split $uhost @] 0] ~]] [string length $nick]] || [string equal "2" [string length [string trimleft [lindex [split $uhost @] 0] ~]]] && [string equal [string range [string trimleft [lindex [split $uhost @] 0] ~] [expr [string length [string trimleft [lindex [split $uhost @] 0] ~]]-2] end] [string range $nick [expr [string length $nick]-2] end]]} {
    putquick "MODE $chan +b *!*@[lindex [split $uhost @] 1]" -next; timer 120 "pushmode $chan -b *!*@[lindex [split $uhost @] 1]"
    putquick "KICK $chan $nick :0,1 Virus Infected Kick 12,0 - Possible 2w32.aplore@mm trojan/virus 12infected 2drone. 12Please 2join #nohack 12for assistance on 2how to clean 12your 2infected PC."
    }
  }
}

proc check:ip {str} {
  set tmp [split $str .]
  if {[llength $tmp] != 4} then {
    return 0
  }
  set index 0
  foreach i $tmp {
    if {(([regexp \[^0-9\] $i]) || ([string length $i] > 3) || (($index == 3) && (($i > 254) || ($i < 1))) || (($index <= 2) && (($i > 255) || ($i < 0))))} then {
      return 0
    }
    incr index
  }
  return 1
}
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

awyeah, you are doing everything possible to prove that Tcl could be wtite-only language too, just like Perl

not only your ifs are awful and almost impossible to read, they are also inefficient, with all those deeply nested mixed string/list operations; you are in dire need to cleanup your scripting style (please don't take offense)
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Well yeah this piece of code is quite complicated because I have used string range especially in here. Somtimes I too get confused because of the length of the conditions. But then again my conditions have more checks than Sir_Fz's script's w32.aplore script.

Try the script and you will see no error. This script has a 100% success rate and 0% error rate -- I've used it alot myself so I know. The logic coded is as same as Oz Script, but turned into TCL. Well the more conditions you have the more less likely you would be kicking out innocent users.

Then again there are only 2 if statements for condition checking. You can merge them into one if you don't like two, but it all gets messy the more the longer the condition statements are.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

You're saying that it's Oz's addon translated into Tcl, well that's exactly what my code is.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

the point is not whether your script works or not, the point is to produce readable, understandable and easily maintainable source code; If you ever get involved in professional software development, you'll know what I mean
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Sir_Fz wrote:You're saying that it's Oz's addon translated into Tcl, well that's exactly what my code is.
I use your code my friend. Purrfect! Is simple too, which can only be good. :D
demond wrote:the point is not whether your script works or not, the point is to produce readable, understandable and easily maintainable source code; If you ever get involved in professional software development, you'll know what I mean
Couldn't agree more. Using the KISS (Keep It Simple Stupid) principle, a simple 'one-liner' does exactly what some spend 80 or so lines on. I cannot fathom the reasoning behind such bloated coding.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
h
helpme
Voice
Posts: 17
Joined: Sun May 08, 2005 11:07 am

Post by helpme »

Is this Script auto active on all Channels, or may i use .chanset #chan +???

Code: Select all

bind join - "*" w32aplore:virus

proc w32aplore:virus {nick uhost hand chan} {
 if {![isbotnick $nick] && [botisop $chan] && ![isop $nick $chan] && ![isvoice $nick $chan] && ![string equal -nocase "#indiahelp" $chan] && [regexp -nocase {^[a-z]{4,}[0-9]{2}$} $nick] && [string equal "~" [string index [lindex [split $uhost @] 0] 0]] && [regexp -all {^[^{}\\\[\\\]-_^`|\\\\]$} $nick] && [string equal "1" [check:ip [lindex [split $uhost @] 1]]] && [string match "*\[0-9\]\[0-9\]*" [string range [string trimleft [lindex [split $uhost @] 0] ~] [expr [string length [string trimleft [lindex [split $uhost @] 0] ~]]-2] end]]} {
  if {[string equal [string trimleft [lindex [split $uhost @] 0] ~] $nick] && [string equal [string length [string trimleft [lindex [split $uhost @] 0] ~]] [string length $nick]] || [string equal "2" [string length [string trimleft [lindex [split $uhost @] 0] ~]]] && [string equal [string range [string trimleft [lindex [split $uhost @] 0] ~] [expr [string length [string trimleft [lindex [split $uhost @] 0] ~]]-2] end] [string range $nick [expr [string length $nick]-2] end]]} {
    putquick "MODE $chan +b *!*@[lindex [split $uhost @] 1]" -next; timer 120 "pushmode $chan -b *!*@[lindex [split $uhost @] 1]"
    putquick "KICK $chan $nick :0,1 Virus Infected Kick 12,0 - Possible 2w32.aplore@mm trojan/virus 12infected 2drone. 12Please 2join #nohack 12for assistance on 2how to clean 12your 2infected PC."
    }
  }
}

proc check:ip {str} {
  set tmp [split $str .]
  if {[llength $tmp] != 4} then {
    return 0
  }
  set index 0
  foreach i $tmp {
    if {(([regexp \[^0-9\] $i]) || ([string length $i] > 3) || (($index == 3) && (($i > 254) || ($i < 1))) || (($index <= 2) && (($i > 255) || ($i < 0))))} then {
      return 0
    }
    incr index
  }
  return 1
} 
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Use this one:

Code: Select all

###################################################################
#                                                                 #
# Coded by: Opposing (Fz@nexushells.net) - #nexushells @ DALnet   #
# Version: 1.0                                                    #
##                                                                #
# Description: Bankicks nicks who are suspicious of being         #
#              infected with w32.aplore@mm Trojan/Virus/Worm.     #
#              Translated from the Oz mirc addon.                 #
#                                                                 #
# Report bugs/suggestions to Fz at nexushells.net                 #
###################################################################
#
##############################
# Configurations start here: #
# __________________________ #

## Set the channels you want this script to work on.
## example: set aplore(chans) "#chan1 #chan2" (in lowercase)
set aplore(chans) "#chan1 #chan2"

## Set the kick message.
set aplore(kmsg) "w32.aplore@mm Trojan/Virus/Worm Infected."

## Set, in minutes, ban time for this offence.
set aplore(btime) "30"

# Configurations end here. #
############################
#
######################################################################
# Code starts here, please do not edit anything unless you know TCL: #
# __________________________________________________________________ #

bind join - * aplore:kick

proc aplore:kick {nick uhost hand chan} {
 global aplore
 set aplorenick 0
 if {([string is alpha $nick]) || ([string match *\[-^`_\]* $nick]) || ([lsearch -exact $aplore(chans) [string tolower $chan]] == -1)} { return 0 }
 scan $uhost %\[^@\]@%s ident host
 if {([string match -nocase "*[set sident [string trimleft $ident ~]]*" $nick]) && ([string is alpha [string range $nick 0 3]]) && ([string is integer [string range $nick end-1 end]]) && ([string is integer [string index $sident end]]) && ([string index $ident 0] == "~")} {
  putquick "KICK $chan $nick :$aplore(kmsg)"
  putquick "MODE $chan +b *!*@$host"
  putlog "\002$nick\002!\002$ident\002 is infected with w32.aplore@mm."
 }
}

putlog "w32.aplore@mm bankick v1.0 by Opposing Loaded..."
Can be configured for more than one channel via 'set aplore(chans)'
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
h
helpme
Voice
Posts: 17
Joined: Sun May 08, 2005 11:07 am

Post by helpme »

thx, when i use: set aplore(chans) "" << this mean that the script is active on all channels?
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

No, set aplore(chans) "" means the script is inactive on all channels. If you want it active on all channels then use

Code: Select all

set aplore(chans) [channels]
h
helpme
Voice
Posts: 17
Joined: Sun May 08, 2005 11:07 am

Post by helpme »

Ah ok thx, so is this right?

Code: Select all

###################################################################
#                                                                 #
# Coded by: Opposing (Fz@nexushells.net) - #nexushells @ DALnet   #
# Version: 1.0                                                    #
##                                                                #
# Description: Bankicks nicks who are suspicious of being         #
#              infected with w32.aplore@mm Trojan/Virus/Worm.     #
#              Translated from the Oz mirc addon.                 #
#                                                                 #
# Report bugs/suggestions to Fz at nexushells.net                 #
###################################################################
#
##############################
# Configurations start here: #
# __________________________ #

## Set the channels you want this script to work on.
## example: set aplore(chans) "#chan1 #chan2" (in lowercase)
set aplore(chans) [channels]

## Set the kick message.
set aplore(kmsg) "w32.aplore@mm Trojan/Virus/Worm Infected."

## Set, in minutes, ban time for this offence.
set aplore(btime) "30"

# Configurations end here. #
############################
#
######################################################################
# Code starts here, please do not edit anything unless you know TCL: #
# __________________________________________________________________ #

bind join - * aplore:kick

proc aplore:kick {nick uhost hand chan} {
 global aplore
 set aplorenick 0
 if {([string is alpha $nick]) || ([string match *\[-^`_\]* $nick]) || ([lsearch -exact $aplore(chans) [string tolower $chan]] == -1)} { return 0 }
 scan $uhost %\[^@\]@%s ident host
 if {([string match -nocase "*[set sident [string trimleft $ident ~]]*" $nick]) && ([string is alpha [string range $nick 0 3]]) && ([string is integer [string range $nick end-1 end]]) && ([string is integer [string index $sident end]]) && ([string index $ident 0] == "~")} {
  putquick "KICK $chan $nick :$aplore(kmsg)"
  putquick "MODE $chan +b *!*@$host"
  putlog "\002$nick\002!\002$ident\002 is infected with w32.aplore@mm."
 }
}

putlog "w32.aplore@mm bankick v1.0 by Opposing Loaded..."
Post Reply