Skip to content

Commit

Permalink
Follow MS-LSAD and MS-LSAT spec for LSARPC & LookupSids
Browse files Browse the repository at this point in the history
  • Loading branch information
sjanusz-r7 committed May 16, 2024
1 parent 6911c35 commit d4778c2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

module Msf

module Exploit::Remote::MsLsarpc
module Exploit::Remote::MsLsad

include Msf::Exploit::Remote::SMB::Client::Ipc

Expand Down Expand Up @@ -69,16 +69,6 @@ def query_information_policy(policy_handle, information_class)
)
end

def lookup_sids(policy_handle, sids, lookup_level)
sids = [sids] unless sids.is_a?(Array)

self.lsarpc_pipe.lsar_lookup_sids(
policy_handle: policy_handle,
sids: sids,
lookup_level: lookup_level
)
end

def close_policy(policy_handle)
self.lsarpc_pipe.lsar_close_handle(
policy_handle: policy_handle
Expand Down
22 changes: 22 additions & 0 deletions lib/msf/core/exploit/remote/ms_lsat.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
###
#
# This mixin provides methods to look-up security identifiers on the remote SMB server.
#
# -*- coding: binary -*-

module Msf

module Exploit::Remote::MsLsat

def lookup_sids(policy_handle, sids, lookup_level)
sids = [sids] unless sids.is_a?(Array)

self.lsarpc_pipe.lsar_lookup_sids(
policy_handle: policy_handle,
sids: sids,
lookup_level: lookup_level
)
end

end
end
3 changes: 2 additions & 1 deletion modules/auxiliary/scanner/smb/smb_lookupsid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
class MetasploitModule < Msf::Auxiliary

# Exploit mixins should be called first
include Msf::Exploit::Remote::MsLsarpc
include Msf::Exploit::Remote::MsLsad
include Msf::Exploit::Remote::MsLsat
include Msf::Exploit::Remote::DCERPC

# Scanner mixin should be near last
Expand Down

0 comments on commit d4778c2

Please sign in to comment.