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

323 Commits

Author SHA1 Message Date
Christophe De La Fuente
a5e33d167d
Remove include DirectSyscall.c 2024-01-10 15:01:19 +01:00
sjanusz-r7
6e2889d64c Add Windows Memory Search support using regex 2023-12-11 14:06:30 +00:00
saim1z
4913a7f783 moved COMMAND_ID_STDAPI_SYS_CONFIG_UPDATE_TOKEN with the others COMMAND_ID_STDAPI_SYS_CONFIG* definitions 2023-05-24 15:35:23 +02:00
saim1z
bc341d1ae9 add update_token function to stdapi 2023-05-24 11:01:13 +02:00
Spencer McIntyre
d64c312029 Update the signature for inject_dll
Need to be able to pass things that are not strings
2023-04-27 09:52:50 -04:00
Spencer McIntyre
bf7e5cb7c6 Fix compiler and other errors 2023-02-28 09:36:26 -05:00
Nishant Desai
98726de8be Display-ipv6-routes 2023-02-25 05:57:15 -05:00
Spencer McIntyre
a3e6d86026 Revert accidental change 2022-09-09 13:54:07 -04:00
Spencer McIntyre
f2de5624e3 Rename some things that are not commands 2022-09-08 17:48:22 -04:00
Spencer McIntyre
cb230d93e5 Refactor a few things 2022-09-08 16:07:00 -04:00
joe
35f950b4d2 wip++ hopefully working c portion 2022-09-03 16:35:44 -04:00
dwelch-r7
0896fb294a Move and rename common/common_logging.c to logging/logging.c 2022-04-26 23:56:09 +01:00
dwelch-r7
66bbd5f078 Code review changes and small refactor 2022-04-26 23:49:04 +01:00
dwelch-r7
e29d876b2e Remove debug artifacts from release build 2022-04-26 15:56:53 +01:00
dwelch-r7
38e6787d84 Configure logging in all extnesions 2022-04-26 15:56:53 +01:00
dwelch-r7
9dfa3ec1fc winpmem failing to compile 2022-04-26 15:56:53 +01:00
Tim W
8ec7d7b254 cleanup windows fs_search 2021-09-22 13:13:27 +01:00
Spencer McIntyre
f9e62ba042 Add a Debug configuration to include debug logs 2020-12-18 16:07:04 -05:00
William Vu
8e3933bed7 Revert "Undo commit for "
This reverts commit 8361d5367a7400d166da3c8b772077aa9a0a793e, reversing
changes made to db3d5f0896ac74b3918387be24de1e994451820d.
2020-10-11 20:49:06 -05:00
William Vu
8c5ab95cd2 Revert "Land - Fix missing TLV migration from string to int"
This reverts commit eb1d51b94e0fa8102734ee3999c53448f9f6f42c, reversing
changes made to b6ce0dff183995ba402c1fe3ebbf74f7a7d8f492.
2020-10-11 20:08:15 -05:00
Alan Foster
985ccbd3af
Fix Metasploit 6 pivoting issue 2020-10-01 22:58:21 +01:00
OJ
37fb807a95
Get extapi compiling under mingw 2020-06-25 10:31:53 +10:00
OJ
effe6b9827
Lots of changes + stdapi support 2020-06-25 10:30:49 +10:00
OJ
060feece01
Kinda almost sorta working for metsrv 2020-06-25 10:29:48 +10:00
OJ
aec49a7863
Final tidy up 2020-06-22 08:25:51 +10:00
OJ
c9ca614313
Remove DLL exports from Meterpreter
Add support for loading RDI-related stuff using ordinals instead of
function names. Remove exports from the extensions/etc. This is another
step in the direction to make the DLLs less obvious.

Extensions no longer have their own name in the library metadata.
They're all "extension.dll". Metsrv is now "server.dll" and the two
non-extensions are "plugin.dll". I was going for something a little less
obvious.

This required changes to the RDI functionality.
2020-06-22 08:25:30 +10:00
OJ
30f232a7fd
Adjust TLV types and fix up code to deal with new raw api 2020-06-09 10:57:44 +10:00
OJ
5fc2117325
Adjust the tlv raw function and remove some unnecessary headers 2020-06-09 10:57:43 +10:00
OJ
5c959187ea
Support pub key in DER instead of PEM
Easy change on the Windows side, we just needed to remove the code that
converts PEM to DER and off we go.
2020-06-09 10:54:28 +10:00
OJ
fad9548108
Adjust the extension and command identifiers (windows) 2020-05-04 14:04:34 +10:00
OJ
3f574e3521
Implement extendion IDs and refactor command enum
Enumeration of commands was a bit of a hack, and still resultsed in
strings (like "stdapi") to appear in binaries, and also meant that
extensions needed to identify themselves.

This code changes the way this works. Extensions no longer have a name.
Instead they have an internal ID tha maps to the command sets they
support. To enumerate extension commands, MSF will ask for a range of
commands, and if any command IDs fit within that range, they'll be
returned.

This moves us towards a nicer way of handling things across all the
meterpreters.
2020-05-01 15:36:07 +10:00
OJ
c7f7bc2fc0
Remove method strings from TLV packets
We now use ints, and hopefully this means we don't have as much obvious
stuff in the binaries!

```
$ # Before:
$ strings metsrv.x86.dll | grep core_ | wc -l
46
$ # After:
$ strings metsrv.x86.dll | grep core_ | wc -l
0
```
Big win, and it's even bigger for the likes of stdapi.

Had to fix a bunch of other stuff along the way, including a subtle
issue with the Powershell Meterp bindings.
2020-04-28 23:41:06 +10:00
OJ
3a3e77942b
Fix small issue with calling convensions in x86 2020-04-22 13:06:49 +10:00
OJ
05d5a16fe5
Get the python extension working without delay loading 2020-04-22 13:06:47 +10:00
OJ
4ffe127f04
Begin removing the delay-load dependency
The 'common' library has been removed. The only project that actually
used it was metsrv, so the code that metsrv required from common is now
directly compiled in as part of that project.

The common folder now contains files that are importanta cross all of
the projects, with a primary focus on the new "API" style function. What
this means is that MetSrv has an API that it exposes through a function
pointer that is passed to the extension when it's initialised. This
pointer references a structure with all the API functions wired in. This
means that:

* Extensions don't need to know anything about metsrv at compile time.
* The delay loading code can be removed, which was one of the last
  instances of "metsrv.dll" as a string.
* Metsrv.dll no longer exports any functions.

More to come.
2020-04-22 13:06:40 +10:00
OJ
8f5d4bef01
Replace OpenSSL with LibreSSL in the Python extension
This was a bit of a pain, but was well worth it. Had to add a couple of
hacks to make it all work, but this is a nicer solution than having to
depend on OpenSSL and its horrendous build experience.
2020-04-15 13:43:50 +10:00
OJ
100ffd6d5b
First round of VS2019 changes 2020-04-14 10:28:08 +10:00
Brent Cook
49b117838a
Land , don't modify stageless config block in place 2020-04-07 17:15:33 -05:00
Brent Cook
bf8950ebe9 remove unneeded checks before free, one being an impossible scenario 2020-04-07 17:15:03 -05:00
OJ
8b4d65de47
Fix stageless config block memory protection
I found an edge case where stageless payloads did not work when they
were embedded in .NET applications. The reason for this is because the
configuration block is stored alongside the code in stageless payloads
and hence is loaded into memory as part of the section when it's mapped.
This section, in native world, remains RWX, and hence we don't have a
problem reading from and writing to it. We write to it for various
reasons, such as when the session guid changes.

In .NET land, this section is mapped as RX instead of RWX. This means
that when we try to write to it, the program segfaults due to an access
violation.

This code modifies the loading of the configuration so that instead of
maintaining a pointer to the original configuration, it instead creates
a copy of it on the heap. I preferred this fix over marking the memory
as RWX, which obviously stands out a bit more.
2020-03-17 13:15:31 +10:00
max3raza
71762fe778 fix for memory leak 2019-09-09 22:20:17 +03:00
OJ
5da10e97e9
Fix packet pivoting in HTTP transports
Windows Meterpreter that uses http/s-based transports wasn't correctly checking for cases where pivoted packets were handled. When pivoted packets are forwarded to the correct handler, the packet is set to NULL. For TCP transports, a check already existed to carry on when the packet was NULL, but this wasn't the case for HTTP/S.

This commit fixes this problem and so the pivot session no longer dies when Meterpreter is using an HTTP/S transport.

For funzies, the fix for this was implemented on a live stream to help other people learn some of Meterp's internals. That video can be found here: https://www.youtube.com/watch?v=de-UYWnafow
2018-08-09 21:51:53 +10:00
Veli-Matti Visuri
78b2b58ab1 Fix varargs leaks 2017-12-04 21:20:05 +02:00
Brent Cook
519df5919c don't crash if there are no custom headers 2017-11-25 15:29:16 -06:00
William Webb
a404126f66
Land , Renegotiate AES in HTTP payloads on new framework instance 2017-11-23 00:21:38 -06:00
Brent Cook
4be0b0756d on reconnect to a new framework instance, we have to renegotiate AES keys 2017-11-22 03:20:36 -06:00
Brent Cook
f065a24b1c Merge branch 'master' into land-236-headers 2017-11-21 00:52:50 -06:00
Brent Cook
7a22b3052a actually reset encryption context when freeing 2017-10-26 23:22:08 -07:00
OJ
e1efa94b06
Transport creation for headers, and starting on python support 2017-09-11 14:39:15 +10:00
OJ
0792d9dc1b
Add HTTP header support for custom HTTP headers
Fixes config size management issues and gets things working in both
WinHTTP and WinINET
2017-09-11 14:39:10 +10:00