| View previous topic :: View next topic |
| Author |
Message |
rt Voice
Joined: 08 Jul 2005 Posts: 25
|
Posted: Mon Jul 25, 2005 4:04 pm Post subject: Drone join. |
|
|
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: |
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."
}
} |
|
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Mon Jul 25, 2005 4:35 pm Post subject: |
|
|
thats trojan(pjen) infect users. Not drone's. So the name should be Pjen join . _________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Mon Jul 25, 2005 6:04 pm Post subject: |
|
|
Read this post. _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
rt Voice
Joined: 08 Jul 2005 Posts: 25
|
Posted: Mon Jul 25, 2005 6:45 pm Post subject: |
|
|
| Tosser^^ wrote: | thats trojan(pjen) infect users. Not drone's. So the name should be Pjen join . |
Be quiet already, take the bloody hint
thanks Alchera for the URL |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Wed Aug 10, 2005 9:47 pm Post subject: |
|
|
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: |
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.
================================== |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Thu Aug 11, 2005 12:42 am Post subject: |
|
|
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) |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Thu Aug 11, 2005 4:42 am Post subject: |
|
|
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.
================================== |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Aug 11, 2005 8:32 am Post subject: |
|
|
You're saying that it's Oz's addon translated into Tcl, well that's exactly what my code is. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Thu Aug 11, 2005 1:11 pm Post subject: |
|
|
| 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 |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Thu Aug 11, 2005 8:31 pm Post subject: |
|
|
| 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.
| 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 |
|
| Back to top |
|
 |
helpme Voice
Joined: 08 May 2005 Posts: 17
|
Posted: Sat Dec 17, 2005 11:23 am Post subject: |
|
|
Is this Script auto active on all Channels, or may i use .chanset #chan +???
| Code: |
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
} |
|
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Sat Dec 17, 2005 11:27 am Post subject: |
|
|
Use this one:
| Code: | ###################################################################
# #
# 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 |
|
| Back to top |
|
 |
helpme Voice
Joined: 08 May 2005 Posts: 17
|
Posted: Sat Dec 17, 2005 11:43 am Post subject: |
|
|
| thx, when i use: set aplore(chans) "" << this mean that the script is active on all channels? |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Dec 17, 2005 12:24 pm Post subject: |
|
|
No, set aplore(chans) "" means the script is inactive on all channels. If you want it active on all channels then use
| Code: | | set aplore(chans) [channels] |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
helpme Voice
Joined: 08 May 2005 Posts: 17
|
Posted: Sat Dec 17, 2005 12:34 pm Post subject: |
|
|
Ah ok thx, so is this right?
| Code: | ###################################################################
# #
# 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..." |
|
|
| Back to top |
|
 |
|