How to install Xrdp+cpolar on Kali Linux to achieve remote access to the Kali system through intranet penetration

Preface

The benefit of Kali Remote Desktop is that it allows users to access the Kali system from a remote location without having direct physical access to the system. This allows users to use the Kali system in different locations without having to install the Kali system in each location. In addition, remote desktop can also improve the security of the Kali system because users can work without direct contact with the Kali system, thus reducing potential security risks.

The following introduces how to install the Xrdp remote desktop tool in Kali and combine it with the Cpolar intranet penetration software to achieve remote access to the Kali desktop and escape LAN restrictions.

1. Install Xrdp in Kali

Kali Linux uses the Xfce desktop environment by default, so you can use the Xrdp software to enable remote desktop. Execute the following command to update the apt package manager

sudo apt update

Install Xrdp after the update is complete

sudo apt install xrdp

After the installation is complete, execute the following command to operate Xrdp

sudo systemctl enable xrdp #加入开机启动
sudo systemctl start xrdp  #启动服务
sudo systemctl status xrdp #查看状态

After executing the above startup command, execute the view status command again. You can see that the status is active. At the same time, you can also see the accessed port below, which is3389. Next, we make a local connection. Visit!

image-20231114152742153

2. Local remote Kali desktop

After the above Xrdp runs successfully, next test the remote Kali desktop locally. First exit the desktop to the lock screen interface. If you do not exit the desktop, you cannot remotely access it. Click the icon in the upper right corner, and then click Log Out ,Exit to the lock screen

image-20231114153159398

Next open the Windows Remote Desktop tool, enter the Kali LAN IP address, and click Connect

image-20231114153335938

An interface for entering your username and password will pop up. Enter your Kali login username and password, and click OK.

image-20231114153426366

In this way, the Kali interface has been successfully reached remotely, and the local installation access test has been successful. Next, install the Cpolar tool to enable remote access.

image-20231114153529645

3. Kali installs Cpolar intranet penetration

Kali is a Linux-based system. You can use the cpolar Linux installation method to quickly install it with one click. In the command interface of kali, we enter the following command. If you are using it for the first time, you can register an account in the official website link below!

cpolar official website address: https://www.cpolar.com

  • Use a one-click script to install the command (if it gets stuck after executing the command, it means you need to enter the kali sudo password)
curl -L https://www.cpolar.com/static/downloads/install-release-cpolar.sh | sudo bash
  • Add services to the system
sudo systemctl enable cpolar
  • Start cpolar service
sudo systemctl start cpolar

After cpolar is installed and the service is successfully started, access the 9200 port on the browser: [http://127.0.0.1:9200], log in using the account logged out of the cpolar official website, and you can see the cpolar web configuration interface after logging in. Next, go to Just configure via web interface

image-20230901153135328

4. Configure the public network remote address

After logging in to the cpolar web UI management interface, click Tunnel Management - Create Tunnel on the left dashboard:

  • Tunnel name: It can be customized. Be careful not to duplicate the existing tunnel name.
  • Protocol: tcp
  • Local address: 3389 (Xrdp default port)
  • Domain name type: Temporary random TCP port
  • Region: Select China VIP

Click创建

image-20231114155418132

Then open the online tunnel list on the left and view the address of the remote tcp connection generated after the tunnel was just created. This address is the public network connection address. We can use this address for remote desktop connection on any device.

image-20231114155524897

5. Public network remote Kali desktop connection

The public network address of the remote Kali desktop is created in Cpolar. Next, use the public network address on the Windows remote desktop tool to connect to the remote Kali desktop. Next, exit the desktop to the lock screen interface. If you do not exit the desktop, Unable to remotely, click the icon in the upper right corner, then clickLog Out to exit to the lock screen interface

image-20231114153159398

Open the Windows Remote Desktop tool and enter the public network address we created above

image-20231114155834306

An interface for entering your username and password will pop up. Enter your Kali login username and password, and click OK.

image-20231114160927422

We can see that the connection is successful, so that the public network address of our remote Kali desktop is set.

image-20231114161045242

summary

For a better demonstration, we used the tunnel generated by Cpolar in the aforementioned process, and its public network address was randomly generated.

The advantage of this random address is that it is established quickly and can be used immediately. However, its disadvantage is that the URL is randomly generated and this address will change randomly within 24 hours, making it more suitable for temporary use.

I usually use a fixed TCP domain name because I hope that when I send the address to colleagues or customers, it will be a fixed and easy-to-remember public network address, which will make it more formal and facilitate communication and collaboration.

6. Fixed connection public network address

It should be noted that the above steps use a random temporary TCP port address, and the generated public network address is a random temporary address, which will change randomly within 24 hours. Next, we configure a fixed TCP port address for it. This address will not change. After setting it, there will be no need to modify the address repeatedly every day.

Configuring a fixed TCP port address requires upgrading Cpolar to the Professional Edition package or above.

Reserve a fixed tcp address

Log inCpolar official website, click Reserve on the left, find the reserved tcp address, let’s reserve a fixed tcp for Minecraft Address:

  • Region: Select China vip
  • Description: Notes, customizable

Click保留

image-20231114162448758

After the address is successfully reserved, the system will generate the corresponding fixed public address and copy it.

image-20231114162509184

Open the Cpolar web ui management interface, click Tunnel Management - Tunnel List on the left dashboard, find the TCP tunnel we created above, and click on the right编辑

image-20231114163201605

Modify the tunnel information and configure the successfully reserved fixed tcp address into the tunnel.

  • Port type: modified to fixed tcp port
  • Reserved tcp address: fill in the address successfully reserved by the official website,

Click更新

image-20231114163230449

After the tunnel is successfully updated, click the status on the left dashboard - Online Tunnel List, and you can see that the public network address has been updated to a fixed TCP address.

image-20231114163255663

7. Fixed address connection test

After fixing the address, use our fixed TCP address to connect. First, exit the desktop to the lock screen. If you do not exit the desktop, you cannot remotely access it. Click the icon in the upper right corner, and then clickLog Out,Exit to the lock screen interface

image-20231114153159398

Then open the windows remote desktop tool and enter our fixed TCP address

image-20231114163425475

An interface for entering your username and password will pop up. Enter your Kali login username and password, and click OK.

image-20231114163455889

As you can see, the fixed address remote is successful, so a fixed remote Kali desktop public network address is set.

image-20231114163600658

Guess you like

Origin blog.csdn.net/qq_73017178/article/details/135000731