Skip to content

Commit 1e1866f

Browse files
committed
Fix rapid7#7158, tiki_calendar_exec incorrectly reports successful login
Fix rapid7#7158
1 parent c682490 commit 1e1866f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

modules/exploits/linux/http/tiki_calendar_exec.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ def initialize(info = {})
5353
[
5454
Opt::RPORT(80),
5555
OptString.new('TARGETURI', [ true, 'The URI of Tiki-Wiki', '/']),
56-
OptString.new('USERNAME', [ false, 'Username of a user with calendar access', 'admin']),
57-
OptString.new('PASSWORD', [ false, 'Password of a user with calendar access', 'admin'])
56+
OptString.new('USERNAME', [ true, 'Username of a user with calendar access', 'admin']),
57+
OptString.new('PASSWORD', [ true, 'Password of a user with calendar access', 'admin'])
5858
], self.class
5959
)
6060
end
@@ -67,6 +67,11 @@ def authenticate
6767
'uri' => normalize_uri(target_uri.path, 'tiki-login_scr.php'),
6868
'method' => 'GET'
6969
)
70+
71+
if res && res.code == 404
72+
fail_with(Failure::Unknown, 'Target does not have tiki-login_scr.php')
73+
end
74+
7075
cookie = res ? res.get_cookies : ''
7176
# if we have creds, login with them
7277
vprint_status('Attempting Login')
@@ -88,7 +93,7 @@ def authenticate
8893
# double check auth worked and we got a Log out on the page.
8994
# at times I got it to auth, but then it would give permission errors
9095
# so we want to try to double check everything is good
91-
if res && !res.body =~ /Log out/
96+
if res && res.body !~ /Log out/
9297
fail_with(Failure::UnexpectedReply, "#{peer} Login Failed with #{datastore['USERNAME']}:#{datastore['PASSWORD']}")
9398
end
9499
vprint_good("Login Successful!")

0 commit comments

Comments
 (0)