Class: Ronin::Exploits::Web

Inherits:
Remote show all
Includes:
Network::Helpers::HTTP
Defined in:
lib/ronin/exploits/web.rb

Instance Attribute Summary

Attributes inherited from Exploit

#encoded_payload, #encoders, #raw_payload, #restricted_chars, #target

Instance Method Summary collapse

Methods inherited from Exploit

#arch, #author, #behaviors, #build!, #build_payload!, #built?, #deploy!, #deployed?, #encode_payload, #encode_payload!, #exploit!, #initialize, #inspect, #os, #payload=, #product, #restrict, #targeted_archs, #targeted_oses, #targeted_products, #targeting, targeting_arch, targeting_os, targeting_product, #to_s, #use_target!, #verify!, written_by, written_for

Methods included from Verifiers

#verify_arch!, #verify_os!, #verify_product!, #verify_restricted!, #verify_target!

Methods included from Controls::Behaviors

#behaviors, #control, #control_helper, #control_model, #load_original!

Methods included from Payloads::HasPayload

#payload, #payload=, #use_payload!, #use_payload_class, #use_payload_from!

Constructor Details

This class inherits a constructor from Ronin::Exploits::Exploit

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Ronin::Exploits::Exploit

Instance Method Details

#targeted_urlURI::Generic

Builds the targeted URL based on the http_host, http_port and url_prefix parameters as well as the url_path and url_query properties.

Returns:

  • (URI::Generic)

    The built URI object.



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/ronin/exploits/web.rb', line 90

def targeted_url
  require_params :host

  url = ::URI::HTTP.build(
    :host => @host,
    :port => @port,
    :path => self.url_path,
    :query => self.url_query
  )

  if @url_prefix
    url.path = @url_prefix.to_s + url.path
  end

  return url
end

#targeted_url_pathString

Builds the targeted URL path based on the url_prefix parameter, as well as the url_path and url_query properties.

Returns:

  • (String)

    The targeted URL path.



71
72
73
74
75
76
77
78
79
80
# File 'lib/ronin/exploits/web.rb', line 71

def targeted_url_path
  url = self.url_path.to_s
  url << "?#{self.url_query}" if self.url_query

  if @url_prefix
    url = @url_prefix.to_s + url
  end

  return url
end