Connecting to a Draytek Vigor Router

Get help with using the PHP Secure Communications Library.

Moderator: Nuxius

Forum rules
The purpose of this forum is to provide support for phpseclib, a pure PHP SSH / SFTP / RSA library.

Posts by new users are held in a moderation queue and are not publicly visible until the post is approved.

Connecting to a Draytek Vigor Router

Postby pilotsnipes » Mon Aug 19, 2013 11:45 pm

Hello, I'm trying to send commands to my draytek router via its internal SSH2 server and having a problem with the execution of commands.

Connecting is fine, but everytime I send a command it automatically disconnects with an error.

Here's what happens when I connect with Putty

Code: Select all
login as: admin
admin@home.example.com's password:
Server refused to allocate pty

Type ? for command help

Draytek> ?
?
% Valid commands are:
adsl         bpa          csm          ddns         dos          exit
internet     ip           ipf          log          mngt         object
port         portmaptime  prn          qos          quit         show
srv          switch       sys          testmail     upnp         vigbrg
vlan         voip         vpn          wan          wl           wol
appqos

Draytek>
Idle timeout. Bye-Bye


Here's my script code

Code: Select all
<?php
set_include_path('/home/laravel/vendor/phpseclib/phpseclib/phpseclib/');
require('Net/SSH2.php');
require('Crypt/RC4.php');

define('NET_SSH2_LOGGING', NET_SSH2_LOG_COMPLEX);

$ssh = new Net_SSH2('home.example.com');
if (!$ssh->login('admin', 'password')) {
    exit('Login Failed');
}

//$ssh->disablePTY();
echo $ssh->exec("?");
echo $ssh->getLog();


Note I have tried it with and without the DisablePTY method - and using write() all with the same result.

Code: Select all
<-
00000000  53:53:48:2d:32:2e:30:2d:44:72:61:79:53:53:48:5f  SSH-2.0-DraySSH_
00000010  32:2e:30:0a                                      2.0.

->
00000000  53:53:48:2d:32:2e:30:2d:70:68:70:73:65:63:6c:69  SSH-2.0-phpsecli
00000010  62:5f:30:2e:33:20:28:6d:63:72:79:70:74:2c:20:62  b_0.3 (mcrypt, b
00000020  63:6d:61:74:68:29:0d:0a                          cmath)..

<- NET_SSH2_MSG_KEXINIT (since last: 0.6575, network: 0.11s)
00000000  2a:68:00:00:b8:7b:00:00:80:45:00:00:64:6a:00:00  *h...{...E..dj..
00000010  00:00:00:1a:64:69:66:66:69:65:2d:68:65:6c:6c:6d  ....diffie-hellm
00000020  61:6e:2d:67:72:6f:75:70:31:2d:73:68:61:31:00:00  an-group1-sha1..
00000030  00:07:73:73:68:2d:64:73:73:00:00:00:08:33:64:65  ..ssh-dss....3de
00000040  73:2d:63:62:63:00:00:00:08:33:64:65:73:2d:63:62  s-cbc....3des-cb
00000050  63:00:00:00:09:68:6d:61:63:2d:73:68:61:31:00:00  c....hmac-sha1..
00000060  00:09:68:6d:61:63:2d:73:68:61:31:00:00:00:04:6e  ..hmac-sha1....n
00000070  6f:6e:65:00:00:00:04:6e:6f:6e:65:00:00:00:00:00  one....none.....
00000080  00:00:00:00:00:00:00:00                          ........

-> NET_SSH2_MSG_KEXINIT (since last: 0.0013, network: 0.0001s)
00000000  ac:7f:15:80:ba:49:89:d6:03:e6:83:31:94:54:5a:13  .....I.....1.TZ.
00000010  00:00:00:36:64:69:66:66:69:65:2d:68:65:6c:6c:6d  ...6diffie-hellm
00000020  61:6e:2d:67:72:6f:75:70:31:2d:73:68:61:31:2c:64  an-group1-sha1,d
00000030  69:66:66:69:65:2d:68:65:6c:6c:6d:61:6e:2d:67:72  iffie-hellman-gr
00000040  6f:75:70:31:34:2d:73:68:61:31:00:00:00:0f:73:73  oup14-sha1....ss
00000050  68:2d:72:73:61:2c:73:73:68:2d:64:73:73:00:00:00  h-rsa,ssh-dss...
00000060  f6:61:72:63:66:6f:75:72:32:35:36:2c:61:72:63:66  .arcfour256,arcf
00000070  6f:75:72:31:32:38:2c:61:72:63:66:6f:75:72:2c:61  our128,arcfour,a
00000080  65:73:31:32:38:2d:63:74:72:2c:61:65:73:31:39:32  es128-ctr,aes192
00000090  2d:63:74:72:2c:61:65:73:32:35:36:2d:63:74:72:2c  -ctr,aes256-ctr,
000000a0  74:77:6f:66:69:73:68:31:32:38:2d:63:74:72:2c:74  twofish128-ctr,t
000000b0  77:6f:66:69:73:68:31:39:32:2d:63:74:72:2c:74:77  wofish192-ctr,tw
000000c0  6f:66:69:73:68:32:35:36:2d:63:74:72:2c:61:65:73  ofish256-ctr,aes
000000d0  31:32:38:2d:63:62:63:2c:61:65:73:31:39:32:2d:63  128-cbc,aes192-c
000000e0  62:63:2c:61:65:73:32:35:36:2d:63:62:63:2c:74:77  bc,aes256-cbc,tw
000000f0  6f:66:69:73:68:31:32:38:2d:63:62:63:2c:74:77:6f  ofish128-cbc,two
00000100  66:69:73:68:31:39:32:2d:63:62:63:2c:74:77:6f:66  fish192-cbc,twof
00000110  69:73:68:32:35:36:2d:63:62:63:2c:74:77:6f:66:69  ish256-cbc,twofi
00000120  73:68:2d:63:62:63:2c:62:6c:6f:77:66:69:73:68:2d  sh-cbc,blowfish-
00000130  63:74:72:2c:62:6c:6f:77:66:69:73:68:2d:63:62:63  ctr,blowfish-cbc
00000140  2c:33:64:65:73:2d:63:74:72:2c:33:64:65:73:2d:63  ,3des-ctr,3des-c
00000150  62:63:2c:6e:6f:6e:65:00:00:00:f6:61:72:63:66:6f  bc,none....arcfo
00000160  75:72:32:35:36:2c:61:72:63:66:6f:75:72:31:32:38  ur256,arcfour128
00000170  2c:61:72:63:66:6f:75:72:2c:61:65:73:31:32:38:2d  ,arcfour,aes128-
00000180  63:74:72:2c:61:65:73:31:39:32:2d:63:74:72:2c:61  ctr,aes192-ctr,a
00000190  65:73:32:35:36:2d:63:74:72:2c:74:77:6f:66:69:73  es256-ctr,twofis
000001a0  68:31:32:38:2d:63:74:72:2c:74:77:6f:66:69:73:68  h128-ctr,twofish
000001b0  31:39:32:2d:63:74:72:2c:74:77:6f:66:69:73:68:32  192-ctr,twofish2
000001c0  35:36:2d:63:74:72:2c:61:65:73:31:32:38:2d:63:62  56-ctr,aes128-cb
000001d0  63:2c:61:65:73:31:39:32:2d:63:62:63:2c:61:65:73  c,aes192-cbc,aes
000001e0  32:35:36:2d:63:62:63:2c:74:77:6f:66:69:73:68:31  256-cbc,twofish1
000001f0  32:38:2d:63:62:63:2c:74:77:6f:66:69:73:68:31:39  28-cbc,twofish19
00000200  32:2d:63:62:63:2c:74:77:6f:66:69:73:68:32:35:36  2-cbc,twofish256
00000210  2d:63:62:63:2c:74:77:6f:66:69:73:68:2d:63:62:63  -cbc,twofish-cbc
00000220  2c:62:6c:6f:77:66:69:73:68:2d:63:74:72:2c:62:6c  ,blowfish-ctr,bl
00000230  6f:77:66:69:73:68:2d:63:62:63:2c:33:64:65:73:2d  owfish-cbc,3des-
00000240  63:74:72:2c:33:64:65:73:2d:63:62:63:2c:6e:6f:6e  ctr,3des-cbc,non
00000250  65:00:00:00:30:68:6d:61:63:2d:73:68:61:31:2d:39  e...0hmac-sha1-9
00000260  36:2c:68:6d:61:63:2d:73:68:61:31:2c:68:6d:61:63  6,hmac-sha1,hmac
00000270  2d:6d:64:35:2d:39:36:2c:68:6d:61:63:2d:6d:64:35  -md5-96,hmac-md5
00000280  2c:6e:6f:6e:65:00:00:00:30:68:6d:61:63:2d:73:68  ,none...0hmac-sh
00000290  61:31:2d:39:36:2c:68:6d:61:63:2d:73:68:61:31:2c  a1-96,hmac-sha1,
000002a0  68:6d:61:63:2d:6d:64:35:2d:39:36:2c:68:6d:61:63  hmac-md5-96,hmac
000002b0  2d:6d:64:35:2c:6e:6f:6e:65:00:00:00:04:6e:6f:6e  -md5,none....non
000002c0  65:00:00:00:04:6e:6f:6e:65:00:00:00:00:00:00:00  e....none.......
000002d0  00:00:00:00:00:00                                ......

-> NET_SSH2_MSG_KEXDH_INIT (since last: 0.0181, network: 0s)
00000000  00:00:00:81:00:c1:a6:ea:1c:ee:fa:3f:f0:8d:d4:72  ...........?...r
00000010  10:97:89:47:13:25:e7:ce:a4:3c:36:2c:b6:15:a0:96  ...G.%....6,....
00000020  a8:52:98:e9:0a:36:18:3e:3c:75:92:c5:2c:ca:2f:3e  .R...6.>.u..,./>
00000030  27:53:8f:49:36:e6:e5:a0:84:d4:7e:14:c0:4f:bd:18  'S.I6.....~..O..
00000040  92:76:ac:13:05:39:69:c7:59:e6:55:d5:cb:d3:19:a2  .v...9i.Y.U.....
00000050  64:dc:3a:00:5f:fd:70:eb:3a:7e:6e:37:08:96:ee:7e  d.:._.p.:~n7...~
00000060  5a:1e:1e:72:63:05:b3:8f:ac:35:8a:24:ff:42:18:19  Z..rc....5.$.B..
00000070  4c:57:50:4e:29:0c:c1:d7:68:d6:ea:6e:9f:a2:d6:ec  LWPN)...h..n....
00000080  7c:86:43:1a:6b                                   |.C.k

<- NET_SSH2_MSG_KEXDH_REPLY (since last: 0.3117, network: 0.3115s)
00000000  00:00:00:f1:00:00:00:07:73:73:68:2d:64:73:73:00  ........ssh-dss.
00000010  00:00:41:00:93:af:76:d0:d4:d1:16:0c:86:5e:7b:17  ..A...v......^{.
00000020  20:8c:96:b5:f2:e4:e2:4d:77:7f:b9:c9:e7:99:ed:9a   ......Mw.......
00000030  a9:7a:26:9d:28:a3:28:98:96:d4:1c:31:87:a4:4c:5f  .z&.(.(....1..L_
00000040  61:a8:d8:93:7c:83:97:0f:e9:d9:44:f7:16:6e:59:54  a...|.....D..nYT
00000050  93:cf:69:2d:00:00:00:15:00:cd:a7:4c:12:f0:3e:03  ..i-.......L..>.
00000060  13:3b:20:e6:ec:e7:cc:b7:3e:27:b1:49:dd:00:00:00  .; .....>'.I....
00000070  40:64:b5:b3:ea:72:c9:bc:4d:82:58:c9:c4:47:90:c4  @d...r..M.X..G..
00000080  30:e7:3c:ec:31:80:74:46:52:f4:7c:8d:70:4f:a1:11  0...1.tFR.|.pO..
00000090  17:fb:f4:c8:42:95:6a:bf:d8:34:77:d5:24:87:7c:fa  ....B.j..4w.$.|.
000000a0  8e:23:52:98:b4:e9:9f:d8:7b:5c:eb:ba:19:cc:d7:27  .#R.....{\.....'
000000b0  06:00:00:00:40:3c:81:10:f4:a9:4a:e1:45:bd:57:97  ....@.....J.E.W.
000000c0  c3:71:59:d9:48:37:b6:5f:6f:1e:ff:27:be:89:e8:f1  .qY.H7._o..'....
000000d0  e4:c5:57:8f:d0:a3:e1:0b:ba:3d:cb:55:cd:cc:ce:fc  ..W......=.U....
000000e0  41:8b:b7:6e:31:cc:a5:d5:ef:72:68:f3:d5:9d:33:af  A..n1....rh...3.
000000f0  cb:b5:80:a4:84:00:00:00:81:00:d8:02:08:0a:19:d2  ................
00000100  c2:29:f5:d0:c9:9d:d9:2a:6e:dd:2b:16:74:3b:3c:1f  .).....*n.+.t;..
00000110  ea:ff:25:71:51:05:e8:ae:84:c9:3c:7f:7a:3c:cc:f4  ..%qQ.......z...
00000120  87:ae:b3:9b:89:d9:a3:ef:bd:13:a7:ab:af:7d:5a:c8  .............}Z.
00000130  6e:ba:e3:ba:60:d5:13:f1:88:6d:bd:17:c7:5d:05:de  n...`....m...]..
00000140  d9:c7:fe:74:92:1c:88:58:c9:a7:a6:0c:bf:0e:7b:6d  ...t...X......{m
00000150  00:c6:76:bf:cb:89:f1:4e:1f:66:ef:a4:79:d2:86:1d  ..v....N.f..y...
00000160  e4:d7:cd:fb:99:b5:9a:2a:e9:c1:99:01:a2:c6:c4:50  .......*.......P
00000170  90:f2:13:97:5a:b0:5e:f3:78:54:00:00:00:37:00:00  ....Z.^.xT...7..
00000180  00:07:73:73:68:2d:64:73:73:00:00:00:28:64:21:35  ..ssh-dss...(d!5
00000190  80:45:cc:f2:a3:06:b3:83:4a:a8:21:39:b7:24:c8:7d  .E......J.!9.$.}
000001a0  92:9c:f9:1d:a3:3c:c8:69:21:44:1f:c5:cc:1e:5b:f5  .......i!D....[.
000001b0  95:42:32:a7:87                                   .B2..

-> NET_SSH2_MSG_NEWKEYS (since last: 0.0213, network: 0.0003s)
                                                 

<- NET_SSH2_MSG_NEWKEYS (since last: 0.0003, network: 0.0001s)
                                                 

-> NET_SSH2_MSG_SERVICE_REQUEST (since last: 0.0086, network: 0.0001s)
00000000  00:00:00:0c:73:73:68:2d:75:73:65:72:61:75:74:68  ....ssh-userauth

<- NET_SSH2_MSG_SERVICE_ACCEPT (since last: 0.2225, network: 0.2221s)
00000000  00:00:00:0c:73:73:68:2d:75:73:65:72:61:75:74:68  ....ssh-userauth

-> NET_SSH2_MSG_USERAUTH_REQUEST (since last: 0.0006, network: 0.0002s)
00000000  32:00:00:00:08:75:73:65:72:6e:61:6d:65:00:00:00  2....username...
00000010  0e:73:73:68:2d:63:6f:6e:6e:65:63:74:69:6f:6e:00  .ssh-connection.
00000020  00:00:08:70:61:73:73:77:6f:72:64:00:00:00:00:08  ...password.....
00000030  70:61:73:73:77:6f:72:64                          password

<- NET_SSH2_MSG_USERAUTH_SUCCESS (since last: 0.1099, network: 0.1095s)
                                                 

-> NET_SSH2_MSG_CHANNEL_OPEN (since last: 0.0007, network: 0.0001s)
00000000  00:00:00:07:73:65:73:73:69:6f:6e:00:00:00:00:7f  ....session.....
00000010  ff:ff:ff:00:00:40:00                             .....@.

<- NET_SSH2_MSG_CHANNEL_OPEN_CONFIRMATION (since last: 0.1093, network: 0.1086s)
00000000  00:00:00:00:00:00:00:00:00:00:00:00:00:00:80:00  ................

-> NET_SSH2_MSG_CHANNEL_REQUEST (since last: 0.0014, network: 0.0005s)
00000000  00:00:00:00:00:00:00:04:65:78:65:63:01:00:00:00  ........exec....
00000010  01:3f                                            .?

<- NET_SSH2_MSG_CHANNEL_FAILURE (since last: 0.1193, network: 0.1187s)
00000000  00:00:00:00                                      ....



Any thoughts as to why it has a channel failure after an exec?

Thank you!
pilotsnipes
Traveler
 
Posts: 6
Joined: Mon Aug 19, 2013 11:27 pm

Re: Connecting to a Draytek Vigor Router

Postby TerraFrost » Tue Aug 20, 2013 8:09 pm

Maybe something like this?:
Code: Select all
<?php
set_include_path('/home/laravel/vendor/phpseclib/phpseclib/phpseclib/');
require('Net/SSH2.php');

define('NET_SSH2_LOGGING', NET_SSH2_LOG_COMPLEX);

$ssh = new Net_SSH2('home.example.com');
if (!$ssh->login('admin', 'password')) {
    exit('Login Failed');
}

echo $ssh->read('Draytek>');
$ssh->write("?\n");
echo $ssh->read('Draytek>');
TerraFrost
Legendary Guard
 
Posts: 12357
Joined: Wed Dec 04, 2002 6:37 am

Re: Connecting to a Draytek Vigor Router

Postby pilotsnipes » Tue Aug 20, 2013 8:17 pm

Thanks for the reply Sir!

No joy as of yet. I think it's because the server wants to reject ALL pty requests - but I don't know how to do that with the read/write method of phpseclib. Everytime I connect with Putty I get "Server refused to allocate pty" but it continues to allow me to type away.

I don't really understand PTY if I'm honest :oops:

Here's the result using your code exactly as you wrote it (bar passwords etc.)

Code: Select all
<-
00000000  53:53:48:2d:32:2e:30:2d:44:72:61:79:53:53:48:5f  SSH-2.0-DraySSH_
00000010  32:2e:30:0a                                      2.0.

->
00000000  53:53:48:2d:32:2e:30:2d:70:68:70:73:65:63:6c:69  SSH-2.0-phpsecli
00000010  62:5f:30:2e:33:20:28:6d:63:72:79:70:74:2c:20:62  b_0.3 (mcrypt, b
00000020  63:6d:61:74:68:29:0d:0a                          cmath)..

<- NET_SSH2_MSG_KEXINIT (since last: 0.6867, network: 0.122s)
00000000  59:59:00:00:16:2d:00:00:f5:56:00:00:e5:2b:00:00  YY...-...V...+..
00000010  00:00:00:1a:64:69:66:66:69:65:2d:68:65:6c:6c:6d  ....diffie-hellm
00000020  61:6e:2d:67:72:6f:75:70:31:2d:73:68:61:31:00:00  an-group1-sha1..
00000030  00:07:73:73:68:2d:64:73:73:00:00:00:08:33:64:65  ..ssh-dss....3de
00000040  73:2d:63:62:63:00:00:00:08:33:64:65:73:2d:63:62  s-cbc....3des-cb
00000050  63:00:00:00:09:68:6d:61:63:2d:73:68:61:31:00:00  c....hmac-sha1..
00000060  00:09:68:6d:61:63:2d:73:68:61:31:00:00:00:04:6e  ..hmac-sha1....n
00000070  6f:6e:65:00:00:00:04:6e:6f:6e:65:00:00:00:00:00  one....none.....
00000080  00:00:00:00:00:00:00:00                          ........

-> NET_SSH2_MSG_KEXINIT (since last: 0.002, network: 0.0001s)
00000000  2f:21:5a:39:7d:6b:72:5d:43:5b:a8:94:01:e7:76:2f  /!Z9}kr]C[....v/
00000010  00:00:00:36:64:69:66:66:69:65:2d:68:65:6c:6c:6d  ...6diffie-hellm
00000020  61:6e:2d:67:72:6f:75:70:31:2d:73:68:61:31:2c:64  an-group1-sha1,d
00000030  69:66:66:69:65:2d:68:65:6c:6c:6d:61:6e:2d:67:72  iffie-hellman-gr
00000040  6f:75:70:31:34:2d:73:68:61:31:00:00:00:0f:73:73  oup14-sha1....ss
00000050  68:2d:72:73:61:2c:73:73:68:2d:64:73:73:00:00:00  h-rsa,ssh-dss...
00000060  f6:61:72:63:66:6f:75:72:32:35:36:2c:61:72:63:66  .arcfour256,arcf
00000070  6f:75:72:31:32:38:2c:61:72:63:66:6f:75:72:2c:61  our128,arcfour,a
00000080  65:73:31:32:38:2d:63:74:72:2c:61:65:73:31:39:32  es128-ctr,aes192
00000090  2d:63:74:72:2c:61:65:73:32:35:36:2d:63:74:72:2c  -ctr,aes256-ctr,
000000a0  74:77:6f:66:69:73:68:31:32:38:2d:63:74:72:2c:74  twofish128-ctr,t
000000b0  77:6f:66:69:73:68:31:39:32:2d:63:74:72:2c:74:77  wofish192-ctr,tw
000000c0  6f:66:69:73:68:32:35:36:2d:63:74:72:2c:61:65:73  ofish256-ctr,aes
000000d0  31:32:38:2d:63:62:63:2c:61:65:73:31:39:32:2d:63  128-cbc,aes192-c
000000e0  62:63:2c:61:65:73:32:35:36:2d:63:62:63:2c:74:77  bc,aes256-cbc,tw
000000f0  6f:66:69:73:68:31:32:38:2d:63:62:63:2c:74:77:6f  ofish128-cbc,two
00000100  66:69:73:68:31:39:32:2d:63:62:63:2c:74:77:6f:66  fish192-cbc,twof
00000110  69:73:68:32:35:36:2d:63:62:63:2c:74:77:6f:66:69  ish256-cbc,twofi
00000120  73:68:2d:63:62:63:2c:62:6c:6f:77:66:69:73:68:2d  sh-cbc,blowfish-
00000130  63:74:72:2c:62:6c:6f:77:66:69:73:68:2d:63:62:63  ctr,blowfish-cbc
00000140  2c:33:64:65:73:2d:63:74:72:2c:33:64:65:73:2d:63  ,3des-ctr,3des-c
00000150  62:63:2c:6e:6f:6e:65:00:00:00:f6:61:72:63:66:6f  bc,none....arcfo
00000160  75:72:32:35:36:2c:61:72:63:66:6f:75:72:31:32:38  ur256,arcfour128
00000170  2c:61:72:63:66:6f:75:72:2c:61:65:73:31:32:38:2d  ,arcfour,aes128-
00000180  63:74:72:2c:61:65:73:31:39:32:2d:63:74:72:2c:61  ctr,aes192-ctr,a
00000190  65:73:32:35:36:2d:63:74:72:2c:74:77:6f:66:69:73  es256-ctr,twofis
000001a0  68:31:32:38:2d:63:74:72:2c:74:77:6f:66:69:73:68  h128-ctr,twofish
000001b0  31:39:32:2d:63:74:72:2c:74:77:6f:66:69:73:68:32  192-ctr,twofish2
000001c0  35:36:2d:63:74:72:2c:61:65:73:31:32:38:2d:63:62  56-ctr,aes128-cb
000001d0  63:2c:61:65:73:31:39:32:2d:63:62:63:2c:61:65:73  c,aes192-cbc,aes
000001e0  32:35:36:2d:63:62:63:2c:74:77:6f:66:69:73:68:31  256-cbc,twofish1
000001f0  32:38:2d:63:62:63:2c:74:77:6f:66:69:73:68:31:39  28-cbc,twofish19
00000200  32:2d:63:62:63:2c:74:77:6f:66:69:73:68:32:35:36  2-cbc,twofish256
00000210  2d:63:62:63:2c:74:77:6f:66:69:73:68:2d:63:62:63  -cbc,twofish-cbc
00000220  2c:62:6c:6f:77:66:69:73:68:2d:63:74:72:2c:62:6c  ,blowfish-ctr,bl
00000230  6f:77:66:69:73:68:2d:63:62:63:2c:33:64:65:73:2d  owfish-cbc,3des-
00000240  63:74:72:2c:33:64:65:73:2d:63:62:63:2c:6e:6f:6e  ctr,3des-cbc,non
00000250  65:00:00:00:30:68:6d:61:63:2d:73:68:61:31:2d:39  e...0hmac-sha1-9
00000260  36:2c:68:6d:61:63:2d:73:68:61:31:2c:68:6d:61:63  6,hmac-sha1,hmac
00000270  2d:6d:64:35:2d:39:36:2c:68:6d:61:63:2d:6d:64:35  -md5-96,hmac-md5
00000280  2c:6e:6f:6e:65:00:00:00:30:68:6d:61:63:2d:73:68  ,none...0hmac-sh
00000290  61:31:2d:39:36:2c:68:6d:61:63:2d:73:68:61:31:2c  a1-96,hmac-sha1,
000002a0  68:6d:61:63:2d:6d:64:35:2d:39:36:2c:68:6d:61:63  hmac-md5-96,hmac
000002b0  2d:6d:64:35:2c:6e:6f:6e:65:00:00:00:04:6e:6f:6e  -md5,none....non
000002c0  65:00:00:00:04:6e:6f:6e:65:00:00:00:00:00:00:00  e....none.......
000002d0  00:00:00:00:00:00                                ......

-> NET_SSH2_MSG_KEXDH_INIT (since last: 0.0206, network: 0s)
00000000  00:00:00:80:40:66:1a:7d:63:32:ee:12:2d:79:de:93  ....@f.}c2..-y..
00000010  92:ed:2f:9b:a2:6e:e7:05:49:a8:3b:bb:f1:bb:1b:6f  ../..n..I.;....o
00000020  48:ee:9f:05:1c:dc:b5:bf:bb:53:b7:36:64:c4:06:65  H........S.6d..e
00000030  d6:69:03:ea:cb:03:0a:75:73:90:ca:3d:c6:e1:11:35  .i.....us..=...5
00000040  51:7c:94:7e:51:08:77:10:75:68:0e:26:20:44:6a:b3  Q|.~Q.w.uh.& Dj.
00000050  22:da:88:fc:9b:65:65:2b:e5:a7:8c:4a:90:f5:e2:8a  "....ee+...J....
00000060  b4:2b:e2:ea:e4:77:ee:ad:1f:c4:f0:ad:6d:b2:23:25  .+...w......m.#%
00000070  4f:2a:cb:29:dc:ec:4a:d0:ce:6f:19:a9:c7:ac:de:e2  O*.)..J..o......
00000080  b5:1f:ed:fc                                      ....

<- NET_SSH2_MSG_KEXDH_REPLY (since last: 0.3326, network: 0.3324s)
00000000  00:00:00:f1:00:00:00:07:73:73:68:2d:64:73:73:00  ........ssh-dss.
00000010  00:00:41:00:93:af:76:d0:d4:d1:16:0c:86:5e:7b:17  ..A...v......^{.
00000020  20:8c:96:b5:f2:e4:e2:4d:77:7f:b9:c9:e7:99:ed:9a   ......Mw.......
00000030  a9:7a:26:9d:28:a3:28:98:96:d4:1c:31:87:a4:4c:5f  .z&.(.(....1..L_
00000040  61:a8:d8:93:7c:83:97:0f:e9:d9:44:f7:16:6e:59:54  a...|.....D..nYT
00000050  93:cf:69:2d:00:00:00:15:00:cd:a7:4c:12:f0:3e:03  ..i-.......L..>.
00000060  13:3b:20:e6:ec:e7:cc:b7:3e:27:b1:49:dd:00:00:00  .; .....>'.I....
00000070  40:64:b5:b3:ea:72:c9:bc:4d:82:58:c9:c4:47:90:c4  @d...r..M.X..G..
00000080  30:e7:3c:ec:31:80:74:46:52:f4:7c:8d:70:4f:a1:11  0...1.tFR.|.pO..
00000090  17:fb:f4:c8:42:95:6a:bf:d8:34:77:d5:24:87:7c:fa  ....B.j..4w.$.|.
000000a0  8e:23:52:98:b4:e9:9f:d8:7b:5c:eb:ba:19:cc:d7:27  .#R.....{\.....'
000000b0  06:00:00:00:40:3c:81:10:f4:a9:4a:e1:45:bd:57:97  ....@.....J.E.W.
000000c0  c3:71:59:d9:48:37:b6:5f:6f:1e:ff:27:be:89:e8:f1  .qY.H7._o..'....
000000d0  e4:c5:57:8f:d0:a3:e1:0b:ba:3d:cb:55:cd:cc:ce:fc  ..W......=.U....
000000e0  41:8b:b7:6e:31:cc:a5:d5:ef:72:68:f3:d5:9d:33:af  A..n1....rh...3.
000000f0  cb:b5:80:a4:84:00:00:00:80:79:c7:29:d1:ca:b5:c2  .........y.)....
00000100  ac:0e:9e:b6:d0:bf:37:b7:ca:2c:f2:be:18:9d:c0:be  ......7..,......
00000110  e5:54:f4:29:76:37:41:47:5f:d6:d7:e4:52:fc:1e:7f  .T.)v7AG_...R...
00000120  08:da:90:3c:8e:ad:42:0d:6d:1b:2e:88:4b:b2:94:de  ......B.m...K...
00000130  11:1b:ff:48:79:3a:8c:cd:72:55:d5:c6:89:0a:96:66  ...Hy:..rU.....f
00000140  98:97:54:31:65:c8:62:a2:44:ac:21:c2:fe:46:15:9e  ..T1e.b.D.!..F..
00000150  2a:3b:d9:0a:c7:32:e5:8a:db:3a:6e:3b:79:77:84:67  *;...2...:n;yw.g
00000160  68:e3:a5:be:21:f5:a8:e6:4b:ed:5a:d2:ba:78:d6:83  h...!...K.Z..x..
00000170  8e:ee:b0:a4:06:fd:bb:95:bf:00:00:00:37:00:00:00  ............7...
00000180  07:73:73:68:2d:64:73:73:00:00:00:28:34:1d:d5:6d  .ssh-dss...(4..m
00000190  ed:f4:b4:5d:13:05:c1:74:73:6d:0f:e4:d8:d3:64:fb  ...]...tsm....d.
000001a0  76:8e:1c:40:9d:af:69:9e:77:00:f8:6f:02:a2:62:62  v..@..i.w..o..bb
000001b0  3f:1d:cc:bb                                      ?...

-> NET_SSH2_MSG_NEWKEYS (since last: 0.0242, network: 0.0002s)
                                                 

<- NET_SSH2_MSG_NEWKEYS (since last: 0.0002, network: 0.0001s)
                                                 

-> NET_SSH2_MSG_SERVICE_REQUEST (since last: 0.0267, network: 0.0001s)
00000000  00:00:00:0c:73:73:68:2d:75:73:65:72:61:75:74:68  ....ssh-userauth

<- NET_SSH2_MSG_SERVICE_ACCEPT (since last: 0.267, network: 0.2666s)
00000000  00:00:00:0c:73:73:68:2d:75:73:65:72:61:75:74:68  ....ssh-userauth

-> NET_SSH2_MSG_USERAUTH_REQUEST (since last: 0.0006, network: 0.0001s)
00000000  32:00:00:00:08:75:73:65:72:6e:61:6d:65:00:00:00  2....username...
00000010  0e:73:73:68:2d:63:6f:6e:6e:65:63:74:69:6f:6e:00  .ssh-connection.
00000020  00:00:08:70:61:73:73:77:6f:72:64:00:00:00:00:08  ...password.....
00000030  70:61:73:73:77:6f:72:64                          password

<- NET_SSH2_MSG_USERAUTH_SUCCESS (since last: 0.1296, network: 0.1291s)
                                                 

-> NET_SSH2_MSG_CHANNEL_OPEN (since last: 0.0011, network: 0.0001s)
00000000  00:00:00:07:73:65:73:73:69:6f:6e:00:00:00:01:7f  ....session.....
00000010  ff:ff:ff:00:00:40:00                             .....@.

<- NET_SSH2_MSG_CHANNEL_OPEN_CONFIRMATION (since last: 0.1375, network: 0.137s)
00000000  00:00:00:01:00:00:00:00:00:00:00:00:00:00:80:00  ................

-> NET_SSH2_MSG_CHANNEL_REQUEST (since last: 0.002, network: 0.0001s)
00000000  00:00:00:00:00:00:00:07:70:74:79:2d:72:65:71:01  ........pty-req.
00000010  00:00:00:05:76:74:31:30:30:00:00:00:50:00:00:00  ....vt100...P...
00000020  18:00:00:00:00:00:00:00:00:00:00:00:01:00        ..............

<- NET_SSH2_MSG_CHANNEL_FAILURE (since last: 0.141, network: 0.1407s)
00000000  00:00:00:01                                      ....

-> NET_SSH2_MSG_DISCONNECT (since last: 0.0019, network: 0.0005s)
00000000  00:00:00:0b:00:00:00:00:00:00:00:00              ............


Thank you for your help.
pilotsnipes
Traveler
 
Posts: 6
Joined: Mon Aug 19, 2013 11:27 pm

Re: Connecting to a Draytek Vigor Router

Postby TerraFrost » Tue Aug 20, 2013 8:27 pm

I'll play around with this some when I get home after work. Thinking I should be able to make some code changes so that phpseclib continues on if the pty request fails as well.

We'll see. I'll let you know!
TerraFrost
Legendary Guard
 
Posts: 12357
Joined: Wed Dec 04, 2002 6:37 am

Re: Connecting to a Draytek Vigor Router

Postby pilotsnipes » Tue Aug 20, 2013 11:26 pm

That's very kind of you!

Much appreciated!
pilotsnipes
Traveler
 
Posts: 6
Joined: Mon Aug 19, 2013 11:27 pm

Re: Connecting to a Draytek Vigor Router

Postby TerraFrost » Wed Aug 21, 2013 4:54 am

TerraFrost
Legendary Guard
 
Posts: 12357
Joined: Wed Dec 04, 2002 6:37 am

Re: Connecting to a Draytek Vigor Router

Postby pilotsnipes » Thu Aug 22, 2013 3:12 pm

It is truly a thing of beauty!

Works exactly right now.

As I have been searching and researching other websites for solutions to this problem (I don't have them to hand anymore unfortunately), it seems that there are quiet a few people who have run into this type of issue. It seems that a lot of switches/routers/hubs etc were all failing on this issue - probably because they aren't "proper" ssh servers.

I'm very sure now that this fix would also help them too....if they know to update to this git branch!

What are your plans for this branch? I currently have this project in my composer.json file, so if I update in the future and it hasn't been merged into the master I'll lose this fix. Will you be keeping the branch or merging do you think?

Thank you *VERY* much for your help.

Code: Select all
Type ? for command help


Draytek> ?

% Valid commands are:

adsl         bpa          csm          ddns         dos          exit         

internet     ip           ipf          log          mngt         object       

port         portmaptime  prn          qos          quit         show         

srv          switch       sys          testmail     upnp         vigbrg       

vlan         voip         vpn          wan          wl           wol         

appqos       


Draytek><-
00000000  53:53:48:2d:32:2e:30:2d:44:72:61:79:53:53:48:5f  SSH-2.0-DraySSH_
00000010  32:2e:30:0a                                      2.0.

->
00000000  53:53:48:2d:32:2e:30:2d:70:68:70:73:65:63:6c:69  SSH-2.0-phpsecli
00000010  62:5f:30:2e:33:20:28:6d:63:72:79:70:74:2c:20:62  b_0.3 (mcrypt, b
00000020  63:6d:61:74:68:29:0d:0a                          cmath)..

<- NET_SSH2_MSG_KEXINIT (since last: 0.7061, network: 0.1088s)
00000000  72:27:00:00:db:09:00:00:10:7b:00:00:ab:33:00:00  r'.......{...3..
00000010  00:00:00:1a:64:69:66:66:69:65:2d:68:65:6c:6c:6d  ....diffie-hellm
00000020  61:6e:2d:67:72:6f:75:70:31:2d:73:68:61:31:00:00  an-group1-sha1..
00000030  00:07:73:73:68:2d:64:73:73:00:00:00:08:33:64:65  ..ssh-dss....3de
00000040  73:2d:63:62:63:00:00:00:08:33:64:65:73:2d:63:62  s-cbc....3des-cb
00000050  63:00:00:00:09:68:6d:61:63:2d:73:68:61:31:00:00  c....hmac-sha1..
00000060  00:09:68:6d:61:63:2d:73:68:61:31:00:00:00:04:6e  ..hmac-sha1....n
00000070  6f:6e:65:00:00:00:04:6e:6f:6e:65:00:00:00:00:00  one....none.....
00000080  00:00:00:00:00:00:00:00                          ........

-> NET_SSH2_MSG_KEXINIT (since last: 0.0009, network: 0.0001s)
00000000  e5:1d:db:54:d0:61:7d:e1:c2:66:2b:58:6b:d4:55:a1  ...T.a}..f+Xk.U.
00000010  00:00:00:36:64:69:66:66:69:65:2d:68:65:6c:6c:6d  ...6diffie-hellm
00000020  61:6e:2d:67:72:6f:75:70:31:2d:73:68:61:31:2c:64  an-group1-sha1,d
00000030  69:66:66:69:65:2d:68:65:6c:6c:6d:61:6e:2d:67:72  iffie-hellman-gr
00000040  6f:75:70:31:34:2d:73:68:61:31:00:00:00:0f:73:73  oup14-sha1....ss
00000050  68:2d:72:73:61:2c:73:73:68:2d:64:73:73:00:00:00  h-rsa,ssh-dss...
00000060  f6:61:72:63:66:6f:75:72:32:35:36:2c:61:72:63:66  .arcfour256,arcf
00000070  6f:75:72:31:32:38:2c:61:72:63:66:6f:75:72:2c:61  our128,arcfour,a
00000080  65:73:31:32:38:2d:63:74:72:2c:61:65:73:31:39:32  es128-ctr,aes192
00000090  2d:63:74:72:2c:61:65:73:32:35:36:2d:63:74:72:2c  -ctr,aes256-ctr,
000000a0  74:77:6f:66:69:73:68:31:32:38:2d:63:74:72:2c:74  twofish128-ctr,t
000000b0  77:6f:66:69:73:68:31:39:32:2d:63:74:72:2c:74:77  wofish192-ctr,tw
000000c0  6f:66:69:73:68:32:35:36:2d:63:74:72:2c:61:65:73  ofish256-ctr,aes
000000d0  31:32:38:2d:63:62:63:2c:61:65:73:31:39:32:2d:63  128-cbc,aes192-c
000000e0  62:63:2c:61:65:73:32:35:36:2d:63:62:63:2c:74:77  bc,aes256-cbc,tw
000000f0  6f:66:69:73:68:31:32:38:2d:63:62:63:2c:74:77:6f  ofish128-cbc,two
00000100  66:69:73:68:31:39:32:2d:63:62:63:2c:74:77:6f:66  fish192-cbc,twof
00000110  69:73:68:32:35:36:2d:63:62:63:2c:74:77:6f:66:69  ish256-cbc,twofi
00000120  73:68:2d:63:62:63:2c:62:6c:6f:77:66:69:73:68:2d  sh-cbc,blowfish-
00000130  63:74:72:2c:62:6c:6f:77:66:69:73:68:2d:63:62:63  ctr,blowfish-cbc
00000140  2c:33:64:65:73:2d:63:74:72:2c:33:64:65:73:2d:63  ,3des-ctr,3des-c
00000150  62:63:2c:6e:6f:6e:65:00:00:00:f6:61:72:63:66:6f  bc,none....arcfo
00000160  75:72:32:35:36:2c:61:72:63:66:6f:75:72:31:32:38  ur256,arcfour128
00000170  2c:61:72:63:66:6f:75:72:2c:61:65:73:31:32:38:2d  ,arcfour,aes128-
00000180  63:74:72:2c:61:65:73:31:39:32:2d:63:74:72:2c:61  ctr,aes192-ctr,a
00000190  65:73:32:35:36:2d:63:74:72:2c:74:77:6f:66:69:73  es256-ctr,twofis
000001a0  68:31:32:38:2d:63:74:72:2c:74:77:6f:66:69:73:68  h128-ctr,twofish
000001b0  31:39:32:2d:63:74:72:2c:74:77:6f:66:69:73:68:32  192-ctr,twofish2
000001c0  35:36:2d:63:74:72:2c:61:65:73:31:32:38:2d:63:62  56-ctr,aes128-cb
000001d0  63:2c:61:65:73:31:39:32:2d:63:62:63:2c:61:65:73  c,aes192-cbc,aes
000001e0  32:35:36:2d:63:62:63:2c:74:77:6f:66:69:73:68:31  256-cbc,twofish1
000001f0  32:38:2d:63:62:63:2c:74:77:6f:66:69:73:68:31:39  28-cbc,twofish19
00000200  32:2d:63:62:63:2c:74:77:6f:66:69:73:68:32:35:36  2-cbc,twofish256
00000210  2d:63:62:63:2c:74:77:6f:66:69:73:68:2d:63:62:63  -cbc,twofish-cbc
00000220  2c:62:6c:6f:77:66:69:73:68:2d:63:74:72:2c:62:6c  ,blowfish-ctr,bl
00000230  6f:77:66:69:73:68:2d:63:62:63:2c:33:64:65:73:2d  owfish-cbc,3des-
00000240  63:74:72:2c:33:64:65:73:2d:63:62:63:2c:6e:6f:6e  ctr,3des-cbc,non
00000250  65:00:00:00:30:68:6d:61:63:2d:73:68:61:31:2d:39  e...0hmac-sha1-9
00000260  36:2c:68:6d:61:63:2d:73:68:61:31:2c:68:6d:61:63  6,hmac-sha1,hmac
00000270  2d:6d:64:35:2d:39:36:2c:68:6d:61:63:2d:6d:64:35  -md5-96,hmac-md5
00000280  2c:6e:6f:6e:65:00:00:00:30:68:6d:61:63:2d:73:68  ,none...0hmac-sh
00000290  61:31:2d:39:36:2c:68:6d:61:63:2d:73:68:61:31:2c  a1-96,hmac-sha1,
000002a0  68:6d:61:63:2d:6d:64:35:2d:39:36:2c:68:6d:61:63  hmac-md5-96,hmac
000002b0  2d:6d:64:35:2c:6e:6f:6e:65:00:00:00:04:6e:6f:6e  -md5,none....non
000002c0  65:00:00:00:04:6e:6f:6e:65:00:00:00:00:00:00:00  e....none.......
000002d0  00:00:00:00:00:00                                ......

-> NET_SSH2_MSG_KEXDH_INIT (since last: 0.0152, network: 0s)
00000000  00:00:00:80:65:f0:25:48:8c:26:ec:cb:85:22:e7:58  ....e.%H.&...".X
00000010  c4:8f:9e:3c:63:23:c2:99:c5:3a:3e:e3:66:9c:43:51  ....c#...:>.f.CQ
00000020  6e:ab:10:93:0e:64:43:bf:4e:81:1f:c6:5c:c8:84:9c  n....dC.N...\...
00000030  69:51:81:9c:35:b5:8c:fe:d5:c2:ff:b3:84:21:64:fb  iQ..5........!d.
00000040  9b:fa:bd:aa:02:ef:57:02:5e:d9:13:93:24:25:72:cd  ......W.^...$%r.
00000050  54:80:b1:b3:9c:a8:b5:83:28:23:6d:de:bb:88:bc:70  T.......(#m....p
00000060  8f:01:f8:26:8c:26:2d:fe:ed:a9:9f:52:b7:83:e4:a6  ...&.&-....R....
00000070  92:c8:1d:6b:58:a5:c4:35:f1:d4:82:64:7a:2b:ea:ee  ...kX..5...dz+..
00000080  8f:23:d0:e9                                      .#..

<- NET_SSH2_MSG_KEXDH_REPLY (since last: 0.319, network: 0.3189s)
00000000  00:00:00:f1:00:00:00:07:73:73:68:2d:64:73:73:00  ........ssh-dss.
00000010  00:00:41:00:93:af:76:d0:d4:d1:16:0c:86:5e:7b:17  ..A...v......^{.
00000020  20:8c:96:b5:f2:e4:e2:4d:77:7f:b9:c9:e7:99:ed:9a   ......Mw.......
00000030  a9:7a:26:9d:28:a3:28:98:96:d4:1c:31:87:a4:4c:5f  .z&.(.(....1..L_
00000040  61:a8:d8:93:7c:83:97:0f:e9:d9:44:f7:16:6e:59:54  a...|.....D..nYT
00000050  93:cf:69:2d:00:00:00:15:00:cd:a7:4c:12:f0:3e:03  ..i-.......L..>.
00000060  13:3b:20:e6:ec:e7:cc:b7:3e:27:b1:49:dd:00:00:00  .; .....>'.I....
00000070  40:64:b5:b3:ea:72:c9:bc:4d:82:58:c9:c4:47:90:c4  @d...r..M.X..G..
00000080  30:e7:3c:ec:31:80:74:46:52:f4:7c:8d:70:4f:a1:11  0...1.tFR.|.pO..
00000090  17:fb:f4:c8:42:95:6a:bf:d8:34:77:d5:24:87:7c:fa  ....B.j..4w.$.|.
000000a0  8e:23:52:98:b4:e9:9f:d8:7b:5c:eb:ba:19:cc:d7:27  .#R.....{\.....'
000000b0  06:00:00:00:40:3c:81:10:f4:a9:4a:e1:45:bd:57:97  ....@.....J.E.W.
000000c0  c3:71:59:d9:48:37:b6:5f:6f:1e:ff:27:be:89:e8:f1  .qY.H7._o..'....
000000d0  e4:c5:57:8f:d0:a3:e1:0b:ba:3d:cb:55:cd:cc:ce:fc  ..W......=.U....
000000e0  41:8b:b7:6e:31:cc:a5:d5:ef:72:68:f3:d5:9d:33:af  A..n1....rh...3.
000000f0  cb:b5:80:a4:84:00:00:00:81:00:f8:da:50:e5:bf:60  ............P..`
00000100  7e:f3:93:7f:42:b1:3f:44:1a:66:9c:1a:d1:cb:58:63  ~...B.?D.f....Xc
00000110  ee:6d:28:5c:af:94:68:e8:7f:a9:46:8e:9d:aa:2c:73  .m(\..h...F...,s
00000120  31:c9:a2:5d:71:8b:e3:91:e6:fd:07:9f:ff:2d:d1:41  1..]q........-.A
00000130  52:fa:87:55:e3:c8:95:dd:7a:64:29:60:1f:53:d8:67  R..U....zd)`.S.g
00000140  6e:7f:51:00:15:80:b5:31:4c:50:4a:63:8d:fb:f3:5a  n.Q....1LPJc...Z
00000150  a6:83:03:de:30:cf:f2:e3:f1:87:15:61:f9:68:05:28  ....0......a.h.(
00000160  b6:46:64:7e:14:68:31:4e:5c:3c:74:06:26:03:00:30  .Fd~.h1N\.t.&..0
00000170  19:c8:42:97:a8:0c:21:d6:d8:61:00:00:00:37:00:00  ..B...!..a...7..
00000180  00:07:73:73:68:2d:64:73:73:00:00:00:28:17:f6:10  ..ssh-dss...(...
00000190  e0:34:b9:22:fa:43:67:3e:0e:87:ac:e7:8f:51:e5:6b  .4.".Cg>.....Q.k
000001a0  f0:85:89:ca:4b:c0:b7:0e:3a:92:d1:4e:c2:93:99:2f  ....K...:..N.../
000001b0  ee:df:c0:c6:3f                                   ....?

-> NET_SSH2_MSG_NEWKEYS (since last: 0.0156, network: 0.0001s)
                                                 

<- NET_SSH2_MSG_NEWKEYS (since last: 0.0001, network: 0s)
                                                 

-> NET_SSH2_MSG_SERVICE_REQUEST (since last: 0.0067, network: 0s)
00000000  00:00:00:0c:73:73:68:2d:75:73:65:72:61:75:74:68  ....ssh-userauth

<- NET_SSH2_MSG_SERVICE_ACCEPT (since last: 0.2155, network: 0.2152s)
00000000  00:00:00:0c:73:73:68:2d:75:73:65:72:61:75:74:68  ....ssh-userauth

-> NET_SSH2_MSG_USERAUTH_REQUEST (since last: 0.0005, network: 0.0001s)
00000000  32:00:00:00:08:75:73:65:72:6e:61:6d:65:00:00:00  2....username...
00000010  0e:73:73:68:2d:63:6f:6e:6e:65:63:74:69:6f:6e:00  .ssh-connection.
00000020  00:00:08:70:61:73:73:77:6f:72:64:00:00:00:00:08  ...password.....
00000030  70:61:73:73:77:6f:72:64                          password

<- NET_SSH2_MSG_USERAUTH_SUCCESS (since last: 0.11, network: 0.1098s)
                                                 

-> NET_SSH2_MSG_CHANNEL_OPEN (since last: 0.0005, network: 0.0001s)
00000000  00:00:00:07:73:65:73:73:69:6f:6e:00:00:00:01:7f  ....session.....
00000010  ff:ff:ff:00:00:40:00                             .....@.

<- NET_SSH2_MSG_CHANNEL_OPEN_CONFIRMATION (since last: 0.1098, network: 0.1095s)
00000000  00:00:00:01:00:00:00:00:00:00:00:00:00:00:80:00  ................

-> NET_SSH2_MSG_CHANNEL_REQUEST (since last: 0.0005, network: 0.0001s)
00000000  00:00:00:00:00:00:00:07:70:74:79:2d:72:65:71:01  ........pty-req.
00000010  00:00:00:05:76:74:31:30:30:00:00:00:50:00:00:00  ....vt100...P...
00000020  18:00:00:00:00:00:00:00:00:00:00:00:01:00        ..............

<- NET_SSH2_MSG_CHANNEL_FAILURE (since last: 0.1098, network: 0.1096s)
00000000  00:00:00:01                                      ....

-> NET_SSH2_MSG_CHANNEL_REQUEST (since last: 0.0006, network: 0.0003s)
00000000  00:00:00:00:00:00:00:05:73:68:65:6c:6c:01        ........shell.

<- NET_SSH2_MSG_CHANNEL_SUCCESS (since last: 0.1096, network: 0.1094s)
00000000  00:00:00:01                                      ....

<- NET_SSH2_MSG_CHANNEL_WINDOW_ADJUST (since last: 0.0006, network: 0.0003s)
00000000  00:00:00:01:00:02:00:00                          ........

<- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0003, network: 0.0001s)
00000000  00:00:00:01:00:00:00:28:0a:0d:0a:0d:54:79:70:65  .......(....Type
00000010  20:3f:20:66:6f:72:20:63:6f:6d:6d:61:6e:64:20:68   ? for command h
00000020  65:6c:70:0a:0d:0a:0d:44:72:61:79:74:65:6b:3e:20  elp....Draytek>

-> NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0005, network: 0.0002s)
00000000  00:00:00:00:00:00:00:02:3f:0a                    ........?.

<- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.1134, network: 0.1129s)
00000000  00:00:00:01:00:00:01:b9:3f:0a:0d:25:20:56:61:6c  ........?..% Val
00000010  69:64:20:63:6f:6d:6d:61:6e:64:73:20:61:72:65:3a  id commands are:
00000020  0a:0d:61:64:73:6c:20:20:20:20:20:20:20:20:20:62  ..adsl         b
00000030  70:61:20:20:20:20:20:20:20:20:20:20:63:73:6d:20  pa          csm
00000040  20:20:20:20:20:20:20:20:20:64:64:6e:73:20:20:20           ddns   
00000050  20:20:20:20:20:20:64:6f:73:20:20:20:20:20:20:20        dos       
00000060  20:20:20:65:78:69:74:20:20:20:20:20:20:20:20:20     exit         
00000070  0a:0d:69:6e:74:65:72:6e:65:74:20:20:20:20:20:69  ..internet     i
00000080  70:20:20:20:20:20:20:20:20:20:20:20:69:70:66:20  p           ipf
00000090  20:20:20:20:20:20:20:20:20:6c:6f:67:20:20:20:20           log   
000000a0  20:20:20:20:20:20:6d:6e:67:74:20:20:20:20:20:20        mngt     
000000b0  20:20:20:6f:62:6a:65:63:74:20:20:20:20:20:20:20     object       
000000c0  0a:0d:70:6f:72:74:20:20:20:20:20:20:20:20:20:70  ..port         p
000000d0  6f:72:74:6d:61:70:74:69:6d:65:20:20:70:72:6e:20  ortmaptime  prn
000000e0  20:20:20:20:20:20:20:20:20:71:6f:73:20:20:20:20           qos   
000000f0  20:20:20:20:20:20:71:75:69:74:20:20:20:20:20:20        quit     
00000100  20:20:20:73:68:6f:77:20:20:20:20:20:20:20:20:20     show         
00000110  0a:0d:73:72:76:20:20:20:20:20:20:20:20:20:20:73  ..srv          s
00000120  77:69:74:63:68:20:20:20:20:20:20:20:73:79:73:20  witch       sys
00000130  20:20:20:20:20:20:20:20:20:74:65:73:74:6d:61:69           testmai
00000140  6c:20:20:20:20:20:75:70:6e:70:20:20:20:20:20:20  l     upnp     
00000150  20:20:20:76:69:67:62:72:67:20:20:20:20:20:20:20     vigbrg       
00000160  0a:0d:76:6c:61:6e:20:20:20:20:20:20:20:20:20:76  ..vlan         v
00000170  6f:69:70:20:20:20:20:20:20:20:20:20:76:70:6e:20  oip         vpn
00000180  20:20:20:20:20:20:20:20:20:77:61:6e:20:20:20:20           wan   
00000190  20:20:20:20:20:20:77:6c:20:20:20:20:20:20:20:20        wl       
000001a0  20:20:20:77:6f:6c:20:20:20:20:20:20:20:20:20:20     wol         
000001b0  0a:0d:61:70:70:71:6f:73:20:20:20:20:20:20:20:0a  ..appqos       .
000001c0  0d                                               .

<- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0004, network: 0.0001s)
00000000  00:00:00:01:00:00:00:0b:0d:0a:44:72:61:79:74:65  ..........Drayte
00000010  6b:3e:20                                         k>

pilotsnipes
Traveler
 
Posts: 6
Joined: Mon Aug 19, 2013 11:27 pm

Re: Connecting to a Draytek Vigor Router

Postby pilotsnipes » Thu Aug 22, 2013 3:16 pm

Oh BTW

It's not a big issue, but this fix only works when I use the ->read ->write methods. Exec() still fails.

But I can work around that :)
pilotsnipes
Traveler
 
Posts: 6
Joined: Mon Aug 19, 2013 11:27 pm

Re: Connecting to a Draytek Vigor Router

Postby TerraFrost » Thu Aug 22, 2013 6:15 pm

I'll merge it in within the next few days. Hopefully today but we'll see.

It's not a big issue, but this fix only works when I use the ->read ->write methods. Exec() still fails.

From the logs you've posted it doesn't appear the server / router supports SSH at all.
TerraFrost
Legendary Guard
 
Posts: 12357
Joined: Wed Dec 04, 2002 6:37 am

Re: Connecting to a Draytek Vigor Router

Postby pilotsnipes » Fri Aug 30, 2013 10:14 pm

I see that this has been merged into the master.

Just wanted to say thank you again!
pilotsnipes
Traveler
 
Posts: 6
Joined: Mon Aug 19, 2013 11:27 pm


Return to phpseclib support

Who is online

Users browsing this forum: No registered users and 1 guest

cron