
How to Remote Desktop to BackTrack 5 from Windows
Introduction
Managing BackTrack R2 via SSH is usually all you need. However, sometimes I like to manage BackTrack from Windows using X11 so that I can also have access to the desktop. In this blog, I’ll show you how to do the same using SSH, PuTTY, and Xming. This should be useful to penetration testers and BackTrack enthusiasts. The steps that will be covered are listed below:
- Setup SSH in BackTrack
- Disable the firewall (optional)
- Enable X11 Forwarding
- Restart SSH
- Export DISPLAY
- Install and Configure Xming
- Install and Configure PuTTY
- SSH to BackTrack
- Install and run gnome-session
- Access desktop in Xming
A Little Background on X11
Without going into any detail, X11 is a X Windows system that allows users to access GUI applications remotely. However, users should be aware that the terms client and server are inverted in the context of X11. Meaning that the system that makes the request to run an application on the remote server is referred to as the X11 Server, and the system providing access to the application is referred to as the client. So, server=client and client=server.
Setup SSH in BackTrack
Now that we have the X11 history out of the way, let’s get SSH enabled in BackTrack. SSH is installed by default, so only a few commands are needed to get things rolling. First, generate the keys that will be used by the server:
- sshd-generate
Next, start the ssh daemon. By default is will start up on port 22:
- /etc/init.d/ssh start
Finally, configure ssh to start and boot time:
- update-rc.d ssh defaults
For those who don’t know. You can get the IP address of the system via the ifconfig. For the sake of this blog let’s assume that the BackTrack system’s IP is 192.168.1.100. At this point I recommend verifing that you can actually connect to your BackTrack system via SSH. In use PuTTY in Windows or the stock ssh client.
Disable the Firewall
This section is NOT a requirement. However, some people like to go nuts and just drop their entire firewall if they are planning to get crazy. So if you feel your in the group, you can disable the default fire wall in Backtrack with the following IPTABLES commands:
- IPTABLES -F
- IPTABLES -X
- IPTABLES -t nat -F
- IPTABLES -t nat -X
- IPTABLES -t mangle -F
- IPTABLES -t mangle -X
- IPTABLES -P INPUT ACCEPT
- IPTABLES -P FORWARD ACCEPT
- IPTABLES -P OUTPUT ACCEPT
Enable X11 Forwarding
Enable the following settings in the “/etc/ssh/ssh_config” file to enabled X11 forwarding.
- ForwardAgent yes
- ForwardX11 yes
- ForwardX11Trusted yes
Restart SSH
Restart your SSH server or start it if it wasn’t running. Below is one option for restarting the service.
- /etc/init.d/ssh restart
However, the Unbuntu community at large seems to prefer restarting services with the command below:
- Service ssh –full-restart
Export DISPLAY
Set the “DISPLAY” variable to the IP of your X11 server (Windows system). The basic syntax is below.
- export DISPLAY=
If your Windows system is 192.168.1.101, then the command would be:
- export DISPLAY=192.168.1.101
Install and Configure Xming
Next, install the Xming X11 server.
- Download Xming from: Http://sourceforge.net/projects/xming/
- Follow the installation wizard.
- Double click Xlaunch icon.
- Choose “One window”.
- Click Next.
- Choose “Start no client”.
- Click Next.
- Click Next.
- Click Finish.
- Minimize the Xming window.
Install and Configure PuTTY
Next, install the full PuTTY package.
- Downlod the full .msi PuTTY install from: https://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
- Follow the installation wizard.
- Enter the IP or hostname of the X11 client (BackTrack system).
- Under “Connection”, expand the SSH setting and select X11.
- Check the “Enable X11 Forwarding” check box.
- Enter “locahost:0.0” into the “X display location”.
- Click the Session Category.
- Click Save.
SSH to BackTrack
- Open PuTTY.
- Select saved session.
- Click open.
- Enter username.
- Enter password.
Install and Run gnome-session
You can install gnome-session with the following command.
- apt-get install gnome-session
Once installed run the command below to send a gnome desktop to your Xming server.
- gnome-session
Please be aware that you are not limited to the gnome desktop. I only chose it as an example because I’ve had success with it in the past. You can also run individual X applications like xterm, Firefox, etc by running the commands in your SSH sessions.
Access Desktop with Xming
Now all you have to do is open the Xming window and you should have desktop access waiting for you. Whooray for stuff!
Wrap Up
In closing, don’t feel like you have to be limited to the SSH console in BackTrack. I know it’s “Uber l33t”, but sometimes its nice to have desktop access too. As always, have fun, but don’t forget to Hack Resposibly.
References
Explore More Blog Posts

Shift Left Security: Integrating Pentesting Early in Development
Discover how to integrate penetration testing into a shift left security strategy, enhancing application security early in the development lifecycle.

Validating Azure Cloud Security with Breach and Attack Simulation as a Service
NetSPI’s Breach and Attack Simulation as a Service offers focused simulation tests for Azure users to validate your cloud security capabilities.

Getting Shells at Terminal Velocity with Wopper
This article introduces Wopper - a new NetSPI tool that creates self-deleting PHP files and automates code execution on WordPress using administrator credentials.