Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

CB Bot

CB Bot is a threat hunting and incident response web application framework for using with Carbon Black (CB) Defense. By leveraging CB Defense's REST APIs, CB Bot can build and run sweeps (hunts) across a CB instance! I created CB Bot with the main goal to automate and speed up the threat hunting and incident response process across an organization. Not only will it make it easier to run hunts or sweeps across a network, but also make it faster. Let's spend less time building tech, and more time finding bad guys. 😄


This disclaimer informs those that are reading, downloading, and using CB Bot that this code was written by me and does not represent my employer's views. My employer did not have any part or say in this project and everything that was done was as as side project of mine.



Make sure you have at least the following:

1 1 GB 25 GB

Of course, the more you have, the better, but I've created a small instance in Digital Ocean and these are the specifications. I suggest you have more disk space, as sweeps can get pretty beefy if you have a large environment.


Make sure that you apply the following inbound and outbound rules in order for CB Bot to work:

Protocol Inbound Outbound
TCP 22, 443 443, 9418


Note: Tested on Ubuntu 18.04.3 (LTS) x64.

Step 1: Setting Up Your Server 🔌

Let's make sure that you have all the system updates, Python 3, and Mongo.

apt-get update
apt-get install -y mongodb python3 python3-pip

Go to the directory that you would like to clone CB Bot, and then use Git to clone the repository.

git clone <repository>

Step 2: Installing CB-Bot Requirements 📝

Once you've installed and downloaded all of the necessary files, let's jump into the CB Bot directory and install all the python libraries that CB Bot uses.

cd cb-bot/setup
pip3 install -r requirements.txt

I highly recommend you use a certificate of your own. However, if you do not have a certificate that you can use, you can create a self-signed certificate for CB Bot. I used these commands to create one for the demo server.

openssl genrsa 4096 > /etc/ssl/private/cb_bot.key;
openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj "/C=US/ST=TX/L=Austin/O=All Things DFIR" -key /etc/ssl/private/cb_bot.key -out /etc/ssl/certs/cb_bot.crt;

If you happen to use your own certs make sure you copy them to /etc/ssl/private/cb_bot.key and /etc/ssl/certs/cb_bot.crt. You can also save it in a different path, just make sure to edit the "" file to reflect where the paths to the cert and key are.

Important: Go to the application/ file to change the app.config['SECRET_KEY'] value. At the moment I have placed a generic value for testing, but this value should be changed and unique.

Step 3: Run "" 🏃

Finally, before you can get to use CB Bot, it's important to run "" to get the MongoDB configured with all the collections, generate the folders needed on the system, and create the admin account used to log into the portal. Run it and follow all of the instructions.


Step 4: Start CB Bot 🤖

After you have completed all of the steps above, just make sure to run CB Bot from the root directory of the application. If you've been following these instructions, then just do the following:

cd ../

Note: I recommend you running this as a background process using screen. If so, run the command screen -S <session_name>, where <session_name> is the name of the session that you want to give it to. Then you can run CB Bot, then hit Ctrl A + D to detach from the session.


Once you run CB Bot, go to address of where you have installed CB Bot and log in using the credentials that you supplied during Step 3 of the Installation section. Now, once you successfully authenticate, you'll see something like the screenshot below. You'll notice that on the top right corner will be your name and a randomnly assigned avatar (you can change that in your profile settings). To the bottom right will be the Administration tab and once you click that new options are shown. Click on Settings.

screenshot 1

The Settings page will look like the screenshot below. Here you will have to put in your CB API Key and API Secret Key. Make sure to also include the root URL to your instance. For example, if you log in to your CB instance and the URL is something like, change the Root URL on the page to be Once you're done, click the Update Configuration button.

screenshot 2

If you also noticed, there is a Giphy API section on the Settings page! 🤘 With this, the "Random Gif Of The Day (GOTD)" section will have random gifs generated everytime you access the homepage, or everytime you click on the refresh button on the corner of the module. All you need to do is create an account in Giphy and then generate an API key so that you can provide it to CB Bot. Remember, with gifs come great responsibility, so at the moment everything is set to rated PG-13 (Feel free to change this setting, but beware of the content!).


This should be pretty self explanatory. However, check out for some tips and tricks on how to use CB Bot. I've created a list of generic sweeps for you to start using. However, feel free to create new ones, and if you're open to sharing, don't hesitate to reach out to me and we can get it added to the config files!


No releases published


No packages published