Skip to content

Commit 4703278

Browse files
committed
Move SMB mixins into their own directory
1 parent ede804e commit 4703278

File tree

5 files changed

+29
-22
lines changed

5 files changed

+29
-22
lines changed

lib/msf/core/exploit/dcerpc.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module Exploit::Remote::DCERPC
2121
DCERPCPacket = Rex::Proto::DCERPC::Packet
2222
DCERPCClient = Rex::Proto::DCERPC::Client
2323
DCERPCResponse = Rex::Proto::DCERPC::Response
24-
DCERPCUUID = Rex::Proto::DCERPC::UUID
24+
DCERPCUUID = Rex::Proto::DCERPC::UUID
2525
NDR = Rex::Encoder::NDR
2626

2727

lib/msf/core/exploit/smb.rb

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
require 'rex/proto/dcerpc'
55
require 'rex/encoder/ndr'
66

7-
87
module Msf
98

109
###
@@ -18,7 +17,8 @@ module Msf
1817

1918
module Exploit::Remote::SMB
2019

21-
require 'msf/core/exploit/psexec'
20+
require 'msf/core/exploit/smb/authenticated'
21+
require 'msf/core/exploit/smb/psexec'
2222

2323
include Exploit::Remote::Tcp
2424
include Exploit::Remote::NTLM::Client
@@ -35,20 +35,6 @@ module Exploit::Remote::SMB
3535
DCERPCUUID = Rex::Proto::DCERPC::UUID
3636
NDR = Rex::Encoder::NDR
3737

38-
# Mini-mixin for making SMBUser/SMBPass/SMBDomain regular options vs advanced
39-
# Included when the module needs credentials to function
40-
module Authenticated
41-
def initialize(info = {})
42-
super
43-
register_options(
44-
[
45-
OptString.new('SMBUser', [ false, 'The username to authenticate as', '']),
46-
OptString.new('SMBPass', [ false, 'The password for the specified username', '']),
47-
OptString.new('SMBDomain', [ false, 'The Windows domain to use for authentication', 'WORKGROUP']),
48-
], Msf::Exploit::Remote::SMB::Authenticated)
49-
end
50-
end
51-
5238
def initialize(info = {})
5339
super
5440

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# -*- coding: binary -*-
2+
3+
module Msf
4+
5+
# Mini-mixin for making SMBUser/SMBPass/SMBDomain regular options vs advanced
6+
# Included when the module needs credentials to function
7+
module Exploit::Remote::SMB::Authenticated
8+
9+
include Msf::Exploit::Remote::SMB
10+
11+
def initialize(info = {})
12+
super
13+
register_options(
14+
[
15+
OptString.new('SMBUser', [ false, 'The username to authenticate as', '']),
16+
OptString.new('SMBPass', [ false, 'The password for the specified username', '']),
17+
OptString.new('SMBDomain', [ false, 'The Windows domain to use for authentication', 'WORKGROUP']),
18+
], Msf::Exploit::Remote::SMB::Authenticated)
19+
end
20+
end
21+
22+
end

lib/msf/core/exploit/psexec.rb renamed to lib/msf/core/exploit/smb/psexec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# -*- coding: binary -*-
12
require 'msf/core'
23
require 'msf/core/exploit/dcerpc'
34

@@ -11,10 +12,10 @@ module Msf
1112
# and runing a binary.
1213
####
1314

14-
module Exploit::Remote::Psexec
15+
module Exploit::Remote::SMB::Psexec
1516

1617
include Msf::Exploit::Remote::DCERPC
17-
include Msf::Exploit::Remote::SMB
18+
include Msf::Exploit::Remote::SMB::Authenticated
1819

1920
# Retrives output from the executed command
2021
#

modules/auxiliary/admin/smb/psexec_command.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
class Metasploit3 < Msf::Auxiliary
66

77
include Msf::Exploit::Remote::DCERPC
8-
include Msf::Exploit::Remote::SMB
9-
include Msf::Exploit::Remote::SMB::Authenticated
10-
include Msf::Exploit::Remote::Psexec
8+
include Msf::Exploit::Remote::SMB::Psexec
119
include Msf::Auxiliary::Report
1210
include Msf::Auxiliary::Scanner
1311

0 commit comments

Comments
 (0)