Jump to content
Sign in to follow this  

Remote Desktop connections control

Recommended Posts

Hi guys!

This time I get bored with free connection to my pc (I cannnot change pass because It is needed for others to complete some tasks). I have idea but I cannot process how to realize it.

Is there any chance to control incoming connections to remote desktop? (port 3389)

I appreciate any beginnings, and any idea, just how I could begin this script, because I have no any idea.

So the purpose is: check IP adress trying to connect and if it is in the trust list, - allow, if not in the list -disallow remote desktop connection.

Help pls,

Kind regards,


Edited by electrico

Share this post

Link to post
Share on other sites

You could change the listening port of RDP to something other than 3389, 3300 for example. Set an AutoIt proxy up on port 3389 to forward requests to the RDP server (port 3300). You can use the _SocketToIP() function floating around the forums to nab IP addresses... ;)

This example only allows one connection... lol. But I had it sitting in my archives.

$g_IP = ""
$MainSocket = TCPListen($g_IP, 3389) ;Listen on port 3389 for incoming connections
If $MainSocket = -1 Then Exit MsgBox(0, "ERROR", "Error... :(")

;Wait for Connection to Proxy
While $Local_Socket < 0
    $Local_Socket = TCPAccept($MainSocket)

;Connect to local RDP and start forwarding packets back and forth
$RDP_Socket = TCPConnect("", 3300) ; Connect to the local RDP
If @error Then Exit MsgBox(0, "ERROR", "Failed to Connect to RDP...")

While 1

Func _DoProxy()
    $Recv = TCPRecv($RDP_Socket, 2048)
    $Recv2 = TCPRecv($Local_Socket, 2048)
    If $Recv <> "" Then
        TCPSend($Local_Socket, $Recv)
    If $Recv2 <> "" Then
        TCPSend($RDP_Socket, $Recv2)
EndFunc   ;==>_DoProxy
Edited by BinaryBrother

Share this post

Link to post
Share on other sites

Thanks a lot for your reply.

I will check your method, may be it will be good for me. But as I know, RDP always allow only one connection to host.

Anyway, thx.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...