This project implements a Remote Access Trojan (RAT) that allows for remote command execution on a client machine. It consists of two components: a client-side code that connects to an attacker server, and a server-side code that listens for incoming connections and executes commands on the client.
The main purpose of this project is to demonstrate how a RAT can be implemented for educational purposes. It highlights the communication between the client and server over a TCP/IP network and the execution of commands on the client's machine.
- Establishes a TCP/IP connection between the client and the attacker server.
- Allows the attacker to send commands to the client machine for execution.
- Executes commands using the
subprocess
module and sends the output back to the attacker. - Supports the "exit" command to terminate the connection gracefully.
- Clone the repository to your local machine.
- Ensure you have Python installed (version 3.7 or above).
- Install the required dependencies by running the command:
pip install -r requirements.txt
.
- Start the attacker server by running the server-side code:
python server.py
. - Modify the
attacker_ip
variable in the client-side code (client.py
) to match the IP address of the attacker server. - Run the client-side code on the target machine:
python client.py
. - The client will connect to the attacker server and wait for commands.
- On the server-side, enter commands to be executed on the client machine.
- View the output of the executed commands in the server console.
Contributions to this project are welcome. To contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them.
- Push your changes to your forked repository.
- Submit a pull request, explaining the changes you have made.