Lab ‐ Accessing Kali Linux from Windows 11 Using RDP - Dleifnesor/SEC-250 GitHub Wiki

Lab Manual: Accessing Kali Linux from Windows 11 Using RDP

Objective

Learn how to configure and access Kali Linux on a remote machine using the Remote Desktop Protocol from a Windows 11 system.

Requirements

  • A computer with Kali Linux installed
  • A computer with Windows 11 installed
  • Network connectivity between both computers

Part 1: Configure Kali Linux for RDP Access

Update System Packages

  1. Open a terminal in Kali Linux.
  2. Update your package list and upgrade all your installed packages to their latest versions:
sudo apt update && sudo apt upgrade -y

Install XRDP Server

  1. Still in the terminal, install the XRDP server:
sudo apt install xrdp -y

Screenshot 2025-04-16 234017

  1. Enable the XRDP service to start at boot:
sudo systemctl enable xrdp

Screenshot 2025-04-16 234058

Start XRDP Service

Start the XRDP server with the following command:

sudo systemctl start xrdp

Configure XRDP

By default, XRDP uses the /etc/ssl/private/ssl-cert-snakeoil.key file which needs proper permissions. Screenshot 2025-04-16 234217

  1. Add the xrdp user to the ssl-cert group:
sudo adduser xrdp ssl-cert
  1. Restart XRDP to apply the changes:
sudo systemctl restart xrdp

Check XRDP Status

Ensure that XRDP is running properly:

sudo systemctl status xrdp

Screenshot 2025-04-16 234504

Note Your Kali Linux IP Address

Obtain the IP address of your Kali Linux machine:

ip a

Note the IP address under either your ethernet or Wi-Fi adapter.

Part 2: Connect from Windows 11 Using Remote Desktop Connection

Open Remote Desktop Connection

On your Windows 11 machine, search for "Remote Desktop Connection" in the Start menu and open the application.

Enter the IP Address of Kali Linux

In the "Computer" field, enter the IP address of your Kali Linux machine noted earlier.

Start the Connection

Click on "Connect". You might get a warning about the certificate authenticity, click "Yes" or "Continue" to proceed.

Log In

When prompted, enter the username and password for your Kali Linux machine.

If the connection fails regarding authentication, you may need to modify the /etc/xrdp/xrdp.ini file:

sudo nano /etc/xrdp/xrdp.ini

Change crypt_level=high to crypt_level=low and require_credentials=yes to require_credentials=no.

Restart XRDP:

sudo systemctl restart xrdp

Verify Connection

Once logged in, you should see the Kali Linux desktop interface through the Windows Remote Desktop window. image

Troubleshooting Tips

  • Ensure both machines are on the same network.
  • Check firewall settings on both machines to ensure the firewall is off.
  • If you cannot connect, verify that the XRDP service is active and running:
sudo systemctl status xrdp
  • Check for any error messages in the XRDP logs:
sudo tail -f /var/log/xrdp-sesman.log

Additional Commands

  • To stop the XRDP service:
sudo systemctl stop xrdp
  • To disable XRDP from starting at boot:
sudo systemctl disable xrdp
  • To check open ports including the RDP port (3389):
sudo netstat -tuln | grep 3389