Viewing topic:IRC bot protection
Page:
1
01-03-2008 - 14:04
Your bot tutorial is great btw, if I didnt say it yet :P. I am still a n00b, but I am getting a hold of this added some new things, but I cant get hold of bots protection.
The problem is that, I can normally /msg the bot , but all commands work as this too, so when someone who has access to !die command will /msg bot he will die.
I cant find a good way to "ignore" everything that comes in as /msg. So I would need little assistence again
Your site is great btw
The problem is that, I can normally /msg the bot , but all commands work as this too, so when someone who has access to !die command will /msg bot he will die.
I cant find a good way to "ignore" everything that comes in as /msg. So I would need little assistence again

Your site is great btw
01-03-2008 - 16:13
Admin systems are quite easy actually. The way i do it is by nickname and hostname. I store all the admins by Hostname in a SQL table, and when a special command is triggered, i first check the database for the hostname, if the hostname excists, i will excecute the command, else i don't.
You need help with that code or is it ok?
(i have the code so dont hestitate asking)
You need help with that code or is it ok?
(i have the code so dont hestitate asking)
01-03-2008 - 17:01
Thats nice I know what you mean. But actually I mean this - If bot will get - "/query bot !command" I want him to ignore everything that comes this way. Because theoreticaly everyone can do it, it doesnt matter which access level he has.
I tried similar method as with PING, but its not working
The auth system is not so hard indeed, but I want to code him so, he will ignore everything from "/query".
Thanks for your fast reply
I tried similar method as with PING, but its not working

The auth system is not so hard indeed, but I want to code him so, he will ignore everything from "/query".

Thanks for your fast reply
01-03-2008 - 17:47
Hmm i think im too much of a programmer, what the heck is /query?
. Via a notice or pm or something?
If thats the case, you can check if it's a notice with ex2, (PRIVMSG will be NOTICE afaik), and when it's pm the channel is a user, so it won't start with "#".
. Via a notice or pm or something?If thats the case, you can check if it's a notice with ex2, (PRIVMSG will be NOTICE afaik), and when it's pm the channel is a user, so it won't start with "#".
01-03-2008 - 17:58
I will try and "/query" is pm
01-03-2008 - 18:08
01-03-2008 - 22:30
And here I am again lol.
I understand what I need to do, but still I was unable to do it... I dont know how to check it.
Sorry for being a total n00b, but begginings are always hard 
Though, like you said before Auth system is really easy and it works perfectly, but adding admins manually is not very handy, cause I want to code him as flexible as possible.
Inserting data into sql shouldnt be a problem, but again I would need little assistance with reading the data. It should look like this
!register username
but it would store the hostname also, which I dont know if he should write there. And that moves me to another question lol.
Example code would be really nice
And fot the hostname, can vhost (virtual host, example - realshadow@real.shadow) be used as hostname?
Now really sorry for n00bish questions
I understand what I need to do, but still I was unable to do it... I dont know how to check it.
Sorry for being a total n00b, but begginings are always hard 
Though, like you said before Auth system is really easy and it works perfectly, but adding admins manually is not very handy, cause I want to code him as flexible as possible.
Inserting data into sql shouldnt be a problem, but again I would need little assistance with reading the data. It should look like this
!register username
but it would store the hostname also, which I dont know if he should write there. And that moves me to another question lol.
Example code would be really nice

And fot the hostname, can vhost (virtual host, example - realshadow@real.shadow) be used as hostname?
Now really sorry for n00bish questions

01-03-2008 - 23:16
No! Their not noobish in a way! 
Well first, why not letting a user PM a password for inserting a hostname in the table? At least that's how i use it.
Eg:
PM: !admin register _password_
Bot checks if password is true, and adds the hostname to the table (remember the piece of code i posted on the tutorial page where you can extract the hostname).
Later you can create a test function:
!admin test
Checks the hostname of the user, and checks it against the hostnames stored in the table, and gives an error when hostname does not excist.
This way seems pretty simple.
Also, please keep security in mind! When letting the users insert information that is used with SQL, make sure it's save!
Please check out this tutorial, it will explain it in the detail.
(Oh, and can you tell me what you miss in this site? In the news on the frontpage.. Thanks in advance!
)

Well first, why not letting a user PM a password for inserting a hostname in the table? At least that's how i use it.
Eg:
PM: !admin register _password_
Bot checks if password is true, and adds the hostname to the table (remember the piece of code i posted on the tutorial page where you can extract the hostname).
Later you can create a test function:
!admin test
Checks the hostname of the user, and checks it against the hostnames stored in the table, and gives an error when hostname does not excist.
This way seems pretty simple.

Also, please keep security in mind! When letting the users insert information that is used with SQL, make sure it's save!
Please check out this tutorial, it will explain it in the detail.
(Oh, and can you tell me what you miss in this site? In the news on the frontpage.. Thanks in advance!
)
02-03-2008 - 00:09
Thanks a lot, I will try it tomorrow and then propably stop coding my bot for a while lol. Until I will find a good way to bypass uni's firewall for better testing.
And continue on my website for a while, but its using blog system, so I will stick around there for a while
.. I am not much into PHP yet. I am more XHTML/CSS guy 
And for the news thingy, I think its fine. Though if I may suggest a change then there are two things bothering me a little.
1. Up you have your navigation page - Navigation: Combined Minds > Forum > Reply . I think it would be better if you would use them as links so you can go back back in tree using ancestors and stuff.
2. Maybe you should find better place for search box.
Thats all, I like it here, everything is fine, clear and easy to use.
And continue on my website for a while, but its using blog system, so I will stick around there for a while
.. I am not much into PHP yet. I am more XHTML/CSS guy 
And for the news thingy, I think its fine. Though if I may suggest a change then there are two things bothering me a little.
1. Up you have your navigation page - Navigation: Combined Minds > Forum > Reply . I think it would be better if you would use them as links so you can go back back in tree using ancestors and stuff.

2. Maybe you should find better place for search box.

Thats all, I like it here, everything is fine, clear and easy to use.

02-03-2008 - 16:12
Hi Jim. Everything works fine, I was even able to fix the pm problem and now I can finally perfectly read how our array is processing
and also the !register command works perfect, however.. after the data is stored in database and I use command for identify, it wont work because bot needs to be reloaded. Like when you code something and you need to hit refresh to see results and now I am not sure what to do 
Have a nice day
and also the !register command works perfect, however.. after the data is stored in database and I use command for identify, it wont work because bot needs to be reloaded. Like when you code something and you need to hit refresh to see results and now I am not sure what to do 
Have a nice day
02-03-2008 - 18:50
Hmm, that problem can be helped. Take a look at the eval() function at PHP.net
. You can just edit PHP in a SQL table and excecute it via eval();
. You can just edit PHP in a SQL table and excecute it via eval();
Page:
1
Reply to topic
Reply to topic

