Remote desktop ‘internal error’ attepting connect after ‘NSA’ patches installed

rdpwindows-terminal-services

I just installed the latest Windows update (NSA vulnerability patch tuesday) and now I cannot connect to remote desktop.

  • The server is remotely hosted. I don't have physical access. Server 2012 R1.
  • Fortunately all web sites are running ok after reboot.
  • I have not yet tried a second reboot because I'm a little scared to.
  • When I try to connect I immediately get this message:
  • "Remote Desktop Connection : An internal error has occured"

enter image description here

  • Have tried from multiple clients. They all fail – including an iOS app which in addition gives me a 0x00000904 error.
  • If I run telnet servername 3389 then it does initiate a connection, so I know the port is open.
  • I can connect just fine to other servers from my Win 10 (unpatched) machine.
  • I cannot connect from my second laptop either, which is Win 10 Creators edition.
  • Cannot find anything useful in Event Viewer.
  • I've even tried wireshark which didn't show me anything useful.
  • The best I have to diagnose is the ability to upload an ASPX page and run it.

I understand that the recent 'NSA edition' patch roundup had some RDP fixes – but I can't find anyone else who suddenly had issues hit week.

I want to have an idea what the problem is before I contact the hosting company, which is why I'm posting here.


Update:

While I still don't have physical server access I remembered I have a Windows 7 VM hosted on the server itself. I was able to get into this and open the server certificates snap-in by connecting to the 10.0.0.1 local IP.

This is showing that the RDP certificate is indeed expired – although I get no errors when connecting that suggest as such. I certainly have been connecting daily and since it expired 2 months ago my guess is that some kind of security update removed whatever other certificate was in the Remote Desktop store and it did not renew itself.

So trying to figure out a way to install a different cert here now.

Update 2

Finally found this in the event log under 'Administrative Events' (by connecting remotely via the VM) :

"The Terminal Server has failed to create a new self signed
certificate to be used for Terminal Server authentication on SSL
connections. The relevant status code was Object already exists."

This seems helpful, albeit a slightly different error. Can't reboot tonight though so will have to check again tomorrow.

https://blogs.technet.microsoft.com/the_9z_by_chris_davis/2014/02/20/event-id-1057-the-terminal-server-has-failed-to-create-a-new-self-signed-certificate/

enter image description here

Best Answer

The solution is basically here

https://blogs.technet.microsoft.com/askpfeplat/2017/02/01/removing-self-signed-rdp-certificates/

This helped too:

https://social.technet.microsoft.com/Forums/ie/en-US/a9c734c1-4e68-4f45-be46-8cae44c95257/unable-to-remote-desktop-to-windows-server-2012-due-to-failed-to-create-self-signed-certificate?forum=winserverTS

Assuming you have already verified that the certificate listed under Certificates > Remote Desktop > Certificates isn't valid ...

enter image description here

Note: I took this screenshot after I fixed everything - so this expiration date is the newly created cert that it did all by itself.

You basically then need to rename or delete this file - and then it will recreate it:

"C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys\f686aace6942fb7f7ceb231212eef4a4_a54b3870-f13c-44bb-98c7-d0511f3e1757"

This is a well-known filename beginning in f686aace. Then restart the Remote Desktop Configuration service and it should recreate it. (Note: it may actually not be necessary to restart the service - just wait to see if it is recreated with the same filename for a minute).

It may take some messing around with permissions and you may need to take ownership of the file and then in addition apply permissions. Note: Ownership doesn't imply permissions. You must add permissions after taking ownership.


As I said I don't have physical access to the server - if you do then the above should suffice.

I was fortunate to be able to connect remotely via another machine on the same local networkand change the registry.

I wanted to DISABLE authentication so I could connect and gain access remotely. The registry entries to do this are HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp

Set the existing keys SecurityLayer and UserAuthentication to 0

Create an RDP file (open mstsc and click Save after entering the servername) and in notepad add the line enablecredsspsupport:i:0 somewhere. This disables the expectation of security.

When you then run the RDP file it should allow you to UNSECURELY connect and gain access to your server.

As soon as you connect change these two registry entries back and then go ahead and delete the f686... file...