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 

excess flood ban tcl

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Sydneybabe
Op


Joined: 27 Apr 2007
Posts: 106
Location: Philippines

PostPosted: Sun Jul 08, 2007 10:50 pm    Post subject: excess flood ban tcl Reply with quote

hi and good days. i'm requesting a script that will ban the user disconnected with a reason of "Quit (Excess Flood)" .. thanks in advance. Smile
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon Jul 09, 2007 5:30 am    Post subject: Reply with quote

Code:
bind sign - * excess:flood

proc excess:flood {nick uhost hand chan arg} {
 if {[string equal "Excess Flood" $arg]} {
  pushmode $chan +b *!*@[lindex [split $uhost @] 1]"
 }
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Sydneybabe
Op


Joined: 27 Apr 2007
Posts: 106
Location: Philippines

PostPosted: Mon Aug 20, 2007 4:29 am    Post subject: Reply with quote

thanks Sir_Fz for the help. can i requet also a script ban the user w/ this:

* ASIA (~klg@121.250.95) Quit (Excess Flood)
* bot sets mode: -k+b Excess.Flood *!*@121.250.95

thanks in advance for the help. Very Happy
Back to top
View user's profile Send private message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Mon Aug 20, 2007 6:23 am    Post subject: Reply with quote

Here you go:

Code:

#Set the channels here for this script to work on
set quitmsgchans "#urdu #awyeah #miri"

bind sign - "*" quitmsg:ban

proc quitmsg:ban {nick uhost hand chan reason} {
  if {![botisop $chan]} { return 0 }
  if {[string equal "Excess Flood" $reason] || [string equal "SendQ exceeded" $reason]} {
   if {[lsearch -exact [split [string tolower $::quitmsgchans]] [string tolower $chan]] != -1} {
    if {![wasop $nick $chan] && ![matchattr $hand mnof|mnof $chan]} {
      pushmode $chan +b "*!*@[lindex [split $uhost @] 1]"
      pushmode $chan -k "\00312Server.\0032flood.off.\00312quit.\0032message\0036"
      timer 60 "pushmode $chan -b *!*@[lindex [split $uhost @] 1]"
      }
    }
  }
}

_________________
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon Aug 20, 2007 10:02 am    Post subject: Reply with quote

Your timer creates a vulnerability in the script which is easily exploitable, pass a list to timer instead of a string.
Code:
timer 60 [list pushmode $chan -b *!*@[lindex [split $uhost @] 1]]

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Tue Aug 21, 2007 6:15 am    Post subject: Reply with quote

Yes I know that, but for the fact that, a *!*@host.domain.com cannot contain special tcl characters to choke on, even if you use vhosts (hosts can only be aplhanumeric) if you look into the case.
_________________
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Aug 22, 2007 3:56 pm    Post subject: Reply with quote

awyeah wrote:
Yes I know that, but for the fact that, a *!*@host.domain.com cannot contain special tcl characters to choke on, even if you use vhosts (hosts can only be aplhanumeric) if you look into the case.

Yes, but $uhost (user@host) and $chan can certainly contain special tcl characters so anyone can easily exploit that code. However it doesn't matter if these characters exist or not, it's always good practice to apply these rules in scripting.

See: Script security
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Aut0Cr0ss
Voice


Joined: 15 Jun 2007
Posts: 19

PostPosted: Wed Aug 22, 2007 10:33 pm    Post subject: Reply with quote

Nice one.. Smile
Back to top
View user's profile Send private message
Sydneybabe
Op


Joined: 27 Apr 2007
Posts: 106
Location: Philippines

PostPosted: Sat Aug 25, 2007 6:04 am    Post subject: Reply with quote

thanks for the help Sir_Fz and awyeah Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests 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