Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem in connecting nodes of Cisco Terminal Server #210

Open
abhijitbakale opened this issue Jul 14, 2020 · 1 comment
Open

Problem in connecting nodes of Cisco Terminal Server #210

abhijitbakale opened this issue Jul 14, 2020 · 1 comment

Comments

@abhijitbakale
Copy link

I have several devices connected to cisco Terminal Server and while I am trying to reach out to those nodes, I am not about to get in.

The code:
from Exscript.util.interact import read_login
from Exscript.protocols import Telnet

account = read_login()
conn = Telnet(debug=5)
conn.set_driver('ios')
conn.connect('192.100.101.201', 2042)
conn.login(account)
conn.execute('conf t')
conn.send('exit\n')
conn.close()

Output Traceback Stack:

Please enter your user name [user1]: cisco
Please enter your password:
ios: Attempting to authenticate cisco.
ios: Attempting to app-authenticate cisco.
ios: waiting for: ['[\r\n][^\\r\\n](?:bad secrets|denied|invalid|too short|incorrect|connection timed out|failed|failure)', 'user ?name: ?$', u'(?:s\/key|otp-md4) (\d+) (\S+)(?=\s|[\r\n])', '(?:[\r\n][Pp]assword: ?|last resort password:)$', '[\r\n][\-\w+\.:/]+(?:\([^\\)]+\))?[>#] ?$']
Telnet(192.100.101.201,2042): Expecting ['[\r\n][^\\r\\n]
(?:bad secrets|denied|invalid|too short|incorrect|connection timed out|failed|failure)', 'user ?name: ?$', u'(?:s\/key|otp-md4) (\d+) (\S+)(?=\s|[\r\n])', '(?:[\r\n][Pp]assword: ?|last resort password:)$', '[\r\n][\-\w+\.:/]+(?:\([^\\)]+\))?[>#] ?$']
Telnet(192.100.101.201,2042): recv '\xff\xfb\x01\xff\xfb\x03\xff\xfd\x18\xff\xfd\x1f'
Telnet(192.100.101.201,2042): IAC WILL 1
Telnet(192.100.101.201,2042): IAC WILL 3
Telnet(192.100.101.201,2042): IAC DO 24
Telnet(192.100.101.201,2042): IAC DO 31
Telnet(192.100.101.201,2042): recv '\xff\xfc\x03\xff\xfa\x18\x01\xff\xf0'
Telnet(192.100.101.201,2042): IAC WONT 3
Telnet(192.100.101.201,2042): IAC SUBCOMMAND 24
Telnet(192.100.101.201,2042): IAC SUBCOMMAND_END
Telnet(192.100.101.201,2042): indicating support for terminal type dumb
ios: Response was u''
Traceback (most recent call last):
File "c:/Users/user1/Desktop/DC Automation Scripts/exscript1_ter_ser.py", line 10, in
conn.login(account)
File "C:\Python27\lib\site-packages\Exscript\protocols\protocol.py", line 675, in login
self.authenticate(account, flush=False)
File "C:\Python27\lib\site-packages\Exscript\protocols\protocol.py", line 701, in authenticate
self.app_authenticate(app_account, flush=flush)
File "C:\Python27\lib\site-packages\Exscript\protocols\protocol.py", line 870, in app_authenticate
self._app_authenticate(account, password, flush, bailout)
File "C:\Python27\lib\site-packages\Exscript\protocols\protocol.py", line 774, in _app_authenticate
raise TimeoutException(msg)
Exscript.protocols.exception.TimeoutException: Buffer: u''

please enlighten me if I am doing anything wrong.

@int3rlop3r
Copy link
Contributor

int3rlop3r commented Apr 9, 2021

You'll have to implement your own driver. The ios driver in this package doesn't handle ANSI escape codes.
(posting this in case someone comes across a similar issue in the future).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants