Commit Graph

33 Commits

Author SHA1 Message Date
Spencer McIntyre 566020abbf Cache the result of whoami 2025-07-08 15:43:41 -04:00
Spencer McIntyre 23c02d6873 Note the permissions required for checking permissions 2025-07-08 15:01:54 -04:00
Spencer McIntyre 2650956fce Add special handling for more groups
Add handling for the special `Authenticated Users` and `Users` groups.
2025-07-08 15:01:54 -04:00
Spencer McIntyre a93d20ccfe Add some basic tests 2025-07-08 15:01:54 -04:00
Spencer McIntyre d0d3a2719d Add some commented code for debugging
Squash me
2025-07-08 15:01:54 -04:00
Spencer McIntyre 7cacc4cd45 Update the ad_cs_cert_template module too 2025-07-08 15:01:54 -04:00
Spencer McIntyre c2a06e341d Expand on the matcher logic 2025-07-08 15:01:46 -04:00
Spencer McIntyre 23c85a26fe Add some documentation for the methods 2025-06-24 11:27:52 -04:00
Spencer McIntyre b8ecd50f32 Add and use a generic LDAP entry cache 2025-06-24 11:27:52 -04:00
Spencer McIntyre cf53956128 Add a method to get domain info 2025-06-24 11:27:52 -04:00
Spencer McIntyre 7b1af9fc09 Initial implementation of #adds_sd_grants_permissions? 2025-06-24 11:27:52 -04:00
Spencer McIntyre 70f7dfebc3 Initial commit of AD DS LDAP mixin 2025-06-24 11:27:52 -04:00
Ashley Donaldson 6d3fc7b732 Neatening kerberoasting modifications 2025-05-13 18:26:25 +10:00
Ashley Donaldson abba784190 Fix AES kerberoast hashcat format. Change when hashes are displayed in module. 2025-05-13 18:26:25 +10:00
Ashley Donaldson 1e56168905 Move kerberoasting to Ruby code 2025-05-13 18:26:25 +10:00
Spencer McIntyre daed558f9a Remove a piece of dead code 2025-04-09 13:04:00 -04:00
Spencer McIntyre c9dc97c242 Update some modules to print the SDDL 2025-02-13 17:19:43 -05:00
Dean Welch 68f7334348 Fix kerberos auth and missing method error when querying with -a 2024-05-15 16:11:40 +01:00
Dean Welch e693b9588c Update ldap modules to support an ldap session 2024-05-15 15:12:51 +01:00
Dean Welch df32ce2db9 Add ldap query support to the ldap session 2024-05-15 15:12:51 +01:00
Dean Welch 463200cfb3 Add ldap acceptance tests 2024-04-11 14:40:19 +01:00
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