Commit Graph

44 Commits

Author SHA1 Message Date
HarmJ0y 1980f403ee For ./CodeExecution/ :
-PSScriptAnalyzering
    -Tweaking of synopsis blocks in order to support platyPS
    -Code standardization
    -Generated docs
2016-12-14 17:50:37 -05:00
Matt Graeber 6b0ada999a Fixed FreeLibrary function signature #146
The parameter type and return types were accidentally transposed. Thanks
@rojaster for pointing this out.
2016-05-29 07:54:50 -07:00
Matt Graeber 9f183e3651 Set all module versions to 3.0
Also cleaned up some module manifest cruft.
2015-12-18 16:28:03 -08:00
Matt Graeber c2a70924e1 Removed all version numbers from scripts
Scripts in a module should not be individually versioned. Only the
module should be versioned.
2015-12-16 17:08:57 -08:00
Matt Graeber 1cdad586c8 Added a slight delay to Invoke-DllInjection validation
In some cases, the loaded module would show up as loaded after the check
occurred.
2015-12-16 14:48:09 -08:00
Matt Graeber f5d9b25275 Invoke-DllInjection detects OS arch on all OSes
This fix addresses issue #99. While I'm not the biggest fan of
performing tests based on environment variables, I felt that making
additional Win32 API calls would have been overkill.
2015-12-16 14:31:03 -08:00
Matt Graeber fdcdeab702 Fixed Invoke-WmiCommand credential popup issue
Easy fix to issue #97
2015-12-16 08:50:34 -08:00
Matt Graeber f70c63f9d5 Invoke-WmiCommand is now PSv2 compatible
This bug fix addresses issue #96. As much as a hate dropping files to
disk, this was the easiest way to preserve objects in PSv2+. If someone
want to implement the [de]serialization themselves and keep everything
in memory, please submit a PR.
2015-12-15 11:55:47 -08:00
Matt Graeber f6e032c3b1 Invoke-WmiCommand now obtains full powershell path
Addresses issue #95.
2015-12-15 09:10:35 -08:00
Matt Graeber 00af1656b2 Bugfix #93
Removed the "EndAddress" parameter set since it was never used. This
should resolve any parameter set confusion.
2015-12-14 17:26:33 -08:00
Matt Graeber ce3b21685a Bugfix #92: perform OS check when importing NtCreateThreadEx 2015-12-14 16:40:09 -08:00
Matt Graeber 7f6d3a4565 Fix Invoke-Shellcode OS architecture detection
Fixes issue #70
2015-12-14 11:02:14 -08:00
Matt Graeber aae81ddfe5 Adding -DoNotZeroMZ for testing 2015-11-07 20:26:08 -08:00
Matt Graeber 992f980022 Removed extraneous parameters
Removed extraneous parameters

Removed the following extraneous parameters:
-PEPath
-PEUrl

The functionality they provided can be easily replicated in code outside
of Invoke-ReflectivePEInjection. i.e. it should be up to the user how
they might want to download a PE before loading it. That should not be
dictated by Invoke-ReflectivePEInjection.
2015-11-07 20:00:22 -08:00
Matt Graeber b8e831e4f9 Revert "Removed extraneous parameters"
This reverts commit 0eb520e31f.
2015-11-07 19:50:05 -08:00
Matt Graeber 0eb520e31f Removed extraneous parameters
Removed the following extraneous parameters:
-PEPath
-PEUrl
-ComputerName

The functionality they provided can be easily replicated in code outside
of Invoke-ReflectivePEInjection. i.e. it should be up to the user how
they might want to download a PE before loading it. That should not be
dictated by Invoke-ReflectivePEInjection.
2015-11-07 20:25:29 -05:00
Matt Graeber 17bfa4e276 Fixed a casting bug 2015-11-06 13:31:58 -05:00
Matt Graeber 18b7a10f89 Removing Invoke-ShellcodeMSIL
This was only ever intended to be a PoC. I'll bring this back if
requested but it exhibits duplicate functionality.
2015-11-05 13:26:05 -05:00
Matt Graeber d1145e0540 Re-import Invoke-Shellcode.ps1 2015-11-05 10:34:26 -05:00
Matt Graeber 5065810c07 Removing Metasploit integration from Invoke-Shellcode
This should have only ever been a shellcode runner. Those wishing to
integrate this with Metasploit should generate a shellcode payload with
msfvenom.
2015-11-05 10:31:40 -05:00
Matt Graeber d0fff7b637 Migrating everything back to Invoke-Shellcode.ps1. I'm done making my point now. :P 2015-11-04 14:56:46 -05:00
Matt Graeber 03ed2adb56 Adding Invoke-WmiCommand 2015-09-23 15:25:39 -07:00
Chris Campbell 5b1a7750c0 URI fix, Proxy Support, UA Update
This fixes the URI bug submitted by @enigma0x3. Thank you for the PR as well! A legacy switch is added in case anyone is relying on this script and an older meterpreter handler. 

Proxy support is added to grab the default proxy by way of a switch.

The default user-agent is grabbed from the registry instead of being a static string.

I tested this on a Windows 7 SP1 (both x86 and 64-bit) and Windows 8.1 (64-bit) with an older handler and an updated one.
2015-04-26 18:32:44 -04:00
mattifestation 142afad54e Added parameters back to the original Invoke-Shellcode 2015-02-03 21:47:05 -05:00
mattifestation 59b35d1470 Moved Invoke-Shellcode
These things happen
2015-02-03 21:24:46 -05:00
clymb3r 93bc214659 Adding PEBytes parameter
Added PEBytes parameter for reflectively loading a PE file passed as a
byte array to the script.
2015-01-26 09:26:43 -08:00
clymb3r 90a05de7a6 Bugfix: Resolving ordinals in remote dll injection
Thanks to sixdub for finding and fixing a bug when resolving functions
by ordinal in remote processes.
2015-01-07 21:08:58 -08:00
Matt Graeber 36e1e29987 Merge pull request #52 from clymb3r/master
Bug fixes to Invoke-ReflectivePEInjection
2014-07-12 07:46:32 -04:00
clymb3r 03b8d5c6b4 Bug fixes to Invoke-ReflectivePEInjection
Fixed a bug where calling GetProcAddress by ordinal instead of procedure
name failed.
Fixed a bug where reflectively loading an EXE will cause the entry
function (main()) to be called twice instead of once as expected.
Added a ForceASLR flag to force ASLR to be used even if the PE file
doesn't officially support ASLR.
Some minor other changes.
2014-07-10 22:40:01 -07:00
mattifestation dc3cab2c9f Invoke-DllInjection now calls RtlCreateUserThread
Calling CreateRemoteThread on lsass.

Bug fix: Invoke-DllInjection was checking the processor architecture
when it should have been validating the OS architecture. This would
cause Invoke-DllInjection to fail on a 32-bit OS with a 64-bit
processor.
2014-06-21 11:29:46 -04:00
mattifestation 80ffa19fa3 Removing Watch-BlueScreen
This vulnerability was patched a while ago making this function largely
irrelevant.
2014-06-19 20:16:26 -04:00
mattifestation 237d362acf Normalized all scripts to ASCII encoding 2013-11-13 21:01:02 -05:00
clymb3r d269eec01d Switching to ANSI from UTF8 encoding
Scripts now work in 2008r2. I thought I tested before uploading but
something broke somehow... Now the scripts work in 2008r2 and win8+
2013-10-01 21:25:36 -07:00
clymb3r 1291abdae3 Fixes for Windows 8.1/.NET 4.5
.NET 4.5 introduced breaking changes in the way Marshalling works. Added
a fix so ReflectivePEInjection works with Windows 8.1/.NET4.5.
2013-09-30 22:32:57 -07:00
clymb3r 5e1f6ac29a Call to DllMain when unloading reflective DLL
Prior to this fix, DllMain with the ProessDetach flag was not called
when unloading the reflectively loaded DLL. This was causing very weird
crashes in the Invoke-NinjaCopy script which is built on this script.
This should fix the crash.
2013-09-03 20:10:18 -07:00
Matt Graeber dfec277813 Added Invoke-ReflectivePEInjection
Another awesome addition from Joe Bialek. Invoke-ReflectivePEInjection
is a vast improvement over Invoke-ReflectiveDllInjection. It adds the
following features:

* Now supports loading exe files in memory
* Supports reflective dll injection into a remote process
* Additional sample Visual Studio solutions
2013-05-31 19:35:26 -04:00
Matt Graeber a1cb7db1d0 Added an idiot filter to Watch-BlueScreen 2013-05-13 20:26:05 -04:00
Matt Graeber 2a17b8fb56 Added Watch-BlueScreen
Causes a blue-screen (bugcheck) to occur.
2013-05-13 20:01:59 -04:00
Matt Graeber 9d7ee39166 Removed test code in Invoke-ShellcodeMSIL
There was some test code at the end of Invoke-ShellcodeMSIL that would
cause the function to execute when the script was dotsourced.
2013-05-12 10:17:00 -04:00
Matt Graeber 2224f4dca9 Adding reflective DLL loading capability
Adding Invoke-ReflectiveDllInjection. PowerSploit now has reflective DLL
loading capabilities!!! Thanks to Joe Bialek @JosephBialek for writing
this awesome code!
2013-04-06 07:04:16 -04:00
Matt Graeber 014a7bb421 Adding Invoke-ShellcodeMSIL
Invoke-ShellcodeMSIL executes shellcode without making any Win32
function calls.
2013-04-05 14:06:58 -04:00
bitform 4475824be0 Updated 64-32bit conversion logic for Metasploit 2013-02-17 18:12:56 -05:00
bitform 40eb187bca Consistency improvements in comment-based help 2013-01-21 08:33:51 -05:00
bitform a233d60908 Added 'CodeExecution' Module
* I unfortunately needed to change the names of Inject-Shellcode and
Inject-Dll to Invoke-Shellcode and Invoke-DllInjection in order to
confirm to proper verb naming.
2013-01-20 21:34:37 -05:00