Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Setting up xrdp on Kali Linux 2016.2 on AWS
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
@kikismalls

This comment has been minimized.

Copy link

@kikismalls kikismalls commented Jan 29, 2017

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

@sullyjman

This comment has been minimized.

Copy link

@sullyjman sullyjman commented Feb 8, 2017

https://www.chasewright.com/guacamole-with-mysql-on-ubuntu/

I used this and it worked perfectly in Ubuntu

@sajtalma

This comment has been minimized.

Copy link

@sajtalma sajtalma 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
xrdp

@jcconnell

This comment has been minimized.

Copy link

@jcconnell 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?

@SVG62

This comment has been minimized.

Copy link

@SVG62 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:

sudo service xrdp restart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.