@@ -170,14 +170,20 @@ def get_os_info(ip, rport)
170
170
def lanman_netshareenum ( ip , rport , info )
171
171
shares = [ ]
172
172
173
- res = self . simple . client . trans (
174
- "\\ PIPE\\ LANMAN" ,
175
- (
176
- [ 0x00 ] . pack ( 'v' ) +
177
- "WrLeh\x00 " +
178
- "B13BWz\x00 " +
179
- [ 0x01 , 65406 ] . pack ( "vv" )
180
- ) )
173
+ begin
174
+ res = self . simple . client . trans (
175
+ "\\ PIPE\\ LANMAN" ,
176
+ (
177
+ [ 0x00 ] . pack ( 'v' ) +
178
+ "WrLeh\x00 " +
179
+ "B13BWz\x00 " +
180
+ [ 0x01 , 65406 ] . pack ( "vv" )
181
+ ) )
182
+ rescue ::Rex ::Proto ::SMB ::Exceptions ::ErrorCode => e
183
+ if e . error_code == 0xC00000BB
184
+ return srvsvc_netshareenum ( ip )
185
+ end
186
+ end
181
187
182
188
lerror , lconv , lentries , lcount = res [ 'Payload' ] . to_s [
183
189
res [ 'Payload' ] . v [ 'ParamOffset' ] ,
@@ -325,13 +331,13 @@ def cleanup
325
331
datastore [ 'SMBDirect' ] = @smb_redirect
326
332
end
327
333
334
+
328
335
def run_host ( ip )
329
336
@rport = datastore [ 'RPORT' ]
330
337
@smb_redirect = datastore [ 'SMBDirect' ]
331
338
shares = [ ]
332
339
333
340
[ [ 139 , false ] , [ 445 , true ] ] . each do |info |
334
- print_warning ( "Options modified: RPORT=#{ info [ 0 ] } , SMBDirect=#{ info [ 1 ] } " )
335
341
datastore [ 'RPORT' ] = info [ 0 ]
336
342
datastore [ 'SMBDirect' ] = info [ 1 ]
337
343
0 commit comments