Commit Graph

5658 Commits

Author SHA1 Message Date
space-r7 aa87d5d387 add fixed definitions and exploit 2022-03-04 15:56:28 -06:00
adfoster-r7 e9393e471c Land #16258, convert unknown tlv types to readable strings 2022-03-04 16:55:39 +00:00
adfoster-r7 1253878dd3 Land #16135, Add setg sessiontlvlogging command to log TLV packets 2022-03-04 16:30:09 +00:00
sjanusz ae704eb067 Add support for multiple tlv types when logging 2022-03-04 16:20:20 +00:00
sjanusz a2fadf0606 Init logging on meterpreter's init, add option to change log file 2022-03-04 14:21:00 +00:00
adfoster-r7 383fa316cc Land #16219, Update core enumextcmd and loadlib commands to show human readable strings 2022-03-04 01:35:29 +00:00
adfoster-r7 dd3cca5037 Land #16265, Fix race condition in jobs cleanup that could allow it to clean up twice simultaneously 2022-03-04 00:45:33 +00:00
Ashley Donaldson 499ba611e5 Move cleaned_up flag up so that cleanup is never re-entrant 2022-03-04 10:59:14 +11:00
Spencer McIntyre d52bee3201 Remove an unnecessary duplicate line 2022-03-03 11:57:25 -05:00
sjanusz 3871ac9eac Improve TLV Type handling 2022-03-03 10:07:43 +00:00
Ashley Donaldson f6e88d0405 Fix bug in tab completion of directories 2022-03-03 15:57:10 +11:00
Ashley Donaldson 4c4b0b4f8c Fix race condition in jobs cleanup that could allow it to clean up twice simultaneously 2022-03-02 14:43:06 +11:00
sjanusz 869f073a1b Add setg option to log TLV packets to console or file 2022-03-01 12:50:35 +00:00
sjanusz 04ecb347a4 rjust command output 2022-02-28 18:26:31 +00:00
space-r7 40bb5e2afa correct return val for definition, add module 2022-02-25 18:13:49 -06:00
space-r7 9c56a9a2bc add more definitions / constants for permissions 2022-02-24 20:20:38 -06:00
h00die dc5209e412 vnc docs and fixes 2022-02-24 16:42:36 -05:00
sjanusz f473c0e3b1 Convert core_enumextcmd and core_loadlib commands to human readable strings 2022-02-24 14:54:21 +00:00
space-r7 99226f1a5c add definitions for winspool and spoolss libs 2022-02-15 15:51:22 -06:00
adfoster-r7 18b4ce8a13 Update replicant pattern to increment refs 2022-02-15 16:08:35 +00:00
Simon Janusz 732bd3a71c Land #16173, Add readline option to msfconsole
Add readline option to msfconsole
2022-02-14 16:11:15 +00:00
alanfoster d45783a5a0 Add readline option to msfconsole 2022-02-13 23:47:08 +00:00
Grant Willcox cfa3d15cee Land #16161, Update user agent strings 2022-02-11 16:28:14 -06:00
Grant Willcox 47fea63fdf One more update to address Apple bumping some versions at the very last minute 2022-02-11 15:57:09 -06:00
Spencer McIntyre 72ca957285 Don't use default values 2022-02-08 17:40:03 -05:00
Ashley Donaldson 1f60303772 Updated user agent strings as of 9 Feb 2022 2022-02-09 08:39:05 +11:00
Spencer McIntyre 1fe01087b6 Remove trailing whitespace from command output 2022-02-08 15:37:11 -05:00
Spencer McIntyre 7d9e6c2bb9 Don't crash when the hostname can't be determined
This fixes a framework-level crash when msfconsole initializes and the
HOSTNAME environment variable is not set and the hostname binary is
missing.
2022-02-08 15:14:36 -05:00
adfoster-r7 8ab102e72c Land #16014, Change custom parsers to Rex Parser and add long arguments 2022-02-01 17:38:51 +00:00
Spencer McIntyre 3cd2b1b929 Update naming for consistency and the module 2022-01-24 10:35:40 -06:00
Ashley Donaldson d088be6fa0 Metasploit-side logic to support a 5th getsystem mechanism 2022-01-24 10:35:40 -06:00
sjanusz 158a0aa30c Change custom parser to Rex, add custom opt, add tabcomplete 2022-01-19 13:01:33 +00:00
sjanusz 21beb58ffb Add command to kill all Meterpreter channels 2022-01-07 12:12:14 +00:00
Spencer McIntyre cc2616b7cf Land #15982, Normalize smbuser to a string 2022-01-04 15:42:01 -05:00
RageLtMan 25e2fbd640 Do not redefine constant 2021-12-21 22:36:51 -05:00
3V3RYONE 56b19e5e9b Fix exploit session crashing when unsetting smbuser or smbpass 2021-12-19 19:02:17 +05:30
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
adfoster-r7 f1427fd383 Land #15944, Add support and tests for long arguments to Rex Parser 2021-12-15 14:55:44 +00:00
sjanusz 063c3936a9 Add support for long arguments to Rex Parser 2021-12-14 17:45:56 +00:00
sjanusz 210f704a77 Print error when session id is nil for kiwi creds_all 2021-12-14 10:16:52 +00:00
Spencer McIntyre ad0dba9385 Display st_mode using 6 octal digits 2021-12-09 13:43:00 -05:00
Spencer McIntyre 82a22ad38c Skip empty stat buffers
This skips empty stat buffers, allowing Meterpreter to return empty ones
for entries that can not be stat'ed and thus maintain the array
alignment.
2021-12-09 13:43:00 -05:00
Tim W 4696418089 Land #15939, Fix #15919, fix unpacking 64-bits stat buffers in meterpreter 2021-12-09 08:40:49 +00:00
Simon Janusz 46dc748bd0 Land #15905, Only normalize new/updated hosts after nmap import 2021-12-08 11:57:13 +00:00
Spencer McIntyre d94d2ff13c Fix unpacking 64-bit stat buffers from Meterpreter 2021-12-07 16:08:38 -05:00
Jeffrey Martin aebd989883 Land #15937, Remove references to Sorted Set 2021-12-06 12:00:46 -06:00
adfoster-r7 abd8ad6fa2 Remove references to Sorted Set 2021-12-06 16:01:01 +00:00
adfoster-r7 7dd5d5d3c2 Land #1585, Fix SMB SpiderShare Enum 2021-12-03 13:07:09 +00:00