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 Apt package manager persistence module #11665

Merged
merged 8 commits into from Apr 27, 2019

Conversation

Projects
None yet
4 participants
@aringo
Copy link
Contributor

commented Mar 31, 2019

This module will run a payload when the package manager is triggered. Module installs a pre-invoke hook for APT in apt.conf.d.

Verification

  • Start msfconsole
  • Get a privileged session on a target that uses the Apt package manger
  • use exploit/linux/local/apt_package_manager_persistence
  • Choose a payload and set options
  • exploit
  • Verify Wrote hook file , wrote binary
  • Verify fail if no permissions to write hook or binary
  • use exploit/multi/handler/
  • Choose a payload and set options
  • run
  • On target run sudo apt-get update
  • Verify Caught a root session
  • Documentation Included

apt

@aringo

This comment has been minimized.

Copy link
Contributor Author

commented Mar 31, 2019

There is no need to check for apt as the first write attempt is to an apt specific folder. If apt is not installed the folder will not exist and so the write check should fail. Changed the error message to reflect that.

@bcoles bcoles referenced this pull request Mar 31, 2019

Closed

Add Apt package manager persistence module #11663

0 of 13 tasks complete
@aringo

This comment has been minimized.

Copy link
Contributor Author

commented Apr 25, 2019

Changed some of the quotes and also ran a rubocop to try to find some space formatting. I did not see the use of single quotes vs double quotes in the docs, although covered under rubocop. Was mostly sticking to double quotes since there was a lot of string interpolation.

Update modules/exploits/linux/local/apt_package_manager_persistence.rb
Changed Disclosure Date format

Co-Authored-By: aringo <ringo.aaron@gmail.com>

@jrobles-r7 jrobles-r7 self-assigned this Apr 26, 2019

jrobles-r7 added some commits Apr 26, 2019

@jrobles-r7 jrobles-r7 merged commit 635be0c into rapid7:master Apr 27, 2019

3 checks passed

Metasploit Automation - Sanity Test Execution Successfully completed all tests.
Details
Metasploit Automation - Test Execution Successfully completed all tests.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

jrobles-r7 added a commit that referenced this pull request Apr 27, 2019

msjenkins-r7 added a commit that referenced this pull request Apr 27, 2019

@jrobles-r7

This comment has been minimized.

Copy link
Contributor

commented Apr 27, 2019

Release Notes

The linux/local/apt_package_manager_persistence exploit module has been added to the framework. This module adds a hook to execute a payload when apt update is ran on the host.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.