You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
└─$ pwncat -i ssh.key john@gaming.thm
[14:24:26] Welcome to pwncat 🐈!
RSA Private Key Passphrase: *******
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/pwncat-0.4.3-py3.9.egg/pwncat/channel/ssh.py", line 64, in __init__
key = paramiko.RSAKey.from_private_key(identity)
File "/usr/lib/python3/dist-packages/paramiko/pkey.py", line 256, in from_private_key
key = cls(file_obj=file_obj, password=password)
File "/usr/lib/python3/dist-packages/paramiko/rsakey.py", line 52, in __init__
self._from_private_key(file_obj, password)
File "/usr/lib/python3/dist-packages/paramiko/rsakey.py", line 179, in _from_private_key
data = self._read_private_key("RSA", file_obj, password)
File "/usr/lib/python3/dist-packages/paramiko/pkey.py", line 334, in _read_private_key
data = self._read_private_key_pem(lines, end, password)
File "/usr/lib/python3/dist-packages/paramiko/pkey.py", line 386, in _read_private_key_pem
raise PasswordRequiredException("Private key file is encrypted")
paramiko.ssh_exception.PasswordRequiredException: Private key file is encrypted
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/pwncat", line 33, in <module>
sys.exit(load_entry_point('pwncat==0.4.3', 'console_scripts', 'pwncat')())
File "/usr/local/lib/python3.9/dist-packages/pwncat-0.4.3-py3.9.egg/pwncat/__main__.py", line 272, in main
manager.create_session(
File "/usr/local/lib/python3.9/dist-packages/pwncat-0.4.3-py3.9.egg/pwncat/manager.py", line 665, in create_session
session = Session(self, platform, channel, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/pwncat-0.4.3-py3.9.egg/pwncat/manager.py", line 80, in __init__
channel = pwncat.channel.create(**kwargs)
File "/usr/local/lib/python3.9/dist-packages/pwncat-0.4.3-py3.9.egg/pwncat/channel/__init__.py", line 592, in create
channel = find(prot)(**kwargs)
File "/usr/local/lib/python3.9/dist-packages/pwncat-0.4.3-py3.9.egg/pwncat/channel/ssh.py", line 68, in __init__
key = paramiko.RSAKey.from_private_key_file(identity, password)
File "/usr/lib/python3/dist-packages/paramiko/pkey.py", line 235, in from_private_key_file
key = cls(filename=filename, password=password)
File "/usr/lib/python3/dist-packages/paramiko/rsakey.py", line 55, in __init__
self._from_private_key_file(filename, password)
File "/usr/lib/python3/dist-packages/paramiko/rsakey.py", line 175, in _from_private_key_file
data = self._read_private_key_file("RSA", filename, password)
File "/usr/lib/python3/dist-packages/paramiko/pkey.py", line 307, in _read_private_key_file
with open(filename, "r") as f:
TypeError: expected str, bytes or os.PathLike object, not TextIOWrapper
Expected Behavior
Pwncat should be able to connect to the machine.
The private key and passphrase are correct and normal SSH works just fine.
Screenshots
Thank you.
The text was updated successfully, but these errors were encountered:
connornguyxn
changed the title
Error connecting to a Tryhackme machine via SSH using a private key
Error connecting to a Tryhackme machine via SSH with a private key
Aug 22, 2021
Apologies for not getting back to you. I've fixed this in the above pull request, and will be merging in a few minutes. I've tested with the mentioned Try hack me machine, and it seems to be working for me. Feel free to reopen or post again if something is still wonky. Thanks!
Bug Description
Got this error when connecting to TryHackMe's GamingServer room.
pwncat version
Target System (aka "victim")
TryHackMe - GamingServer
https://tryhackme.com/room/gamingserver
Steps to Reproduce
Steps to reproduce the behavior:
Expected Behavior
Pwncat should be able to connect to the machine.
The private key and passphrase are correct and normal SSH works just fine.
Screenshots
Thank you.
The text was updated successfully, but these errors were encountered: