Rdp ��� kali linux

Installing xRDP on Kali Linux

13 October 2019

There are a lot of complicated tutorials on how to get xRDP working on Kali Linux. I suspect the tutorials have become complicated as they address a variety of bugs that xRDP and connecting software has had over time, but there isn’t much you actually need to do.

Note that if you are using Gnome, you’ll run into issues. I have got RDP working with Gnome before, but I haven’t been able to create a reliable set of steps to replicate it, as it usually starts working after several hours of messing around. If this is you, then you can try the below, but it may just be your starting point.

Install xRDP

The only package you need is xrdp, which you should enable after installation.

“Authentication is required to create a color managed device”

If you get this message there are a few potential fixes. The one I use is to add the following file to policy kit, and restart it:

Open your Firewall

If you are using UFW, you’ll need to open up a port.

Then in Windows, you’ll need to lower your color depth in the RDP settings when you make a connection:

And it should work from this point.

Connecting via an SSH tunnel

xRDP transport is encrypted using TLS by default, and should be as secure as RDP is on windows, but if you open it up to the internet you can expect to be subject to ongoing brute force attacks. If a vulnerability is found, you can expect it to be used against you pretty soon. A safer option is to connect using an SSH tunnel, and secure that using certificates instead of passwords.

Install PuTTY & Set Up

I’m assuming you know how to set up port forwarding on your router, and how to install puTTY. If not, Google is your friend. First step is just to put in your IP address (take a look at duckdns.org if you need a static one) and the external port that you’ve chosen into puTTY.

Next, you need to go into Tunnel under SSH. Here you need to add a Source port, which can be any port you have available on Windows. I’ve used 6666 in this example. Then under destination, add localhost:3389 .

Under Session, you will probably want to save these settings so that you don’t need to do the setup every time.

Create a Private Key file with PuTTYGen

Press the Windows key and type in ‘PuttyGen’, which should open up the following program:

Click on Load, and select your private ‘id_rsa’ key that you normally use for logging in via SSH. You can then save this as a .ppk file. Once you have this, under SSH and Auth, add the .ppk key file.

Again, you’ll want to go back to Session and save this.

Connect the tunnel

Now that this is set up, connect using puTTY by pressing ‘Open’. You’ll get a black window, asking you for the username, which will probably be ‘root’ for Kali.

Now that the connection is established, go into RDP and use localhost and the port you configured in puTTY to connect:

And all being well, you should successfully connect to xRDP via an SSH tunnel at this point

Last bits of security

Set SSH to accept Certificates only

You will need to edit the SSH daemon config and restart it. Make sure you have certificates set up and can authenticate without a password before you turn this off.

Set xRDP to require SSH tunnels

The last bit of security you can apply is to force xRDP to require a tunnel by constraining it to accept local connections only.

Читайте также:  Kaspersky linux config file

Hopefully that’s all you’ll need to connect in a reasonably secure fashion to your Kali box over the internet.

Источник

How to Connect to Kali Linux in Windows With RDP

This tutorial will show how to install and run the graphical environment of Kali Linux in Windows.

Using Kali Linux graphical environment (GUI) in Windows.

After installing Kali Linux on Windows, you will have the Kali Linux terminal (command environment). For using the graphical environment you have to make some adjustments.

  1. Open Kali through CMD or from the start menu.
  2. Enter the following command to install wget.

sudo apt-get install wget

  1. Enter the following command to access the graphical environment.

The above command will download a script from the Kali site.

  1. Entering the command below will run that script.

Note that the entered command includes downloading the graphics package and installing Xrdp and it may take some time.

sudo /etc/init.d/xrdp start

  1. Now you can start XRDP service by this command.

sudo /etc/init.d/xrdp start

By running the above command and running Xrdp service, the port number will be shown.

  1. Open Remote Desktop(RDP)
  2. After opening Remote Desktop window, enter 127.0.0.1 with given port number as address then click on connect button.

8. After opening Kali Linux, enter username and password and click on OK

9. Now you are connected to Kali Linux via Xrdp.

  1. After completing your work, enter the following command to stop the Xrdp

Источник

Erreinion / Kali Linux xrdp on AWS.txt

Setting up xrdp on Kali Linux 2016.2 on AWS
AWS has an AMI for Kali 2016.2, but being remote, you need VNC or RDP to access the graphical tools.
VNC is easy to set up but very restrictive. RDP is harder to set up, but easier to use. These are the instructions I use to set up xrdp.
I use this config so that I connect to the Kali VM through an Apache Guacamole RDP proxy. This keeps Kali behind the firewall and in my pentesting lab. Guacamole also allows me to access the Kali box on SSH or RDP via a web interface from anywhere and any device.
OS: Kali Linux 2016.2
AMI: Updated 19 Oct 2016
Bash:
# Upgrade OS
sudo apt-get update -y && apt-get upgrade -y
sudo apt-get dist-upgrade -y
sudo apt-get install xrdp lxde-core lxde tigervnc-standalone-server -y
sudo update-alternatives —config x-session-manager
# choose xfce4-session
# New sudo user for Guacamole connection
sudo useradd -m kali
sudo passwd kali
sudo usermod -a -G sudo kali
sudo chsh -s /bin/bash kali
# edit xrdp.ini — reducing colour depth reduces bandwidth and can resolve black screen issues
sudo nano /etc/xrdp/xrdp.ini
autorun=sesman-any
max_bpp=16
[sesman-any]
ip=127.0.0.1
# changed username and password to the kali user
# Allow more than root to access the system
sudo nano /etc/X11/Xwrapper.config
allowed_users=anybody
# start services
sudo service xrdp start
sudo service xrdp-sesman start
# configure services to auto-start on boot
sudo update-rc.d xrdp enable
sudo systemctl enable xrdp-sesman.service

This comment has been minimized.

Copy link Quote reply

kikismalls commented Jan 29, 2017

Thanks for this!! any chance of being able to share how you setup apache guacamole as well??

This comment has been minimized.

Copy link Quote reply

sullyjman commented Feb 8, 2017 •

I used this and it worked perfectly in Ubuntu

This comment has been minimized.

Copy link Quote reply

ghost commented Feb 15, 2017

Hi, i get an error message when trying to
sudo service xrdp start
A dependency job for xrdp.service failed. See ‘journalctl -xe’ for details.
when i do that i get a really long error message

This comment has been minimized.

Copy link Quote reply

jcconnell commented Apr 18, 2017

Guac is disconnecting after 1-2 mins of connection and then I can’t reconnect until Kali is rebooted. Any ideas why?

This comment has been minimized.

Copy link Quote reply

SVG62 commented Dec 25, 2017

Thanks, I used your settings, but get connection errors
However, when I go to rdp from windows, I am able to connect and type in username and password but when I do, I get the following error:

Connecting to sesman IP 127.0.0.1 port 3350
sesman connect ok
sending login info to session manager, please wait.
srdp_mm_process_login_response:login successful for display
started connecting
connecting to 127.0.0.1 5910
error-problem connecting

I summarize here the solution:

I had to remove xrdp, vnc4server, tightvnc, which were all installed in the wrong order. I had to install tightvncserver, then install xrdp.

sudo apt-get remove xrdp vnc4server tightvncserver
sudo apt-get install tightvncserver
sudo apt-get install xrdp
Then restart the xrdp service:

Читайте также:  Installing virtio windows drivers

sudo service xrdp restart

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

How to enable RDP in Kali Linux

Say what? This is probably well known by people that knows Linux a little more than average. I often have Kali Linux running on Hyper-V and I often struggle with resolution using the native Hyper-V console. After a little research I found out that I can install xrdp on the Kali machine and be able to RDP directly into the Kali machine. This post is meant as a reminder to myself on how to do this later in life….

The following steps assumes that you have installed Kali Linux from the latest ISO and did the update procedure:

  • Apt-get update && apt-get upgrade
  • Apt-get dist-upgrade

In order to install the RDP server you run the following command from a terminal window:

After xrdp is installed you can start the server with the following command:

  • Service xrdp start
  • Service xrdp-sesman start (Thanks to Greg for pointing that out) — UPDATE!!
  • If want it to auto start after reboot you need to run this command also:
    update-rc.d xrdp enable (It will not start xrdp-sesman automatic)

Now you should be able to RDP directly into your Kali Linux:

The only problem is that right now there is a bug in the distro (kali/debian with GNOME) causing both VNC and RDP to cause this error message after login:

(UPDATE: In newer Kali versions this screen is not present. Instead nothing is happening)

The only way I found that fixes this is to uninstall the Gnome-desktop and use another window manager (I use LXDE):

  • Apt-get remove gnome-core
  • apt-get install lxde-core lxde kali-defaults kali-root-login desktop-base

After this you need to reboot and the RDP should work “perfectly”

A full list of windows managers can be found here:

Update 30.09.2016:
There seems to be an issue that causes protocol error. This is if you use 32 bit color depth in the RDP client. Use a lower number and you should be good.

61 Comments

Thanks for that little nugget at the end that saved the day for me. I too was in the same situation as you, without being able to RDP into Kali on my ESXi and was staring at that error message. Changing the desktop manager to lxde was fantastic.

Removing gnome is not a good idea. lxde is stupid. there’s nothing there. you go to run and type terminal you get an error. there’s no sidebar or anything. do not do it

I removed the gnome. I regreted it at first, but then, with a little bit of exploring i found everything that i need.
If you want to find the terminal go to Start -> Usual applications -> System Tools -> LxTerminal.
Just get a shortcut of the terminal, and do all the other stuff with only commands. For my opinion this is the best option if you wan’t to be better at typing and in the same time, memorise more commands.

Thanks for Oddvar Håland Moe so much!
I spent one whole day yesterday to do this,and finally I succeeded now!

Actually I read this article yesterday and follow steps above,but I encountered some error at this step:
apt-get install lxde-core lxde kali-defaults kali-root-login desktop-base
so I failed.
and then I searched lots of pages by google,but I can’t find valuable articles about RDP for kali linux.
I retry again this morning,and it is done!

update-alternatives –config x-session-manager

should be
update-alternatives –config x-session-manager

The last bit saved the day! Thanks a ton!

Thanks so much for the tip. It saved my sanity after trying all sorts of things. The update-alternatives bit didn’t work for me for some reason (even with two dashes) so I just edited my

/.vnc/xstartup to include /usr/bin/startlxde and that seems to work fine.

Thanks for the info. After days of searching and testing
Finally it is running

So awesome trick.Thank You!!

This is awesome – huge timesaver for me! Thank you!

Anyone else having issues running wireshark after performing this?

I have the same issue . any solution?

yes, problem in wireshark.. its just ending and closing.. lol

So As a noob how does the cmd line look with the 2 dashs ?

Thank you for sharing this information it was helpful

This easy installation instruction helps me to activate XRDP on KALI – thank’s a lot.

But when I try to run wireshark (execute it in terminal) the following error message appears:
Qt: XKEYBOARD extension not present on the X server.
The X11 connection broke: Maximum allowed requested length exceeded (code 4)
XIO: fatal IO error 0 (Erfolg) on X server “:10.0”
alfter 195 requests (195 known processed) with 0 events remaining.

Do you have any idea how to solve this problem. Unfortunately I didn’t find a solution so far.

Thanx a lot in advanced,
TW

I had to add startlxde into /etc/xrdp/startwm.sh and comment out /etc/X11/Xsession. Now it works great!

Thank you very much . Oddvar Moe

You are welcome

maybe I am way off but I cant even seem to find that package keeps coming back with unable to locate package.

This worked for me

Thanks much! brough two days of agony to a close.

linux cmd lines are case sensitive; it is not an something that should be needed explained but for those that it is. You are misinforming.

Okay. Have I done a typo? What are you referring to?

Apt instead of apt

I cant get logged in no matter what at the moment. I put kali in the cloud ssh into with no issue useing putty on my windows10 i tunnel my ssh session and open rdp. I get the xrdp login screen with what looks like in the backgroud my cloud. No matter what setting i use such as vpn-any, nothing happens it says vpn connection error. If i put username and password it will just load then null. anyone have ideas.

James – I believe I am having a similar issue to you. Here is my config:

Kali deployed to Azure. I have allowed RDP and configured above as per Oddvar Moe. However when I try to RDP I get presented with the following GUI screen:

“XRDP (inside of what looks like a multi colored nucleus) Just connecting” I have the option for a bunch of different session types:
– sesman-xorgxrdp
– sesman-Xvnc
– console
– vnc-any
– sesman-any
– rdp-any
– neutrinordp-any
– Session manager

Depending on what I pick I get different user/password/ip/port options. No matter what I pick and click OK it just doesn’t do anything.

Any thoughts anyone?

Ok, I got my issue resolved. Looks like the xrdp session manager also needs to be running.

service xrdp-sesman start

I found this on: https://forums.kali.org/archive/index.php/t-32480.html. Take a look at the second post by: mjdx88. The combination of mjdx88 and Oddvar Moe got me going.

# update-alternatives –config x-session-manager
update-alternatives: error: unknown argument ‘–config’
———————————
root@kali:

# update-alternatives ––config x-session-manager
update-alternatives: error: unknown argument ‘––config’
———————————

Thanks for posting this.

I recently got this working on Kali 2016.2 rolling update version and have some notes for the post:

Depending on the version of Kali you may need to change up the repo’s:

cat advanced Launch GNOME services on startup

service xrdp restart

#looks like it needs to be typed in every reboot:
service xrdp-sesman start

scratch the last two lines

update-rc.d xrdp enable

and the service will begin on startup

Dude, you rock with the xfce4 tips! Very Very helpful, without having to switch from Gnome! Many thanks.

thanks worked great in gnome

Just tried this today. I got to the part where I got the blank screen, so I removed gnome and installed lxe. After reboot, RDP didn’t connect and I get an error when trying to start xrdp. Wrong permissions? I”m running as root.

# service xrdp start
Job for xrdp.service failed because the control process exited with error code.
See “systemctl status xrdp.service” and “journalctl -xe” for details.
root@kali:

# journalctl -xe
Oct 31 10:17:01 kali CRON[1757]: pam_unix(cron:session): session closed for user
Oct 31 10:17:08 kali realmd[1392]: quitting realmd service after timeout
Oct 31 10:17:08 kali realmd[1392]: stopping service
Oct 31 10:17:10 kali dbus-daemon[1473]: Activating service name=’org.gnome.GConf
Oct 31 10:17:10 kali dbus-daemon[1473]: Successfully activated service ‘org.gnom
Oct 31 10:20:40 kali systemd[1]: Starting xrdp (X Remote Desktop Protocol) proto
— Subject: Unit xrdp.service has begun start-up
— Defined-By: systemd
— Support: https://www.debian.org/support

— Unit xrdp.service has begun starting up.
Oct 31 10:20:40 kali sh[1912]: E: /var/run/xrdp has wrong permissions
Oct 31 10:20:40 kali systemd[1]: xrdp.service: Control process exited, code=exit
Oct 31 10:20:40 kali systemd[1]: Failed to start xrdp (X Remote Desktop Protocol
— Subject: Unit xrdp.service has failed
— Defined-By: systemd
— Support: https://www.debian.org/support

— Unit xrdp.service has failed.

Greetings from Singapore. Thank you so much for your write up 🙂 it helps me a lot. 2 thumbs up 🙂

Источник

Читайте также:  Windows command prompt codes
Оцените статью