1
mirror of https://github.com/rapid7/metasploit-payloads synced 2025-03-24 18:16:24 +01:00

258 Commits

Author SHA1 Message Date
OJ
6d2582102d
Slow progress on pipe packet pivots 2017-07-10 20:00:37 +10:00
OJ
f96fe3542f
Next phase of packet pivot work 2017-07-06 15:40:32 +10:00
OJ
fc6c593eb7
Add the first pass of named pipe pivot code 2017-07-05 16:15:06 +10:00
OJ
c74376fb69
Make enc flags 32 bit, fix extension bindings
This updates the packet header so that the encryption byte flag is now
32 bits. This also updates the powershell and python extensions so that
both of the bindings work correctly as a result of the TLV packet header
changes.
2017-07-03 16:51:57 +10:00
OJ
a911045d5e
Merge upstrea/master + fix issues 2017-06-25 19:52:11 +10:00
OJ
8ffb877610
Initial version of working AES encrypted TLV packets 2017-06-21 21:02:33 +10:00
OJ
cb9ae6acd4
Rework the packet XOR code
Make the XOR key an array of bytes as a start to normalise the way the
XOR happens across the board. Given that we're going to be adding
encryption to the packet level and adding more stuff to the packet
header, now is the time to fix this up once and for all.
2017-06-20 19:20:41 +10:00
OJ
8858acb618
Initial attempt to AES encryption at the packet level 2017-06-20 17:50:58 +10:00
OJ
813760a9e2
Remove support for the crypto context
Crypto context stuff appears to have only ever been supported in
Meterpreter on Windows. The only thing it allowed for is XOR, which is
redundant given that we have packet level XOR in place. Also, it would
appear that MSF didn't have support for it anyway!

With the move torwards packet-level encryption, this is unnecessary so
it needs to go bye bye.
2017-06-19 16:51:54 +10:00
OJ
9e3aef62bc
Hack to ignore metsrv.dll stage when connecting to staged listener
The last issue we had in removing the OpenSSL library from Windows
meterp is making it so that reconnects would behave. With a staged
listener, the first thing that gets sent down the wire is metsrv.dll. As
a result, when a fully staged connect comes in (whether it be from
a stageless payload, from a transport switch or from a sleeping session
waking up), Meterpreter needs to handle the case that the data coming
down the wire is no actually a TLV packet, and hence ignore it.

This "hack" abuses the properties of the XOR key for the packet,
relying on the fact that the XOR key will never contain NULl bytes and
that the first 4 bytes from a staged listener starts with the length of
the metsrv DLL, which is small enough to result in a NULL byte in the
MSB position.

If we see a NULL byte in that position, we assume it's the metsrv header
coming in, and we just ignore it and move on. If the XOR key looks
legit, we assume it's a valid TLV packet.

Dirty, but it's quick and it works!
2017-06-16 13:34:46 +10:00
OJ
3554aff9de
Remove SSL from all but the python extension
Re-implement MD5 and SHA1 file hashing using CSP.
2017-06-14 21:40:20 +10:00
Brent Cook
28a9f42e14 more ssl flensing 2017-06-14 04:56:47 -05:00
Brent Cook
36f3d346fe fix line endings 2017-06-14 04:56:47 -05:00
Brent Cook
36771d6309 initial pass at flensing openssl code from reverse_tcp 2017-06-14 04:56:47 -05:00
OJ
cf575a05dd
Add session GUID support to Meterpreter payloads 2017-06-06 17:24:36 +10:00
Brent Cook
0a2d768e77 delete Linux meterpreter support 2017-05-14 02:11:57 -05:00
Brent Cook
dc712150af
Land , Adjust proxy code to support DNS/DHCP resolution 2017-05-08 16:57:08 -05:00
OJ
91558d0c16
Adjust proxy code to support DNS/DHCP resolution
This code is blatantly poached from the blog post locted at
https://medium.com/@br4nsh/a-meterpreter-and-windows-proxy-case-4af2b866f4a1
which was written by Juan. A great deal of time and effort went into
that research and all credit for this work should go to him.
2017-05-05 16:16:54 +10:00
OJ
7c65e621a1
Fix stageless URI redirect parsing
This commit fixes the case where we incorrectly assume that the URIs
used in the transport don't make use of the LURI setting in MSF.

The bug was that the code iterated through the URI string in reverse,
looking for a slash and then using that as the point to patch the new
URI over the existing. This meant that with the LURI parameter used, the
actual LURI field was missed, and the patch would result in the LURI
value appearing again.

The fix put in iterates from the start of the string and looks for the
third instance of the slash. This means that the LURI field is patched
as well as the UUID section.

Fixes 
2017-05-03 10:36:53 +10:00
Brent Cook
8d84a89c5a
Land , Revamp Kiwi to work off Mimikatz subrepo 2016-12-29 14:31:19 -06:00
OJ
e42ef7a17e
Change PBYTE to LPBYTE to keep POSIX happy 2016-12-08 16:39:38 +10:00
OJ
ff56b36a98
Move migration stub code to MSF
This commit changes the code so that the migration stubs are generated
in MSF and are transport specific (so that we only do the work we need
to).
2016-12-08 16:00:04 +10:00
OJ
ffc9c1d37a
Add mimikatz submodule with MSF changes
This includes a few changes that are in an open branch waiting to be
merged into the mimikatz source.
2016-12-07 14:41:33 +10:00
OJ
86f2093968
Re-add key UUID sending functionality
As part of b50955a92476e797256158db783ba9684db2a902 important code that
sent UUIDs along with each request was accidentally removed. This PR
re-includes it so that the UUIDs are in fact sent when they should be
sent.

This fixes issues where UUID commands don't work, and fixes migration in
a bunch of scenarios.
2016-12-07 13:27:34 +10:00
Brent Cook
b50955a924 Revert "Refactor XOR code, dedup packet writing code"
This reverts commit 7e8b4c3c5206891de38312c15518e5139fc56d6e.
2016-11-17 06:22:53 -06:00
Brent Cook
e5f695fde7 fix posix build, remove dos EOLs 2016-11-14 11:58:52 -06:00
OJ
70812fd1ce
Remove core_uuid and add core_set_uuid 2016-10-29 12:42:36 +10:00
OJ
b96eaff14f
Remove check for UUID, force add without check 2016-10-14 13:27:45 +10:00
OJ
d06d7e1807
Include UUID in each request, update UUID on migrate 2016-10-14 10:53:21 +10:00
OJ
7e8b4c3c52
Refactor XOR code, dedup packet writing code 2016-10-10 14:40:05 +10:00
Brent Cook
08e008fc77
Land , add xor encoding to TLV messages 2016-02-10 21:32:43 -06:00
Brent Cook
263fc0a00a posix xor 2016-02-04 05:50:47 -06:00
BAZIN-HSC
8ddd54c565 Build correction for fedora on not EN system 2016-01-29 10:41:18 +01:00
OJ
246c78fccc Remove extra call to scheduler init 2016-01-13 10:08:12 +10:00
OJ
3d598c4275 Remove superfluous comments from code 2015-12-08 16:57:40 +10:00
OJ
1061df8b8d Remove the RECV POST request 2015-12-07 13:26:33 +10:00
OJ
5ca5fe89f0 Begin to enable DWORD xor out of the box 2015-12-02 13:30:22 +10:00
OJ
c692e76332 Finalise stageless initialisation scripts 2015-11-10 20:00:34 +10:00
OJ
175d6d93f1 First pass of stageless initialisation script 2015-11-10 15:43:59 +10:00
OJ
f572570b7d Initial work to get python talking to metsrv's ssl 2015-10-30 15:23:01 -05:00
OJ
04cb09737e More work on the meterpreter bindings for python 2015-10-30 15:23:00 -05:00
OJ
eaabcabca8 Starting work on meterpreter bindings 2015-10-30 15:23:00 -05:00
OJ
2422f0926b Support transport failover for SSL cert failures
This commit will result in SSL cert failures causing failovers to other
transports, even to itself, instead of shutting the session down. This
will result in repeated calls back to the endpoint, every "retry wait"
seconds, and will continue to do so until the session expires, or the
SSL verification works.

Be warned, this can be noisy in your console if you haven't configured
things properly. The result is a lot of callbacks over the life of the
session.
2015-09-25 12:47:18 +10:00
Brent Cook
8732204833
Land , fix posix transport switching/deleting 2015-07-12 00:29:06 -05:00
Brent Cook
8de19e788a We don't have to log an error if it's expected.
There is a close log message right below anyway.
2015-07-10 07:11:53 -05:00
Brent Cook
28425e7a99 On socket flush, stop reading on error
We are currently inconsistently handling errors in recv() when flushing data from a TCP socket. In one case, we handle the graceful close, but not the error case. In the other, we handle exactly the opposite.

Both of these loops may spin indefinitely depending on the recv value from the remote server. In one, if the TCP connection is abruptly closed in stageless meterpreter or on a transport switch, the flush function may loop. In the other, if the remote server does a socket shutdown, but not a close, we will also loop.
2015-07-10 07:04:57 -05:00
OJ
d16e5276c5 Use temp storage for URL parsing
This removes the issue where URLs were truncated during parsing,
resulting in them not working later on when transports are changed.
2015-07-10 14:57:23 +10:00
OJ
863138d803 Avoid fallback when SSL cert verification is on
This is to avoid unintended MITM when Meterpreter is configured in
paranoid mode.
2015-07-04 14:45:49 +10:00
OJ
18a814d3a0 Refactor wininet/winhttp code to reduce code duplication 2015-07-03 20:46:18 +10:00
OJ
09c4d8b137 Initial WinINET fallback implementation 2015-07-03 18:55:14 +10:00