Skip to content

Commit

Permalink
Good bye get_resource
Browse files Browse the repository at this point in the history
  • Loading branch information
wchen-r7 committed Nov 12, 2013
1 parent f16aa91 commit fbe1b92
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions lib/msf/core/exploit/remote/browser_exploit_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,6 @@ def initialize(info={})
], Exploit::Remote::BrowserExploitServer)
end

#
# Removes the trailing slash for get_resource
#
def get_resource
super.chomp("/")
end

#
# Syncs a block of code
#
Expand All @@ -95,7 +88,7 @@ def sync(&block)
# @return [String] URI to the exploit page
#
def get_module_resource
"#{get_resource}/#{@exploit_receiver_page}"
"#{get_resource.chomp("/")}/#{@exploit_receiver_page}"
end

#
Expand Down Expand Up @@ -372,8 +365,8 @@ def get_detection_html(user_agent)
<% end %>
var query = objToQuery(d);
postInfo("<%=get_resource%>/<%=@info_receiver_page%>/", query);
window.location = "<%=get_resource%>/<%=@exploit_receiver_page%>/";
postInfo("<%=get_resource.chomp("/")%>/<%=@info_receiver_page%>/", query);
window.location = "<%=get_resource.chomp("/")%>/<%=@exploit_receiver_page%>/";
}
|).result(binding())

Expand All @@ -385,8 +378,8 @@ def get_detection_html(user_agent)
#{js}
</script>
<noscript>
<img style="visibility:hidden" src="#{get_resource}/#{@noscript_receiver_page}/">
<meta http-equiv="refresh" content="1; url=#{get_resource}/#{@exploit_receiver_page}/">
<img style="visibility:hidden" src="#{get_resource.chomp("/")}/#{@noscript_receiver_page}/">
<meta http-equiv="refresh" content="1; url=#{get_resource.chomp("/")}/#{@exploit_receiver_page}/">
</noscript>
|
end
Expand All @@ -399,12 +392,12 @@ def get_detection_html(user_agent)
#
def on_request_uri(cli, request)
case request.uri
when get_resource
when get_resource.chomp("/")
#
# This is the information gathering stage
#
if get_profile(retrieve_tag(request))
send_redirect(cli, "#{get_resource}/#{@exploit_receiver_page}")
send_redirect(cli, "#{get_resource.chomp("/")}/#{@exploit_receiver_page}")
return
end

Expand Down

0 comments on commit fbe1b92

Please sign in to comment.