Elevate to administrator privileges in CMD/Powershell without UAC?

I managed to change the port or remote desktop on my Windows Server 2016, using REGEDIT. But the problem began when I forgot to open that port in the firewall, so therefor I can no longer access remote desktop.

The server is still running a website that can run PHP code, and a java minecraft server, and I have FTP access to those.

The problem is that running things like exec with php that is suppose to run command lines, isn’t elevated to admin privileges, and of course UAC isn’t an option since i can’t click anything.

So my question is, is there any way I can restore the RDP port, without admin privileges, or any way to remotely elevate so I can open the port with either CMD or PowerShell?

Many of the answers that are out there haven’t worked.

Edit:
Current access:

  • Running non-elevated cmd/PowerShell commands via PHP or Java
  • Full FTP access for the Website, and Java server

Edit 2:

RDP connection does connect using FPipe, but gives “Internal Error occurred”.

Problem solved!

Using FPipe with java made me access RDP! I can now access it again. Thanks for all help!

Answer

Just an untested hacky attempt…

Using netcat to portward..

Upload 3 files via FTP

  1. fpipe.exe ( http://www.mcafee.com/us/downloads/free-tools/fpipe.aspx )
  2. forward.php
  3. forward.bat

Content of forward.php:

<?php
function execInBackground($cmd) { 
        pclose(popen("start /B ". $cmd, "r"));  
} 

execInBackground("forward.bat");
?>

content of forward.bat (replace 8888 with your new RDP port)

fpipe -l 3389 -s 3389 -r 8888 127.0.0.1

Visit forward.php via webbrowser and then attempt to connect via RDP port 3389

Attribution
Source : Link , Question Author : Jocke155 , Answer Author : Community

Leave a Comment