@@ -48,7 +48,7 @@ def initialize(info={})
48
48
OptBool . new ( 'SpiderShares' , [ false , 'Spider shares recursively' , false ] ) ,
49
49
OptBool . new ( 'VERBOSE' , [ true , 'Show detailed information when spidering' , true ] ) ,
50
50
OptBool . new ( 'SpiderProfiles' , [ false , 'Spider only user profiles when share = C$' , true ] ) ,
51
- OptInt . new ( 'LogSpider' , [ false , '1 = CSV, 2 = table (txt), 3 = one liner (txt)' , 3 ] ) ,
51
+ OptEnum . new ( 'LogSpider' , [ false , '0 = disabled, 1 = CSV, 2 = table (txt), 3 = one liner (txt)' , 3 , [ 0 , 1 , 2 , 3 ] ] ) ,
52
52
OptInt . new ( 'MaxDepth' , [ true , 'Max number of subdirectories to spider' , 999 ] ) ,
53
53
OptBool . new ( 'USE_SRVSVC_ONLY' , [ true , 'List shares only with SRVSVC' , false ] )
54
54
] , self . class )
@@ -80,7 +80,7 @@ def to_unix_time(thi, tlo)
80
80
t . strftime ( "%m-%d-%Y %H:%M:%S" )
81
81
end
82
82
83
- def eval_host ( ip , share , subdir = "" )
83
+ def eval_host ( ip , share , subdir = "" )
84
84
read = write = false
85
85
86
86
# srvsvc adds a null byte that needs to be removed
@@ -417,13 +417,13 @@ def get_files_info(ip, rport, shares, info)
417
417
print_status ( "#{ ip } :#{ rport } - Spider #{ x } complete." ) unless datastore [ 'VERBOSE' ] == true
418
418
end
419
419
unless detailed_tbl . rows . empty?
420
- if datastore [ 'LogSpider' ] == 1
420
+ if datastore [ 'LogSpider' ] == '1'
421
421
p = store_loot ( 'smb.enumshares' , 'text/csv' , ip , detailed_tbl . to_csv )
422
422
print_good ( "#{ ip } - info saved in: #{ p . to_s } " )
423
- elsif datastore [ 'LogSpider' ] == 2
423
+ elsif datastore [ 'LogSpider' ] == '2'
424
424
p = store_loot ( 'smb.enumshares' , 'text' , ip , detailed_tbl )
425
425
print_good ( "#{ ip } - info saved in: #{ p . to_s } " )
426
- elsif datastore [ 'LogSpider' ] == 3
426
+ elsif datastore [ 'LogSpider' ] == '3'
427
427
p = store_loot ( 'smb.enumshares' , 'text' , ip , logdata )
428
428
print_good ( "#{ ip } - info saved in: #{ p . to_s } " )
429
429
end
0 commit comments