![]() |
|
[Python] Issue with pxssh failing to login to Cisco Router - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Python] Issue with pxssh failing to login to Cisco Router (/showthread.php?tid=5727967) |
Issue with pxssh failing to login to Cisco Router - H4cker193 - Sep 30, 2017 Hello all, I am having an issue getting my code to connect to a Cisco router. I keep getting the error "pxssh failed to login". I can login to the router from my windows machine using putty but not from my Kali machine. Both are local to the network in the same subnet. Any one might know what is causing this issue? from pexpect import pxssh import getpass try: s = pxssh.pxssh() hostname = raw_input('hostname: ') username = raw_input('username: ') password = getpass.getpass('password: ') s.login (hostname, username, password) s.sendline ('show log') # run a command s.prompt() # match the prompt print s.before # print everything before the prompt. s.sendline ('show run int gi0/0') s.prompt() print s.before s.sendline ('show run int gi0/1') s.prompt() print s.before s.logout() except pxssh.ExceptionPxssh, e: print "pxssh failed on login." print str(e) The error I am getting is what I put to print when the connection fails. I just do not understand what is causing the issue. Any help would be highly appreciated by me. Thanks for reading. I ran a packet capture. It shows Cisco SSHv 1.9 and OpenSSH sshv2.0. The key exchange the Inits and after the key exchange happens my client is sending a FIN packet to the cisco router. * - koolkid - Sep 30, 2017 (Sep 30, 2017 11:48 AM)H4cker193 Wrote: Hello all, please try to use the php and code tags please |