Does some know how to get the output when I send commands to a telnetI saw the other posts about fake windows telnet servers, so if you get pass that point and find a telnet server you can talk to...
server using a perl script??? I m using telnet.pm module
I do need it today and I don’t Know what to do... :-(
If some one could help me.,plzz
Thanx
rogerio
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.541 / Virus Database: 335 - Release Date: 11/14/2003
I used to do a lot of Net::Telnet on our SCO Unix boxes, back before we enabled (hacked) ssh to work on SCO. I was completely green when I started rolling my own telnet sessions, and knew nothing about networking or IPC. I've improved since than - now I know virtually nothing.
What my scripts used to do was first log in (obviously). Then I'd do a
$telnet->buffer_empty;
Maybe that was mindless voodoo, but I thought I'd be on the safe side and clear out any license warnings or other crap that SCO pushed down at
me. Followed by
my @output = $telnet->cmd("date"); my $output = join "",@output; if ($output =~ /\w{3}\s\w{3}\s+\d+\s\d{2}:\d{2}:\d{2}\s(EST|EDT)\s\d{4}/) { # ...it worked, do something... } else { # Not a valid connection, do something else (like try again) }
That's right, the first command I would execute would be "date", and then I would match the buffer against the regex to see if what I got back contained something that looked like a date. If it did, I figured that I was in. My script would go ahead and start having dialogs with the server. And if it didn't? Typically I wrapped a while loop around the code and would retry the login and this test command a couple of times before giving up.
This is how I did it, and IMHO, it's crude to the point of being retarded, but I did this hundreds of times on the most mission-critical applications we had, and nothing bad ever happened. The worst that occurred was that several times, possibly, something weird happened to telnet and although my script connected, for some reason it thought it didn't (false negative?). In which case the script gave weary shrug and died. So it's crude, but how great does it have to be, anyway? The impression that I get from reading listservs is that telnet is obsolete and insecure anyway, and you should be using something else (like ssh) if you can. Anyway, good luck and hth.
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]