BOTNET SHARING and LINKING v2.0			                  03 Jun 1999


	
INDEX
	
I	ABOUT THIS DOCUMENT
II	TERMS USED
III	WHAT IS A BOTNET FOR?
IV	ADDING AND LINKING BOTS
V	USING BOTFLAGS
VI	MAKE TWO BOTS SHARE USER RECORD
	
	
	
	


I. ABOUT THIS DOCUMENT

The purpose of this document is to show you what a botnet is for and why
it could be useful for you. It also covers botflags and some sharing
information which you may need for making your bots faster and more reliable.




II. TERMS USED

The following are some common terms used in this document.  
If applicable, there is also the associated command named.


 Botnet
  The term used to describe multiple bots connected together.


 Link
  The term that means the actual linking of one bot

  commands: ".link <botname>" ".unlink <botname>"


 Hub
  A bot is described as a hub-bot, if one or more leafs are linking
  to him.


 Leaf
  A leaf is a bot connecting to an other bot.


 Share
  The term used to describe two bots sharing user records.


 Aggressive Share
  Term used to describe the method of sharing user-files. Aggressive
  share bots will send user data to another bot.


 Passive Share
  Term used to describe the method of sharing user-files. Passive
  share bots will only receive users from an other bot.


 Flags
  Flags are attributes that determine what a bot can or is allowed
  to do. Flags can be either global (+s) or channel specific (|+s #lamest).
  Botnet affecting flags are:

  s   share (user records will be shared aggressively with this bot)
  p   share (user records will be shared passively with this bot)
  g   global share (share all channels)
  h   hub (bot is auto-linked)
  a   alternate (bot is auto-linked if the hub bot can't be linked)
  l   leaf (bot is not allowed to link in other bots)
  r   reject (bot will not be allowed on the net)
  i   isolate (isolate the party line across a botlink)
  0-9 user (user defined flags)

  command: ".botattr <botname> [(.+<flag> [#channel]) or (.-<flag> [#channel])]"
	

 Address
  The physical address, containing the host and port address of the bot.
  i.e. lame.org:3333

  command: ".chaddr <botname> <hostaddress:botport[/userport]>"


 Relay
  The relay port number of the bot if defined in the config file.
 Note that you can define one for telnet connections to other bots
 and one for relay connections.


 Relay connection
 A relay connection is used to relay (jump) to another bot in DCC chat.
 You can still relay to  another bot even if this is not defined in the
 conf file.

 command: ".relay <botname>"


 Port
  The telnet port is used by the bot to communicate with other bots and/or
  users. Note that you can define two separate ports for user and bot
  connections.




III. WHAT IS A BOTNET FOR?

Basically a botnet is needed if you want to use more then one bot to protect
your channel.
Linked Bots can share user records (global or channel specific) between each
other or perform script controlled tasks. Such a script can be get-ops (ops each
bot in a botnet) or some kind of a prevent-flood stuff. Just take a look at /pub/eggdrop/scripts1.3 on ftp.eggheads.org and you'll find a lot of botnet
scripts.




IV. ADDING AND LINKING BOTS

With the common terms out of the way we can start with the process of 
linking two bots. Before you start you have to know the following:

	-  What are the domains and ports of the bots.

Let's say there is BotA on lame.org listening to port 3333 and BotB
on irc.org listening to port 4444. Now you have to add each Bot to the
other's userfile (including hostmask, address and listening port of the
other bot). In BotA's console you have to type ".+bot BotB irc.org:4444"
(assuming that BotB is in the channel and so the hostmask is grabbed
automatically, otherwise you have to add it manually with ".+host") and on
BotB's console ".+bot BotA lame.org:3333".
At this point you can link them for the first time manually by typing
".link BotA" on BotB's console (or in reverse, of course with BotB ".link BotB"
on BotA's console). The bots will give themselves now randomized passwords,
which are *not* stored encrypted in the userfile. Now you've generated your
first botnet.
Note that you can add and link as much Bots as you want to your botnet.




V	USING BOTFLAGS

Botflags are needed to assign special functions and tasks to your bots.

 "h" (hub)
  If you want your bots to auto-link after getting unlinked or started (due
  to a crash or a server reboot) or started, you have to set +h on the bot
  you want to link to an other.
  Note, you can assign +h only to one bot at a time!

  command: ".botattr <botname> +h"


 "a" (alternate)
  If your leaf's are for some reason not able to link to your hub, they will
  start to connect to an other "alternate-hub", which you can define by
  setting "+a" on one bot.
  Note, you can assign +a only to one bot at a time!

  command: ".botattr <botname> +a"


 "l" flag (leaf)
  This flag assigned to another bot will cause your bot to unlink the other
  one, if it tries to link any other bot.

  command: ".botattr <botname> +l"


 "r" flag (reject)
  If you assign this flag to a bot, it won't be tolerated on your botnet and
  will be unlinked, if it tries to link to your one or any other bot.

  command: ".botattr <botname> +r"


 "i" flag (isolate)
  Setting this flag to a bot will effect an isolation of the partyline
  between your bot(net) and the other bot(net).

  command: ".botattr <botname> +i"


 "0-9" flag (user)
  These 10 flags aren't hardcoded into eggdrop and can be assigned by scripts
  or just for fun :-)

  command: ".botattr <botname> +(0-9)"


 "s" flag (share aggressively)
   +s   If you set on BotA's console BotB +s then BotA will try to send his
        userfile (parts selected by |s and g flags) aggressively to BotB.

        command: ".botattr <botname> +s"


   |s   With this flag you can define channels, which you want your bots
        to share.
        Note that you can use this flag only on +s bots!

        command: ".botattr <botname> |s #lamest"

   |+s  You can assign the channel for which the bot will acceppt changes to
        his userfile from a +p set bot.

        command: ".botattr <botname> |+s #lamest"


 "p" flag (share passively)
  If you set this flag to another bot, your bot will accept changes to his
  userfile by the other one (as much as you've allowed with |+s or +g)

        command: ".botattr <botname> +p"


 "g" flag (global share)
  If you set this flag on your +s or +p bot, |s and |+s are getting obsolete.
  Every ban and every user on every single channel will be transfered/accepted.

        command: ".botattr <botname> +g"  




VI	MAKE TWO BOTS SHARE USER RECORDS

Before you start preparing your bots for sharing, you have to make sure that
you've loaded the transfer, share and filesys module into your bot (look
through the conf). You also have to ensure that the channel, which user records
should be shared, is set +shared in the conf.

If you've fulfilled all the requirements mentioned above, you can start to
prepare your bots.
At first you have to decide which bot should share aggressively (BotA) and which
will be passively (BotB) receive the user records. You should type this on your
bots console (Note that you can't change botflags for a linked bot, you have to
unlink it first):

On BotA:
.botattr BotB +s

On BotB:
.botattr BotA +p

Next you have to decide if BotA should share every channel with BotB or if just
one specific. If you want him to share the user record globally you have to type
the following:

On BotA:
.botattr BotA +g

On BotB:
.botattr BotA +g

If you don't want to share all channels with BotB but #lamest you have to set
the following:

On BotA:
.botattr BotA |s #lamest

On BotB:
.botattr BotA |+s #lamest

You can add as many channels in this way as you like.
Note that by sharing user records, you also share automatically bans and
ignores (globally or channel specific) with the other bot. Botflags are
*not* shared.



Hope that this document helped you in some way...

Johoho@IRCNET
comments: wodecki@gmx.de