Commit Graph

1437 Commits

Author SHA1 Message Date
Grant Willcox e2c6c36b2b Land #1642, Add module for cve-2022-0995 2022-04-21 09:12:47 -05:00
bwatters fb4d12a558 Semicolon.... 2022-04-20 17:41:16 -05:00
bwatters 26f9175816 Update c source with argc check and CRASH notes for module 2022-04-20 17:37:48 -05:00
bwatters d9a241defb Fix overzealous source code edit and some version copy/pasta errors 2022-04-20 14:31:32 -05:00
bwatters f32443b477 Update with debug source code and options, cleanup module code per gwillcox-r7 2022-04-14 10:25:55 -05:00
usiegl00 b9052be102 Use libdyld locator to fix osx stager on monterey
We locate the dyld_shared_cache in memory to find and resolve the
functions we need in libdyld.dylib. We retain the original dyld location
method on osx versions before Sierra.

Explicitly set length for osx x64 initial stage

The rdx register, used for passing the payload length, is being
clobbered by a system call in the new MacOS version. Instead of relying
on the register being untouched, we set it equal to the payload length.
2022-04-12 11:27:23 +09:00
bwatters 4fada9570c Remove extra file 2022-04-07 17:12:37 -05:00
bwatters 96d86944da Added precompiled binary and option to strip output, fixed comment-strip bug 2022-04-07 17:09:35 -05:00
bwatters db89fc5e7a Add module for cve-2022-0995 2022-04-06 13:35:14 -05:00
Grant Willcox 9e2d7f655b Update data to fix more things found during review process 2022-04-05 12:48:11 -05:00
Grant Willcox db4b22df5e Update the exploit code to output errors in a better format, and fix a potential issue when trying to delete folders recursively. Also update exploit module to try kill msiexec.exe if its still running to prevent it holding onto handles when it shouldn't be. 2022-04-04 17:58:52 -05:00
Grant Willcox 8daecca5c3 Update code with latest changes 2022-04-01 12:11:05 -05:00
Grant Willcox 24342e764c Update solution file so that we can only build the DLL for x64 bit platforms since that is the only one we support at this time 2022-03-31 12:31:55 -05:00
Grant Willcox 743138abed Add in initial fixes from review and remove extra BREAKAWAY_FROM_JOB code changes not directly related to this PR as we'll raise a separate PR for those 2022-03-31 12:13:29 -05:00
Grant Willcox 5695863901 Add in updated source code for exploiting domain joined systems 2022-03-28 16:17:58 -05:00
Grant Willcox bab215fccb Remove .vs directory and associated files as there is no need for us to ship those files 2022-03-25 14:11:17 -05:00
Grant Willcox 3d871e0ea9 Remove unneeded DLL from source code 2022-03-24 11:59:20 -05:00
Grant Willcox b504585979 Add in source code 2022-03-24 11:56:18 -05:00
Spencer McIntyre 443bf1249a Remove all the old CVE-2021-1732 data 2022-02-18 15:25:39 -05:00
Spencer McIntyre d92259f868 One exploit for CVE-2021-1732 and CVE-2022-21882 2022-02-18 15:23:38 -05:00
RageLtMan 5eb2c3233d Authors cleanup 2021-12-29 10:56:44 -05:00
RageLtMan 4f07a2fbea First "working" 2021-44228 exploit module state
Clean up the Java code for PayloadFactory - the `main()` function
is actually not required, the error seen on initial attempts to
compile was some sort of PEBKAC or weird things in classpaths.

Update the module to start the HTTP server before issuing the HTTP
request starting the call chain which eventually executes the Java
PayloadFactory - that chain is quick and races with the service's
startup time to get the JAR containing the Payload and its factory.

Minor misc cleanup.
Give credit where due: we stand on the shoulders of giants.

Testing:
  LDAP request is serviced with response containing our JAR URL and
trigger parameters for the factory to instantiate Payload.class and
call its `main()` function.
  HTTP request is serviced to deliver the JAR.
  Payload handler on MSF-side is tripped with incoming connection.
2021-12-29 09:10:07 -05:00
RageLtMan 4874943e7f Implement infrastructure for payload delivery
Per the discussion with @schierlm on GitHub (mihi), the most direct
way to deliver and instantiate our Java payload in the target is
via remote code loading of the JAR using HTTP. This requires a
bootstrap class, a Factory, which instantiates our Payload.class
by calling its main() function on-load from the HTTP endpoint
serving the remote-code-loaded JAR.

Implement a basic PayloadFactory class and include and its sources
in the Metasploit tree.

Using @schierlm's own code from ~10y ago, implement injection of
the PayloadFactory class into our JAR-encoded payloads. Then,
using more of his code from the same module (2011-3544), implement
a secondary service within the exploit module (Rex::ServiceManager
services don't stack well in Msf namespace as they all get assigned
to self.service - faux pas on our end) to serve HTTP requests with
the injected JAR. Finally, generate an appropriate URL target for
the remote code loaded JAR for injection into the LDAP response and
leveraging a final piece of @schierlm's hackery, generate a valid
URI path (updating the datastore is ill advised @ runtime, but its
needed here for the correct service cleanup routines to fire).

Note: during development, i figured out a way to use Rjb for native
Java object serialization to buffers which we can use in Ruby, so i
stashed that away in the Exploit::Java mixin for posterity and left
a reference to it in the module for future endeavors.

Testing:
  Verified that the generated jar is served at the generated URL
  Verified that the generated JAR can be executed at the CLI for
both metasploit.Payload and metasploit.PayloadFactory
  Currently not triggering the remote code load (per wireshark and
our own HTTP service) when delivering the LDAP response, so tuning
that is the next leg of this effort.
2021-12-29 09:10:07 -05:00
Jake Baines e7810acb1e Pulled offsets out of dll into module. Auto-find lsass.exe when pid is 0 2021-12-18 10:56:46 -08:00
Jake Baines deab4ce90e Initial commit of Dellicious port 2021-12-08 07:33:16 -08:00
bwatters b1f6937542 Updated exploit to compile on target, added control over directory creation
Added a method to get source code for the write and compile method
2021-12-01 14:54:47 -06:00
bwatters bf1b3b377c Add cve-2021-3493 module 2021-12-01 14:54:47 -06:00
Grant Willcox 9f9942feb6 Make adjustments to dllmain.c from reviews and recompile the DLL again 2021-11-09 10:49:14 -06:00
Grant Willcox 780a9370a2 First draft of code, documentation, and exploit DLL plus exploit code 2021-11-09 10:36:40 -06:00
Grant Willcox 517b586f8b Add in new definitions to external/source/include/windows/definitions.h including a proper THREADINFOCLASS definition, additional SYSTEM_INFORMATION_CLASS definitions, and a BIG_POOL_INFO definition 2021-11-08 16:46:52 -06:00
Grant Willcox ab1316ac10 Update README.md with some minor additional notes
Add in a minor additional note about needing to potentially create one of the directories in case people run into errors as I encountered this during some recent testing.
2021-11-04 12:02:56 -05:00
sjanusz 2c7aa022d4 Add PoC for CVE-2021-22555 Netfilter Priv Escalation 2021-10-04 16:48:23 +01:00
Grant Willcox 3bca3b0bcb Update exploit code to use & after the command to execute as root so it executes in the background and doesn't hang Metasploit. Also update the logic of the code to check the response from executing the exploit and respond accordingly and update the documentation to match 2021-08-31 15:07:37 -05:00
Grant Willcox bd490d35ed Add support for Linux 5.11.x on Fedora 2021-08-23 15:09:10 -05:00
Grant Willcox e46611cffb Add in support for exploiting Fedora 32 with Linux kernel 5.10.12 2021-08-20 18:04:59 -05:00
Grant Willcox 75ae2b76f5 Add support for Fedora 32 Linux Kernel 5.9.8-100 and also fix an error where the wrong file was being used for Fedora 32 Linux Kernel 5.8.8. 2021-08-20 16:50:20 -05:00
Grant Willcox 5abf407228 Add support for Fedora 32 with Linux Kernel 5.8.8-200 2021-08-20 15:42:34 -05:00
Grant Willcox dd806a9d61 Add in support for Fedora 32 running kernel 5.7.11-200 2021-08-20 13:37:52 -05:00
Grant Willcox b60ad3ee26 Fix up mistakes I noticed whilst doing edits on the code as well as some mistakes identified during peer review 2021-08-19 13:55:54 -05:00
Grant Willcox d5df47692c Add in first copy of the exploit along with the supporting source code and binaries. Documentation to come 2021-08-17 18:01:14 -05:00
Christophe De La Fuente ccaedd6c9a Last additions and improvements
- add binaries
- add documentation
- backup `runc` binary in the exploit C file
- add `MeterpreterBackground` options to set Mettle `background` option
- add `WsfDelay` logic
- refactor code
- add cleanup logic
- add restore `runc` binary logic
2021-06-30 11:02:11 +02:00
Christophe De La Fuente 1b59b8c83e Rebase and fix conflicts in lib/msf/core/post/common.rb 2021-06-30 11:02:11 +02:00
bwatters 8e1391f098 Land #15216, Fix targeting for CVE-2021-21551
Merge branch 'land-15216' into upstream-master
2021-05-21 14:56:08 -05:00
bwatters 72375d1f67 Land #15024, Add RCE Exploit For CVE-2020-0796 (SMBGhost)
Merge branch 'land-15024' into upstream-master
2021-05-20 17:02:04 -05:00
Spencer McIntyre 5e13fdb7dc Couple of minor cleanups for the assembly stub 2021-05-20 17:20:57 -04:00
Spencer McIntyre 78d47b11f2 Add targeting for Windows 10 v21H1 2021-05-18 12:56:02 -04:00
Spencer McIntyre c5b022e2f2 Fix Windows 10 versioning by using ranges 2021-05-18 10:28:27 -04:00
Spencer McIntyre d990e884af Add and test even more targets 2021-05-13 17:27:58 -04:00
Spencer McIntyre eb89550f85 Clear up some target offset discrepancies 2021-05-13 16:06:15 -04:00
Spencer McIntyre 7d841a0f79 Add a target for Windows 7 x64 2021-05-13 14:24:15 -04:00