How can I link my bots together to form a botnet?

Setting Up a Botnet

One of the great features of Eggdrop is bot linking, allowing you to create your own 'botnet'. A botnet can consist of two linked bots to as many as hundreds of linked bots. If you're using an Eggdrop for channel management, the most important feature of linked bots is userfile sharing. With userfile sharing, the bots can keep their user lists, ban lists, and ignore lists in sync with one another. A botnet also has many other possible capabilities, such as allowing bots to op one another securely, and making all bots join a channel with one command.

Linking bots can be a confusing process for first timers, but it's quite simple if you know how. The first thing you need to do is chose a hub bot. The hub is the main bot which all the other bots on the botnet (which will become leaf bots) connect to. Even if you are only using two bots, it's best to use one as a hub bot, and the other as a leaf. The hub bot should be the most reliable bot on your botnet, running on a fast, stable, and secure shell - so keep that in mind when deciding which bot will be the hub.

Once you've decided on the hub, it's time to set up the linking. A typical botnet of just a few bots will have a structure like the one shown in the tree below:

BigBoy
|--Camelback
`--Mallard

The tree above shows a botnet of three linked bots. BigBoy is the hub bot, while Camelback and Mallard are leaf bots. In order to set up a botnet like this, you need to add each bot to each other bot's user file, then set certain flags for each of those bots. In the steps below, I'll refer to the nicknames of the bots above - just substitute your own bot nicks when following these steps.

Note that if you don't wish to set up userfile sharing, just skip the four steps marked with an (s).

1) First up, config file stuff - make sure any channels you want bots to synchronise information about (e.g. user flags, bans, etc.) are set to +shared in each bot's config file, and make sure the share and transfer modules are loaded (loadmodule transfer and loadmodule share).

2) On BigBoy (the hub bot), you need to add the leaf bots to the userfile. To add Camelback and Mallard, type .+bot Camelback and .+bot Mallard.

3) Set any ordinary user flags for the bots. Generally, bots should be given global f (friend) and o (op) flags. To do this, .chattr Camelback +fo and .chattr Mallard +fo.

4) (s) Give the bots the s bot flag. Type .botattr Camelback +s and .botattr Mallard +s. This makes the hub aggressively share its userfile with the leaf bots.

5) (s) Give the bots the s bot flag for each channel you want to synchronise information about, e.g. if the three bots are on #railroad and #trains, type .botattr Camelback |+s #railroad and .botattr Camelback |+s #trains, then do the same for Mallard. Alternatively, you can use the g flag by typing .botattr Camelback +g, instead of setting the s flag for each channel. The g flag simply makes the bot share information for all channels.

6) Repeat steps 2 to 5 for any other leaf bots to be added to the hub.

7) Now it's time to setup the hub on the leaf bots. Let's start with Camelback, so leave BigBoy for now and switch to Camelback's command console. First, you need to know the telnet address for your hub bot (BigBoy), which consists of the bot's host and port (the port will be whatever you set in the listen setting in BigBoy's config file). If BigBoy's hostname is bigboy@steam.trains.com and the port is 11941, its telnet address is steam.trains.com:11941. You can then add BigBoy by typing .+bot BigBoy steam.trains.com:11941.

8) Set any ordinary flags for BigBoy, like you did for the leaf bots, e.g. .chattr BigBoy +fo.

9) (s) Give BigBoy the p bot flag by typing .botattr BigBoy +p. The p flag makes the bot passively share its userfile with the hub bot (i.e. the bot downloads the userfile from BigBoy).

10) (s) Give BigBoy the s bot flag for each channel you want to synchronise user information about, e.g. if the three bots are on #railroad and #trains, type .botattr BigBoy |+s #railroad and .botattr BigBoy |+s #trains. Alternatively, you can use the g flag by typing .botattr BigBoy +g, instead of setting the s flag for each channel. The g flag simply makes the bot share information for all channels.

11) Give BigBoy the h flag by typing .botattr BigBoy +h. The h flag makes the bot try to link to the hub automatically.

12) Within a minute, Camelback should attempt to link to BigBoy and (if you set up sharing flags) download the userfile.

13) Repeat steps 7 to 11 on any other leaf bots.

The above steps will link all your leaf bots to your hub bot, and (if you set up the sharing flags) userfile sharing will be active. Note that if you have protect-telnet enabled in the hub bot's config file, the connection attempts from the leaf bots will be rejected until you add a telnet host for each leaf bot. This is described here.

If the the hub bot goes down for any reason, leaf bots will automatically relink when returns. Some users may wish to set up an alternate hub, which the leaf bots will connect to if the hub goes down, using the a bot flag. If you wish to try this, as well as gain a better understanding of botnet configuration, refer to the Botnet Sharing and Linking guide that is included with Eggdrop.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Setting up an Eggdrop (the short version)

Setting up an Eggdrop The Short Short Version If you're experienced with the Unix shell...

Getting the Eggdrop Source Code

Getting the Eggdrop Source There are many different versions of Eggdrop available for download...

Detailed Installation Instructions (Manual Install Method)

Installation Installing Eggdrop is a relatively simple process provided your shell has the...

How to configure your eggdrop bot

Configuration There are two files you will need to edit before you can start up your Eggdrop -...

Editing the botchk file to automatically restart your bot

Editing the botchk file The botchk script and crontab are used to automatically restart the bot...