Psotnic 0.2.x HOWTO [EN]
This file contains basics that are needed to setup (and use) psotnic irc bot.
Please read this file before asking any dumb questions.
Have a nice time reading it.
1. Config file options
Mandatory options for all bots |
nick |
bot's nickname |
realname |
bot's real name |
nickappend |
bunch
of characters that will be appended to nick if it is taken (eg. -|`^,
this setting is taken in consideration if `altuidnick' is set to 0) |
myipv4 |
ip address of the bot (eg. 88.45.56.15, 0.0.0.0 means any address) |
Mandatory options for main bot |
listen |
port on which main is listening for connections from slaves and owners (eg. 12345) |
ownerpass |
md5sum of owner password (main pass) for partyline (to make a md5hash run ./psotnic -p) |
Additional options for main bot |
ssl_listen |
SSL secured port for partyline access, to connect use openssl s_client command (man s_client). |
Mandatory options for main slave |
listen |
port on which slave is listening for connections from leafes (eg. 12345) |
hub |
ip, port, pass of the main bot (eg. 123.123.123.123 9000 some_password) |
Mandatory options for leafs |
hub |
ip, port, pass and slave handle name (eg. 111.111.111.111 8000 some_password slave1) |
Additional oprtion for leafs |
alt |
ip, port of alternative slave (eg. 1111.111.222.222 9000, it can be set more than once) |
Additional options for all
bots |
ident |
bot's username (default: same as account name) |
handle |
bot's handle that is visible in the partyline (default: same as nick) |
vhost |
ipv4 or ipv6 address (e.g: 217.2.3.54 or 3ffe:2f4:56:35:0:0:0:23),
domain names are not supported (default: determined by the operating
system) |
logfile |
file where bot logs some actions (default: /dev/null :) |
userlist |
userlist (aka. userfile) will be stored there (default: $nick.ul) |
altuidnick |
turns on/off changing of nick to 0 when nick is taken (by default it is turned ON) |
ctcptype |
ctcp
version (default: random). Available options: 0 = none, 1 = psotnic, 2
= irssi, 3 = epic, 4 = lice, 5 = bitchx, 6 = dzony loker, 7 = luzik, 8
= mirc 6.14 |
keepnick |
keepnick (default: 0) |
kickreason |
kick reason
used for most kicks |
limitreason |
kick reason used when somebody overrides channel limit |
keepoutreason |
kick reason for keepout setting |
partreason |
part reason |
quitreason |
quit reason |
cyclereason |
cycle reason |
bnc |
ip, port, pass of the bnc (only BNC from www.gotbnc.com is supported) |
router |
ip, port, pass of the router (only cisco routers are supported) |
Addition options for all bots, those options can be set more then once |
server |
ipv4 (or ipv6 in case of 0.2.3 or newer) address and port of irc server. Additionally you can add a password, if this is necessary to connect. (eg. 218.234.456.123 6667 password) |
server6 |
ipv6 address and port of the irc server (e.g: 3ffe:2f4:56:35:0:0:0:23 6667) (this option has been removed in 0.2.3 version) |
ssl_server |
specifies SSL server, syntax is the same as in server option |
Note that since 0.2.3 config file can be edited via partyline, please read section 7 for details.
2. Setting up botnet
* Setting up main bot
First of all copy hub.conf from cfg-examples dir to the dir where
psotinic binary is located in. Then edit it :). Next thing that is
needed to be done is ecnryption of the config file, to do that run
`psotnic -c config.file'. This should either output bunch of errors or
simply tell you that everything went ok. Now having your config file
encrypted you can run the bot, to do that run `psotnic config.file`, it
is also adviceable to move config file to some safe place, for obvious
reasons.
Now when bots is up and running telnet to him (telnet ip port) and
enter your owner password (not the md5 hash), if pass is ok bot should
ask for the login and pass. After creating account bot will drop your
connection, so telnet back to him and provide ownerpass, login and
password. Now when you have joined into the partyline for the first
time type `.help', this should output you list of available commands,
play with them, it wont hurt ;p
* Setting up slave
Basicaly the same as above, but with three differences, first
differnece is that you use conf.salve instead of conf.hub, second one
is that you do not set the ownerpass, third on is that you do not
telnet into to slave. Rest is the same.
After starting slave you should notice new messages on the partyline,
if you cant see any connection attempts that means that ips in slave's
config file are wrong.
Now it is high time to inform main that we will be having new slave, to do that type those commands on the partyline:
.+bot handle IP
.+host handle nick*!ident@vhost (only when slave is on irc)
.chattr handle s
.chpass handle some_password (password is the same as in the slave's config - hub line)
* Setting up leaf
The same as setting up slave but with two differences, first you use
conf.leaf instead of conf.slave, second one if that you do `.chattr bot
l' instead of `.chattr bot s'.
* Few remarks:
- leaf can _only_ be linked to slave, not main bot.
- if bots kick eachother or they do not give op make sure that they
have their hosts added (you can check that with .list i command) and
that non of the bots is sharing host with something that is not a bot,
eg. with you.
3. Settings
Settings that can be controled via .set command |
cycle-delay |
cycle delay |
rejoin-delay |
delay after witch bot joins channel if he got kicked out of it |
rejoin-fail-delay |
delay after which bot joins channel if last join was unsucessful |
hub-conn-delay |
delay after witch bot tries to reconnect to hub |
irc-conn-delay |
delay after witch bot tries to reconnect to irc |
auth-time |
all unauthorised connections are closed after this time |
private-ctcp |
turns on/off private ctcp response for all bots |
ops-per-mode |
number of ops in one line when there are enemies in the channel |
ask-for-op-delay |
after this time bot asks for op if he wasn't opped before |
getop-op-check |
turns on/off checking if bot that is reqesting op is allready oped |
conn-timeout |
time after witch all authorsied inacive connection are being closed |
keep-nick-check-delay |
this setting tells bots how often should they check if their nick is available |
remember-old-keys |
turns on/off remembering of old channel keys |
telnet-owners |
if set to 0 owners are not allowed to connect via telnet, if set to 1
all owners having +pt flags can connect to main via telnet, if set to 2
only owners having +pt flags set and having their ip added to host list
are allowed to connect. |
max-matches |
maximum number of matches shown in .match |
perip-max-shown-cons |
maximum number of shown connection attempts from one IP |
perip-burst-size |
maximum number of unauthorsied connections from one IP |
perip-burst-time |
time after witch connection counters are being reset |
perip-ignore-time |
how long to ignore ip that reached maximum number of unauthorised connectios |
synflood-max-conns |
maximum number of all unregistrated connections |
synflood-ignore-time |
how long to ignore all ips |
bIe-mode-bounce-time |
after this time bots will remove b/e/I channel modes |
wasop-cache-time |
this setting controls how long bot should keep information about ops during netsplit |
away-time |
bots will stay away for this time |
chat-time |
bots will stay not away for this time |
between-msg-delay |
delay time between sending messages when bots are not away (antiidle) |
randomness |
randomness of antidile/away |
public-away |
turns on/off public aways/backs |
ident-clones |
maximum number of ppl on given channel having the same ident |
host-clones |
maximum number of ppl on given channel having the same hostname / C subclass |
proxy-clones |
maximum number of ppl on given channel having simmilar domain and not having ident |
clone-life-time |
time after witch clones are deleted from clone list |
critical-bots |
if minimal number of bots on given channel reaches this number, bots will lock the channel (+i) |
quarantine-time |
controls the delay between adding a host to a bot (bot without added host will not join channels) and joining channels |
dont-trust-ops |
0 off
1 ops (that dont have +f) can op only users that have +s or bots
2 ops (that dont have +f) can op only users that have +s
|
4. Local/channel settings
Channel settings controlled by .chset #channel command |
aop-bots |
number of bots assigned to oping joining +ao ppl |
bot-aop-bots |
number of bots assigned to oping joining bots |
bot-aop-mode |
it sets bot autop op mode, when it is set to 2, bots op like in <
0.2.7 versions (fast but insecurity - if someone pretends to be a bot,
he migh get oped), when it is set to 1, bots use getop code to gain op
only if the number of ppl to kick is not larger then 4, otherwise they
use < 0.2.7 op code, when this setting is set to 0, bots will only
use get op code (it might be usefull when you really care that nobody
would spoof bots hosts, but you also do not care whether bots op fast
or slow). Additionaly when takeover is enabled, bots will always use
the fastest op mode (that is 0). |
punish-bots |
number of bots assigned to kicking ppl that are doing sth nasty |
getop-bots |
number of bots which bot will ask for op |
invite-bots |
number of bots witch bot will ask for invitation |
guardian-bots |
number of bots which will guard channel modes |
channel-ctcp |
turns on/off response to channel ctcp queries |
enforce-bans |
turns on/off ban enforcing (=kicking ppl that are matching placed ban) |
enforce-limits |
turns on/off limit enforcing, if somebody with +n flag places lower limit then the number of users bots will `remove' surplus |
stop-nethack |
turns on/off kicking of -f ppl upon recieving op from the irc server |
limit |
turns on/off autolimit feature |
limit-time |
autolimit recheck time |
limit-offset |
autolimit offset (new limit := number_of_users + this value) |
limit-bots |
number of limit bots assigned to autolimiting |
limit-tolerance |
tolerance of the limit (:= limit offset * this value), this setting prevents too freqent changes of the limit |
owner-limit-time |
owner is allowed to change the limit for this value of time |
takeover |
turns on/off takeover mode |
bitch |
turns on/off bitch mode |
wasoptest |
turns on/off remembering of all ops that splited |
clonecheck |
turns on/off clone checking |
dynamic-bans |
turns on/off removal of old placed bans |
dynamic-invites |
turns on/off removal of old placed invites |
dynamic-exempts |
turns on/off removal of old placed exempts |
lockdown |
turnd on/off locking of the channel if the numver of bots on the channel reaches critical level |
lockdown-time |
not used ;-) |
backup-mode-delay |
... |
keepout |
when enabled, channel will be kept locked (+i), all not added (not having +v or +o) ppl will be forced to leave :P |
protect-chmodes |
can protect/forbid channel modes. example: "+nt-ims" will make sure that 'n' and 't' are always set, and that 'i' 'm'
and 's' are not set.
|
idiots |
0 off
1 remove +a only (if exists)
2 remove +a and the highest level flag. if user will have no flag
we'll give him +d
3 remove all flags for 1st offence. 2nd time +d
4 +d locally
5 +d globally and clear flags for all other channels
|
5. Flags
global flags |
x |
main owner (full control) |
s |
super owner (partyline access, bot modification, -s handle modification) |
n |
normal owner (partyline access, -n handle modyfication) |
t |
telnet privilege (not that +p is it still needed to connect) |
p |
partyline access flag |
m |
master (lacks partyline access, can op one person per mode, cannot modify channel modes) |
f |
friend (cannot op, but he may recieve op from irc servers, shits do not apply to him) |
o |
op (just plain @) |
v |
voice |
a |
auto-mode (combined with +o, +a gives auto-op or auto-voice respectively) |
d |
deop (user gets kicked when he recieves op) |
q |
quiet (user gets devoiced when he recieves voice) |
k |
kick (user get kicked on join) |
c |
clone (user is not taken in consideration by clonecheck algortyhm) |
i |
invite (auto-invite after kick when channel is full or closed (+i)) |
r |
reop (auto-reop on deop) |
local flags |
n |
channel owner (full channel control, user cannot deop/kick/ban bots and
connect to the partyline - unless he gets global +pt, then he will be
able to modify all channel handles) |
x|s|t|p |
those flags are not allowed, other flags behave like the global flags |
bot flags |
h |
main |
s |
slave |
l |
leaf |
y |
allowed to load modules |
p |
allowed to inform botnet about his host changes |
6. Modules
A lot of ppl i having problem with them, so there is a short info how to load them.
First of all you need to get a non static version of psotnic irc bot
(yes, that means that there is now way of loading modules to static
version). After unpacking psotnic package, enter framework directory,
depending on a version of bot you should see a lot of files (0.2.2
case) or a few files and two dirs (0.2.3 case). If you are using 0.2.2
simply run make clean && make all, this should build all
modules, if you get an error that means that sth bad had happend and
now you are on your own. If you are 0.2.3 user then type make op
&& make spam (only those two modules are proted, if you wish
you can port rest of them). Having compiled modules (module_name.so
<- thats the module, not module_name.cpp) you have to edit config
file. In both cases (0.2.2 and 0.2.3) you should add following line to
you config in order to load a module:
load /path/to/home/psotnic/framework/module_name.so
and simply encrypt config and start the bot. Thats all.
7. Config file edition via partyline (since 0.2.3rc1)
All 0.2.3 bots have an option of config edition via partyline, to get current config we need to do:
.bc botname cfg
This should display sth like that:
(botname) cfg: nick botname
(botname) cfg: realname Psotnic C++ Edition
and so on...
You can change given option by doing:
.bc botname cfg
For instance:
.bc botname cfg kickreason blah blah
[15:08] #you# bc botname cfg kickreason blah blah
(botname) cfg: kickreason has been set to blah blah
In order to save changes, you have to do:
.bc botname cfg-save
Some config options can have more then one instance, for example server or alt option.
To add 3 servers just do:
.bc botname cfg server 1.1.1.1 1111
.bc botname cfg server 2.2.2.2 2222
.bc botname cfg server 3.3.3.3 3333
To remove second one do:
.bc botname cfg -server 2.2.2.2 2222
Thats all, dont forget to save cfg :)
8. On join host resolver (linux only)
All 0.2.3 version psotnics are equiped with asynchronous resolver,
unforunetely only rc9 works properly, so if you have an older bot you
should upgrade it.
In order to enable resolver set resolve-threads config option to some
sane value (for instance 4), the bigger the value the more simultaneous
resolving will be performed, notice that on linux each thread creates
new process. After setting this option restart bot.
To see resolver statistics do:
.status botname
9. The end
Thats general description of the stuff that confuses most ppl, if you
find any errors please let me know, i will try to fix them as soon as
it will be possible.
--
pks (grusin{at}gmail.com)
mrcn (mrcn@op.pl)
|