Welcome Guest! To enable all features please try to register or login.
Go to last post Go to first unread
Offline Dr-Hack  
#1 Posted : Saturday, June 07, 2014 4:39:33 PM(UTC)

Rank: Administrator
Medals: Hackology Founder: This medal is earned by the Founders of Hackogy

Joined: 1/15/2005(UTC)
Posts: 1,318

Thanks: 22 times
Was thanked: 73 time(s) in 57 post(s)
Command Line is a favourite for all those who like to play around Wink
So here I will explain how to change RDP Port from Command Line , there are many reasons why you would like to do that. Its possible the Default 3389 port is not being forwarded by the firewall or there might be some different in your case. You will need to access the machine using Command Line if you are trying to achieve this remotely and if you have a shell access you can pretty much do so.
Microsoft Provides an automatic method and Manual Method on Microsoft Support Site but we dont want that tongue :p
CMD Line to Change RDP port

I will be explaining it on Metasploit but you can achieve the same even with a simple Command Shell.

First Find out the Current RDP Port by typing the Following in CMD
REG QUERY "HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber

The above command will display RDP port in hexadecimal format. To convert from hexadecimal to decimal use the python interpreter or some other tools you like, for those in Kali can simply type
python -c "print int(0xd3d)"

Now find out the HEX value of the Port you want to change to by using
python -c "print hex(139)"
. Here we want to use Port 139 after getting the Hex Value overwrite in the reg by typing in the following :
REG ADD "HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber /t REG_DWORD /d 0x8b /f

Now restart terminal services.
NOTE: Before restarting terminal services make sure that new rdp port is opened in firewall.

net stop TermService /y
net start TermService /y

Enjoy Smile

you can open Firewall Port by doing a Simple Netsh
netsh advfirewall firewall add rule name="Open Port 3389" dir=in action=allow protocol=TCP localport=3389

Rss Feed  Atom Feed
Users browsing this topic
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.