Home Creating a C2 Server with Discord
Post
Cancel

Creating a C2 Server with Discord

Intro

This blog post will go through the basic setup of a Discord C2

Create a Discord Server

Creating a server is very easy

Click the green plus button at the bottom of your client

DiscordC2

Click through all the options and give it a name

DiscordC2

Now you have yourself a discord server

DiscordC2

Create a Discord Bot

Open the Discord developer portal and log into your account https://discord.com/developers/applications

Click the “New Application” button in the top right

DiscordC2

Enter in a name for your bot and click “Create”

DiscordC2

I added in a picture for my bot, you can customsie it however you’d like but once you are happy click on the “Bot” section on the left. Once you are there click the “Add Bot” button and you have your first discord bot!

DiscordC2

Add Bot to Server

To add a bot to your server go to the “OAuth2” section on the left and select “URL Generator”

DiscordC2

On that screen check “bot” and “applications.commands”. Once they are clicked you can give your bot specific permissions. For testing, I gave it Administrator but at the bare minimum you will need the following:

  • Send Messages
  • Read Messages
  • Attach Files
  • Manage Server

Once you are happy you should have a URL at the bottom, copy it and, put it into your browser and you should see something like this

DiscordC2

Select your new server and press continue. In just a moment you will see your bot in your server!

DiscordC2

DiscordGo

DiscordGo will be the framework for this c2

On discord, you will need to enable developer options. To do this:

  1. Click the cog by your username at the bottom
  2. Under “App Settings” click “Advanced”
  3. Enable Developer Mode

Next, we need to get our server ID. Just go to your server and right-click the name in the top right and select “Copy ID”

DiscordC2

The other piece of info we need is our bot Token. This is under our Bot Application Page

DiscordC2

Install on kali

Make sure you have golang installed sudo apt install -y golang

Download the repo git clone https://github.com/emmaunel/DiscordGo

Edit the following file pkg/util/variables.go and insert your Server ID and Bot Token

Execute make and it will build

Inside the DiscordGo/bin directory you will see a few binaries. I’ll transfer one over to a windows machine and execute the .exe

DiscordC2

And we can see that the process is running

DiscordC2

Checking back on discord we have the agent connect and we can run various commands

DiscordC2

DiscordC2

This post is licensed under CC BY 4.0 by the author.