Skip to content

Commit a03cfce

Browse files
committed
Add table prefix and doc root as fallback options
1 parent d870031 commit a03cfce

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

modules/exploits/unix/webapp/kimai_sqli.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ def initialize(info={})
5454
register_options(
5555
[
5656
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_'])
5859
], self.class)
5960
end
6061

@@ -90,7 +91,7 @@ def exploit
9091
path = "#{$1}"
9192
print_good("#{peer} - Found file system path: #{path}")
9293
else
93-
path = normalize_uri(datastore['TARGETPATH'], target_uri.path)
94+
path = normalize_uri(datastore['FALLBACK_TARGET_PATH'], target_uri.path)
9495
print_warning("#{peer} - Could not retrieve file system path. Assuming '#{path}'")
9596
end
9697

@@ -103,7 +104,7 @@ def exploit
103104
table_prefix = "#{prefixes.flatten.last}"
104105
print_good("#{peer} - Found table name prefix: #{table_prefix}")
105106
else
106-
table_prefix = 'kimai_'
107+
table_prefix = normalize_uri(datastore['FALLBACK_TABLE_PREFIX'], target_uri.path)
107108
print_warning("#{peer} - Could not retrieve MySQL table name prefix. Assuming '#{table_prefix}'")
108109
end
109110

0 commit comments

Comments
 (0)