Giter Site home page Giter Site logo

malicious-discord-bot's Introduction

Malicious-Discord-Bot

As the name suggests, the application features a malicious discord bot as a proof-of-concept malicious workspace communication platform application. The project is part of TDA602 - Language Based Security, a course in language based security, offered by Chalmers University of Technology.

Table of Contents


General Info:

The application was made using Node.js, together with the popular Discord API "discord.js". It was created as a proof-of-concept attack application, and gives the user whose USER_ID is specified in the ".env" file administrator permissions on the discord server the bot is invited into. This is only done when the SlashCommand "help" is called from within the discord server.


Technologies Used:

This project utilizes the following technologies:

  • Node.js
  • discord.js

Setup:

To setup and try out the exploit yourselves, the first step is to head over to the Discord Developer Portal, login, and create a New Application. The image down below illustrates exactly this:

New Application

Next step is heading over to the "Bot" tab, and pressing "Add bot".
Then add the bot to your discord server. This can be done by going into the "OAuth - URL Generator" tab, selecting "bot" as the scope:

Bot Token

Select "Administrator" as the bot permission:

Bot Token

Then simply click on the generated link (here greyed out as a security measure) and specify what server the bot should be invited into.

One final thing that is needed from the Discord Developer Portal is the "Bot Token", which can be found in the "Bot" tab, as can be seen in the image provided down below:

Bot Token

Now this repository can be cloned into any directory you desire, running the command:

git clone https://github.com/Morshok/Malicious-Discord-Bot.git

One last thing is to run:

npm install dotenv

inside of this repository, and then create a key-value pair inside of the generated ".env" file called DISCORD_TOKEN. The value of DISCORD_TOKEN should be the "Bot Token" fetched from the Discord Developer Portal.

Some other important fields to fill in inside of the ".env" file includes:

  • CLIENT_ID, called APPLICATION ID by the discord API.
  • GUILD_ID, the id of the server which the bot is to be invited into
    • Can be found inside the Discord Application by first heading over to Settings -> App Settings -> Advanced.
    • Then turn on Developer Mode:
    • Developer Mode
    • Then simply right click on top of your server's name in the top left corner.
    • An option to copy the Server ID will appear:
    • Server ID
    • Pressing it will copy the Server ID to your clipboard.
  • USER_ID, the id of the user whose privileges should be escalated.
    • Can be found inside the Discord Application by first heading over to Settings -> My Account.
    • Then simply press the three dots next to your user profile, and then press "Copy User ID":
    • User ID
    • This places your "User ID" onto the clipboard.

An example of such a ".env" file can be found within this repository inside of the ".env.example" file.

NOTE: This exploit will only work if the bot is given "Administrator" permissions.


How To Use The Application:

If the previous steps have been followed, now is the time to open up a terminal and run:

node deploy-commands

This is simply to register the SlashCommands to the client.

Then run:

node .

or

node index.js

The result will be the same.
I hope you enjoy exploiting your own server! ๐Ÿ˜œ


malicious-discord-bot's People

Contributors

morshok avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.