@@ -28,8 +28,7 @@ def initialize(info={})
28
28
directories, files, time stamps, etc.
29
29
30
30
By default, a netshareenum request is done in order to retrieve share information,
31
- but if this fails, you may also fall back to SRVSVC. When SRVSVC is used, please
32
- note the module will not attempt to enumerate more info like netshareenum.
31
+ but if this fails, you may also fall back to SRVSVC.
33
32
} ,
34
33
'Author' =>
35
34
[
@@ -79,13 +78,16 @@ def to_unix_time(thi, tlo)
79
78
80
79
def eval_host ( ip , share )
81
80
read = write = false
81
+
82
+ # srvsvc adds a null byte that needs to be removed
83
+ share = share . chomp ( "\x00 " )
84
+
82
85
return false , false , nil , nil if share == 'IPC$'
83
86
84
87
self . simple . connect ( "\\ \\ #{ ip } \\ #{ share } " )
85
88
86
89
begin
87
90
device_type = self . simple . client . queryfs_fs_device [ 'device_type' ]
88
-
89
91
unless device_type
90
92
vprint_error ( "\\ \\ #{ ip } \\ #{ share } : Error querying filesystem device type" )
91
93
return false , false , nil , nil
@@ -373,7 +375,7 @@ def run_host(ip)
373
375
:update => :unique_data
374
376
)
375
377
376
- if datastore [ 'DIR_SHARE' ] and not datastore [ 'USE_SRVSVC_ONLY' ]
378
+ if datastore [ 'DIR_SHARE' ]
377
379
get_files_info ( ip , rport , shares , info )
378
380
end
379
381
0 commit comments