Home

Awesome

REBot

Release Mode Maintenance Version

<p align="center"> <img src="https://i.imgur.com/t30VQO0.png"> </p>

REBot is a Discord bot programmed in the Golang programming language to provide useful commands to reverse engineers and exploit developers. It provides features such as on-the-fly assembly and disassembly for common (and even less common) architectures, such as x86/64, ARM/AARCH64, PPC, and MIPS. It also provides other features such as a technical dictionary, CVE look-up, and giving tips and tricks on reverse engineering and exploit development practices.

You can join the official REBot to your server using this discord invite link. REBot doesn't need any special permissions - only text read and send permissions so it can interact with you.

Getting Started

Below are some instructions on how to get the project building on your machine. I personally built this on Windows 10. The project itself is platform independent - however the way you build and configure keystone and capstone will vary depending on your target system.

Prerequisites

The following software is required to built and use REBot.

Go Dependencies

The following dependencies are required to build the project using Go.

Building

Installing prerequisites

Windows

You should install Golang using their official Windows installer provided here. As for Keystone and Capstone, for Windows I recommend that you use the pre-compiled libraries they provide here (for keystone) and here (for capstone).

The libraries and header files for Keystone and Capstone should go in dedicated folders, I personally chose C:\src\keystone and C:\src\capstone respectively. The .lib files can be disgarded/deleted/renamed, as if they're present in the folder when you go to build, you may encounter linker errors. The .dll file is sufficient.

You may also need to edit the bindings to build the project successfully - changing the cgo directives to reflect the directories you setup the libraries in. For Keystone, I edited go/src/github.com/keystone-engine/keystone/bindings/go/keystone/keystone-binding.go and set the cgo directives to the following:

//#cgo windows CFLAGS: -IC:/src/keystone/include
//#cgo windows LDFLAGS: -LC:/src/keystone -lkeystone -lstdc++ -lm

For Capstone, nearly all the .go files for the binding had to be edited for the cgo directives. I edited them to the following:

//#cgo windows CFLAGS: -IC:/src/capstone/include
//#cgo windows LDFLAGS: -LC:/src/capstone -lcapstone

Linux (Debian)

Firstly, you should install Golang. You can do this via the following commands in the terminal:

sudo apt-get update
sudo apt-get install golang-go

For Keystone and Capstone, you may have to build the libraries yourself. Follow Keystone's and Capstone's COMPILE instructions for your given system.

Building the project

Finally, you can build the project by simply running go build. You will however need to add your Discord app authentication token to the config.ini file - or REBot won't be able to connect to discord.

Obtaining a Discord bot token

  1. Create a bot @ Discord Development Portal
  2. Ensure "Message Content Intent" is set to enabled
  3. Copy the token from the "Bot" page, and add it to config.ini
  4. Go to OAuth -> URL Generator
  5. Make sure "bot" is checked
  6. Give the bot appropriate permissions
  7. Copy URL and paste in browser to invite bot to server

Running REBot as a Docker container

Discord has a limit of how many servers (unverified) bots can join. For unverified bots, the max is 100 servers. REBot is currently unverified and has maxed the number of servers it can be invited to. You can however run the following commands to self-host REBot:

$ git clone https://github.com/Cryptogenic/REBot.git
$ cd REBot
$ docker compose up -d

License

Specter (Cryptogenic) - @SpecterDev

This project is licensed under the WTFPL license - see the LICENSE.md file for details.