I've got a channel where every command is outputted and so when a channel is created and registered, the channel says:
Code: Select all
<Global> ChanServ: Channel '#Cottage-by-the-Sea' registered by Dorian
Can someone assist me?
Code: Select all
<Global> ChanServ: Channel '#Cottage-by-the-Sea' registered by Dorian
Code: Select all
proc pub:global:chanreg {nick host handle channel text} {
global botnick
set type [lindex $text 0]
if {$type == "Channel"} {
set newchan [lindex [split [lindex $text 1] "'"] 1]
if {![validchan $newchan]} {
channel add $newchan
puthelp "PRIVMSG ChanServ :SOP $newchan ADD $botnick"
return 1
}
}
}
bind pub -|- "ChanServ:" pub:global:chanreg
Code: Select all
# Make sure you set the full hostname here. (this is to make sure it's not spoofed)
set chanserv(source) "Global!user@hostname"
# This is the message that's sent by the service (don't change it)
set chanserv(pattern) "ChanServ: Channel '*' registered by *"
# The channel in which the service sends the message.
set chanserv(channel) "#servicechannel"
bind pub -|- "ChanServ:" pub:global:chanreg
proc pub:global:chanreg {nick host handle channel text} {
global chanserv
if {[string equal -nocase $channel $chanserv(channel)] && [string equal -nocase $nick!$host $chanserv(source)] && [string match -nocase $chanserv(pattern) $text]} {
set text [string map [list ' ""] $text]
set channel [lindex [split $text] 2]
if {![validchan $channel]} {
channel add $channel
}
}
}
Actually, regardless of if the sender is on the channel or not, the nickname and user@hostname are still sent with the PRIVMSG.TCL_no_TK wrote:It would be difficult to make this type of script secure. I'm sure the person that owns the bot/network would of increased security my means such as locking the channel ...etc as this tends to be strongly adviced when having services log to a channel. On a scripting note, Is it even possible to check the hostmask of Global in this situation, since it wouldn't be on the channel (unless you use a module to do this*). I assumed this type of thing would be the same as a server sending msg's to a channel.
Thanks, good to know. Was thinking of server's... regardless of if the sender is on the channel or not, the nickname and user@hostname are still sent with the PRIVMSG.
I was aware of this but as i stated, it would be difficult to make this type of script secure. As you said i think it would be better to use network services such as BotServ for this type of thing.Also _YOUR_ script was so insecure it would allow any user to add channels regardless of who said the line.
Since the eggdrop would be on alot of channels it would allow any user to spam the bot by adding it to dozens if not hundreds of channels.
These comments would be better off left for private message, since i cant see them being constructive/relivant to this topic. I like giving my input and asking questions about scripting on differant posts as long as i dosen't disrupt it. I dont think it would appropriate to pick out "security holes" in each others code like this.Not to sound smug or arrogant but if you don't know about the IRC protocol then please don't tell me that my script is pointless.
My script is pretty much as secure as it can get whilst yours is an open book to any user.