| | |
Telnet Automation How to?
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
I got this big problem. I have to automate a Telnet connection for this project but I have no idea on how to do that in C/C++
. I need to be able to send an ascii file's contents (1 command per line) so that it will automate those commands. Then I need to save the output in a text file, and have the program analyze it. Finally i have to repeat the process automatically for the next ip in line.
If this can be done all automatically already with an exsisting program, could you please direct me to it?
Any help is greatly appreciated!
. I need to be able to send an ascii file's contents (1 command per line) so that it will automate those commands. Then I need to save the output in a text file, and have the program analyze it. Finally i have to repeat the process automatically for the next ip in line.If this can be done all automatically already with an exsisting program, could you please direct me to it?
Any help is greatly appreciated!
A Hacker's Mind:
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
•
•
Join Date: Mar 2004
Posts: 8
Reputation:
Solved Threads: 1
Open winsock on port 23, then just send the data away. Assuming you'll get a reply for every telnet command you send, you can just use blocking winsock commands in a loop.
i.e:
i.e:
C++ Syntax (Toggle Plain Text)
readdata(Filename, CommandArray) initwinsock() for (int x=0;x<UpperBound(IPList);x++) { connect(ip) for (int i=0;i<UpperBound(CommandArray);i++) { send(CommandArray[i]) recv(RecieveBuffer) handlebuffer(RecieveBuffer) } }
•
•
Join Date: Mar 2004
Posts: 77
Reputation:
Solved Threads: 2
you need to make sure u terminate everything u send with "\r\n", or telnet server wont recognize it. and u'll need to login properly, i'd check out part of the telnet RFC, or try and google for a quick telnet tutorial; as well as sniffing your own traffic on a few sessions - that is one of best ways to write a quick prog that actually works. another option, would be to use the Expect scripting language, quite handy for things liek this: http://expect.nist.gov/
![]() |
Similar Threads
- Using telnet under dos (Networking Hardware Configuration)
- Test Automation Leader (Software Development Job Offers)
- QA Automation Lead Engineer (Regression, JAVA, C/C++) in Replay Solutions Inc. (Software Development Job Offers)
- Shuting down Linux Cluster using Telnet (*nix Software)
Other Threads in the C++ Forum
- Previous Thread: Preventing Hooks
- Next Thread: pausing a command
| Thread Tools | Search this Thread |
api array based binary c++ c/c++ calculator char char* class classes code coding compile console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets





