This project is a basic Discord Command and Control (C2) Handler written in Python. Using the discord library, it allows users to execute specific commands on a target system through a Discord bot. This project serves as a first foray into learning about bot development and command execution in a secure and controlled environment for myself.
- Connects to Discord using a user-provided bot token.
- Executes system commands based on user input from Discord messages.
- Handles command outputs and sends them back to the Discord channel.
- Supports several commands including
ls,cat,pwd,uname,whoami, and more.
Ensure you have the following installed:
- Python 3.7 or later
discord.pylibrary (can be installed viapip install discord.py)python-dotenvlibrary for environment variable management (can be installed viapip install python-dotenv)
-
Clone the repository:
git clone https://github.com/PeaceKeeper96/ixxi/ cd ixxi -
Install the required dependencies:
pip install discord.py python-dotenv
-
Create a
.envfile in the project directory to securely store your Discord token and other sensitive credentials:DISCORD_TOKEN=your_discord_token_here
-
Set your Discord user ID and the desired channel ID in the source code:
discord_id = # Put your discord user ID here channel_id = # Put your desired C2 channel ID here
-
Navigate to the project directory in your command line.
-
Run the script using:
python ixxi.py
-
The bot will log in and be available in the specified Discord server.
The following commands can be executed via the Discord channel:
- dir: Lists directory contents on the target machine.
- ls : Lists contents of the specified directory (default is current directory).
- PIKEMAN: Reads the
/etc/passwdfile. - VOLGIER: Reads the
/etc/shadowfile. - SWORDSMAN: Reads the
/etc/groupfile. - WATCHER: Displays network interface configurations.
- cat : Outputs the content of the specified file.
- pwd: Displays the current working directory.
- uname: Shows system information.
- whoami: Displays the current user.
- history: Shows the command history.
- Ensure that you have permission to execute commands on any target machine.
- Use this script responsibly and only in environments where you have legal authorization.
- Keep your token and user IDs secure & never share them publicly.
- Enhance error handling for command executions.
- Add more sophisticated command parsing and execution capabilities.
- Implement logging and tracking for executed commands.
- Create an interactive help command.
- General Cleanup of code.
This project is intended for educational purposes only. Modify as needed for your use case. Always adhere to ethical guidelines and legal standards in your software development practices.