lib/ronin/exploits/web.rb in ronin-exploits-0.2.1 vs lib/ronin/exploits/web.rb in ronin-exploits-0.3.0

- old
+ new

@@ -1,7 +1,6 @@ # -#-- # Ronin Exploits - A Ruby library for Ronin that provides exploitation and # payload crafting functionality. # # Copyright (c) 2007-2009 Hal Brodigan (postmodern.mod3 at gmail.com) # @@ -16,25 +15,32 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -#++ # require 'ronin/exploits/remote' -require 'ronin/sessions/http' +require 'ronin/network/helpers/http' require 'ronin/extensions/uri/http' require 'uri' module Ronin module Exploits class Web < Remote - include Sessions::HTTP + include Network::Helpers::HTTP + # + # Creates a new Ronin::Exploits::Web object using the given + # _block_. + # + # ronin_web_exploit do + # ... + # end + # contextify :ronin_web_exploit # The targeted URL path property :url_path, String @@ -54,13 +60,16 @@ # The optional URL path prefix parameter :url_prefix, :description => 'Optional URL path prefix' # - # Returns the targeted URL path based on the +url_prefix+ parameter + # Builds the targeted URL path based on the +url_prefix+ parameter, # as well as the +url_path+ and +url_query+ properties. # + # @return [String] + # The targeted URL path. + # def targeted_url_path url = self.url_path.to_s url << "?#{self.url_query}" if self.url_query if @url_prefix @@ -69,12 +78,15 @@ return url end # - # Returns the targeted URL based on the +http_host+, +http_port+ + # 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. + # + # @return [URI::Generic] + # The built URI object. # def targeted_url require_params :host url = ::URI::HTTP.build(