Skip to content

Commit f9bd079

Browse files
authored
Apply suggestions from code review
1 parent 7746c88 commit f9bd079

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/exploits/multi/http/atlassian_confluence_rce_cve_2024_21683.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def get_csrf(page, operation)
155155

156156
vprint_status("Grabbed #{operation} CSRF token: #{csrf_token}")
157157

158-
return csrf_token
158+
csrf_token
159159
end
160160

161161
def get_host_os
@@ -177,7 +177,7 @@ def get_host_os
177177
vprint_status("Target returned the operating system string '#{os}'")
178178

179179
# If the string begins with "win", assume the host is Windows. If it's anything else, assume it's something Unix-based.
180-
return os.downcase.start_with?('win') ? 'win' : 'nix'
180+
os.downcase.start_with?('win') ? 'win' : 'nix'
181181
end
182182

183183
def upload_payload(shell)
@@ -208,10 +208,10 @@ def upload_payload(shell)
208208
)
209209

210210
# Connection failure, no response, or malformed response.
211-
fail_with(Failure::Unknown, 'Target did not respond as expected during code execution attempt') unless res_upload
211+
print_error('Target did not respond as expected during code execution attempt') unless res_upload
212212

213213
# If the response to the multipart request does not return a 200.
214-
print_error(Failure::Unknown, 'The application returned a non-200 response during code execution attempt') unless res_upload.code == 200
214+
print_error('The application returned a non-200 response during code execution attempt') unless res_upload.code == 200
215215
end
216216

217217
def exploit

0 commit comments

Comments
 (0)