7h331337 Posted July 29, 2008 Posted July 29, 2008 (edited) ok its not finished but its a start lol enjoy u can use the telnet server to show the running processes read a au3/txt file wright au3/txt file thats it so far but i am still working on other commands the now it times out after 10 min of inactivitytelnet.au3 Edited July 29, 2008 by 7h331337
7h331337 Posted July 29, 2008 Author Posted July 29, 2008 thanks this is just the starti sould be upploading the next one in 2 days i shuld have 12 commands but if anybudy wants me to add a command tell me the command + a description of what u want it to do
BrettF Posted July 30, 2008 Posted July 30, 2008 Nice, but not appropriate for the young uns... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
SoulA Posted July 31, 2008 Posted July 31, 2008 (edited) I really like what you have done so far I think its great and I'm having a lot of fun fooling around with your idea but I have some suggestions. For the logins I thought they could be done a bit easier. Here is a code snippet of what I put together. It obviously isn't as in depth because I did not add the GUI front end on my server end but you should be able to grasp the idea. I used the StringInStr() function to detect the @CRLF and then I did the StringStripCR() and StringStripWS() functions to get rid of the @CRLF so you don't have to go through that wierd GUI read way. Just an idea take what you like. Anyway can't wait for the rest of the commands. expandcollapse popupGlobal $socket, $recv, $ip, $port, $user, $pass, $acc $ip = "WHATEVER YOU WANT" $port = 23 $user = "user" $pass = "pass" connect() Func connect() TCPStartup() $socket = TCPListen($ip, $port, 1000) Sleep(400) Do $acc = TCPAccept($socket) Until $acc > -1 TCPSend($acc, " ******************************************" & @CRLF) TCPSend($acc, " ** This server is my test server **" & @CRLF) TCPSend($acc, " ******************************************" & @CRLF) TCPRecv($acc, 100) user() EndFunc Func user() TCPSend($acc, "Username: ") Do $recv = TCPRecv($acc, 100) Until StringInStr($recv, @CRLF) $recv = StringStripCR($recv) $recv = StringStripWS($recv, 2) If $recv = $user Then TCPSend($acc, " ** Success **" & @CRLF) pass() EndIf $send = TCPSend($acc, "username wrong" & @CRLF) user() EndFunc Func pass() TCPSend($acc, "please type password for user" & @CRLF) TCPSend($acc, "password:") Do $recv = TCPRecv($acc, 10000) Until StringInStr($recv, @CRLF) $recv = StringStripCR($recv) $recv = StringStripWS($recv, 2) If $recv = $pass Then TCPSend($acc, "connected..." & @CRLF) TCPSend($acc, @CRLF) TCPSend($acc, "**************************************************************************************************************" & @CRLF) TCPSend($acc, "* help shows commands *" & @CRLF) TCPSend($acc, "* process list shows process list *" & @CRLF) TCPSend($acc, "* exit just exits *" & @CRLF) TCPSend($acc, "* read reads an txt/au3 file u must putit like this: read au3.au3 :dont forget the spaceat the end *" & @CRLF) TCPSend($acc, "* new wrights a new file au3 or txt it is the same as above: new au3.au3 :dont forget the space at the end *" & @CRLF) TCPSend($acc, "**************************************************************************************************************" & @CRLF) TCPSend($acc, @ScriptDir & ">") sleep(50000) ;connected() EndIf TCPSend($acc, "pass wrong" & @CRLF) user() EndFunc Func OnAutoItExit() TCPCloseSocket($socket) TCPShutdown() EndFunc Edited July 31, 2008 by SoulA
7h331337 Posted August 1, 2008 Author Posted August 1, 2008 I really like what you have done so far I think its great and I'm having a lot of fun fooling around with your idea but I have some suggestions. For the logins I thought they could be done a bit easier. Here is a code snippet of what I put together. It obviously isn't as in depth because I did not add the GUI front end on my server end but you should be able to grasp the idea. I used the StringInStr() function to detect the @CRLF and then I did the StringStripCR() and StringStripWS() functions to get rid of the @CRLF so you don't have to go through that wierd GUI read way. Just an idea take what you like. Anyway can't wait for the rest of the commands. expandcollapse popupGlobal $socket, $recv, $ip, $port, $user, $pass, $acc $ip = "WHATEVER YOU WANT" $port = 23 $user = "user" $pass = "pass" connect() Func connect() TCPStartup() $socket = TCPListen($ip, $port, 1000) Sleep(400) Do $acc = TCPAccept($socket) Until $acc > -1 TCPSend($acc, " ******************************************" & @CRLF) TCPSend($acc, " ** This server is my test server **" & @CRLF) TCPSend($acc, " ******************************************" & @CRLF) TCPRecv($acc, 100) user() EndFunc Func user() TCPSend($acc, "Username: ") Do $recv = TCPRecv($acc, 100) Until StringInStr($recv, @CRLF) $recv = StringStripCR($recv) $recv = StringStripWS($recv, 2) If $recv = $user Then TCPSend($acc, " ** Success **" & @CRLF) pass() EndIf $send = TCPSend($acc, "username wrong" & @CRLF) user() EndFunc Func pass() TCPSend($acc, "please type password for user" & @CRLF) TCPSend($acc, "password:") Do $recv = TCPRecv($acc, 10000) Until StringInStr($recv, @CRLF) $recv = StringStripCR($recv) $recv = StringStripWS($recv, 2) If $recv = $pass Then TCPSend($acc, "connected..." & @CRLF) TCPSend($acc, @CRLF) TCPSend($acc, "**************************************************************************************************************" & @CRLF) TCPSend($acc, "* help shows commands *" & @CRLF) TCPSend($acc, "* process list shows process list *" & @CRLF) TCPSend($acc, "* exit just exits *" & @CRLF) TCPSend($acc, "* read reads an txt/au3 file u must putit like this: read au3.au3 :dont forget the spaceat the end *" & @CRLF) TCPSend($acc, "* new wrights a new file au3 or txt it is the same as above: new au3.au3 :dont forget the space at the end *" & @CRLF) TCPSend($acc, "**************************************************************************************************************" & @CRLF) TCPSend($acc, @ScriptDir & ">") sleep(50000) ;connected() EndIf TCPSend($acc, "pass wrong" & @CRLF) user() EndFunc Func OnAutoItExit() TCPCloseSocket($socket) TCPShutdown() EndFuncthanks for ure idea it is realy good the reson i went throu so much crap with the user and pass was becouse i was drunk and i couldent think of anything lol i will put the rest of the commands up soon
Yorn Posted August 1, 2008 Posted August 1, 2008 If $ip = "127.0.0.1" Then $ip = @IPAddress2EndIfCan't you just tell it to listen on "0.0.0.0" and it'll listen for all incoming connections? I didn't think you had to put in some sort of exception for a 127.0.0.1.
7h331337 Posted August 2, 2008 Author Posted August 2, 2008 Can't you just tell it to listen on "0.0.0.0" and it'll listen for all incoming connections? I didn't think you had to put in some sort of exception for a 127.0.0.1.true i didnt think of that then thanks i will put that in the script update
Yorn Posted September 15, 2008 Posted September 15, 2008 Just wondering if you did anything more with this?
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