Вход на сайт
HP ProCurve 2626 - telnet - blöde Sau
168
NEW 13.11.09 00:30
Последний раз изменено 13.11.09 00:31 (anatoli888)
Нужен скрипт который будет выключать порт. Скрипт то в принципе у меня есть но нифига не работает. Моя проблема в том что не могу передать пароль. При старте сессии появляется Log-in screen. У меня сложилось такое мнение что в нем то вся и проблема.
Как это прально сделать?
Как это прально сделать?
В ответ на:
#!/usr/bin/perl
use Net::Telnet ();
my $session = new Net::Telnet(
Telnetmode => 0,
Errmode => 'return',
Timeout => 20,
Dump_log => '/tmp/telnet-dump.log',
Input_log => '/tmp/telnet-input.log'
);
$session->open("10.200.0.10");
$session->waitfor(Match=>'/Password: .*$/i',Timeout=>10) or die $session->errmsg;
$session->put('\n') or die $session->errmsg;
$session->waitfor(Match=>'/DMZ-Switch-RZ2> /i') or die $session->errmsg;
$session->put('show version') or die $session->errmsg;
#!/usr/bin/perl
use Net::Telnet ();
my $session = new Net::Telnet(
Telnetmode => 0,
Errmode => 'return',
Timeout => 20,
Dump_log => '/tmp/telnet-dump.log',
Input_log => '/tmp/telnet-input.log'
);
$session->open("10.200.0.10");
$session->waitfor(Match=>'/Password: .*$/i',Timeout=>10) or die $session->errmsg;
$session->put('\n') or die $session->errmsg;
$session->waitfor(Match=>'/DMZ-Switch-RZ2> /i') or die $session->errmsg;
$session->put('show version') or die $session->errmsg;
NEW 13.11.09 11:43
....
я вот думаю может это их файер чет мутит?
в ответ BSDLamer 13.11.09 08:43
В ответ на:
перекличка с ДНС Серваком
...
0:51:14.688808 IP server_ABC.40850 > switch_XYZ.telnet: S 1970359894:1970359894(0) win 5840 <mss 1460,sackOK,timestamp 1371114243 0,nop,wscale 7>
10:51:14.688916 IP server_ABC.50164 > anderer_server.firma.domain: 24880+ PTR? 10.0.200.10.in-addr.arpa. (42)
10:51:14.689344 IP switch_XYZ.telnet > server_ABC.40850: S 3573927869:3573927869(0) ack 1970359895 win 8192 <mss 1460,nop,wscale 0,nop,nop,timestamp 33699597 1371114243>
10:51:14.689362 IP server_ABC.40850 > switch_XYZ.telnet: . ack 1 win 46 <nop,nop,timestamp 1371114244 33699597>
10:51:14.691257 IP switch_XYZ.telnet > server_ABC.40850: . 1:47(46) ack 1 win 8192 <nop,nop,timestamp 33699597 1371114244>
10:51:14.691268 IP server_ABC.40850 > switch_XYZ.telnet: . ack 47 win 46 <nop,nop,timestamp 1371114246 33699597>
10:51:14.691820 IP switch_XYZ.telnet > server_ABC.40850: P 47:650(603) ack 1 win 8192 <nop,nop,timestamp 33699597 1371114246>
10:51:14.691829 IP server_ABC.40850 > switch_XYZ.telnet: . ack 650 win 56 <nop,nop,timestamp 1371114247 33699597>
10:51:14.693221 IP server_ABC.40850 > switch_XYZ.telnet: P 1:3(2) ack 650 win 56 <nop,nop,timestamp 1371114248 33699597>
10:51:14.693474 IP server_ABC.40850 > switch_XYZ.telnet: FP 3:15(12) ack 650 win 56 <nop,nop,timestamp 1371114248 33699597>
66 packets captured
66 packets received by filter
0 packets dropped by kernel
перекличка с ДНС Серваком
...
0:51:14.688808 IP server_ABC.40850 > switch_XYZ.telnet: S 1970359894:1970359894(0) win 5840 <mss 1460,sackOK,timestamp 1371114243 0,nop,wscale 7>
10:51:14.688916 IP server_ABC.50164 > anderer_server.firma.domain: 24880+ PTR? 10.0.200.10.in-addr.arpa. (42)
10:51:14.689344 IP switch_XYZ.telnet > server_ABC.40850: S 3573927869:3573927869(0) ack 1970359895 win 8192 <mss 1460,nop,wscale 0,nop,nop,timestamp 33699597 1371114243>
10:51:14.689362 IP server_ABC.40850 > switch_XYZ.telnet: . ack 1 win 46 <nop,nop,timestamp 1371114244 33699597>
10:51:14.691257 IP switch_XYZ.telnet > server_ABC.40850: . 1:47(46) ack 1 win 8192 <nop,nop,timestamp 33699597 1371114244>
10:51:14.691268 IP server_ABC.40850 > switch_XYZ.telnet: . ack 47 win 46 <nop,nop,timestamp 1371114246 33699597>
10:51:14.691820 IP switch_XYZ.telnet > server_ABC.40850: P 47:650(603) ack 1 win 8192 <nop,nop,timestamp 33699597 1371114246>
10:51:14.691829 IP server_ABC.40850 > switch_XYZ.telnet: . ack 650 win 56 <nop,nop,timestamp 1371114247 33699597>
10:51:14.693221 IP server_ABC.40850 > switch_XYZ.telnet: P 1:3(2) ack 650 win 56 <nop,nop,timestamp 1371114248 33699597>
10:51:14.693474 IP server_ABC.40850 > switch_XYZ.telnet: FP 3:15(12) ack 650 win 56 <nop,nop,timestamp 1371114248 33699597>
66 packets captured
66 packets received by filter
0 packets dropped by kernel
....
я вот думаю может это их файер чет мутит?
NEW 13.11.09 15:25
вот это логинится по телнету на мой ProCurve, выполняет "show version" и аутпут кладет в /tmp/telnet-input.log
ps. Строго не судите, в перле я не силен
в ответ anatoli888 13.11.09 11:43
В ответ на:
#!/usr/bin/perl
use Net::Telnet ();
my $session = new Net::Telnet(
Telnetmode => 0,
Errmode => 'return',
Timeout => 20,
Dump_log => '/tmp/telnet-dump.log',
Input_log => '/tmp/telnet-input.log'
);
$session->open("10.0.47.43");
$session->put('\n') or die $session->errmsg;
$session->waitfor(Match=>'/Password: .*$/i',Timeout=>10) or die $session->errmsg;
$session->print('\n');
$session->print('mysecurepasswd');
$session->waitfor(Match=>'/24G# /i') or die $session->errmsg;
$session->print('show version') or die $session->errmsg;
$output=$session->waitfor('/\$ $/i');
print $output;
#!/usr/bin/perl
use Net::Telnet ();
my $session = new Net::Telnet(
Telnetmode => 0,
Errmode => 'return',
Timeout => 20,
Dump_log => '/tmp/telnet-dump.log',
Input_log => '/tmp/telnet-input.log'
);
$session->open("10.0.47.43");
$session->put('\n') or die $session->errmsg;
$session->waitfor(Match=>'/Password: .*$/i',Timeout=>10) or die $session->errmsg;
$session->print('\n');
$session->print('mysecurepasswd');
$session->waitfor(Match=>'/24G# /i') or die $session->errmsg;
$session->print('show version') or die $session->errmsg;
$output=$session->waitfor('/\$ $/i');
print $output;
вот это логинится по телнету на мой ProCurve, выполняет "show version" и аутпут кладет в /tmp/telnet-input.log
ps. Строго не судите, в перле я не силен
0001, 0010, 0011, 0100, 0101, вышел зайчег погулядь
NEW 13.11.09 17:41
в ответ anatoli888 13.11.09 17:16
после коннекта мне нужен был ентер для того чтобы сбросить НРшный баннер в виде
перед вводом если не послать \n то почему-то всегда получаю "Invalid Password"
мда кстати надо свой свич проапдейтить :)
В ответ на:
ProCurve J9049A Switch 2900-24G
Software revision T.13.45
Copyright (C) 1991-2008 Hewlett-Packard Co. All Rights Reserved.
RESTRICTED RIGHTS LEGEND
Use, duplication, or disclosure by the Government is subject to restrictions
as set forth in subdivision (b) (3) (ii) of the Rights in Technical Data and
Computer Software clause at 52.227-7013.
HEWLETT-PACKARD COMPANY, 3000 Hanover St., Palo Alto, CA 94303
We'd like to keep you up to date about:
* Software feature updates
* New product announcements
* Special events
Please register your products now at: www.ProCurve.com
Press any key to continue
ProCurve J9049A Switch 2900-24G
Software revision T.13.45
Copyright (C) 1991-2008 Hewlett-Packard Co. All Rights Reserved.
RESTRICTED RIGHTS LEGEND
Use, duplication, or disclosure by the Government is subject to restrictions
as set forth in subdivision (b) (3) (ii) of the Rights in Technical Data and
Computer Software clause at 52.227-7013.
HEWLETT-PACKARD COMPANY, 3000 Hanover St., Palo Alto, CA 94303
We'd like to keep you up to date about:
* Software feature updates
* New product announcements
* Special events
Please register your products now at: www.ProCurve.com
Press any key to continue
перед вводом если не послать \n то почему-то всегда получаю "Invalid Password"
мда кстати надо свой свич проапдейтить :)
0001,
0010, 0011, 0100, 0101, вышел зайчег погулядь
0001, 0010, 0011, 0100, 0101, вышел зайчег погулядь
NEW 13.11.09 18:49
в ответ Russman 13.11.09 16:30
с логином не выходило ...
http://search.cpan.org/%7Ejrogers/Net-Telnet-3.03/lib/Net/Telnet.pm
В ответ на:
Use a combination of print() and waitfor() as an alternative to login() or cmd() when they don't do what you want.
Use a combination of print() and waitfor() as an alternative to login() or cmd() when they don't do what you want.
http://search.cpan.org/%7Ejrogers/Net-Telnet-3.03/lib/Net/Telnet.pm