Commit Graph

275 Commits

Author SHA1 Message Date
adfoster-r7 ad2fab6fee Land #16153, read full response on smtp send/recv 2022-03-04 01:24:46 +00:00
bwatters 0081811c52 Land #16185, Firefox CVE-2020-26950 use after free browser exploit
Merge branch 'land-16185' into upstream-master
2022-02-28 14:38:23 -06:00
Jeffrey Martin abe55c8f91 raise RuntimeError on incomplete or extra data 2022-02-24 14:02:44 -06:00
Tim W 480c44e9cb refactor DEBUG_EXPLOIT code into mixin 2022-02-16 11:38:04 +00:00
bwatters 0239ef1cc6 Land #16117, Updates for Log4Shell 2022-02-15 16:39:00 -06:00
adfoster-r7 18b4ce8a13 Update replicant pattern to increment refs 2022-02-15 16:08:35 +00:00
Jeffrey Martin af3fa09896 refactor smtp delivery to support continuation
When dealing with SMTP servers the communication needs to flow
a known protocol. To ensure the socket is in the correct state
after a send and receive it needs to be read until a line return
a response code followed by a `space` and additional data and `\r\n`
or the response code immediately followed by `\r\n` is returned.
2022-02-14 16:55:49 -06:00
Jeffrey Martin 5bc60f5bf7 clear any additional response on smtp connect
When connecting to an SMTP server after `HELO` and auth
complete there can be additional data sent from the client
that sits in the socket queue. Adding a `get_once` after connection
has settled ensure any pending for extension responses are cleared.
2022-02-10 14:25:05 -06:00
Jake Baines 9758251278 Initial commit of CVE-2021-37343 2022-02-05 18:21:18 -08:00
Spencer McIntyre 965493191f Add and use a Log4Shell mixin 2022-02-03 16:09:49 -05:00
Spencer McIntyre d46822184f Updates for Log4Shell 2022-01-28 14:56:44 -05:00
Spencer McIntyre dd2d512851 Support session -1 for ListenerComm options 2022-01-24 11:42:39 -05:00
bwatters 4cf3ae352c Land #16050, Log4Shell: vCenter RCE
Merge branch 'land-16050' into upstream-master
2022-01-19 16:30:33 -06:00
space-r7 383ada6ae2 Land #16016, fix RHOSTS in dcerpc scanner 2022-01-13 13:15:24 -06:00
Spencer McIntyre 7b1398f0ae Allow overriding check module datastore options 2022-01-13 11:51:39 -05:00
Spencer McIntyre 62a814fa59 Refactor Log4shell exploit code into reusable bits 2022-01-13 09:45:02 -05:00
space-r7 199eae5e99 Land #16012, add pi-hole aux module and lib 2022-01-12 09:21:11 -06:00
bwatters f17d460a7a Remove now unused deregister_tcp_options method 2022-01-06 15:48:24 -06:00
h00die 990e4a1e7a pihole new module and lib 2022-01-02 11:48:41 -05:00
h00die c3e0f455ec some cleanup for rubocop 2021-12-30 15:35:22 -05:00
RageLtMan 60fdf2a7da Rubocop pass on LDAP pieces 2021-12-18 09:03:56 -05:00
RageLtMan 0e90c3e573 Address @adfoster-r7's change requests
Due to how this stack is being broken up into LDAP core, scanner
update, and exploit work, changes requested in #15972 actually
apply in this branch and get rebased to the remaining ones.

Address requests to clean up the textual messages, LDIF file read,
sourcing of LDAP methods from net-ldap, and YARD-related placement
of attr_* annotations.
2021-12-18 07:52:33 -05:00
RageLtMan db8f4ffa6f Native LDAP infrastructure to support log4shell
In order to detect scan callbacks, serve payloads, and otherwise
interact with the LDAP protocol handler in JNDI, Metasploit needs
a native LDAP service properly exposed to various parts of the
Framework and users/consumers.

Implement Rex::Protocol::LDAP::Server with TCP and UDP socket
handlers abstracted to a common access pattern between L4 stacks.
Extend the socket clients to hold a state attibute for LDAP bind
authentication, and use the UDP client abstraction to implement
consistent callback semantics for data receipt from a client and
handling response on the other side. The server utilizes Rex'
native sockets, permitting full pivot and proxy support over the
Switchboard.

Implement the Msf::Exploit::Remote::LDAP::Server mixin to manage
service abstraction and shared methods exposed to Metasploit
modules.
Note: during implementation of this functionality, it was
discovered that the Scanner mixin's :replicant method resulted in
:dup calls to the Rex::ServiceManager service created by this new
mixin (and any others leveraging ServiceManager). As a result,
double-bind attempts created failures in service instantiation from
the duplicated MetasploitModules which also dropped the @service
instance variable reference to the actual running service; leaving
the socket inexorably bound until Framework was halted and Ruby
released the FDs. See https://github.com/rapid7/rex-core/pull/19
and the Issues/Pull Requests sections of R7's MSF GitHub.

Expose the new LDAP infrastructure to users by way of a basic LDAP
server MetasploitModule which consumes a tiny sample LDIF (provided)
and performs queries against it. This is intended to be a template
for future work such as LDAP authentication capture, protocol proxy
for MITM and intercept, and other more specific implementations for
exploits and auxiliary modules.

For feature completeness, provide a Rex::Socket override for
Net::LDAP::Connection until we have a proper, native to Rex, LDAP
client class implemented.

Testing:
  Basic functionality only, this is an early effort which will be
extended for feature-completeness over time
2021-12-16 18:47:52 -05:00
Spencer McIntyre e6b7669114 Address PR feedback from module hacking 2021-12-16 11:12:11 -05:00
Spencer McIntyre 5e5e73a1d8 Add module metadata and more checks 2021-12-15 08:45:25 -05:00
Jeffrey Martin 21a6a18d92 trade URI.encode & URI.escape for Ruby 3
Ruby 3 removed the `URI.escape` methods however access to
the a parse for the same RFC is stil available at `URI::DEFAULT_PARSER.escape`.

Per the Ruby forum [comment](https://bugs.ruby-lang.org/issues/17309#note-1) this should equal.
2021-11-22 14:11:03 -06:00
Ashley Donaldson f020c99a85 Implement suggestions from code review 2021-11-16 11:07:48 +11:00
Ashley Donaldson cab04d33f5 Use existing Rex::UserAgent class; keep UA string consistent across an MSF session 2021-11-10 10:05:45 +11:00
Ashley Donaldson 551ef90c5f Use default User agent string for generic auxiliary modules 2021-11-09 18:55:49 +11:00
Ashley Donaldson 839722720a Updated the default metasploit user agent string to be more modern
Selected from a set of currently-modern browser UA strings
2021-11-09 18:20:41 +11:00
alanfoster 9346a43e4a Improve kube exec reliability 2021-11-05 02:38:44 +00:00
adfoster-r7 b306641755 Print token claims 2021-10-21 11:05:51 +01:00
adfoster-r7 f28ced60ee Correctly store extracted loot 2021-10-21 11:02:10 +01:00
adfoster-r7 adbe6070ab PR feedback 2021-10-21 11:02:09 +01:00
adfoster-r7 c0ba4bd619 Add kubernetes enum module 2021-10-21 11:01:25 +01:00
adfoster-r7 2f86b332f5 Land #15733, Add Module For Kubernetes Pod Authenticated Code Execution 2021-10-21 10:46:20 +01:00
dwelch-r7 dcb42da269 Land #15612, Add multiple moodle modules 2021-10-11 23:18:55 +01:00
Grant Willcox 8b9b1092f6 Land #15706, Display TCP forwarding information for sessions and jobs for reverse shells 2021-10-07 13:23:06 -05:00
Ashley Donaldson 5196071c22 Keep other instances of via_string to the same convention 2021-10-04 23:51:57 +11:00
Spencer McIntyre d8f2b18649 Implement review feedback 2021-10-01 14:44:13 -04:00
Spencer McIntyre 32540247cb Move the Kubernetes client into a library file 2021-10-01 10:32:12 -04:00
Spencer McIntyre e04882689a Support an explicit HTTP comm 2021-09-30 16:54:01 -04:00
Spencer McIntyre 1aa4bc4f66 Raise exceptions WebSocket connection failure 2021-09-29 17:55:05 -04:00
Spencer McIntyre ac319e730b Document the new WebSocket functionality 2021-09-29 17:55:05 -04:00
Spencer McIntyre 7e8afcdaf6 Add a WebSocket implementation for Rex 2021-09-29 17:55:05 -04:00
Ashley Donaldson 2349393ef0 Display computer information gleaned from NTLM handshake in RDP. 2021-09-22 12:09:19 +10:00
Spencer McIntyre 1bd3a764a6 Fixup issues from testing 2021-09-14 16:32:25 -04:00
Jack Heysel e30ccafd86 Refeactor lfs.rb, revert rubocop changes on library files 2021-09-07 13:43:10 -04:00
h00die 65aae010ce more libs for moodle and teacher priv esc to rce module 2021-09-04 13:31:11 -04:00
Jack Heysel f9c4c35431 Update the target_suitable? method 2021-09-03 16:17:35 -05:00