1
mirror of https://github.com/rapid7/metasploit-payloads synced 2025-01-20 20:37:27 +01:00
Commit Graph

88 Commits

Author SHA1 Message Date
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
OJ
37fb807a95
Get extapi compiling under mingw 2020-06-25 10:31:53 +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
5fc2117325
Adjust the tlv raw function and remove some unnecessary headers 2020-06-09 10:57:43 +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
c8aa435b3c
Finally removed delay loading from the last extension: extapi 2020-04-22 13:06:49 +10:00
OJ
078a3e960f
Finalise 'Release' build for both x86 and x64 _clean_
Still need to fix dependencies and whatnot as well.
2020-04-14 13:18:25 +10:00
OJ
100ffd6d5b
First round of VS2019 changes 2020-04-14 10:28:08 +10:00
cn-kali-team
348aa69f68 Add window class name filter,Unicode Support etc. 2020-03-27 22:12:37 +08:00
cn-kali-team
443b6f2f23 add window class name filter 2020-03-27 22:12:04 +08:00
Brent Cook
0a2d768e77 delete Linux meterpreter support 2017-05-14 02:11:57 -05:00
Tim
015d57d0fe fix clipboard 2016-09-04 15:12:26 +01:00
OJ
a7ef4b91e3 Add powershell interactive prompt 2016-03-14 20:23:44 +10:00
Brent Cook
98fae3e075 change source perms back to non-executable 2015-11-09 21:10:30 -06:00
Brent Cook
600ed34f1e merge and cleanup @stufus's pageantjacker extension into extapi
see https://github.com/rapid7/meterpreter/pull/164 for details
2015-09-20 20:18:02 -05:00
OJ
c8de66fd31 Remove extra htonq call 2015-06-27 21:44:41 +10:00
Brent Cook
ba86e968d7 fix broken partial-batch / eof handling 2015-06-22 03:58:24 -05:00
Brent Cook
9ff7339644 move ntds parser from priv to extapi 2015-06-22 03:58:24 -05:00
OJ
e9b7ec97c0 Implement support for ssl cert verify toggling
Querying of the status of SSL cert verification is now possible. This commit allows for this to be enabled and disabled on the fly.
2015-04-06 14:42:38 +10:00
OJ
0393927159 Add extension names, enuemrators, etc
This commit contains a bunch of code tidying (formatting, spaces, naming, etc) as well as new exports for each of the modules so that the extension can be identified. The plan is for the loader to know which modules are loaded so that when stageless meterpreter fires up MSF can query the existing extensions and load the appropriate functionality on the client side.
2015-03-09 21:28:27 +10:00
OJ
5e0fbedd30 Make state destruction set pointers to NULL 2015-01-31 08:23:54 +10:00
OJ
c9d9e5978c Fix issue with double-start of clipboard
If a user attempts to start the clipboard monitor when it is already started then the code path that is taken results in the current clipboard monitor state pointers being lost. The net effect of this is that the existing monitor thread will never be shut down. Not a good thing!

This code fixes that case so that the monitor doesn't create a new monitor thread and doesn't reset important pointers to NULL.

This change also results in a "success" status being returned to the caller. This means it looks like the clipboard monitor has been started even if it was already running. I think this is acceptable and is better than an obscure error.
2015-01-31 07:00:06 +10:00
OJ
061439edb2 Final tweaks to adsi 2014-12-09 14:27:50 -06:00
OJ
76a492ab56 Fix silly typo 2014-12-09 14:27:50 -06:00
OJ
c7a8645709 Update adsi to use group functionality
Now includes group nesting which will require work on the MSF side to
fully support it. But this option is way better as we don't lose info
thanks to serialising to strings.
2014-12-09 14:27:50 -06:00
OJ
fe70c6a733 Updated service enumeration to use group tlv api 2014-12-09 14:27:50 -06:00
OJ
3aeda7ed2a Refactor group Tlv usage in window enumeration 2014-12-09 14:27:50 -06:00
OJ
e40f1a0eaf Fix missing field on x64, use packet groups
Despite rigorous testing, the x64 version seemed to be dropping a column
from the result set. This would appear to be due to the differences in
the way the x86 version of the API handles the ubound parameter of the
enumeration.

x86 ubounds are inclusive, where as x64 are exclusive. Hence in the case
of x86 we need to subtract one from the field set, but not in x64.
2014-03-21 17:22:46 +10:00
Tod Beardsley
fae26b4b3d Land #77, Service control support
This also wants rapid7/metasploit-framework#3085
2014-03-19 08:39:45 -05:00
Tod Beardsley
ef6411271b Land #75, adds Group Packets to Meterpreter 2014-03-19 08:39:24 -05:00
Tod Beardsley
bea18dd6f0 Land #70, Expand ADSI types 2014-03-19 08:39:04 -05:00
OJ
a54e37f301 Remove unused defintion 2014-03-12 06:58:47 +10:00
OJ
f7468732ec Fix incorrect comment for the WMI query function 2014-03-12 06:58:19 +10:00
OJ
49877fda24 Fix comment type and reverse ternary condition 2014-03-12 06:53:05 +10:00
OJ
f1fbf2064f Enable service control and status in queries.
This commit adds service status to the query functionality for a single
service so that it doesn't have to be found in the full list of services.

It also adds the ability for the caller to control services using the
typical start/stop/pause/resume/restart style functions. To use these
functions the caller has to have appropriate rights.
2014-03-11 14:49:19 +10:00
OJ
a4beeba7bc Rejig service initialisation
Gathering of function pointers is now done during initialisation. This
means that it doesn't have to be done each time a function is called
and allows for reuse across other functions.
2014-03-11 09:37:36 +10:00
OJ
d8f86c1806 Merge branch 'upstream/master' into wmi_query_support
Conflicts:
	make.bat
	workspace/ext_server_extapi/ext_server_extapi.vcxproj
2014-03-07 08:11:35 +10:00
OJ
a7927a4105 Added the notion of "group packets"
A group packet is a special packet that is to be used as a group of TLVs that
will live under another packet. Using this functionality means that we can
easily nest groupings of data to arbitrary depths, which wasn't something we
were able to do before easily.

The MSF side is easily capable of handling this scenario, but this side had
always been lacking.

The clipboard dump code has been updated to show how this can be used.
2014-03-04 19:38:15 +10:00
OJ
62140f8fa1 Pulled in master and added a fallback for the SID stuff
I just realised I shouldn't have done that in a merge commit.

Conflicts:
	workspace/ext_server_extapi/ext_server_extapi.vcxproj
2014-02-28 13:32:37 +10:00
OJ
256e43cde3 Change the binary->string converter, add SID, warnings as errors
The existing implementation wasn't really solid and I never liked it
anyway. Egypt rightfully pointed out flaws in the code, so it has
been changed so that it allocates the required memory up front
and returns that string to the caller, who then has to free it up.

Added a function to render SIDS.

Made the build set warnings as errors. Still no idea why this wasn't
the case already.
2014-02-28 13:21:33 +10:00
OJ
ce9cfa6c2e Fix silly typo in header comment 2014-02-21 13:01:59 +10:00
OJ
94468e1313 One last tweak to remove all evidence of stupidity 2014-02-05 23:06:10 +10:00
OJ
cca2f14835 Fix number of issues revealed in x64 testing
Thanks to sinner being on the ball, x64 was broken and causing some
crazy things to happen. The CPU would peg at 100% despite x86 being
quite happy. It turns out, I suck at C, so I had to fix that up.

This commit includes the following changes:

* Fix up the WNDPROC callback so that the parameters are in the right
  order.
* Specify the correct array size for wait handles in the monitor thread.
* Add extra debugging.
* Handle WM_* messages correctly and add WM_NCCREATE.
* Correctly use the CREATESTRUCT to pass in the state.

"How on earth did this ever work?"

Fixed now, thanks again sinner!
2014-02-05 22:37:55 +10:00
OJ
2cebe3c19e INCLUDE the resume event in the monitored array
I am clearly stupid. How did this ever work? This change tells the
wait call to include the signal handle for the resume event.
2014-02-05 07:54:08 +10:00
OJ
2c56a1bcb1 Add documentation to the functionality 2014-01-29 15:51:57 +10:00
OJ
54b596674d Add purge and dump functionality, remove dup caps
This no longer captures duplicate content if the user does the same
thing twice.
2014-01-29 14:51:27 +10:00
OJ
3ec5aaca3f Fix small indexing issue resulting in a crash 2014-01-23 10:19:33 +10:00
OJ
5b1007e940 Merge branch 'upstream/master' into clipboard_monitor
Conflicts:
	source/ReflectiveDLLInjection
	source/extensions/extapi/extapi.c
	source/extensions/extapi/extapi.h
	workspace/ext_server_extapi/ext_server_extapi.vcxproj
2014-01-22 22:53:29 +10:00