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

Methodically check existence and permissions before adding authkeys #263

Closed
wants to merge 5 commits into from
Closed

Conversation

lavafroth
Copy link

@lavafroth lavafroth commented Jul 5, 2022

Description of Changes

Addresses #260. The Linux implant module for authorized keys now checks for the existence of the .ssh directory and the key file. Any file or directory created in the process as well as permission changes will be reverted on calling remove on the implant.

The implant now keeps track of all the tampers it has committed and the remove function rolls back all the changes.

Please note any noqa: comments needed to appease flake8.

Major Changes Implemented:

  • Added tamper classes ModifiedPermissions, ModifiedOwnership
  • Authkeys implant module keeps track of its tampers internally
  • A call to remove on the implant rolls back any changes made

Pre-Merge Tasks

  • Formatted all modified files w/ python-black
  • Sorted imports for modified files w/ isort
  • Ran flake8 on repo, and fixed any new problems w/ modified files
  • Ran pytest test cases
  • Added brief summary of updates to CHANGELOG (under [Unreleased])

pytest results

4 failed, 26 passed

tests/test_platform.py::test_platform_su[ubuntu] FAILED
tests/test_platform.py::test_platform_su[centos] FAILED
tests/test_platform.py::test_platform_sudo[ubuntu] FAILED 
tests/test_platform.py::test_platform_sudo[centos] FAILED

Note: Running these tests on the pwncat master branch returned the same results for me.

For issues with pre-merge tasks, see CONTRIBUTING.md

@lavafroth lavafroth closed this by deleting the head repository May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant