1
mirror of https://github.com/rapid7/metasploit-payloads synced 2025-01-08 14:36:22 +01:00
Commit Graph

1351 Commits

Author SHA1 Message Date
Spencer McIntyre
9ebb095a0a
Land #437, Fix Metasploit 6 pivoting issue 2020-10-06 09:05:15 -04:00
Alan Foster
985ccbd3af
Fix Metasploit 6 pivoting issue 2020-10-01 22:58:21 +01:00
Spencer McIntyre
e96d8e5fc8 Fix a bad comment 2020-08-20 14:42:17 -04:00
Spencer McIntyre
25a0b76797 Filter out Windows < 6.3 for the namedpipe_rpcss technique 2020-08-20 14:05:48 -04:00
Spencer McIntyre
ee69b4f274 Revert "Add a fourth parameter to the thread API"
This reverts commit 0afe17d160.
2020-08-19 11:54:45 -04:00
Spencer McIntyre
cf4614c941 Working on Windows 10 from native x64 and WOW64 2020-08-19 11:54:45 -04:00
Spencer McIntyre
ce7dd3f699 Clean up the namedpipe_rpcss code 2020-08-19 11:54:21 -04:00
Spencer McIntyre
7967fd569d x64 version is working 2020-08-18 15:41:42 -04:00
Spencer McIntyre
ee72ac26b9 Add support for a callback after named pipe impersonation 2020-08-14 18:12:02 -04:00
Spencer McIntyre
0afe17d160 Add a fourth parameter to the thread API 2020-08-14 17:47:59 -04:00
OJ
da7fb0e27f
Makefile tweak, RDI changeset update 2020-07-06 20:03:18 +10:00
OJ
68e27f00fa
Force mimikatz and RDI submodules to point to master 2020-07-03 08:47:41 +10:00
OJ
1fc117743f
Fix kiwi build 2020-06-25 23:29:36 +10:00
OJ
325048a5e6
Fix build, remove metsrv warning 2020-06-25 10:41:29 +10:00
OJ
7fab0b200a
Building, but not working yet
Got an issue where certain functions aren't being resolved and hence are
null when being invoked. Need to debug the loading of the DLL to see why
this is the case.
2020-06-25 10:32:32 +10:00
OJ
37fb807a95
Get extapi compiling under mingw 2020-06-25 10:31:53 +10:00
OJ
3d4d4706e2
Remove unused local 2020-06-25 10:31:48 +10:00
OJ
b55b186e79
Final pass of working stuff for the day 2020-06-25 10:31:45 +10:00
OJ
205405effe
Final winpmem changes.. I think 2020-06-25 10:31:05 +10:00
OJ
936fa267b4
More of the cross compilation dance! 2020-06-25 10:31:03 +10:00
OJ
e7162dda2c
Few more cross comp changes for pmem 2020-06-25 10:31:00 +10:00
OJ
cb0c1d476c
Fix some winpmem stuff for cross building 2020-06-25 10:30:57 +10: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
dee84d6ca9
Fix small compiler warning 2020-06-25 10:29:59 +10:00
OJ
d820fb6458
Get x86 working for metsrv 2020-06-25 10:29:54 +10:00
OJ
aa3b58628f
Get rid of the clang noise 2020-06-25 10:29:51 +10:00
OJ
060feece01
Kinda almost sorta working for metsrv 2020-06-25 10:29:48 +10:00
OJ
e6441ad2fa
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-25 10:28:36 +10:00
OJ
d9629c46d9
Point to new changes in RDI submodule 2020-06-23 08:19:53 +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
Spencer McIntyre
c8312f9c73
Land #397, Change from PEM to DER for crypt TLV negotiation 2020-06-18 13:54:31 -04:00
OJ
45624d2389
Fix config generation for migration 2020-06-18 09:15:50 +10:00
OJ
c5f8f893ac
Remove the mimikatz extension
Also turn off PDB generation for the sniffer extension.
2020-06-11 08:34:17 +10:00
OJ
6419fa9e40
Fix buffer meta type values, typos and function calls 2020-06-09 10:57:44 +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
e9e5894eca
Updated powershell extension binding IDs 2020-05-08 17:17:25 +10:00
OJ
fad9548108
Adjust the extension and command identifiers (windows) 2020-05-04 14:04:34 +10:00
OJ
6163be1142
Updated powershell extension with appropriate command map 2020-05-01 15:41:31 +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
4f8544cfca
Slight make tweak and removal of some verbose debug stuff 2020-04-24 13:31:34 +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
57eda40fc7
Fix mimikatz to build clean again
I am sad. Like.. really sad. I'm sad for so many reasons. For nearly
7 years I've worked on this god forsaken source, and for many of those
7 years I have had the ext_server_mimikatz project configured to have
warning level 3, and warnings as errors. While making changes to the
build systems in the last week or so, I've even rebuilt this on updated
toolsets on multiple platforms.

Despite all this, one thing slipped through the cracks. I have NO idea
why this warning wasn't shown in th past. Also.. how did this ever
work!? Why is it that it's only rearing its ugly head now? I honestly
don't know. Based on the code that I've had to fix in this PR, there's
no reason why this should build without warnings on any machine. Yet, it
does. It builds clean on my Windows 10 desktop with VS2013/2017/2019.
Same on most of my other virtual machines. For some reason it only
failed on this one VM after I had to fight to reproduce it when Brent
hand an issue.

The issue here was that a `string` type was being constructed from an
iterator over a `wstring` type, and hence there was an implicit
character conversion from `wchar_t` to `char`. This SHOULD be a warning,
because clearly that's not a good thing. BUT HERE WE ARE.

Anyway, we're proxying via the `_bstr_t` type now to avoid having to do
horrible manual character conversions. Given that we're in C++ land
already there's no point in working any harder. Also, this extension is
probably going to go away soon anyway, so a temporary fix that does the
job is good enough.

RIP my morning. I won't be getting that back.
2020-04-24 12:35:40 +10:00
OJ
f5313a91d0
Remove __declspec(dllexport) from the Init function in metsrv 2020-04-23 01:37:51 +10:00
OJ
24e6067b51
Update RDI, remove metsrv references/libs from extensions 2020-04-22 13:13:56 +10:00
OJ
64f6062d8b
Remove unused crap from espia
The video and audio capture things didn't do anything other than leave
artifacts on disk. So this commit removes the code that does that,
resulting in just one feature being available for this extension. Might
be worth ditching it entirely?
2020-04-22 13:06:49 +10:00
OJ
3a3e77942b
Fix small issue with calling convensions in x86 2020-04-22 13:06:49 +10:00
OJ
c8aa435b3c
Finally removed delay loading from the last extension: extapi 2020-04-22 13:06:49 +10:00
OJ
4cd3a29319
Remove delay loading from the kiwi extension 2020-04-22 13:06:48 +10:00
OJ
f4f6bb01d8
Remove delay loading from mimikatz 2020-04-22 13:06:48 +10:00
OJ
472a6b1f9e
Move incognito to no more delay loading 2020-04-22 13:06:48 +10:00
OJ
86a4763164
Update powershell extension to avoid delay loading 2020-04-22 13:06:48 +10:00
OJ
05d5a16fe5
Get the python extension working without delay loading 2020-04-22 13:06:47 +10:00
OJ
ce8544bd2d
Move sniffer over to metserv api 2020-04-22 13:06:47 +10:00
OJ
8565f9967e
Update lanattacks to not use delay loading of metsrv 2020-04-22 13:06:47 +10:00
OJ
f7b50df020
Update peinjectory to avoid delay loading
Also added the GetExtensionName function.
2020-04-22 13:06:47 +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
cd18f98caf
Make espia work without delay loading 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
1fb386c93b
Remove metcli and bare extension projects 2020-04-22 13:01:26 +10:00
OJ
23b7a7b9ad
Finalise support for building on all the toolsets. 2020-04-21 09:37:11 +10:00
OJ
f8154f8e04
Finalise support for VS2013/VS2017/VS2019 & v120_xp/v141_xp
These changes allow us to build across multiple toolsets and VS
versions.
2020-04-21 08:10:42 +10:00
OJ
dbe13941c3
Update mimikatz code to avoid warnings 2020-04-16 11:06:59 +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
ef721b1f3c
Update make file and dependencies 2020-04-14 14:24:30 +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
1a6bb89845
Update to build against new libs, remove hacks to make things work 2020-04-14 12:40:02 +10:00
OJ
443bfca952
Update JPEG lib to build with VS2019 toolset 141_xp 2020-04-14 12:29:59 +10:00
OJ
712268fab7
Get Python extension building clean
Warnings as errors, builds clean. Had to do some horrible hacks:
1) Include custom implementation of a lib function just so we could
   link against stuff built with older VS.
2) Include legacy symbols for old io for the same reason.
2020-04-14 12:13:30 +10:00
OJ
100ffd6d5b
First round of VS2019 changes 2020-04-14 10:28:08 +10:00
Brent Cook
2e9943af8d
Land #385, 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
Brent Cook
49b117838a
Land #384, 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
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
bwatters
903620268f
Land #377, Reducing permissions requested for sys_steal_token
Merge branch 'land-377' into upstream-master
2020-04-02 08:37:42 -05: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
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
Spencer McIntyre
03ddbd773e Send addrinfo when opening a channel in Windows 2020-02-24 18:40:12 -05:00
Justin Bui
bad3ef7df4
Update config.c
Reduced permissions from ALL_ACCESS to the minimum access needed.
2020-02-12 20:18:18 -08:00
Francesco Soncina
b35cc0ac70
add support for PPID spoofing
fix #373
2019-12-17 00:57:49 +01:00
Brent Cook
363a90be11
Land #370, update kiwi to latest mimikatz release 2019-12-06 09:34:15 -06:00
Brent Cook
c3624d73b2 bump to kiwi 2.2.0-20191125 2019-12-06 09:28:19 -06:00
Brent Cook
188fef721e
Land #366, fix unhook extension logic around clr.dll 2019-12-05 17:02:55 -06:00
Brent Cook
03491bfa9b
Land #361, add hidpi and multi-desktop support to espia screengrab extension 2019-12-05 16:51:39 -06:00
Brent Cook
81a4d8ad96
Land #360, fix crypt key memory leak 2019-12-05 16:50:29 -06:00
OJ
d2f7bfd420
Update to kiwi 2.2.0-20190813 2019-11-17 13:14:07 +10:00
Francesco Soncina
b527e76abd
fix: syntax error 2019-11-07 17:19:16 +01:00
Francesco Soncina
e386835042
fix: exclude clr.dll from being unhooked
see https://github.com/rapid7/metasploit-framework/issues/12549
2019-11-07 17:11:02 +01:00
Tim W
a74dedca56 fix espia screenshot 2019-10-22 23:51:21 +08:00
max3raza
71762fe778 fix for memory leak 2019-09-09 22:20:17 +03:00
plowsec
389e71df32 Fix address truncation occurring in x64 Windows processes. 2019-09-06 14:50:13 +02:00
bwatters
f6808dde30
Land #352, add windows keyevent api
Merge branch 'land-352' into upstream-master
2019-09-03 16:39:51 -05:00
Tim W
6253af16c8 use MapVirtualKey 2019-07-31 13:16:28 +08:00
bwatters
db171fb83a
Those should be usigned ints, not unsigned longs. 2019-07-23 10:21:21 -05:00
bwatters
509c1936a3
Update OS names to be more generic in kernel versions 10.0.x 2019-07-23 08:17:06 -05:00
Tim W
d95d827c8e add windows mouse doubleclick 2019-06-20 15:26:07 +08:00
Tim W
ab53c872fa fix windows move and click 2019-06-19 12:42:11 +08:00
Tim W
a29110ca5c add windows keyevent api 2019-06-17 12:36:55 +08:00
Brent Cook
dfb79b11cd
Land #343, update ReflectiveDLLInjection subproject 2019-06-01 19:53:13 -05:00
Tim W
48171ecc48 fix crash in keyboard_send on windows 2019-05-31 06:55:02 +08:00
Tim W
d2e9834ed0 update ReflectiveDLLInjection subproject 2019-05-16 14:04:23 +08:00
Tim W
16213667b7 add mouse api for windows 2019-05-13 02:32:27 +08:00
Tim W
35d908b6bf add send_keys api for windows 2019-05-13 02:31:44 +08:00
Brent Cook
7e2181700a update stat struct sizes 2019-02-06 17:51:21 -06:00
Tim W
783c52e118 fix windows meterpreter ls of 4gb files 2019-01-03 13:51:39 +08:00
Brent Cook
1d694f16cb
Land #314, update proxy autoconfig for Windows 2018-12-21 16:21:55 -06:00
Brent Cook
3762aa1568
Land #311, add REG_MULTI_SZ read support 2018-12-21 16:10:14 -06:00
bwatters
6431374acf
Land #302, Add universal unhooking call to meterpreter server
Merge branch 'land-302' into upstream-master
2018-12-12 16:12:56 -06:00
OJ
9b3a8280b1
Update to kiwi 2.1.1-20181203 2018-12-05 12:05:07 +10:00
Green-m
108081e1da Handle REG_MULTI_SZ correctly. 2018-11-29 15:36:40 +08:00
Green-m
e2029e2342
Handle more strings in one line. 2018-11-22 15:25:45 +08:00
Meatballs
a349e592e3 Modify the proxy autoconfig code as per Juan Caillava's code at:
https://medium.com/@br4nsh/a-meterpreter-and-windows-proxy-case-4af2b866f4a1
2018-11-19 16:04:26 +00:00
Jeff Tang
95e8fd2102
fix bug on win7/win8.1 2018-11-16 16:04:14 -05:00
4ntonch3
c04408081a
Update search.c
DWORD dwResult = ERROR_ACCESS_DENIED; -> DWORD dwResult; (in functions search_all_drivers, request_fs_search)
Comments in function request_fs_search were deleted
2018-11-15 15:27:03 +03:00
4ntonch3
1bc4a4902c
Add files via upload 2018-11-13 19:51:23 +03:00
Green-m
f779b809fa
Fix issue about REG_MULTI_SZ. 2018-11-05 16:07:34 +08:00
OJ
add6d464fc
Update kiwi extension to Mimikatz 2.1.1-20180925 2018-09-26 14:13:47 +10:00
Jeff Tang
b9c01eaa17 Add unhook extension 2018-09-19 15:55:25 -04:00
bwatters
5208d17131 Revert "Land #174, Add universal unhooking call to meterpreter server"
This reverts commit f148f8cb38, reversing
changes made to 87d2410468.
2018-09-10 16:44:55 -05:00
bwatters
f148f8cb38
Land #174, Add universal unhooking call to meterpreter server
Merge branch 'land-174' into upstream-master
2018-09-06 10:27:03 -05:00
Brent Cook
2b76d59b9b fix signed comparision bug 2018-08-31 17:01:31 -05:00
Brent Cook
62383a43c0 fix various peinjector extension issues.
64-bit compilation had a number of warnings / errors.
Added Unicode support for file path.
Fixed the r7_release build.
2018-08-31 16:51:47 -05:00
OJ
47bc2469f3
Update kiwi to Mimikatz 2.1.1-20180820 2018-08-31 09:25:35 +10:00
bwatters
bdce920e15
fix typo 2018-08-28 10:01:11 -05:00
bwatters
0b9783b55b
Standardize line endings to UNIX style 2018-08-28 09:51:02 -05:00
bwatters
2b0905b3d7
Fix __peinfect_clean_header declaration/definition/call 2018-08-28 09:47:30 -05:00
alpiste
94f560e30e Fix pull request issues 2018-08-28 09:08:06 -05:00
alpiste
cf807f5004 add peinjector 2018-08-28 09:08:06 -05:00
Matthew Kienow
336d154ca9
Land #294, audio output for windows meterpreter 2018-08-27 15:20:52 -04:00
OJ
3c26a76ec4
Update kiwi to match Mimikatz 2.1.1 (TBAL) 2018-08-17 09:36:24 +10: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
Tim W
1e97ef7c90 fix playing of > 8MB wavs 2018-07-15 02:39:19 +08:00
Tim W
01d8aacc0f audio output for windows 2018-07-14 23:40:34 +08:00
OJ
3dc014e8ad
Add powershell transport scripts
This commit adds two new scripts and modifies some of the powershell transport binding functionality.

Code has been added that generates valid Metasploit URIs for use with stageless listeners. This means that it's possible to add HTTP/S transports on the fly and have a URL generated that will work with the current architecture of the process.

Two new scripts will appear in each of the powershell sessions:

* Add-WebTransport - adds http/s transports to the session.
* Add-TcpTransport - adds TCP transports to the session.

These two scripts are just abstractions on top of the built-in Meterpreter transport binding functionality, but it makes it a lot easier to interact with the feature and makes it more.. er.. Powershelly.

The functions come with documnetation, so `Get-Help Add-WebTransport -Full` will show how it's used.

From here, people can do some more fun stuff, such as adding init scripts to their stageless payloads that add support for more transports.
2018-05-28 12:45:29 +10:00
OJ
71edb392ea
Fix issue with pointer handling on WOW64 processes
I stuffed up when dealing with values that are being passed back and forth across components when in x86 processes. I was passing 64 bit ints around even in 32 bit mode, which resulted in some natstiness. This commit fixes that problem by forcing everything to be 64 bit regardless of arch, and casting to the appropriate pointer at the right time.
2018-05-21 12:45:21 +10:00
OJ
1e175da8b1
Change hash output to use LM hash if present
The previous commit hard coded the LM hash to the empty value. This commit changes this so that if the LM hash isn't present it'll manually specify the empty one, but use the existing one if it is present.
2018-05-17 09:06:35 +10:00
OJ
90265c5a0f
Rework powershell_shell to work with "streaming"
This commit changes the channel functionality within the powershell extension so that commands do execute behind the scenes and stream the results to the UI in the current channel.

This comes with the caveat that users are patient. I haven't yet made sure that running separate commands while long running ones are running will not cause problems. We'll have to see.
2018-05-07 21:13:08 +10:00
OJ
f44877ae29
Add ability to dcsync & hashdump via Powershell
DCSync functionality is exposed, and from this it is possible to enumerate all users in the domain and dump each user's hash one by one. This code has a few extension functions built into the runner, and also has some baked-in powershell functions that are available in every powershell runner session in the host.

I've also added a powershell version of the build command that lets us generate the source to the powershell assembly wiring from PSH as well as Python.
2018-05-07 16:36:21 +10:00
OJ
d9cb58050d
Update kiwi to match mimikatz 2.1.1 20180502 2018-05-04 16:59:03 +10:00
UserExistsError
006bb2c998 added support for bind_named_pipe comms 2018-02-11 17:58:39 -07:00
Brent Cook
a8eebd18f2 remove read-only attribute on delete 2018-01-16 10:16:03 -06:00
Brent Cook
0959897065 if we cannot load powershell 4 support, fall back to 2 2017-12-20 14:39:16 -06:00
visuve
b8ef9d3d4e Remove redundant check 2017-12-05 10:14:49 +02:00
Veli-Matti Visuri
db2da2cc89 Fix iterator increments 2017-12-05 10:12:29 +02:00
Veli-Matti Visuri
b6c421cc3b Fix memory leaks 2017-12-04 21:45:00 +02:00
Veli-Matti Visuri
78b2b58ab1 Fix varargs leaks 2017-12-04 21:20:05 +02:00
Brent Cook
d4e403980c
Land #251, use utf8 for user and domain names 2017-11-29 05:37:32 -06:00
Brent Cook
ecedfac2a8
Land #249, update delete_dir to be able to recursively delete 2017-11-29 05:32:44 -06:00
Brent Cook
fcf69bb7ca pass file-not-found and other errors back to the caller 2017-11-29 05:30:53 -06: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 #252, 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
scriptjunkie
0b89ea3e37 Support non-ascii environment variables 2017-11-21 16:22:51 -06:00
scriptjunkie
936272b59d Encode name characters 2017-11-21 15:59:56 -06:00
Brent Cook
f065a24b1c Merge branch 'master' into land-236-headers 2017-11-21 00:52:50 -06:00
OJ
bbbe755206
Land #250 - Fix recv failure in windows transports
Fixes #9163
Fixes #9175
2017-11-08 09:21:36 +10:00
Brent Cook
0548a12f3c remove do/while(0) exception anti-pattern 2017-11-06 08:06:17 -06:00
Brent Cook
2dc48bea43 remove do/while(0) exception anti-pattern, fail properly on pipe close 2017-11-06 08:05:31 -06:00
Brent Cook
b0fbc4f550 remove do/while(0) exception anti-pattern, fail properly on socket close 2017-11-06 08:04:52 -06:00
Brent Cook
e117dd2326 unify whitespace 2017-11-06 03:33:08 -06:00
Artem
22235e228b
Update fs_win.c
Fix Error Open File VS2017 and Add Delete not empty Folder
2017-11-02 03:43:21 +03:00
Brent Cook
1010ded636
Land #244, handle situations when SetProcessDPIAware is unavailable 2017-10-27 00:06:12 -07:00
Brent Cook
58f7d2d606 fix whitespace 2017-10-26 23:56:45 -07:00
Brent Cook
7a22b3052a actually reset encryption context when freeing 2017-10-26 23:22:08 -07:00
Artem
752888a2c2 Update screenshot.c
Fix Compile in VS2017
2017-10-20 21:36:11 +03:00
OJ
db20322182
Fix TLV type defs and config size for HTTP migrate 2017-10-04 10:42:40 +10:00
OJ
c6eebdf72b
Properly fix half-baked changes to getprivs
This was left over code from me trying to do some fixes to getprivs
which didn't make sense in the middle of the packet pivot work. This was
left over by me as a result of my half-baked revert. This caused issues
with both the `getprivs` and `getsystem` command. I'm pretty sure that
as a result of breaking the latter, I will never live down the "make
getsystem great again" meme.
2017-09-27 16:30:18 +10: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
Tim
c61c565918 fix record_mic TLV values 2017-09-11 10:53:15 +08:00
Brent Cook
167c2d380a
fix sniffer/networkpug breakage 2017-09-01 03:29:26 -05:00
OJ
e328b986fb
Merge branch 'upstream/master' into packet-pivot 2017-08-21 17:26:21 +10:00
Brent Cook
4fd68effd4
Land #192, add unicode support for the incognito extension 2017-08-18 06:22:34 -04:00
OJ
52d770228e
Fix stupid double-free in WinHTTP packet handling 2017-08-11 17:32:49 +10:00
OJ
2cd4f3cf98
Turn off debug builds 2017-08-09 15:59:37 +10:00
OJ
a10938e5a0
Revert changes made to getprivs
This work should be done in another PR
2017-08-09 15:58:38 +10:00
OJ
bc6c2039fb
Add debug statements, and fix one that was causing crashes 2017-08-09 13:03:12 +10:00
OJ
005ba6a8c0
Merge branch upstream into packet-pivot 2017-08-08 17:37:59 +10:00
OJ
b363584648
Merge branch 'upstream/master' into transport-agnostic-packet-encryption 2017-08-08 17:37:25 +10:00
OJ
0413a5c2ce
Add check for existing session reconnect 2017-08-08 17:15:49 +10:00
OJ
5f8b775842
Fix reading data from pipe, fix XOR bug in x64 2017-08-07 19:51:24 +10:00
OJ
95f1903a10
Update kiwi module to disable busylight notification 2017-08-03 09:45:07 +10:00
William Webb
7ae31a76f1
Land #220, Support Hi DPI for screenshots 2017-07-25 23:12:29 -05:00
OJ
c30d7ee349
Fix session GUID creation/management for pivots 2017-07-25 17:40:54 +10:00
Brent Cook
ead41b1092 initial unicode conversion for incognito 2017-07-23 04:41:51 -07:00
Brent Cook
cdff912abf support hidpi for screenshots 2017-07-22 08:35:28 -07:00
Brent Cook
b8a60c1561 use prefix for debug messages, 64-bit consistently for memory sizes and offsets 2017-07-22 08:31:13 -07:00
Brent Cook
94f4147425 give attribution 2017-07-22 06:15:34 -07:00
Brent Cook
9118645a6e simplify and reduce logic 2017-07-22 06:12:19 -07:00
Artem
770d0f65f4 Update fs_win.c
Fix FS Stat on Windows XP
2017-07-22 06:12:13 -07:00