telnet-client icon indicating copy to clipboard operation
telnet-client copied to clipboard

What I do wrong?

Open Mackiavelly opened this issue 5 years ago • 0 comments

$telnet = \Graze\TelnetClient\TelnetClient::factory(); $telnet->connect('ip:23', 'User name:'); $resp = $telnet->execute('admin', 'User password:');

what wrong???

Graze\TelnetClient\Exception\UndefinedCommandException
1. in /vendor/graze/telnet-client/src/InterpretAsCommand.phpat line 89
808182838485868788899091 
            if (in_array($command, [$this->WILL, $this->WONT])) {
                $socket->write($this->IAC . $this->DONT . $option);
                return true;
            }
        } catch (Exception $e) {
            throw new TelnetException('failed negotiating IAC', 0, $e);
        }
 
        throw new UndefinedCommandException($command);
    }
}
2. in /vendor/graze/telnet-client/src/TelnetClient.php at line 240– Graze\TelnetClient\InterpretAsCommand::interpret('', Socket\Raw\Socket)
234235236237238239240241242243244245246            }
 
            if (in_array($character, [$this->NULL, $this->DC1])) {
                break;
            }
 
            if ($this->interpretAsCommand->interpret($character, $this->socket)) {
                continue;
            }
 
            $buffer .= $character;
 
            // check for prompt
3. in /vendor/graze/telnet-client/src/TelnetClient.php at line 199– Graze\TelnetClient\TelnetClient::getResponse('User password:', null)
193194195196197198199200201202203204205    {
        if (!$this->socket) {
            throw new TelnetException('attempt to execute without a connection - call connect first');
        }
 
        $this->write($command);
        return $this->getResponse($prompt, $promptError);
    }
 
    /**
     * @param string $command
     *
     * @return void
4. in /index.php at line 170– Graze\TelnetClient\TelnetClient::execute('admin', 'User password:')

Mackiavelly avatar Jul 15 '20 09:07 Mackiavelly