electrico Posted September 6, 2010 Share Posted September 6, 2010 (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 September 6, 2010 by electrico Link to comment Share on other sites More sharing options...
BinaryBrother Posted September 6, 2010 Share Posted September 6, 2010 (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 September 6, 2010 by BinaryBrother SIGNATURE_0X800007D NOT FOUND Link to comment Share on other sites More sharing options...
electrico Posted September 7, 2010 Author Share Posted September 7, 2010 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. Link to comment Share on other sites More sharing options...
BinaryBrother Posted September 7, 2010 Share Posted September 7, 2010 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. SIGNATURE_0X800007D NOT FOUND Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now