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

Add Support for ssh-agent for ssh authentication #91

Closed
Anunayj opened this issue Apr 2, 2021 · 3 comments · Fixed by #227
Closed

Add Support for ssh-agent for ssh authentication #91

Anunayj opened this issue Apr 2, 2021 · 3 comments · Fixed by #227
Assignees
Labels
enhancement New feature or request linux Issues relating specifically to the Linux platform upstream Issues/Pull Requests waiting on upstream fixes

Comments

@Anunayj
Copy link

Anunayj commented Apr 2, 2021

Is your feature request related to a problem? Please describe.
Many users tend to use a ssh-agent for convenience/security purposes. As of right now pwncat requires user to pass the private key file for ssh authentication. which might not be always possible because

  1. User uses a hardware token to store the ssh key and cannot possibly get the identity file.
  2. User uses gpg-agent with ssh support. Which does not expose the private key as a file by default.

Describe the solution you'd like
Instead of asking for a identity file, ask the ssh-agent for authentication. paramiko already has support for it here

SSH-agent forwarding would be very nice to have too, which seems to be undocumented? https://gist.github.com/toejough/436540622530c35404e6
This should come with big warning texts though, since exposing your ssh-agent on a untrustworthy machine can only end in a disaster.

Alternative
Just generate another key for use with pwncat.

@Anunayj Anunayj added the enhancement New feature or request label Apr 2, 2021
@Anunayj
Copy link
Author

Anunayj commented Apr 2, 2021

Also the current system assumes that the key in use is a RSA key, which might not be true in all cases, many users have begun to move to Ed25519 (very new, and kinda unsupported) or ECDSA (if you can get them to work on your computer****).

@trevorbryant
Copy link
Collaborator

@calebstewart I don't know if you currently have this on your radar, so pinging you back just in case.

@calebstewart
Copy link
Owner

With paramiko, the correct way to do this would be to use the SSHClient class instead of manually constructing the SSH session like I have been doing. I implemented this (as seen in #122), but can't merge this until the upstream is fixed (see paramiko/paramiko#1606).

Once the upstream is fixed, I will take the issue out of draft state and do some testing before merging. Hopefully that's soon.

@calebstewart calebstewart added linux Issues relating specifically to the Linux platform upstream Issues/Pull Requests waiting on upstream fixes labels Jun 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request linux Issues relating specifically to the Linux platform upstream Issues/Pull Requests waiting on upstream fixes
Projects
None yet
3 participants