Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
tcl bug

Posted by virtuoso (virtuoso), 15 December 2003
im trying to run this tcl script,but it doesn't works.
im using windrop 1.6.13.
the error message i see is :

[06:42] Tcl error in script for 'need-op':
[06:42] can't read "randbase": no such variable

can some one help me to fix it ? thanks

or if someone knows a better tcl script like this,please tell me... what i need to do is to make a botnet of dynamic ip numbers. i have no other solutions than to use this tcl.


this is the source code :



#Distributed Eggdrop Keyserver for eggdrop1.3.22

#by nullset{} (nullset@nullset.resnet.gatech.edu)

#

#This is the way overly secure opping script i wrote.

#It started off just as an op script, but then i decided to make the
distributed key server

#And use it in the op script

#It's for those of you who are way overly paranoid, such as myself.

#Please read through and edit it, as your bot will crash if you don't edit
some lines

#If you edit anything, or have questions/comments (ie it sucks, it rules,
it's way overkill)

#email them to me at the address shown above

#Future versions (if ever) will include: A C module for PGP encyrption
(hehe)

#Custom sockets

#More security checking within the script itself

#A maximum ping time so that it won't op the bot if there is more than XX
lag b/w the two

#(Prevents the bot from 'verifying' itself then lagging off right after this
bot puts in the

#mode. If this were to happen, anyone with the nick 'bot1' will be opped.

#Anything else overly complex i can think of. Please use my opping script as
an example

#Of how to use the keyserver....don't let it go to waste by jsut opping.
Send me anything you

#do based on this script.

#The last section of code is the opping script, with usage instructions.
Enjoy

###### INITIAL SETTINGS #######

#how long to keep a key before generating a new one? (in seconds, but the
clock is a bit fast)

set keepvkey "5000"

# Place the nickname of the 'keyserver' bot here

set keyserver "Nutellina"

# This is the key used to encrypt the keys. If it's more than 8 chars long,
the bot will crash

#NOTE: edit this or your bot will crash

set vkey "giustizia"

#This phrase is used to make sure the other bot knows our vkey.

set testphrase "sincerita"

#This is the keyword used for opping.....

set opvword "amore"

#A list of bots you want to receive keys/ask for ops from. noticed this bot
(bot1) isn't in

#its own list

set botlist { ada123 }

#Number of bots

set num_of_vbots "1"

############################################################################
############

#### YOU DONT NEED TO TOUCH ANYTHING BELOW HERE, BUT IF YOU DO, EMAIL ME
WHAT YOU CHANGED

#I'm nullset@nullset.resnet.gatech.edu

############################################################################
#############

#### Keyserver client proc ###########

proc newkey {from command args} {

global keyserver randbase sanekey vkey testphrase newkey

set testkey [lindex "$args" 0]

set testkeya [decrypt $vkey $testkey]

if { $testkeya == $testphrase} {

set newkey [eval lindex "$args" 1]

set randbase [decrypt $vkey $newkey]

putlog "New Key Received from $from."

}

if { $testkeya != $testphrase } {

putlog "Invalid Key Sent from $from. Decrypted = $testkeya"

}

return 0

}

####### Keyserver server proc##############

proc initialize_random {} {

global randbase randnum keepvkey vkey testphrase botlist num_of_vbots

set randbase [eval rand 720]

set keytosend [encrypt $vkey $randbase]

set encphrase [encrypt $vkey $testphrase]

#the catch is there, in case said bot isn't on the botnet

for {set botname 0} {$botname < $num_of_vbots} {incr botname} {

catch [putbot [lindex "$botlist" $botname] "NUKEY $encphrase $keytosend"]

}

utimer $keepvkey initialize_random

return 0

}

#####This is needed to call the keyserver script initially

if { $botnick == $keyserver} {

initialize_random

}

###If we aren't keyserver, we want to receive keys....

if { $botnick != $keyserver} {

bind bot - NUKEY newkey

}

#####################This is the script i wrote to op my bots using the
keys################

#To use it, do '.chanset #yourchan need-op msg_getops #yourchan' and edit
the need-op value#

#In your cfg file #

############################################################################
################

proc msg_op {nick uhost hand args} {

global randbase opvword

set chan [eval lindex "$args" 1]

set chantoop [decrypt $randbase $chan]

set testopword [eval lindex "$args" 0]

set testbase [decrypt $randbase $testopword]

if { $testbase == $opvword } {

if { [handonchan $hand $chantoop] } {

putlog "Opping $nick on $chantoop"

putserv "MODE $chantoop +o $nick"

}

}

}

bind msg b OPME msg_op

proc msg_getops {chan} {

global botlist randbase opvword num_of_vbots

putlog "Asking for ops....."

for {set botnum 0} {$botnum < $num_of_vbots} {incr botnum} {

set bottomsg [lindex "$botlist" $botnum]

set encoded [encrypt $randbase $opvword]

set chann [encrypt $randbase $chan]

putserv "PRIVMSG $bottomsg PME $encoded $chann" }

}

Posted by admin (Graham Ellis), 15 December 2003
Quick first glance - I suspect that you might be running the script without the correct password.

This is a programmer's forum for discussing programming issues between programmers and folks who are learning to program.  I'm quit happy to provide help on questions like "why doesn't my program work", but do note that this is not a forum that provides a free debugging service for folks who aren't intent on learning Tcl.

Posted by virtuoso (virtuoso), 15 December 2003
there is a bug and eggdrops aren't linked. they don't get the channel ops. im learning tcl,this tcl script is my first try to understand how this language works.

Posted by virtuoso (virtuoso), 16 December 2003
i've fixed the error,but the tcl doesn't works
anyway. there is a problem that im not able to fix,because im not so experienced with tcl
im learning,so please help me.

Posted by graham (graham), 16 December 2003
Please describe the problem as it is now exhibited (i.e. what do you do, what does the program look like, what does the program do, and what did you expect it to do) and I'll have a look and see if I can give you some pointers.

Posted by virtuoso (virtuoso), 16 December 2003
i need to have a tcl that does something like this :

when bot1 restarts / gets a new ip he privmsg's bot2 with a special password and then the ip / port, then bot2 removes bot1's old host and adds the new one (if the password is correct). not very secure since ircops can log your messages, but you could (if the correct pw is entered) open a DCC chat between bot1 and bot2 in which bot2 is asking for a level 2 password to continue)

the tcl i've posted does something like :

there is a bot HUB defined in the tcl that generates encrypted keys starting from a word that u should define inside the tcl and there are a list of bots LEAFS that receives keys/ask for ops from the HUB.
the problem is that im not able to get the op from bots where it is installed. bot HUB is generating keys,but leafs aren't able to get the op channel status after to have verified them.

in this example ,i've setup in the tcl a bot HUB called NUTELLINA and i have given the @ to it and a bot LEAF called Adaaaaa1 without @ and i see :

IN THE SHELL OF NUTELLINA

[18:08] Asking for ops.....
[18:09] Asking for ops....

IN THE SHELL OF  Adaaaaa1

[17:39] [Adaaaaa1!~Ada@host36-22.pool80116.interbusiness.it] op sk0ZC.ltaX// /Oc
Fq.i/ezq0

as u can see Adaaaaa1 asks the @ and NUTELLINA is not able to give it to him...



Posted by virtuoso (virtuoso), 16 December 2003
i've got this pointer :

set mypassword "thisisapassword"
set mykey "123imakey456"

bot1 connects, privmsg's bot2 with [encrypt $::mypassword $::mykey] followed by $::{my-ip} and the bots listen port
bot2 has a bind for privmsg, if [decrypt $::mypassword $privmsgtext] == $::mypass -> change the host

he's not able to write the complete script,cuz hardware problems of the server...

Posted by admin (Graham Ellis), 16 December 2003
I'm sorry but I'm not a great user of IRC so I'm finding it very hard to understand the question properly.  I would love to be able to provide an answer, or even some pointers, but at the moment I'm frankly rather confused as to what the question is.   Is there any way you can post up a short program of (say) 10 or 20 lines and tell us what it does and what it's supposed to do?  It would help me personally if you could explain in general computing terms rather than in IRC-speak as I have enough trouble keeping up with Perl PHP and Tcl without having to learn IRC too  

Posted by virtuoso (virtuoso), 16 December 2003
Post deleted by the moderator

This post was a copy of 6k of text from another copyrighted website.  Poster - if you are indeed the copyright holder from that other site, please let me know and I will check and re-instate it

Posted by admin (Graham Ellis), 16 December 2003
I am about to delete the content of the previous post. It appears to be a copy of http://www.egghelp.org/whatis.htm, which is copyright information.

If you want to refer to a long article on another web site, you are welcome to post a link to it on this board - that's legal and works well for everyone.  If you copy and paste an article that's many kilobytes long, that is likely to be illegal and as moderator, sorry, I have to remove it.

Your remain welcome to post a Tcl program of 10 to 20 lines to illustrate your problem, and I will have a look at that and attempt to provide you with some assistance if you do.

Posted by virtuoso (virtuoso), 17 December 2003
ok,i've copied informations from this link :

http://www.egghelp.org/whatis.htm,

thinking that these informations could be useful for u,helping u to understand better my problems.
i can't explain it by writing 20 lines of code,im haven't so much tcl knowledge to do it. i can explain the problem only by words,but i have done it ,already. if u can ask to me the points that u haven't understood,we can make some faster progress. thanks




Posted by admin (Graham Ellis), 17 December 2003
I have no doubt that you hadn't thought it through when you pasted the copyrighted description to this board.  Situation now corrected, thank you.   Personally, your question remains beyond me I'm afraid; I'm fine at looking at / advising on Tcl code and very happy to do so for free where the code is a few lines long and clearly illustrates a problem.  But there aren't enough hours in the day to learn about other background applications if such is necessary for me to help, as you're telling me is the case.

It's possible that someone else on this forum may be able to help, so don't give up hope.  And have you tried posting to forums that are more particularly geared to IRC and Eggdrop questions / problems?  A final idea - I suspect that your first language is Italian or Spanish; I'm afraid I don't know either of those langauges, but if you were to find a forum / correspondent with the same first language, that might make it easier too.  I do admire people who know English well enough as a second language to post in it - I really wish I could respond in their first language, but the fact remains that it does add one extra level we have to get through as I don't have those skills.



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho