mirror of
https://github.com/calebstewart/pwncat.git
synced 2024-11-27 19:04:15 +01:00
Merge pull request #194 from calebstewart/issue-185-private-key-password
[FIXES 185] Added logic for calling correct paramiko method
This commit is contained in:
commit
faec8be275
@ -17,6 +17,7 @@ and simply didn't have the time to go back and retroactively create one.
|
||||
- Fixed verbose logging handler to be __unique__ for every `channel`
|
||||
- Fixed docstrings in `Command` modules
|
||||
- Changed docker base image to `python3.9-alpine` to fix python version issues.
|
||||
- Added logic for calling correct paramiko method when reloading an encrypted SSH privat ekey ([#185](https://github.com/calebstewart/issues/185)).
|
||||
### Added
|
||||
- Added alternatives to `bash` to be used during _shell upgrade_ for a _better shell_
|
||||
- Added a warning message when a `KeyboardInterrupt` is caught
|
||||
|
@ -65,7 +65,12 @@ class Ssh(Channel):
|
||||
except paramiko.ssh_exception.SSHException:
|
||||
password = prompt("RSA Private Key Passphrase: ", is_password=True)
|
||||
try:
|
||||
if isinstance(identity, str):
|
||||
key = paramiko.RSAKey.from_private_key_file(identity, password)
|
||||
else:
|
||||
# Seek back to the beginning of the file (the above load read the whole file)
|
||||
identity.seek(0)
|
||||
key = paramiko.RSAKey.from_private_key(identity, password)
|
||||
except paramiko.ssh_exception.SSHException:
|
||||
raise ChannelError(self, "invalid private key or passphrase")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user