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

[ssh] improvement #25

Merged
merged 27 commits into from
Oct 22, 2023
Merged

[ssh] improvement #25

merged 27 commits into from
Oct 22, 2023

Conversation

XiaoliChan
Copy link
Contributor

@XiaoliChan XiaoliChan commented Sep 18, 2023

Totally bugs fixed & improvement:

  • [ssh.py]: less create ssh connect, keep doing set credential via paramiko transport
  • [ssh.py]: rewrite enum_host_info function
  • [ssh.py]: fix hanging, old one will never exit
  • [ssh.py]: fix private key with passphrase
  • [ssh.py]: add sudo check for linux user
  • [ssh.py]: windows privileges check
  • [ssh.py]: improve command execute and format command execute result
  • [ssh.py]: paramiko always discovery private keys in ~/.ssh/, that will make paramiko exception, disable it.

Signed-off-by: XiaoliChan <2209553467@qq.com>
@NeffIsBack NeffIsBack added the enhancement New feature or request label Sep 18, 2023
@NeffIsBack NeffIsBack added this to the v1.1.0 milestone Sep 22, 2023
Copy link
Collaborator

@Marshall-Hallenbeck Marshall-Hallenbeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will need to actually test this as well

@XiaoliChan can you also add new e2e tests in the command list for the new options you've added?

nxc/protocols/ssh.py Outdated Show resolved Hide resolved
nxc/protocols/ssh.py Outdated Show resolved Hide resolved
nxc/protocols/ssh.py Outdated Show resolved Hide resolved
nxc/protocols/ssh.py Show resolved Hide resolved
nxc/protocols/ssh.py Show resolved Hide resolved
nxc/protocols/ssh.py Show resolved Hide resolved
nxc/protocols/ssh.py Show resolved Hide resolved
nxc/protocols/ssh/proto_args.py Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@XiaoliChan
Copy link
Contributor Author

Will need to actually test this as well

@XiaoliChan can you also add new e2e tests in the command list for the new options you've added?

Sure!

@Marshall-Hallenbeck Marshall-Hallenbeck changed the base branch from main to develop October 2, 2023 21:53
nxc/protocols/ssh.py Outdated Show resolved Hide resolved
nxc/protocols/ssh.py Show resolved Hide resolved
nxc/protocols/ssh.py Outdated Show resolved Hide resolved
nxc/protocols/ssh.py Outdated Show resolved Hide resolved
nxc/protocols/ssh.py Outdated Show resolved Hide resolved
nxc/protocols/ssh.py Outdated Show resolved Hide resolved
nxc/protocols/ssh.py Show resolved Hide resolved
@NeffIsBack
Copy link
Contributor

NeffIsBack commented Oct 4, 2023

image
image

Linux works 👍

Tho it would be nice if you could change the syntax back to for example "(Pwn3d!) - (root/non root) Linux - Shell access!"

@XiaoliChan
Copy link
Contributor Author

@NeffIsBack @Marshall-Hallenbeck I will solve the issues in reviews after my holiday :D

@NeffIsBack
Copy link
Contributor

@NeffIsBack @Marshall-Hallenbeck I will solve the issues in reviews after my holiday :D

Take your time and enjoy your holidays :D

Signed-off-by: XiaoliChan <2209553467@qq.com>
@XiaoliChan
Copy link
Contributor Author

Tho it would be nice if you could change the syntax back to for example "(Pwn3d!) - (root/non root) Linux - Shell access!"

Done, I changed it to this
image

@XiaoliChan
Copy link
Contributor Author

Confirm the private key with passphrase login works
image

XiaoliChan and others added 7 commits October 7, 2023 23:03
Signed-off-by: Xiaoli Chan <2209553467@qq.com>
Signed-off-by: Xiaoli Chan <2209553467@qq.com>
Signed-off-by: Xiaoli Chan <2209553467@qq.com>
Signed-off-by: Xiaoli Chan <2209553467@qq.com>
Signed-off-by: Xiaoli Chan <2209553467@qq.com>
Signed-off-by: XiaoliChan <2209553467@qq.com>
nxc/protocols/ssh/proto_args.py Outdated Show resolved Hide resolved
nxc/protocols/ssh.py Outdated Show resolved Hide resolved
nxc/protocols/ssh.py Outdated Show resolved Hide resolved
@NeffIsBack
Copy link
Contributor

image

Windows working for me 🎉

Signed-off-by: XiaoliChan <2209553467@qq.com>
Signed-off-by: XiaoliChan <2209553467@qq.com>
@NeffIsBack
Copy link
Contributor

There are still some single quotes instead of double quotes :)

Copy link
Contributor

@NeffIsBack NeffIsBack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Everything is working now. Great job @XiaoliChan

There are still a few single quotes but we wait until #35 is merged, probably a lot are already fixed there

Copy link
Contributor

@NeffIsBack NeffIsBack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Have to revoke approval, ssh with keyfile is no longer working from linux to linux

@NeffIsBack
Copy link
Contributor

Have to revoke approval, ssh with keyfile is no longer working from linux to linux

Further investigation:
having ssh keyfiles in the ~/.ssh directory leads ssh to crash
image

Signed-off-by: XiaoliChan <2209553467@qq.com>
Signed-off-by: XiaoliChan <2209553467@qq.com>
@XiaoliChan
Copy link
Contributor Author

XiaoliChan commented Oct 21, 2023

Further investigation: having ssh keyfiles in the ~/.ssh directory leads ssh to crash image

Fixed!
image

@NeffIsBack
Copy link
Contributor

image image

Everything working now 👍

@NeffIsBack
Copy link
Contributor

NeffIsBack commented Oct 22, 2023

@Marshall-Hallenbeck this is ready as well, should i merge it or are we waiting for your PR?

@Marshall-Hallenbeck
Copy link
Collaborator

@NeffIsBack we can probably merge this, I still have to fix some of the things from your feedback for #35

@NeffIsBack NeffIsBack merged commit a790c85 into Pennyw0rth:develop Oct 22, 2023
@XiaoliChan XiaoliChan deleted the ssh-improv branch October 23, 2023 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request reviewed code Label for when a static code review was done tested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants