-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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 at rest encryption to Meterpreter payloads #18441
Add at rest encryption to Meterpreter payloads #18441
Conversation
Is there some place where we can find a bit of conext for the intended use of this functionality |
The title was a bit of a misnomer. We're just adding at rest encryption for the Meterpreter payloads on disk, the changes should be transparent for the average user |
2e6bea0
to
b08eca6
Compare
Pesky AVs not appreciating users having the files on their machines? |
Is there a facility for dumping the raw DLLs? Other tools might want access to them... |
c43e9bb
to
63e9a29
Compare
63e9a29
to
c73e815
Compare
encrypted_dll = ::File.binread(library_path) | ||
dll = ::MetasploitPayloads::Crypto.decrypt(ciphertext: encrypted_dll) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
encrypted_dll = ::File.binread(library_path) | |
dll = ::MetasploitPayloads::Crypto.decrypt(ciphertext: encrypted_dll) | |
dll = ::File.binread(library_path) |
Release NotesAdd at rest encryption to Meterpreter payloads on the Metasploit host machine's file system |
This PR is requires rapid7/metasploit-payloads#679
The change to
client_core.rb
is necessary to support encrypted stdapi libraries.Other changes were made to support encrypted file contents being added to zip/jar/archive files by using
::MetasploitPayloads.read
which will handle encrypted/plain-text payloads as#add_files
cannot take in a buffer, and we have to resort to calling#add_file
for each file with the contents instead.Verification
msfconsole
use payload/python/meterpreter/reverse_tcp
irb
, check that the payload being read is stored as an encrypted file on diskpath = ::MetasploitPayloads.path('meterpreter', 'meterpreter.py')
raw_contents = ::File.binread(path); nil
raw_contents[0..5] == "msf\x01\x01\x01"
decrypted_contents = ::MetasploitPayloads.read('meterpreter', 'meterpreter.py')