@@ -53,8 +53,8 @@ def initialize(info = {})
53
53
[
54
54
Opt ::RPORT ( 80 ) ,
55
55
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' ] )
58
58
] , self . class
59
59
)
60
60
end
@@ -67,6 +67,11 @@ def authenticate
67
67
'uri' => normalize_uri ( target_uri . path , 'tiki-login_scr.php' ) ,
68
68
'method' => 'GET'
69
69
)
70
+
71
+ if res && res . code == 404
72
+ fail_with ( Failure ::Unknown , 'Target does not have tiki-login_scr.php' )
73
+ end
74
+
70
75
cookie = res ? res . get_cookies : ''
71
76
# if we have creds, login with them
72
77
vprint_status ( 'Attempting Login' )
@@ -88,7 +93,7 @@ def authenticate
88
93
# double check auth worked and we got a Log out on the page.
89
94
# at times I got it to auth, but then it would give permission errors
90
95
# 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/
92
97
fail_with ( Failure ::UnexpectedReply , "#{ peer } Login Failed with #{ datastore [ 'USERNAME' ] } :#{ datastore [ 'PASSWORD' ] } " )
93
98
end
94
99
vprint_good ( "Login Successful!" )
0 commit comments