A Discord-based Command and Control (C2) framework for remote system management and security research. This project demonstrates advanced command execution, system manipulation, and remote administration capabilities through Discord bot integration.
⚠️ DISCLAIMER: This project is for educational and authorized security testing purposes only. Unauthorized access to computer systems is illegal. Use only on systems you own or have explicit permission to test.
- Remote Shell Execution - Execute Windows CMD commands remotely
- PowerShell Integration - Run PowerShell scripts and commands
- Process Management - List and terminate running tasks
- File Transfer - Upload/download files via Discord
- System Information - Retrieve system details and IP information
- Screenshot Capture - Take screenshots of target system
- Clipboard Access - Read and manipulate system clipboard
- Encryption/Decryption - Secure file operations using Fernet encryption
- Persistence - Automatic startup registry entries
- Long Output Handling - Store large command outputs as files
- IP Detection - Public IP address retrieval
- Obfuscation - PyInstaller executable compilation
- Session Management - Maintain multiple active remote sessions
git clone https://github.com/yourusername/SamsaC2.git
cd SamsaC2pip install -r requirements.txtBefore using the compiler, you need to set up a Discord bot and obtain necessary credentials:
- Go to Discord Developer Portal
- Click "New Application" and give it a name
- Navigate to the "Bot" section and click "Add Bot"
- Under TOKEN, click "Copy" to copy your bot token (keep this secret!)
- In the Bot section, scroll to "INTENTS"
- Enable the following intents:
- Message Content Intent (required for command reading)
- Server Members Intent (for member management)
- Guilds (for server access)
- Navigate to "OAuth2" → "URL Generator"
- Under "SCOPES", select:
bot
- Under "PERMISSIONS", select:
- Administrator (to ensure full access)
- Copy the generated URL and use it to invite the bot to your server
- Run the compiler.py file using python3 compiler.py. Press Enter to initiate the process.
- Input all the details as asked
- Make sure to use the Discord server where the bot is invited and has the relevant permissions.
- Next, to generate the Fernet key, use the following script or use a third-party service like https://8gwifi.org/fernet.jsp.
Generating a Fernet Key for file encryption/decryption To generate a Fernet key, run:
from cryptography.fernet import Fernet
key = Fernet.generate_key()
print(key.decode())- Copy the generated key and paste it when prompted in the compiler.
- After entering the key you will see that the script has been generated.
- Upon pressing enter, the script will be compiled into an executable.
- After a few seconds the executable will be compiled via PyInstaller and will be available in the
/distfolder.
- You can now execute the compiled file on the system and get remote access on your desired Discord server.
- Upon executing
[filename].exeyou will receive a connection on the Discord Server from the bot. The bot will automatically create a new channel specifically used to operate the target machine where the file was executed.
- This enables the user to manage multiple devices efficiently at the same time using the C2 framework.
- You will receive a live screenshot of the target along with basic information of the target device.
- Next, you can use the help command with the desired prefix that you initially entered in the compiler to view the list of available commands.
-
The possibilities are endless now. You can execute system commands using cmd
[command]. To change the working directory you will have to usecd [path]. -
You can also implant files on the target using
send. Files from the target can be fetched and sent to the Discord server by the bot usingrecv [file path]. -
The help menu can be referred to understand the usage of other commands. For any more queries or problems you can create an Issue on the Github repository.
For users running a bot instance, the following commands are available (using the configured prefix):
Command Description helpShow help menu cmd <command>Execute a shell command cd <path>Change directory ps <cmd>Run PowerShell command tasklistList running processes stoptask <name>Kill a process by name ssTake a screenshot send <path>Upload a file to the client in a specific location recv <path>Download a file from the client encrypt <file>Encrypt a file decrypt <file>Decrypt an encrypted file hide <file/dir> <path>Hide a file or directory unhide <file/dir> <path>Unhide a file or directory press <key>Simulate a key press type <string>Type text at the cursor clipboardRead clipboard contents web <url>Open a URL in default browser wifipRetrieve stored Wi‑Fi passwords quitExit the session - Keylogger integration
- Webcam and microphone surveillance
- Display manipulation
LEGAL WARNING: This software is for authorized security testing and educational purposes only. Unauthorized access to computer systems is illegal under the Computer Fraud and Abuse Act (18 U.S.C. § 1030) and similar international laws. The author is not responsible for misuse or damages caused by this software.
For questions or issues, open a GitHub issue or submit a pull request.







