home links tools blog about
home

« HP's Print Drivers | Main | Nice »

June 07, 2006

Hacking Remote Desktop Connections

Recently while trying to 'Remote Desktop' into a remote server on a VPN I got the dreaded "Terminal Server has exceeded the maximum number of allowed connections".

I contacted the Admin at the remote site, he poked around a bit in the Remote Desktops Management MMC - but couldn't see ANY connections.

Then I stumbled upon this great article from Scott Forsyth - showing spiffy command line options (available even in XP) that let you do some better interogation.

Querying with qwinsta /server:vpnIPAddyHere I was able to see two disconnected winstations/sessions, nuked them, and then got on.

Only, there was ONE little trick that I had to pull off. Since I was connecting via VPN, I wasn't a member of the remote domain - in fact, my login to the remote box was limited to only one machine (a SQL Server).  So qwinsta wouldn't work - as I didn't have permission to access it.

The solution? Simple: open up Windows Explorer to \\remoteMachineName\c$ (or some other share). In order to connect to a share you have to pass in credentials and get a Kerberos ticket. Once that's in place, it's good for roughly 10 hours in most cases... and once you have that ticket it then gets bundled with your subsequent requests with qwinsta and rwinsta. (Okay... so maybe that's not hacking... but it does solve the issue of qwinsta and rwinsta not letting you pass in optional credentials.)
 

Spiffy - and thanks to Scott for the excellent overview of those tools. Total life saver.

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d8341ce4d453ef00d834c7ebf869e2

Listed below are links to weblogs that reference Hacking Remote Desktop Connections:

Comments

One other hit, you can ALWAYS connect to the console of machine even if all the other sessions are busy.

Do this by either passing the -console command-line argument to the mstsc.exe program.

You can also hand-edit a .RDP file to make it always connect to the console by loading it in Notepad.exe and adding to the end this line:
connect to console:i:1


Thanks man! This was gold. I have a number of sneaky ways to get on machines that I get locked out of bur this has been added to my aresnal.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Comments are moderated, and will not appear until the author has approved them.