Sign in to follow this  
Followers 0
electrico

Remote Desktop connections control

4 posts in this topic

#1 ·  Posted (edited)

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,

elect.

Edited by electrico

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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 = "127.0.0.1"
TCPStartup()
$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)
WEnd

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

While 1
    _DoProxy()
WEnd


Func _DoProxy()
    $Recv = TCPRecv($RDP_Socket, 2048)
    $Recv2 = TCPRecv($Local_Socket, 2048)
    If $Recv <> "" Then
        TCPSend($Local_Socket, $Recv)
    EndIf
    If $Recv2 <> "" Then
        TCPSend($RDP_Socket, $Recv2)
    EndIf
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

That completely relies on your version of Windows and RDP. Server editions allow multiple connections for example. There are 'other' ways to enable Concurrent connections on OS's which don't supposedly support that feature, some of which could be in violation of M$ TOS or EULA.

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  
Followers 0