1
mirror of https://github.com/rapid7/metasploit-payloads synced 2025-04-24 10:09:49 +02:00

400 Commits

Author SHA1 Message Date
Alex Romero
885d63d568
Update c/meterpreter/source/extensions/stdapi/server/net/config/arp.c
Co-authored-by: Spencer McIntyre <58950994+smcintyre-r7@users.noreply.github.com>
2023-03-07 21:32:37 +03:30
Alex Romero
5df4982d73
return interface name instead of index for arp command 2023-03-06 16:25:20 -05:00
Spencer McIntyre
fb8bf774ed Set the metric so routes can be added and deleted 2023-03-02 10:52:20 -05:00
Spencer McIntyre
9f2491bac4
Land , Fix getprivs permissions set
Fix getprivs permissions that are grabbed on C Meterpreter and Python Meterpreter So That They Match
2023-02-28 14:32:47 -05:00
Grant Willcox
242e66ec44
Add in missing SE_DELEGATE_SESSION_USER_IMPERSONATE_NAME privilege that was not being obtained in C versions of Meterpreter 2023-02-28 10:32:13 -06:00
Spencer McIntyre
16a9a2d2f6
Land , Display IPv6 Routes on Windows
Feature to display IPv6 Routes on Windows
2023-02-28 10:24:20 -05:00
Spencer McIntyre
f402d7cb9e Fix Windows XP compatibility
GetIpForwardTable2 is not available on Windows versions prior to Vista.
Use GetProcAddress to call it when it's available while avoiding
crashing on XP.
2023-02-28 09:36:31 -05: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
a54ea83cb0 More error handling and documentation 2023-01-19 15:32:46 -05:00
Spencer McIntyre
b83af142c0 Allow binding to specific addresses in Windows
Related to 
2023-01-10 15:51:36 -05:00
Spencer McIntyre
36f3783279 Code and docs cleanups 2022-09-21 17:01:37 -04:00
Spencer McIntyre
b680804951 Don't assume the buffer is null terminated
Apparently values returned by RegQueryValueExW may not actually be null
terminated.

See: https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regqueryvalueexw#return-value
2022-09-08 12:07:49 -04:00
Spencer McIntyre
d40b95c1c2 Ensure that the parsed buffer is terminated
This copies the input buffer to a private copy which is the easiest way
to guarantee that it has two null terminiating characters.
2022-09-07 12:07:42 -04:00
Spencer McIntyre
2e6fb9c2f3 Add docs for the new functions 2022-09-07 12:07:42 -04:00
Spencer McIntyre
18a3d8d85d Fix REG_MULTI_SZ handling
This updates the registry handling for the native Windows Meterpreter to
handle REG_MULTI_SZ values as UTF-8 encoded strings in a buffer with an
additional NULL terminator. This is basically what RegSetValueExW wants
but Meterpreter will encode the UTF-8 strings into UTF-16. They are
however split with a NULL byte and no longer \0.
2022-09-07 12:07:32 -04:00
Spencer McIntyre
89aa11e177 Fix reading REG_MULTI_SZ values for Windows 2022-09-07 09:32:16 -04:00
Spencer McIntyre
d720a549a4 Use RegOpenKeyExW for checking existance
This has two benefits:
1. It's the same function as what's used to open keys, ensuring that the
   options is consistent.
2. It allows the desired permissions to be explicitly set instead of
   being inferred from the "default securitya ccess mask". See:
   https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regopenkeya#return-value
2022-09-07 09:32:05 -04:00
dwelch-r7
e29d876b2e Remove debug artifacts from release build 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
0d2f0f380d whitespace fixup 2021-09-22 15:48:12 +01:00
Tim W
4f49792feb fix windows wds3_search 2021-09-22 14:51:10 +01:00
Tim W
8ec7d7b254 cleanup windows fs_search 2021-09-22 13:13:27 +01:00
Tim W
027de2be9c fix windows build 2021-09-20 19:08:06 +01:00
Tim W
949b9de394 minor cleanups on windows search.c 2021-09-20 15:38:13 +01:00
test
e43f437a2c Clarified variable names 2021-09-20 15:38:13 +01:00
test
e2f9e64779 Updated search functionality 2021-09-20 15:38:13 +01:00
test
13a1b7e0b3 Source code for searching by date 2021-09-20 15:38:13 +01:00
Tim W
dc4d69d695 fix request_fs_ls on an inaccessible file 2021-03-30 19:35:16 +01:00
Spencer McIntyre
c911749430 Fix a guard condition to check the correct thing 2020-12-18 16:08:14 -05:00
Tim W
be443779ff fix free() process.execute wchars 2020-11-30 18:48:26 +00:00
Kali-Team
7933f06484 [stdapi] support_unicode_characters_for_execute 2020-11-24 17:41:07 +08:00
OJ
fdb785dcee
Few more build fix ups and removal of warnings 2020-06-25 10:30:53 +10:00
OJ
effe6b9827
Lots of changes + stdapi support 2020-06-25 10:30:49 +10:00
OJ
aa3b58628f
Get rid of the clang noise 2020-06-25 10:29: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
6419fa9e40
Fix buffer meta type values, typos and function calls 2020-06-09 10:57:44 +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
3dbff1e401
Clean and working builds with CMake 2020-04-24 13:31:34 +10:00
OJ
0e9a231e8a
First pass of CMake support (MSVC specific ATM)
This commit includes a bunch of changes that are working towards being
able to build the Meterpreter source from CMake. Changes include:

* Updated `make.bat` which does the stuff that we need.
* Removed a bunch of stuff from the python extension source tree so that
  CMake generator would not include them.
* Moved a few things around in the priv extension.
* Created `CMakeFileLists.txt` for all the projects.

There are a few hacks required in things like stdapi and kiwi to ignore
files that are on disk but shouldn't be included in the build.

Initial testing indicates that sessions run, extensions load, but some
things don't work as intended. It's a start! Still much to do.
2020-04-24 13:31:16 +10:00
OJ
136a58a194
Clean comments & update winpmem to avoid delay loading
Also, added the "GetExtensionName" functions to winpmum and unhook
2020-04-22 13:06:46 +10:00
OJ
9ca881235e
Change unhook extension to remove delay loading of metsrv 2020-04-22 13:06:46 +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
23b7a7b9ad
Finalise support for building on all the toolsets. 2020-04-21 09:37:11 +10:00
Brent Cook
2e9943af8d
Land , enhance Windows extapi support for window enumeration
Merge remote-tracking branch 'upstream/pr/385' into upstream-master
2020-04-08 06:04:41 -05:00
cn-kali-team
6d7740cc72 Process Unicode support 2020-04-05 11:53:22 +08:00
cn-kali-team
451a094269 Process Unicode support 2020-04-05 11:53:16 +08:00
cn-kali-team
25f770dcb3 Process Unicode support 2020-04-05 11:53:06 +08:00
cn-kali-team
a8df9b3604 Process Unicode support 2020-04-05 11:52:08 +08:00