Irongeek Posted June 1, 2006 Share Posted June 1, 2006 Has anyone coded a Telnet server/daemon in Autoit3 yet? I've tried to make one just redirecting StdOut to a TCP stream and the reverse for StdIn, but things are not working quite as expected. I figure why reinvent the wheel if someone else already did it. Link to comment Share on other sites More sharing options...
Valuater Posted June 1, 2006 Share Posted June 1, 2006 Welcome to the forums.... search "telnet" in scripts and scraps forum there are many to choose from 8) Link to comment Share on other sites More sharing options...
Irongeek Posted June 1, 2006 Author Share Posted June 1, 2006 (edited) I've searched and I must be missing it. I'm not looking to write a telnet client, but a telnet server that redirects cmd.exe. Here is what I have so far but it does not work: ;SERVER!! Start Me First !!!!!!!!!!!!!!! $g_IP = "127.0.0.1" ; Start The TCP Services ;============================================== TCPStartUp() ; Create a Listening "SOCKET" ;============================================== $MainSocket = TCPListen($g_IP, 65432, 100 ) If $MainSocket = -1 Then Exit $cmdpid = Run(@comspec, @SystemDir, @SW_MAXIMIZE, 3) ; look for client connection ;-------------------- Do $ConnectedSocket = TCPAccept($MainSocket) Until $ConnectedSocket <> -1 While ($ConnectedSocket >= 0) $line = StdoutRead($cmdpid) TCPSend( $ConnectedSocket , $line) $recv = TCPRecv( $ConnectedSocket, 2048) StdinWrite($cmdpid, $recv) ;If $recv <> "" Then msgbox(0, "monkey", $recv) ;StdinWrite($cmdpid, "dir") ;StdinWrite($cmdpid) Wend Thanks. Edited June 1, 2006 by Irongeek Link to comment Share on other sites More sharing options...
Irongeek Posted June 1, 2006 Author Share Posted June 1, 2006 Well, I can read StdOut, I can write to StdIn but I can't seem to do both at the same time. Any help? 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