Commit Graph

18 Commits

Author SHA1 Message Date
usiegl00 27c8210b27 Update smb_shadow module to fix rubocop errors
Use msftidy to fix the rubocop errors.
2022-04-06 07:12:46 +09:00
usiegl00 8495bff61c Merge master and update the smb_shadow module
Add comments detailing the technique used to attack SMBv3. Remove some
comments that are no longer needed. Fix Gemfile.lock conflict.
2022-04-06 07:06:45 +09:00
usiegl00 09ae52fecd Update smb_shadow and shadow_mitm_dispatcher
Remove duplicated print_status messages. Use respond_to? instead of
methods.include?. Simplify payload generation. Fix naming for the rst
capture thread.
2022-04-05 20:03:14 +09:00
usiegl00 7e010cbde2 Merge master and update smb_shadow + dispatcher
The smb_shadow module can confirm the server smb version supported with
the ConfirmServerDialect option. The shadow_mitm_dispatcher closes each
stream before opening a new one to prevent leaking file descriptors.
2022-04-02 10:39:02 +09:00
usiegl00 6d94a316cf Add packet fragmentation to ShadowMitmDispatcher
The ShadowMitmDispatcher now supports arbitrary size packets. The
ShadowMitmDispatcher now supports SMB3. The ShadowMitmDispatcher no
longer interferes with existing sessions.
2022-02-18 17:05:37 +09:00
usiegl00 72a0732009 Update ShadowMitmDispatcher to reduce ip lookups
The ShadowMitmDispatcher must be initialized with an interface, mac, and
ip address as keyword arguments. This prevents dispatchers from
retrieving the same network configuration multiple times.
2022-02-11 22:35:40 +09:00
usiegl00 8bf51dd1d8 Update smb_shadow and shadow_mitm_dispatcher
The dispatcher no longer uses an override flag, Instead the smb_shadow
module explicitly sets the attributes.
2022-01-31 14:49:18 +09:00
usiegl00 0259e586a9 Update smb_shadow module and rename MitmDispatcher
The MitmDispatcher is now the ShadowMitmDispatcher to help prevent name
confusion. Updated the ShadowMitmDispatcher to use native rex lib calls
to decode binary fields.
2022-01-28 08:39:07 +09:00
usiegl00 5cc716fa0d Add MitmDispatcher to the smb_shadow module
The MitmDispatcher reduces code repetition and enables the use of
standard RubySMB syntax. I have noticed increased power draw when using
the new dispatcher compared to the previous (less stateful) approach.
2022-01-21 14:57:07 +09:00
Christophe De La Fuente a458961631 Move the cleanup instance variables to the begining of #exploit 2022-01-07 20:34:58 +01:00
usiegl00 3051c5d9f5 Add mutex to cleanup in smb_shadow
The mutex will prevent multiple calls to cleanup when the module is
stopped with Ctrl-C. Add a Notes section to the documentation which
describes arpspoof usage and such.
2022-01-07 14:18:15 +09:00
usiegl00 cf6ab21467 Fix disabling of port 445 forwarding in smb_shadow
Update the iptables invocation to use the FORWARD table, which filters
packets being routed through the device. Add check for STATUS_PENDING
response from the server while creating the service.
2022-01-06 13:15:30 +09:00
usiegl00 204da6a0b4 Use packet filter anchor for pfctl in smb_shadow
The packet filter anchor will prevent the flushing of previous packet
filter rules. Using an anchor also allows us to remove the rule, instead
of disabling the filter.
2021-12-28 20:13:32 +09:00
usiegl00 609bf4be3c Update smb_shadow module to clean unnecessary code
Remove the return statement after fail_with which will never be reached.
Add documentation for the module options. Reset the packet forwarding
settings during the module cleanup.
2021-12-07 08:41:52 +09:00
usiegl00 260ea0725c Update smb_shadow module and docs for review
Add mutex to module to prevent race condition. Add sleep to after arp
query to prevent arp cache restoration. Add DefangedMode to indicate
system network changes. Change module INTERFACE option to be explicit.
Remove unnecessary module payload parameters. Add module Notes.
2021-12-03 14:33:40 +09:00
usiegl00 bfd57daea7 Update Range Syntax to Support Ruby 2.5
Change [?..] to [?..-1] to be compatible with older ruby versions. Fix
failing msftidy rubocop linting tests.
2021-11-25 15:05:39 +09:00
usiegl00 e19511a31c Update documentation for the smb_shadow module.
Add additional clarity and details to the existing documentation for the
smb_shadow module. Remove some outdated comments and fix some spelling
errors.
2021-11-25 08:12:13 +09:00
usiegl00 e2734293e1 Add SMB Shadow Module: Direct SMB Session Takeover
This module intercepts direct SMB connections on the LAN.
Both the SMB Server and Client must be on the LAN.
The SMB Client must be authenticating to the Server as an Administrator.
This module is dependent on an external ARP spoofer.
2021-11-24 20:05:30 +09:00