|
Posted by Mr_Noob on March 11, 2008, 2:14 pm
Please log in for more thread options wrote:
> Mr_Noob wrote:
> > Hi all,
>
> > Here is my perl script that make a telnet connection with a windows2k3
> > box :
>
> > #!/usr/bin/perl -w
> > use strict;
> > use warnings;
> > use Net::Telnet ();
> > my $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die', Prompt =>
> > '/$ $/i');
>
> That's saying that you want a prompt that ends with a '$ '.
>
> [...]
>
> > I guess my "Prompt" isn't set correctly but can't find how to correct
> > this...
>
> You change the regular expression of the Prompt attribute above.
>
> > Here is how it looks like if i telnet my server manually :
>
> > $ telnet myserver
> > Trying 192.168.1.6...
> > Connected to myserver.mydomain.com.
> > Escape character is '^]'.
> > Welcome to Microsoft Telnet Service
>
> > login: administrator
> > password:
>
> Your prompt on the remote machine would be the 'login: ', then the
> 'password: '.
>
> Modify your Prompt to match what you're seeing on the remote machine.
ok, thx for the advise.
But i tried this :
my $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die', Prompt =>
'/login: $/i');
or
my $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die', Prompt =>
'/password:$/i');
my $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die', Prompt =>
'/login:|password:$/i');
without any success.....
|