Files
wpscan/lib/environment.rb
2013-02-21 11:49:36 +01:00

64 lines
2.0 KiB
Ruby

# encoding: UTF-8
#--
# 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/>.
#++
begin
# Standard libs
require 'rubygems'
require 'bundler/setup'
require 'getoptlong'
require 'optparse' # Will replace getoptlong
require 'uri'
require 'time'
require 'resolv'
require 'xmlrpc/client'
require 'digest/md5'
require 'digest/sha1'
require 'readline'
require 'base64'
require 'rbconfig'
require 'pp'
# Third party libs
#gem 'typhoeus', :git => "https://github.com/typhoeus/typhoeus.git"
require 'typhoeus'
require 'json'
require 'nokogiri'
# Custom libs
require 'common/browser'
require 'common/cache_file_store'
require 'common/custom_option_parser'
rescue LoadError => e
puts "[ERROR] #{e}"
missing_gem = e.to_s[%r{ -- ([^\s]+)}, 1]
if missing_gem
if missing_gem =~ /nokogiri/i
puts
puts 'Nokogiri needs some packets, please run \'sudo apt-get install libxml2 libxml2-dev libxslt1-dev\' to install them. Then run the command below'
puts
end
puts "[TIP] Try to run 'gem install #{missing_gem}' or 'gem install --user-install #{missing_gem}'. If you still get an error, Please see README file or https://github.com/wpscanteam/wpscan"
end
exit(1)
end
if Typhoeus::VERSION == '0.4.0'
puts 'Typhoeus 0.4.0 detected, please update the gem otherwise wpscan will not work correctly'
exit(1)
end