INTRO

I have already told you about using Kali Linux in Andriod via SSH. But it has some limitations. for example, you can’t open with that. you can’t open any GUI application. but what if you want to perform such task which requires a graphical user interface. if you have read my article on “Enable RDP on Linux”, I have told you there that you can use XRDP to enable RDP on a Linux. so, you would be able to connect to it with another computer. but you may face some problems to use connect to RDP with android. by the way, you will find a lot of applications on Google Play-Store. although, the RDP is fast but it is not officially made for Linux. so, you may find a little bit slow. but the XRDP runs with VNC. so, why don’t we try the VNC instead of XRDP? but you can use XRDP. it is all your choice. you can read my previous post on XRDP from HERE.

In this tutorial, we are going to use the VNC(Virtual network computing) to control our Linux from our android device. I am using Kali Linux for this tutorial. but the process is the same for all other Linux Distributions. It will work in Ubuntu, Mint, Arch, Fedora etc same as It is going to be in Kali Linux.

SETUP

You will need to install x11vnc in your Linux distribution. to do that, type this command:

sudo apt install x11vnc

Screenshot:

I have already installed it. that is why you can’t see any installation process. I think x11vnc comes pre-installed in Kali Linux.

Now that you have the x11vnc. you can start a server on your Linux. but before you do that let’s download a client for VNC. it is an application that is available on Google Play-Store.

VNC Viewer ==>  INSTALL

When you will open the application for the first time, you will see a nice minimalistic interface.

Screenshot:

we will use this application to connect to our Linux.

Now, let’s get back to our PC and take a look at the help menu of x11vnc. Type this command:

x11vnc --help

Screenshot:

The output is too huge to fit in one screenshot. but we don’t need to use any argument to start a simple VNC server on port 5900.

To start a Simple VNC server, type this command:

x11vnc

Screenshot:

Now let’s use the android application that we install before.

First, we will add an IP/Domain on which the VNC server is currently. you can add the Host by pressing “green plus” icon on the bottom right.

Screenshot:

I am using it on my local network. so, I will use my local IP which is 192.168.43.183. you can use port forwarding to make it available on the public internet.

Screenshot:

Click “CREATE”. and you must have a connection name “Lucky”(in my case). Now press connect or click on the profile you have created(Lucky) and output will warn you that you are using an unencrypted connection.

Screenshot:

Press “OK”.  you can basically use the Wireshark to see what is unencrypted here.

Screenshot:

But it is okay if you don’t. you will see the screen on the android after pressing “OK”.

Screenshot:

Now you can control your Linux with android. but you will see when you disconnect your android from the server, the server gets closed. if you want to keep the server running, you can use ‘-forever’ flag.

Type this command to run the x11vnc even after client disconnects:

x11vnc -forever

If you want to create a password-protected server, you can use '-passwd'  or '-storepasswd' flag. there is a little difference between these flags. storepasswd will store a pass in a text file which will remain encrypted until the VNC use it. the passwd is a simple flag to provided a password in a terminal which can be seen by someone else.

Storepasswd

Type this command to store a password in a text file:

x11vnc -storepasswd <Password> <path to text file>

For example:

x11vnc -storepasswd 1234 ~/Desktop/test.txt

Screenshot:

let’s try to see the text file which has the encrypted password.

Screenshot:

As you can see the password is fully encrypted.

use this command to enable password from the encrypted file:

x11vnc -rfbauth <Text file Path>

Screenshot:

passwd

Type this command to start x11vnc with password:

x11vnc -passwd <password>

Screenshot:

 

 

Thanks For Visiting.

LEAVE A REPLY

Please enter your comment!
Please enter your name here