lib/wmap/utils/wp_detect.rb
# Identify wordpress version through the login page
Identify wordpress version through the login page
Identify wordpress version through the login page
def wp_ver_login(url,pattern)
  		puts "Check for #{pattern}" if @verbose
  		site=url_2_site(url)
  		login_url=site + "wp-login.php"
      k=Wmap::UrlChecker.new
      if k.response_code(login_url) == 200
        doc=open_page(login_url)
        links=doc.css('link')
  			links.each do |tag|
  	      if tag.to_s.include?(pattern)
  					puts tag.to_s if @verbose
  					k=nil
            if tag.to_s.scan(/[\d+\.]+\d+/).first =~ /\d+\./
  	           return tag.to_s.scan(/[\d+\.]+\d+/).first
             else
               return nil
             end
  	      end
  			end
      end
      k=nil
      return nil
  	rescue => ee
  		puts "Exception on method #{__method__} for url #{url}: #{ee}" if @verbose
  		return nil
    end
def wp_ver_login ( url , pattern ) puts "Check for #{pattern}" if @verbose site = url_2_site ( url ) login_url = site + "wp-login.php" k = Wmap :: UrlChecker . new if k . response_code ( login_url ) == 200 doc = open_page ( login_url ) links = doc . css ( 'link' ) links . each do | tag | if tag . to_s . include? ( pattern ) puts tag . to_s if @verbose k = nil if tag . to_s . scan ( / [ \d + \. ]+ \d + / ) . first =~ / \d + \. / return tag . to_s . scan ( / [ \d + \. ]+ \d + / ) . first else return nil end end end end k = nil return nil rescue => ee puts "Exception on method #{__method__} for url #{url}: #{ee}" if @verbose return nil end
Identify wordpress version through the login page
Identify wordpress version through the login page
#puts "Res code: #{k.response_code(login_url)}" if @verbose #puts doc.inspect #puts links.inspect if @verbose
url
<not_specific>
pattern
<not_specific>