Commit Graph

12 Commits

Author SHA1 Message Date
Spencer McIntyre 4a51e028d8 Print multiple attributes on individual rows 2024-02-26 17:28:41 -05:00
Spencer McIntyre 4b7f4e2b0d Just show the DN, commas and all
This way the DN can just be copy-pasted into locations where a DN is
expected.
2024-02-22 17:36:30 -05:00
adfoster-r7 7b56d012e8 Land #18678, add LDAP capture capabilities 2024-02-15 22:11:04 +00:00
Ashley Donaldson 2ead152173 Add specific module to perform ASREP-roasting 2023-11-24 07:43:49 +11:00
JustAnda7 7876912eab Changes-as-per-comments 2023-10-08 02:49:46 -04:00
JustAnda7 ea189d6c34 Changes-to-the-helper-lib 2023-10-02 13:35:28 -04:00
Nishant Desai 1a3b00e593 shifting-appropriate-methods-to-auth-lib 2023-09-27 12:23:29 +00:00
Spencer McIntyre 2e4f04a804 Add and use the new bindhost/bindport options 2022-03-21 11:47:55 -04:00
Ashley Donaldson 6f159fa54e Consistent handling of DNS and LDAP servers wrt ServiceManager 2022-03-10 11:01:37 +11: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