Skip to content

Commit a70b346

Browse files
author
jvazquez-r7
committed
2 parents e9a4f6d + 95b0735 commit a70b346

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

modules/auxiliary/scanner/smb/smb_enumshares.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ def initialize(info={})
2828
directories, files, time stamps, etc.
2929
3030
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.
3332
},
3433
'Author' =>
3534
[
@@ -79,13 +78,16 @@ def to_unix_time(thi, tlo)
7978

8079
def eval_host(ip, share)
8180
read = write = false
81+
82+
# srvsvc adds a null byte that needs to be removed
83+
share = share.chomp("\x00")
84+
8285
return false,false,nil,nil if share == 'IPC$'
8386

8487
self.simple.connect("\\\\#{ip}\\#{share}")
8588

8689
begin
8790
device_type = self.simple.client.queryfs_fs_device['device_type']
88-
8991
unless device_type
9092
vprint_error("\\\\#{ip}\\#{share}: Error querying filesystem device type")
9193
return false,false,nil,nil
@@ -373,7 +375,7 @@ def run_host(ip)
373375
:update => :unique_data
374376
)
375377

376-
if datastore['DIR_SHARE'] and not datastore['USE_SRVSVC_ONLY']
378+
if datastore['DIR_SHARE']
377379
get_files_info(ip, rport, shares, info)
378380
end
379381

0 commit comments

Comments
 (0)