egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

script causes eggdrop bug

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Sun Oct 09, 2005 4:16 pm    Post subject: script causes eggdrop bug Reply with quote

Ok. I decided to modify the code which awyeah made, his w32aplore code, and wiebe's ircworm script. But now, when the eggdrop (its a windrop)connects to irc with this script loaded and joins #antipjen it causes a bug.

The bug:

Code:
<level93|Tosser> .+chan #antipjen
<aP|Drone> [20:46] tcl: builtin dcc call: *dcc:+chan Tosser 9 #antipjen
<aP|Drone> [20:46] #Tosser# +chan #antipjen
<aP|Drone> [20:46] Tcl error [w32aplore:virus]: no such channel record
<aP|Drone> [20:46] * Last context: tclhash.c/684 [Tcl proc: *join:notes, param:  $_jp1 $_jp2 $_jp3 $_jp4]
<aP|Drone> [20:46] * Please REPORT this BUG!
<aP|Drone> [20:46] * Check doc/BUG-REPORT on how to do so.
<aP|Drone> [20:46] * Wrote DEBUG
<aP|Drone> [20:46] * SEGMENT VIOLATION -- CRASHING!
-
DCC session closed


The antipjen code:

Code:
#by wiebe @ QuakeNet

#counters this worm http://www.vsantivirus.com/drefir-e.htm

setudef flag antipjen
setudef str antipjen_scanned
setudef str antipjen_detected
setudef str antipjen_kicked
setudef str antipjen_id

bind join -|- * ircworm:join
bind join - "*" w32aplore:virus
bind join -|- * check:op:join
bind pub - !antipjen pub:antipjen:toggle
bind msg - antipjen antipjen:toggle 

proc ircworm:join { nick uhost handle chan } {
if {![isbotnick $nick]} {
if {[channel get $chan antipjen]} {
[expr [channel get $chan "antipjen_scanned"] +1]
#the nicks
  set pjennicks "Zenia Zoe Zilya Xenia Xylia Xandra Willa Wendy Vicky Vivian Violet Valora Vanessa Valda Ula Uma Sharon Silver Rosa Ruby Rita Rae Rachel Queen Peggy Pamela Olivia Olga Nicole Naomi Natalie Nora Nina Nova Nadia Maia Mary Melody Mimi Myra Linda Lisa Lolita Lynn Laura Lara Kara Kassia Kyle Kali Kacey Katrina Janet Jewel Joanna Juliet Julie Ida Idona Isabel Iris Ivana Ivory Helga Holly Haley Gloria Gilda Gale Faith Emily Evelyn Eve Erika Eliza Eden Ebony Donna Dora Doris Diana Danielle Daria Damita Camille Cara Carla Carmen Clarissa Chelsea Caitlin Bettina Blenda Bridget Briana Bella Becky Barbra Aldora Alysia Amorita Aretina Ara April Anita"

#check if nick ends in 2 digits and the rest of the nick is in the list
  if { [regexp {\d\d$} $nick] && ![string equal [lsearch -exact [split $pjennicks] [string range $nick 0 end-2]] -1] || [string match "*$pjennicks*" "[lindex [split $uhost @] 0]"] } {

#increase the detected counter
[expr [channel get $chan "antipjen_detected"] +1]

#set mask to ban
    set ban *!*@[lindex [split $uhost @] 1]

#increase the antipjen id counter
[expr [channel get $chan "antipjen_id"] +1]

#ban
if {[botisop $chan]} {
putquick "KICK $chan $nick :\[IrcWorm-1.3\] infected drone detected \(ID: [channel get $chan antipjen_id]\) \(Anti-pjen bot by #antipjen\)"
[expr [channel get $chan "antipjen_kicked"] +1]
} else {
putserv "PRIVMSG $chan :#Antipjen: If im not oped within 3 minutes i will part $chan \(Anti-pjen bot by #antipjen\)"
utimer 3 [check:op $chan]
}
newchanban $chan $ban $::botnick "\[IrcWorm-1.3\] infected drone detected \(ID: [channel get $chan antipjen_id]\) \(Anti-pjen bot by #antipjen\)" 0
      }   
    }
  }
}

proc check:op {chan} {
if {[string equal -nocase $::botnick $nick]} {
if {![botisop $chan]} {
set reason "no op"
putserv "PRIVMSG $chan :This channel has been deleted \(Reason: $reason\) \(Anti-pjen bot by #antipjen\)"
channel remove $chan
lappend suspended $chan $reason
putserv "PRIVMSG #antipjen :Channel '$chan' has be deleted from my channel list \(Reason: $reason\)"
}
}
}

proc check:op:join {nick host hand chan} {
if {[string equal -nocase $::botnick $nick]} {
if {![botisop $chan]} {
set reason "no op"
putserv "PRIVMSG $chan :This channel has been deleted \(Reason: $reason\) \(Anti-pjen bot by #antipjen\)"
channel remove $chan
lappend suspended $chan $reason
putserv "PRIVMSG #antipjen :Channel '$chan' has be deleted from my channel list \(Reason: $reason\)"
}
}
}




bind raw -|- "315" ircworm:raw

proc ircworm:raw { server numeric text } {
  set chan [string tolower [lindex [split $text] 1]]

#invalid chan
  if { ![validchan $chan] } { return 0 }

#check if we recently joined
  if { [expr [unixtime] - [getchanjoin $::botnick $chan]] > "60" } { return 0 }

#check each user
  foreach nick [chanlist $chan] { ircworm:join $nick [getchanhost $nick] [nick2hand $nick] $chan }
}

proc w32aplore:virus {nick uhost hand chan} {
if {[channel get $chan antipjen]} {
[expr [channel get $chan "antipjen_scanned"] +1]
if {![isbotnick $nick] && ![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]]} {
[expr [channel get $chan "antipjen_detected"] +1]
[expr [channel get $chan "antipjen_id"] +1]
if {[botisop $chan]} {
putquick "KICK $chan $nick :\[W32@aplore] infected drone detected \(ID: [channel get $chan antipjen_id]\) \(Anti-pjen bot by #antipjen\)"
[expr [channel get $chan "antipjen_kicked"] +1]
} else {
putserv "PRIVMSG $chan :#Antipjen: If im not oped within 3 minutes i will part $chan \(Anti-pjen bot by #antipjen\)"
utimer 3 [check:op $chan]
}
newchanban $chan $ban $::botnick "\[W32@aplore] infected drone detected \(ID: [channel get $chan antipjen_id]\) \(Anti-pjen bot by #antipjen\)" 0
}
}
}
}

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
}

proc antipjen:toggle {n u h t} {
  set channel [lindex [split $t] 0]
  set option [lindex [split $t] 1]
  switch exact $option {
    "on" {
      if {[matchattr $h nmA|]} {
        if {![validchan $channel]} {
          putserv "NOTICE $n :Channel '$channel' is not a valid channel"
          } else {
          if {[channel get $channel "antipjen"]} {
            putserv "NOTICE $n :Anti-pjen is already enabled for $channel"
            } else {
            channel set $channel +antipjen
            putserv "NOTICE $n :Done"
          }
        }
      }
    }
    "off" {
      if {[matchattr $h nm|]} {
        if {![validchan $channel]} {
          putserv "NOTICE $n :Channel '$channel' is not a valid channel"
          } else {
          if {![channel get $channel "antipjen"]} {
            putserv "NOTICE $n :Anti-pjen is already disabled for $channel"
            } else {
            channel set $channel -antipjen
            putserv "NOTICE $n :Done"
          }
        }
      }
    }
    "default" {
      if {[matchattr $h nm|]} {
        if {![validchan $channel]} {
          putserv "NOTICE $n :Channel '$channel' is not a valid channel"
          } else {
          if {[channel get $channel "antipjen"]} {
            putserv "NOTICE $n :Anti-pjen is enabled for $channel"
            } else {
            putserv "NOTICE $n :Anti-pjen is disabled for $channel"
          }
        }
      }
      putserv "NOTICE $n :Please use: /msg $::botnick $::lastbind on|off"
    }
  }
}

proc pub:antipjen:toggle {n u h c t} {
set option [lindex [split $t] 0]
if {$option == "stats"} {
putserv "NOTICE $n :Stats for $c: Scanned: [channel get $c "antipjen_scanned"] Detected: [channel get $c "antipjen_detected"] Kicked: [channel get $c "antipjen_kicked"]"
} else {
putserv "NOTICE $n :Please use: $::lastbind stats"
}
}

putlog "anti-pjen.tcl loaded!!"


Please help me, i dont see how this tcl script can cause such a bug.

Thanks in advance !!! Smile
_________________
r0t3n @ #r0t3n @ Quakenet
Back to top
View user's profile Send private message MSN Messenger
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sun Oct 09, 2005 5:28 pm    Post subject: Reply with quote

irrelevant & wrong forum

awyeah's script is obviously buggy, but no script bug should ever crash eggdrop; report to eggheads or winheads
_________________
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Sun Oct 09, 2005 9:17 pm    Post subject: Reply with quote

Tosser^^ wrote:
Ok. I decided to modify the code which awyeah made ...

Is it any wonder?
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber