This project is a reverse shell malware written in C, developed as part of studies in networks and cybersecurity. It allows an attacker to gain remote control of a machine and execute commands on the victim’s terminal.
- The attacker starts a listener on the server to wait for connections.
- The victim executes the malware, which:
- Establishes a connection to the server.
- Redirects the victim’s terminal (
cmd.exe
) to the created socket.
- The attacker gains full remote control of the victim’s machine.
- Operating System: Windows
- Compiler: GCC (MinGW for Windows)
- Library: Winsock2 (included by default in Windows)
- Netcat (or alternatives like Socat) to create the listener.
1.1. Compile and launch the server
code.
1.2. Use Netcat to wait for incoming connections from the malware.
- Move the
shell.exe
file to the target machine using one of the following methods:- USB drive
- File-sharing platforms
- Remote upload
- Execute the
shell.exe
file on the victim’s machine. - Once executed, the malware will:
- Attempt to connect to the attacker’s server using the predefined IP address and port.
- Establish a reverse shell session, providing remote access to the victim’s terminal.
- Once the victim executes the malware, a reverse shell connection will be established.
- You can now access the victim’s terminal through Netcat.
- Use the terminal session to remotely execute commands on the victim’s machine.
- Example commands you can run:
- File exploration:
dir
(Windows) orls
(Linux) - Download files: Use
curl
orwget
if available. - System monitoring:
tasklist
(Windows) ortop
(Linux)
- File exploration:
- Implement encryption protocols (e.g., AES or RSA) to secure data transfer between the attacker and the victim.
- Ensure stealthier connections by making traffic less detectable by network monitoring tools.
- Extend support for other operating systems such as:
- Linux
- macOS
- Refactor the codebase to use platform-independent libraries for socket communication.
- Develop advanced methods to bypass:
- Firewalls: Use techniques like packet fragmentation or tunneling.
- Antivirus Detection: Implement techniques such as obfuscation, polymorphic code, or process injection.