diff --git a/doc/Array.html b/doc/Array.html index 3d5fe734..3019df95 100644 --- a/doc/Array.html +++ b/doc/Array.html @@ -226,7 +226,7 @@
-
# File lib/common_helper.rb, line 106
+            
# File lib/common_helper.rb, line 111
 def _grep_(regexp)
   matches = []
   self.each do |value|
diff --git a/doc/Browser.html b/doc/Browser.html
index 0ca3928f..cce6590c 100644
--- a/doc/Browser.html
+++ b/doc/Browser.html
@@ -88,7 +88,7 @@
     
     
  • #proxy_auth= -
  • #raise_invalid_proxy_format +
  • #raise_invalid_proxy_auth_format
  • #user_agent @@ -297,7 +297,7 @@
    -
    # File lib/browser.rb, line 60
    +            
    # File lib/browser.rb, line 64
     def self.instance(options = {})
       unless @@instance
         @@instance = new(options)
    @@ -330,7 +330,7 @@
     
               
               
    -
    # File lib/browser.rb, line 67
    +            
    # File lib/browser.rb, line 71
     def self.reset
       @@instance = nil
     end
    @@ -366,7 +366,7 @@
    -
    # File lib/browser.rb, line 167
    +            
    # File lib/browser.rb, line 178
     def forge_request(url, params = {})
       Typhoeus::Request.new(
         url.to_s,
    @@ -399,7 +399,7 @@
     
               
               
    -
    # File lib/browser.rb, line 155
    +            
    # File lib/browser.rb, line 166
     def get(url, params = {})
       run_request(
         forge_request(url, params.merge(:method => :get))
    @@ -434,7 +434,7 @@ browser object, hydra will not have the new @max_threads and
     
               
               
    -
    # File lib/browser.rb, line 127
    +            
    # File lib/browser.rb, line 136
     def load_config(config_file = nil)
       @config_file = config_file || @config_file
     
    @@ -472,7 +472,7 @@ browser object, hydra will not have the new @max_threads and
     
               
               
    -
    # File lib/browser.rb, line 96
    +            
    # File lib/browser.rb, line 101
     def max_threads=(max_threads)
       if max_threads.nil? or max_threads <= 0
         max_threads = 1
    @@ -505,7 +505,7 @@ browser object, hydra will not have the new @max_threads and
     
               
               
    -
    # File lib/browser.rb, line 174
    +            
    # File lib/browser.rb, line 185
     def merge_request_params(params = {})
       if @proxy
         params = params.merge(:proxy => @proxy)
    @@ -570,7 +570,7 @@ browser object, hydra will not have the new @max_threads and
     
               
               
    -
    # File lib/browser.rb, line 161
    +            
    # File lib/browser.rb, line 172
     def post(url, params = {})
       run_request(
         forge_request(url, params.merge(:method => :post))
    @@ -602,7 +602,7 @@ browser object, hydra will not have the new @max_threads and
     
               
               
    -
    # File lib/browser.rb, line 103
    +            
    # File lib/browser.rb, line 108
     def proxy_auth=(auth)
       unless auth.nil?
         if auth.is_a?(Hash)
    @@ -612,12 +612,15 @@ browser object, hydra will not have the new @max_threads and
           @proxy_auth = auth
         elsif auth.is_a?(String)
           if matches = %r{([^:]+):(.*)}.match(auth)
    -        @proxy_auth = {:proxy_username => matches[1], :proxy_password => matches[2]}
    +        @proxy_auth = {
    +          proxy_username: matches[1],
    +          proxy_password: matches[2]
    +        }
           else
    -        raise_invalid_proxy_format()
    +        raise_invalid_proxy_auth_format()
           end
         else
    -      raise_invalid_proxy_format()
    +      raise_invalid_proxy_auth_format()
         end
       end
     end
    @@ -631,10 +634,10 @@ browser object, hydra will not have the new @max_threads and
    -
    +
    - raise_invalid_proxy_formatraise_invalid_proxy_auth_format() click to toggle source
    @@ -646,19 +649,19 @@ browser object, hydra will not have the new @max_threads and -
    -
    # File lib/browser.rb, line 122
    -def raise_invalid_proxy_format
    -  raise "Invalid proxy auth format, expected username:password or {:proxy_username => username, :proxy_password => password}"
    +          
    +
    # File lib/browser.rb, line 130
    +def raise_invalid_proxy_auth_format
    +  raise 'Invalid proxy auth format, expected username:password or {proxy_username: username, proxy_password: password}'
     end
    -
    +
    -
    +
    @@ -677,15 +680,15 @@ browser object, hydra will not have the new @max_threads and
    -
    # File lib/browser.rb, line 84
    +            
    # File lib/browser.rb, line 89
     def user_agent
       case @user_agent_mode
    -    when "semi-static"
    -      unless @user_agent
    -        @user_agent = @available_user_agents.sample
    -      end
    -    when "random"
    +  when 'semi-static'
    +    unless @user_agent
           @user_agent = @available_user_agents.sample
    +    end
    +  when 'random'
    +    @user_agent = @available_user_agents.sample
       end
       @user_agent
     end
    @@ -715,14 +718,15 @@ browser object, hydra will not have the new @max_threads and
    -
    # File lib/browser.rb, line 71
    +            
    # File lib/browser.rb, line 75
     def user_agent_mode=(ua_mode)
    -  ua_mode ||= "static"
    +  ua_mode ||= 'static'
     
       if USER_AGENT_MODES.include?(ua_mode)
         @user_agent_mode = ua_mode
    -    # For semi-static user agent mode, the user agent has to be nil the first time (it will be set with the getter)
    -    @user_agent = nil if ua_mode === "semi-static"
    +    # For semi-static user agent mode, the user agent has to
    +    # be nil the first time (it will be set with the getter)
    +    @user_agent = nil if ua_mode === 'semi-static'
       else
         raise "Unknow user agent mode : '#{ua_mode}'"
       end
    diff --git a/doc/BruteForce.html b/doc/BruteForce.html
    index d4a0c730..86a4de4e 100644
    --- a/doc/BruteForce.html
    +++ b/doc/BruteForce.html
    @@ -224,7 +224,7 @@ on large wordlists, although bareable.

    # File lib/wpscan/modules/brute_force.rb, line 117
     def self.lines_in_file(file_path)
       lines = 0
    -  File.open(file_path, 'r').each { || lines += 1 }
    +  File.open(file_path, 'r').each { |_| lines += 1 }
       lines
     end
    @@ -274,10 +274,10 @@ on large wordlists, although bareable.

    request_count = 0 password_found = false - File.open(wordlist_path, "r").each do |password| + File.open(wordlist_path, 'r').each do |password| # ignore file comments, but will miss passwords if they start with a hash... - next if password[0,1] == "#" + next if password[0, 1] == '#' # keep a count of the amount of requests to be sent request_count += 1 @@ -290,9 +290,9 @@ on large wordlists, although bareable.

    # the request object request = Browser.instance.forge_request(login_url, { - :method => :post, - :params => {:log => username, :pwd => password}, - :cache_timeout => 0 + method: :post, + params: { log: URI::encode(username), pwd: URI::encode(password) }, + cache_timeout: 0 } ) @@ -304,20 +304,20 @@ on large wordlists, although bareable.

    if response.body =~ %rlogin_error/ puts "\nIncorrect username and/or password." if @verbose elsif response.code == 302 - puts "\n " + green("[SUCCESS]") + " Username : #{username} Password : #{password}\n" if show_progression - found << { :name => username, :password => password } + puts "\n " + green('[SUCCESS]') + " Username : #{username} Password : #{password}\n" if show_progression + found << { name: username, password: password } password_found = true elsif response.timed_out? - puts red("ERROR:") + " Request timed out." if show_progression + puts red('ERROR:') + ' Request timed out.' if show_progression elsif response.code == 0 - puts red("ERROR:") + " No response from remote server. WAF/IPS?" if show_progression + puts red('ERROR:') + ' No response from remote server. WAF/IPS?' if show_progression # code is a fixnum, needs a string for regex elsif response.code.to_s =~ %r^50/ - puts red("ERROR:") + " Server error, try reducing the number of threads." if show_progression + puts red('ERROR:') + ' Server error, try reducing the number of threads.' if show_progression else - puts "\n" + red("ERROR:") + " We recieved an unknown response for #{password}..." if show_progression + puts "\n" + red('ERROR:') + " We recieved an unknown response for #{password}..." if show_progression - # ugly method to get the coverage :/ (otherwise some output is present in the rspec) + # HACK to get the coverage :/ (otherwise some output is present in the rspec) puts red("Code: #{response.code.to_s}") if @verbose puts red("Body: #{response.body}") if @verbose puts if @verbose diff --git a/doc/CacheFileStore.html b/doc/CacheFileStore.html index 8274aaa9..1b86f843 100644 --- a/doc/CacheFileStore.html +++ b/doc/CacheFileStore.html @@ -260,19 +260,23 @@
    -

    The serializer must have the 2 methods .load and .dump (Marshal and YAML -have them) YAML is Human Readable, contrary to Marshal which store in a -binary format Marshal does not need any “require”

    +

    The serializer must have the 2 methods .load and .dump

    + +
    (Marshal and YAML have them)
    + +

    YAML is Human Readable, contrary to Marshal which store in a binary format +Marshal does not need any “require”

    -
    # File lib/cache_file_store.rb, line 34
    +            
    # File lib/cache_file_store.rb, line 36
     def initialize(storage_path, serializer = Marshal)
       @storage_path = File.expand_path(storage_path)
       @serializer = serializer
     
    -  # File.directory? for ruby <= 1.9 otherwise, it makes more sense to do Dir.exist? :/
    +  # File.directory? for ruby <= 1.9 otherwise,
    +  # it makes more sense to do Dir.exist? :/
       unless File.directory?(@storage_path)
         Dir.mkdir(@storage_path)
       end
    @@ -309,7 +313,7 @@ binary format Marshal does not need any “require”

    -
    # File lib/cache_file_store.rb, line 44
    +            
    # File lib/cache_file_store.rb, line 47
     def clean
       Dir[File.join(@storage_path, '*')].each do |f|
         File.delete(f)
    @@ -341,7 +345,7 @@ binary format Marshal does not need any “require”

    -
    # File lib/cache_file_store.rb, line 66
    +            
    # File lib/cache_file_store.rb, line 69
     def get_entry_file_path(key)
       @storage_path + '/' + key
     end
    @@ -371,7 +375,7 @@ binary format Marshal does not need any “require”

    -
    # File lib/cache_file_store.rb, line 50
    +            
    # File lib/cache_file_store.rb, line 53
     def read_entry(key)
       entry_file_path = get_entry_file_path(key)
     
    @@ -405,7 +409,7 @@ binary format Marshal does not need any “require”

    -
    # File lib/cache_file_store.rb, line 58
    +            
    # File lib/cache_file_store.rb, line 61
     def write_entry(key, data_to_store, cache_timeout)
       if cache_timeout > 0
         File.open(get_entry_file_path(key), 'w') do |f|
    diff --git a/doc/CheckerPlugin.html b/doc/CheckerPlugin.html
    new file mode 100644
    index 00000000..8b862477
    --- /dev/null
    +++ b/doc/CheckerPlugin.html
    @@ -0,0 +1,483 @@
    +
    +
    +
    +
    +
    +
    +class CheckerPlugin - RDoc Documentation
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    class CheckerPlugin

    + +
    + +
    WPScan - WordPress Security Scanner
    +Copyright (C) 2012-2013
    +
    +This program is free software: you can redistribute it and/or modify
    +it under the terms of the GNU General Public License as published by
    +the Free Software Foundation, either version 3 of the License, or
    +(at your option) any later version.
    +
    +This program is distributed in the hope that it will be useful,
    +but WITHOUT ANY WARRANTY; without even the implied warranty of
    +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    +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, see <http://www.gnu.org/licenses/>.
    + +

    ++

    + +
    + + + + +
    + + + + + + + + + + +
    +

    Public Class Methods

    + + +
    + +
    + new() + click to toggle source +
    + + +
    + + + + + +
    +
    # File lib/wpstools/plugins/checker/checker_plugin.rb, line 21
    +def initialize
    +  super(author: 'WPScanTeam - @erwanlr')
    +
    +  register_options(
    +    ['--check-vuln-ref-urls', '--cvru', 'Check all the vulnerabilities reference urls for 404'],
    +    ['--check-local-vulnerable-files LOCAL_DIRECTORY', '--clvf', 'Perform a recursive scan in the LOCAL_DIRECTORY to find vulnerable files or shells']
    +  )
    +end
    +
    + +
    + + + + +
    + + +
    + +
    +

    Public Instance Methods

    + + +
    + +
    + check_local_vulnerable_files(dir_to_scan) + click to toggle source +
    + + +
    + + + + + +
    +
    # File lib/wpstools/plugins/checker/checker_plugin.rb, line 93
    +def check_local_vulnerable_files(dir_to_scan)
    +  if Dir::exist?(dir_to_scan)
    +    xml_file               = LOCAL_FILES_FILE
    +    local_hashes           = {}
    +    file_extension_to_scan = '*.{js,php,swf,html,htm}'
    +
    +    print '[+] Generating local hashes ... '
    +
    +    Dir[File::join(dir_to_scan, '**', file_extension_to_scan)].each do |filename|
    +      sha1sum = Digest::SHA1.file(filename).hexdigest
    +
    +      if local_hashes.has_key?(sha1sum)
    +        local_hashes[sha1sum] << filename
    +      else
    +        local_hashes[sha1sum] = [filename]
    +      end
    +    end
    +
    +    puts 'done.'
    +
    +    puts '[+] Checking for vulnerable files ...'
    +
    +    xml = Nokogiri::XML(File.open(xml_file)) do |config|
    +      config.noblanks
    +    end
    +
    +    xml.xpath('//hash').each do |node|
    +      sha1sum = node.attribute('sha1').text
    +
    +      if local_hashes.has_key?(sha1sum)
    +        local_filenames = local_hashes[sha1sum]
    +        vuln_title      = node.search('title').text
    +        vuln_filename   = node.search('file').text
    +        vuln_refrence   = node.search('reference').text
    +
    +        puts "  #{vuln_filename} found :"
    +        puts '  | Location(s):'
    +        local_filenames.each do |file|
    +          puts "  |  - #{file}"
    +        end
    +        puts '  |'
    +        puts "  | Title: #{vuln_title}"
    +        puts "  | Refrence: #{vuln_refrence}" if !vuln_refrence.empty?
    +        puts
    +      end
    +    end
    +
    +    puts 'done.'
    +
    +  else
    +    puts "The supplied directory '#{dir_to_scan}' does not exist"
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + check_vuln_ref_urls() + click to toggle source +
    + + +
    + + + + + +
    +
    # File lib/wpstools/plugins/checker/checker_plugin.rb, line 40
    +def check_vuln_ref_urls
    +  vuln_ref_files   = [PLUGINS_VULNS_FILE, THEMES_VULNS_FILE, WP_VULNS_FILE]
    +  error_codes      = [404, 500, 403]
    +  not_found_regexp = %r{No Results Found|error 404|ID Invalid or Not Found}
    +
    +  puts '[+] Checking vulnerabilities reference urls'
    +
    +  vuln_ref_files.each do |vuln_ref_file|
    +    xml = Nokogiri::XML(File.open(vuln_ref_file)) do |config|
    +      config.noblanks
    +    end
    +
    +    urls = []
    +    xml.xpath('//reference').each { |node| urls << node.text }
    +
    +    urls.uniq!
    +
    +    dead_urls       = []
    +    queue_count     = 0
    +    request_count   = 0
    +    browser         = Browser.instance
    +    hydra           = browser.hydra
    +    number_of_urls  = urls.size
    +
    +    urls.each do |url|
    +      request = browser.forge_request(url, { cache_timeout: 0, follow_location: true })
    +      request_count += 1
    +
    +      request.on_complete do |response|
    +        print "\r  [+] Checking #{vuln_ref_file} #{number_of_urls} total ... #{(request_count * 100) / number_of_urls}% complete."
    +
    +        if error_codes.include?(response.code) or not_found_regexp.match(response.body)
    +          dead_urls << url
    +        end
    +      end
    +
    +      hydra.queue(request)
    +      queue_count += 1
    +
    +      if queue_count == browser.max_threads
    +        hydra.run
    +        queue_count = 0
    +      end
    +    end
    +
    +    hydra.run
    +    puts
    +    unless dead_urls.empty?
    +      dead_urls.each { |url| puts "    Not Found #{url}" }
    +    end
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + run(options = {}) + click to toggle source +
    + + +
    + + + + + +
    +
    # File lib/wpstools/plugins/checker/checker_plugin.rb, line 30
    +def run(options = {})
    +  if options[:check_vuln_ref_urls]
    +    check_vuln_ref_urls
    +  end
    +
    +  if options[:check_local_vulnerable_files]
    +    check_local_vulnerable_files(options[:check_local_vulnerable_files])
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + +
    + + + + diff --git a/doc/CustomOptionParser.html b/doc/CustomOptionParser.html new file mode 100644 index 00000000..ede810f2 --- /dev/null +++ b/doc/CustomOptionParser.html @@ -0,0 +1,474 @@ + + + + + + +class CustomOptionParser - RDoc Documentation + + + + + + + + + + + + + + + + +
    +

    class CustomOptionParser

    + +
    + +
    WPScan - WordPress Security Scanner
    +Copyright (C) 2012-2013
    +
    +This program is free software: you can redistribute it and/or modify
    +it under the terms of the GNU General Public License as published by
    +the Free Software Foundation, either version 3 of the License, or
    +(at your option) any later version.
    +
    +This program is distributed in the hope that it will be useful,
    +but WITHOUT ANY WARRANTY; without even the implied warranty of
    +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    +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, see <http://www.gnu.org/licenses/>.
    + +

    ++

    + +
    + + + + +
    + + + + + + + + +
    +

    Attributes

    + + +
    +
    + symbols_used[R] +
    + +
    + + + +
    +
    + +
    + + + + +
    +

    Public Class Methods

    + + +
    + +
    + new(banner = nil, width = 32, indent = ' ' * 4) + click to toggle source +
    + + +
    + + + + + +
    +
    # File lib/common/custom_option_parser.rb, line 23
    +def initialize(banner = nil, width = 32, indent = ' ' * 4)
    +  @results         = {}
    +  @symbols_used    = []
    +  super(banner, width, indent)
    +end
    +
    + +
    + + + + +
    + + +
    + +
    +

    Protected Class Methods

    + + +
    + +
    + option_to_symbol(option) + click to toggle source +
    + + +
    + +

    param Array option

    + + + +
    +
    # File lib/common/custom_option_parser.rb, line 73
    +def self.option_to_symbol(option)
    +  option_name = nil
    +
    +  option.each do |option_attr|
    +    if option_attr =~ %r^--/
    +      option_name = option_attr
    +      break
    +    end
    +  end
    +
    +  if option_name
    +    option_name = option_name.gsub(%r^--/, '').gsub(%r-/, '_').gsub(%r .*$/, '')
    +    :"#{option_name}"
    +  else
    +    raise "Could not find the option name for #{option}"
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    +

    Public Instance Methods

    + + +
    + +
    + add(options) + click to toggle source +
    + + +
    + +

    param Array(Array) or Array options

    + + + +
    +
    # File lib/common/custom_option_parser.rb, line 31
    +def add(options)
    +  if options.is_a?(Array)
    +    if options[0].is_a?(Array)
    +      options.each do |option|
    +        add_option(option)
    +      end
    +    else
    +      add_option(options)
    +    end
    +  else
    +    raise "Options must be at least an Array, or an Array(Array). #{options.class} supplied"
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + add_option(option) + click to toggle source +
    + + +
    + +

    param Array option

    + + + +
    +
    # File lib/common/custom_option_parser.rb, line 46
    +def add_option(option)
    +  if option.is_a?(Array)
    +    option_symbol = CustomOptionParser::option_to_symbol(option)
    +
    +    unless @symbols_used.include?(option_symbol)
    +      @symbols_used << option_symbol
    +
    +      self.on(*option) do |arg|
    +        @results[option_symbol] = arg
    +      end
    +    else
    +      raise "The option #{option_symbol} is already used !"
    +    end
    +  else
    +    raise "The option must be an array, #{option.class} supplied : '#{option}'"
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + results(argv = default_argv) + click to toggle source +
    + + +
    + +

    return Hash

    + + + +
    +
    # File lib/common/custom_option_parser.rb, line 65
    +def results(argv = default_argv)
    +  self.parse!(argv) if @results.empty?
    +
    +  @results
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + +
    + + + + diff --git a/doc/GenerateList.html b/doc/GenerateList.html new file mode 100644 index 00000000..10029895 --- /dev/null +++ b/doc/GenerateList.html @@ -0,0 +1,518 @@ + + + + + + +class GenerateList - RDoc Documentation + + + + + + + + + + + + + + + + +
    +

    class GenerateList

    + +
    + +

    This tool generates a list to use for plugin and theme enumeration

    + +
    + + + + +
    + + + + + + + + +
    +

    Attributes

    + + +
    +
    + verbose[RW] +
    + +
    + + + +
    +
    + +
    + + + + +
    +

    Public Class Methods

    + + +
    + +
    + new(type, verbose) + click to toggle source +
    + + +
    + +

    type = themes | plugins

    + + + +
    +
    # File lib/wpstools/plugins/list_generator/generate_list.rb, line 25
    +def initialize(type, verbose)
    +  if type =~ %rplugins/
    +    @type           = 'plugin'
    +    @svn_url        = 'http://plugins.svn.wordpress.org/'
    +    @popular_url    = 'http://wordpress.org/extend/plugins/browse/popular/'
    +    @popular_regex  = %r{<h3><a href="http://wordpress.org/extend/plugins/(.+)/">.+</a></h3>}
    +  elsif type =~ %rthemes/
    +    @type           = 'theme'
    +    @svn_url        = 'http://themes.svn.wordpress.org/'
    +    @popular_url    = 'http://wordpress.org/extend/themes/browse/popular/'
    +    @popular_regex  = %r{<h3><a href="http://wordpress.org/extend/themes/(.+)">.+</a></h3>}
    +  else
    +    raise "Type #{type} not defined"
    +  end
    +  @verbose  = verbose
    +  @browser  = Browser.instance
    +  @hydra    = @browser.hydra
    +end
    +
    + +
    + + + + +
    + + +
    + +
    +

    Public Instance Methods

    + + +
    + +
    + generate_full_list() + click to toggle source +
    + + +
    + + + + + +
    +
    # File lib/wpstools/plugins/list_generator/generate_list.rb, line 69
    +def generate_full_list
    +  set_file_name(:full)
    +  items = SvnParser.new(@svn_url).parse
    +  save items
    +end
    +
    + +
    + + + + +
    + + + + + + + + +
    + +
    + save(items) + click to toggle source +
    + + +
    + +

    Save the file

    + + + +
    +
    # File lib/wpstools/plugins/list_generator/generate_list.rb, line 120
    +def save(items)
    +  items.sort!
    +  items.uniq!
    +  puts "[*] We have parsed #{items.length} #@types"
    +  File.open(@file_name, 'w') { |f| f.puts(items) }
    +  puts "New #@file_name file created"
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + set_file_name(type) + click to toggle source +
    + + +
    + + + + + +
    +
    # File lib/wpstools/plugins/list_generator/generate_list.rb, line 44
    +def set_file_name(type)
    +  case @type
    +  when 'plugin'
    +    case type
    +    when :full
    +      @file_name = PLUGINS_FULL_FILE
    +    when :popular
    +      @file_name = PLUGINS_FILE
    +    else
    +      raise 'Unknown type'
    +    end
    +  when 'theme'
    +    case type
    +    when :full
    +      @file_name = THEMES_FULL_FILE
    +    when :popular
    +      @file_name = THEMES_FILE
    +    else
    +      raise 'Unknown type'
    +    end
    +    else
    +      raise "Unknown type #@type"
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + +
    + + + + diff --git a/doc/GitUpdater.html b/doc/GitUpdater.html index 2b019b75..14fb6a9e 100644 --- a/doc/GitUpdater.html +++ b/doc/GitUpdater.html @@ -234,7 +234,7 @@
    -
    # File lib/updater/git_updater.rb, line 37
    +            
    # File lib/updater/git_updater.rb, line 38
     def has_local_changes?
       %x[git #{repo_directory_arguments()} diff --exit-code 2>&1] =~ %rdiff/ ? true : false
     end
    @@ -295,7 +295,7 @@ the last commit hash

    -
    # File lib/updater/git_updater.rb, line 28
    +            
    # File lib/updater/git_updater.rb, line 29
     def local_revision_number
       git_log = %x[git #{repo_directory_arguments()} log -1 2>&1]
       git_log[%rcommit ([0-9a-z]{7})/, 1].to_s
    @@ -326,7 +326,7 @@ the last commit hash

    -
    # File lib/updater/git_updater.rb, line 41
    +            
    # File lib/updater/git_updater.rb, line 42
     def reset_head
       %x[git #{repo_directory_arguments()} reset --hard HEAD]
     end
    @@ -356,7 +356,7 @@ the last commit hash

    -
    # File lib/updater/git_updater.rb, line 33
    +            
    # File lib/updater/git_updater.rb, line 34
     def update
       %x[git #{repo_directory_arguments()} pull]
     end
    @@ -392,7 +392,7 @@ the last commit hash

    -
    # File lib/updater/git_updater.rb, line 46
    +            
    # File lib/updater/git_updater.rb, line 47
     def repo_directory_arguments
       if @repo_directory
         return "--git-dir=\"#{@repo_directory}/.git\" --work-tree=\"#{@repo_directory}\""
    diff --git a/doc/ListGeneratorPlugin.html b/doc/ListGeneratorPlugin.html
    new file mode 100644
    index 00000000..bdc55889
    --- /dev/null
    +++ b/doc/ListGeneratorPlugin.html
    @@ -0,0 +1,348 @@
    +
    +
    +
    +
    +
    +
    +class ListGeneratorPlugin - RDoc Documentation
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    class ListGeneratorPlugin

    + +
    + +
    WPScan - WordPress Security Scanner
    +Copyright (C) 2012-2013
    +
    +This program is free software: you can redistribute it and/or modify
    +it under the terms of the GNU General Public License as published by
    +the Free Software Foundation, either version 3 of the License, or
    +(at your option) any later version.
    +
    +This program is distributed in the hope that it will be useful,
    +but WITHOUT ANY WARRANTY; without even the implied warranty of
    +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    +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, see <http://www.gnu.org/licenses/>.
    + +

    ++

    + +
    + + + + +
    + + + + + + + + + + +
    +

    Public Class Methods

    + + +
    + +
    + new() + click to toggle source +
    + + +
    + + + + + +
    +
    # File lib/wpstools/plugins/list_generator/list_generator_plugin.rb, line 21
    +def initialize
    +  super(author: 'WPScanTeam - @FireFart')
    +
    +  register_options(
    +    ['--generate-plugin-list [NUMBER_OF_PAGES]', '--gpl', Integer, 'Generate a new data/plugins.txt file. (supply number of *pages* to parse, default : 150)'],
    +    ['--generate-full-plugin-list', '--gfpl', 'Generate a new full data/plugins.txt file'],
    +
    +    ['--generate-theme-list [NUMBER_OF_PAGES]', '--gtl', Integer, 'Generate a new data/themes.txt file. (supply number of *pages* to parse, default : 150)'],
    +    ['--generate-full-theme-list', '--gftl', 'Generate a new full data/themes.txt file'],
    +
    +    ['--generate-all', '--ga', 'Generate a new full plugins, full themes, popular plugins and popular themes list']
    +  )
    +end
    +
    + +
    + + + + +
    + + +
    + +
    +

    Public Instance Methods

    + + +
    + +
    + run(options = {}) + click to toggle source +
    + + +
    + + + + + +
    +
    # File lib/wpstools/plugins/list_generator/list_generator_plugin.rb, line 35
    +def run(options = {})
    +  verbose      = options[:verbose] || false
    +  generate_all = options[:generate_all] || false
    +
    +  if options.has_key?(:generate_plugin_list) || generate_all
    +    number_of_pages = options[:generate_plugin_list] || 150
    +
    +    puts '[+] Generating new most popular plugin list'
    +    puts
    +    GenerateList.new('plugins', verbose).generate_popular_list(number_of_pages)
    +  end
    +
    +  if options[:generate_full_plugin_list] || generate_all
    +    puts '[+] Generating new full plugin list'
    +    puts
    +    GenerateList.new('plugins', verbose).generate_full_list
    +  end
    +
    +  if options.has_key?(:generate_theme_list) || generate_all
    +    number_of_pages = options[:generate_theme_list] || 150
    +
    +    puts '[+] Generating new most popular theme list'
    +    puts
    +    GenerateList.new('themes', verbose).generate_popular_list(number_of_pages)
    +  end
    +
    +  if options[:generate_full_theme_list] || generate_all
    +    puts '[+] Generating new full theme list'
    +    puts
    +    GenerateList.new('themes', verbose).generate_full_list
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + +
    + + + + diff --git a/doc/Malwares.html b/doc/Malwares.html index 2cf2d304..29040a91 100644 --- a/doc/Malwares.html +++ b/doc/Malwares.html @@ -224,7 +224,7 @@
    -
    # File lib/wpscan/modules/malwares.rb, line 56
    +            
    # File lib/wpscan/modules/malwares.rb, line 59
     def self.malware_pattern(url_regex)
       # no need to escape regex here, because malware.txt contains regex
       %r{<(?:script|iframe).* src=(?:"|')(#{url_regex}[^"']*)(?:"|')[^>]*>}
    @@ -255,7 +255,7 @@
     
               
               
    -
    # File lib/wpscan/modules/malwares.rb, line 52
    +            
    # File lib/wpscan/modules/malwares.rb, line 55
     def self.malwares_file(malwares_file_path)
       malwares_file_path || DATA_DIR + '/malwares.txt'
     end
    @@ -291,7 +291,7 @@
    -
    # File lib/wpscan/modules/malwares.rb, line 23
    +            
    # File lib/wpscan/modules/malwares.rb, line 26
     def has_malwares?(malwares_file_path = nil)
       !malwares(malwares_file_path).empty?
     end
    @@ -321,7 +321,7 @@
    -
    # File lib/wpscan/modules/malwares.rb, line 28
    +            
    # File lib/wpscan/modules/malwares.rb, line 31
     def malwares(malwares_file_path = nil)
       unless @malwares
         malwares_found = []
    diff --git a/doc/Object.html b/doc/Object.html
    index 87064bba..c8d867b6 100644
    --- a/doc/Object.html
    +++ b/doc/Object.html
    @@ -261,6 +261,16 @@
             
    +
    LOCAL_FILES_FILE + +
    + + +
    LOCAL_FILES_XSD + +
    + +
    LOG_FILE
    @@ -311,6 +321,11 @@
    +
    VULNS_XSD + +
    + +
    WPSCAN_LIB_DIR
    @@ -336,6 +351,16 @@
    +
    WP_VERSIONS_FILE + +
    + + +
    WP_VERSIONS_XSD + +
    + +
    WP_VULNS_FILE
    @@ -369,7 +394,7 @@
    -
    # File lib/common_helper.rb, line 60
    +            
    # File lib/common_helper.rb, line 65
     def add_http_protocol(url)
       url =~ %r^https?:/ ? url : "http://#{url}"
     end
    @@ -399,7 +424,7 @@
    -
    # File lib/common_helper.rb, line 64
    +            
    # File lib/common_helper.rb, line 69
     def add_trailing_slash(url)
       url =~ %r\/$/ ? url : "#{url}/"
     end
    @@ -429,22 +454,22 @@