Jump to content

Remote Desktop connections control


 Share

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,

elect.

Edited by electrico
Link to comment
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 = "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

SIGNATURE_0X800007D NOT FOUND

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...