"Fossies" - the Fresh Open Source Software Archive

Member "WhatWeb-0.5.5/plugins/phpmyadmin.rb" (15 Jan 2021, 12231 Bytes) of package /linux/www/WhatWeb-0.5.5.tar.gz:


The requested HTML page contains a <FORM> tag that is unusable on "Fossies" in "automatic" (rendered) mode so that page is shown as HTML source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "phpmyadmin.rb": 0.5.4_vs_0.5.5.

    1 ##
    2 # This file is part of WhatWeb and may be subject to
    3 # redistribution and commercial restrictions. Please see the WhatWeb
    4 # web site for more information on licensing and terms of use.
    5 # https://www.morningstarsecurity.com/research/whatweb
    6 ##
    7 Plugin.define do
    8 name "phpMyAdmin"
    9 authors [
   10   "Brendan Coles <bcoles@gmail.com>", # 2010-06-01
   11   # v0.2 # Updated regex. Added version detection. Added favicon md5 hash. Added cookie matches.
   12   # v0.3 # 2011-04-06 # Added aggressive md5 matches.
   13   "Andrew Horton", # v0.4 # 2012-08-16 # Updated MD5 syntax. In future someone should move the MD5 hash matches into the matches array.
   14   # Brendan Coles <bcoles@gmail.com> # v0.5 # 2016-05-1 # Updated phpMyAdmin Cookie.
   15   "Juanan Pereira", # v0.6 # 2021-01-06
   16    # Added version detection via PMA_VERSION
   17    # Updated version detection for 3.5.8.2, 4.1.9, 4.4.15, 4.5.1, 4.6.1, 4.6.6, 4.9.7, 5.0.4
   18 ]
   19 version "0.6"
   20 description "phpMyAdmin is a free software tool written in PHP intended to handle the administration of MySQL over the World Wide Web."
   21 website "http://www.phpmyadmin.net/home_page/index.php"
   22 
   23 # Google results as at 2010-10-26 #
   24 # 3,490 for +intitle:phpMyAdmin +"Language: Afrikaans" +"Welcome to phpMyAdmin"
   25 
   26 # ShodanHQ results as at 2010-10-26 #
   27 # 1,868 for pma_theme=original
   28 
   29 # Dorks #
   30 dorks [
   31 'intitle:phpMyAdmin "Language: Afrikaans" "Welcome to phpMyAdmin"',
   32 'inurl:main.php "Welcome to phpMyAdmin"'
   33 ]
   34 
   35 
   36 
   37 # Matches #
   38 matches [
   39 
   40 # GHDB Match
   41 { :certainty=>75, :ghdb=>'intitle:phpMyAdmin "Language: Afrikaans" "Welcome to phpMyAdmin"' },
   42 
   43 # Version Detection # Default Title
   44 { :version=>/<title>phpMyAdmin ([^\s^<]+)[^<]*<\/title>/ },
   45 
   46 {:version=>/PMA_VERSION\:"([0-9\.]+)",auth_type/},
   47 
   48 # Version Detection # Default heading HTML
   49 { :version=>/<h2>Welcome to  phpMyAdmin ([^<]+)<\/h2>/ },
   50 
   51 # Default Logo HTML
   52 { :text=>'<img src="./themes/original/img/logo_right.png" id="imLogo" name="imLogo" alt="phpMyAdmin" border="0" /></a>' },
   53 
   54 # Default logo
   55 { :md5=>"d037ef2f629a22ddadcf438e6be7a325", :url=>"favicon.ico" },
   56 
   57 # Login page # Default form HTML
   58 { :regexp=>/<form method="post" action="index\.php" target="_(top|parent)"><input type="hidden" name="phpMyAdmin" value="/ },
   59 
   60 ]
   61 
   62 # Passive #
   63 passive do
   64     m=[]
   65 
   66     # Cookies
   67     m << {:name=>"phpMyAdmin Cookie" } if @headers["set-cookie"] =~ /phpMyAdmin=[a-z0-9]+/
   68     m << {:name=>"pma_theme Cookie" } if @headers["set-cookie"] =~ /pma_theme=original/
   69 
   70     # Return passive matches
   71     m
   72 end
   73 
   74 # Aggressive #
   75 aggressive do
   76     m=[]
   77 
   78 # the paths are relative to the url path if they don't start with /
   79 # this path, with this md5 = this version
   80 files=[
   81 {:version=>'2.10.0',  :md5=>'4c06efa60065abe716e32229fc273c01', :path=>"README"},
   82 {:version=>'2.10.0.1', :md5=>'a45ea22038859ea43ca3939e48095994', :path=>"README"},
   83 {:version=>'2.10.0.2', :md5=>'fb5ed3d88acf3597286f99852e355d8e', :path=>"README"},
   84 {:version=>'2.10.1',  :md5=>'7af790f225d73a9ce817cca8e37691b3', :path=>"README"},
   85 {:version=>'2.10.2',  :md5=>'edd3f3669d6164e50046eedf3c753279', :path=>"README"},
   86 {:version=>'2.10.3',  :md5=>'5b1f00a05f693c3e13806afe431d6487', :path=>"README"},
   87 {:version=>'2.11.0',  :md5=>'55947bd70e5c25272121e390fcf8c897', :path=>"README"},
   88 {:version=>'2.11.1',  :md5=>'35dd8265cee0571d3b322d1f2e787b75', :path=>"README"},
   89 {:version=>'2.11.1.1', :md5=>'278d9a6aeb935f770bb89e1dfe412719', :path=>"README"},
   90 {:version=>'2.11.1.2', :md5=>'0d861d29b2e2048a63ac051f36a3f361', :path=>"README"},
   91 {:version=>'2.11.10', :md5=>'4d9578575978d5d8ed4a47756c01c3ca', :path=>"README"},
   92 {:version=>'2.11.2',  :md5=>'18b673f7ef447040b49e16f6b976eec6', :path=>"README"},
   93 {:version=>'2.11.2.1', :md5=>'aa29c13828d254bee5e48bba193cbe29', :path=>"README"},
   94 {:version=>'2.11.2.2', :md5=>'c0f2ca0bb9bc877a0c58656b1de8e153', :path=>"README"},
   95 {:version=>'2.11.3',  :md5=>'05c87ad89a504992db504f0bf95bc11f', :path=>"README"},
   96 {:version=>'2.11.4',  :md5=>'fa26c5c4b46d9f1b59b0d5ee83815b19', :path=>"README"},
   97 {:version=>'2.11.5',  :md5=>'16335f02ce528df4b606ac238b024988', :path=>"README"},
   98 {:version=>'2.11.5.1', :md5=>'4e91eceb7ce42b1642d10d81e93b9230', :path=>"README"},
   99 {:version=>'2.11.5.2', :md5=>'29f019f69ea21678a5d5f2eb2bd6dfe4', :path=>"README"},
  100 {:version=>'2.11.6',  :md5=>'02f9f9e2fd8edab7feaae9e571ca593a', :path=>"README"},
  101 {:version=>'2.11.7',  :md5=>'c7a5c33922615b9f180967f5c921c3c5', :path=>"README"},
  102 {:version=>'2.11.7.1', :md5=>'cdd7ef1b46ab6c078a33eacf158481b0', :path=>"README"},
  103 {:version=>'2.11.8',  :md5=>'2cb1d469710c7f12b948551b6984010b', :path=>"README"},
  104 {:version=>'2.11.8.1', :md5=>'11e77de74849fd026cd473e9c88ddd94', :path=>"README"},
  105 {:version=>'2.11.9',  :md5=>'c8b1da9b3680e561e74502df451a35c7', :path=>"README"},
  106 {:version=>'2.11.9.1', :md5=>'664f52aaf2dd92bf1a5f8f60bbcdd4b7', :path=>"README"},
  107 {:version=>'2.11.9.2', :md5=>'bc6f08397c045689b24a1fab8fb9e549', :path=>"README"},
  108 {:version=>'2.11.9.3', :md5=>'4743249c31f5de1752cbc08b1599c045', :path=>"README"},
  109 {:version=>'2.11.9.4', :md5=>'254e8e8d4296528a3508a9dd7c5f44b2', :path=>"README"},
  110 {:version=>'2.11.9.5', :md5=>'de4786ec584fd2b9eaae86bf6a9e7857', :path=>"README"},
  111 {:version=>'2.11.9.6', :md5=>'9469b91f4b2bb119bf904a9765510c56', :path=>"README"},
  112 {:version=>'2.11.11.3', :md5=>'37897ebc2d024c7d113a957a1b5ea782', :path=>"README"},
  113 {:version=>'2.2.0',   :md5=>'9f1f13d075044b51b247a767b313cb2d', :path=>"README"},
  114 {:version=>'2.2.x',   :md5=>'229f99fde3366a8f952ef5fc46d027b0', :path=>"README"},
  115 {:version=>'2.2.1 - 2.2.5', :md5=>'6482a96f3e86cfa7f056b5ade23b8ecb', :path=>"README"},
  116 {:version=>'2.2.6',   :md5=>'e7006399103e0126a2badc4acf7845cb', :path=>"README"},
  117 {:version=>'2.2.7pl1', :md5=>'11c7c0a0bdd3a225d60269cf74d2b331', :path=>"README"},
  118 {:version=>'2.3.0',   :md5=>'c98c4eaf0da9222c2c06d02d585fd023', :path=>"README"},
  119 {:version=>'2.3.1 - 2.5.2', :md5=>'f0ad142b2ef7ea53964d05ccdeb52035', :path=>"README"},
  120 {:version=>'2.5.3',   :md5=>'1d90d370466f7a52136adde0c6bfb108', :path=>"README"},
  121 {:version=>'2.5.3-rc3', :md5=>'29de96781e63cbb4af6951796d12c5bf', :path=>"README"},
  122 
  123 {:version=>'2.5.4',   :md5=>'469c3c2cd68859b62f1653ffffc95cd4', :path=>"README"},
  124 {:version=>'2.5.4',   :md5=>'cd5fd08b00f36b08b272131440e326c5', :path=>"README"},
  125 
  126 {:version=>'2.5.5-pl1', :md5=>'3d8de5d32895269e7f04d44016eb2028', :path=>"README"},
  127 {:version=>'2.5.6',   :md5=>'f168cb1403bbfad7ab2cbbfed747a152', :path=>"README"},
  128 
  129 {:version=>'2.5.7-pl1', :md5=>'07ed831d01abf90cf2211fdb5ad10d60', :path=>"README"},
  130 {:version=>'2.5.7-pl1', :md5=>'861e09a07e2e1c502362b36589aa5eeb', :path=>"README"},
  131 
  132 {:version=>'2.6.0-pl3', :md5=>'c4b88ca54187fb1d54dcbefe2f6627de', :path=>"README"},
  133 {:version=>'2.6.1', :md5=>'4c8aa8016b9e3c73ef792f46053a53cc', :path=>"README"},
  134 
  135 {:version=>'2.6.1-pl3', :md5=>'b76786f301a739be5495cb8c843ecde7', :path=>"README"},
  136 {:version=>'2.6.1-pl3', :md5=>'cb1dd403025b43b603266e048ec6eb20', :path=>"README"},
  137 
  138 {:version=>'2.6.2', :md5=>'9388aa6172a45d99921f75af2555ec4e', :path=>"README"},
  139 
  140 {:version=>'2.6.2-pl1', :md5=>'5d4c438de835d784d4c8280f585434fb', :path=>"README"},
  141 {:version=>'2.6.2-pl1', :md5=>'dd4386d57907669bce9d10817104af58', :path=>"README"},
  142 
  143 {:version=>'2.6.3-pl1', :md5=>'0842c25861357b5e535b4ac93a862f09', :path=>"README"},
  144 {:version=>'2.6.3-pl1', :md5=>'343b4a43789d98472dd388e42b809675', :path=>"README"},
  145 
  146 {:version=>'2.6.4-pl1', :md5=>'8ff307e9122053b8f14650d348c04119', :path=>"README"},
  147 {:version=>'2.6.4-pl4', :md5=>'b981f65409134362ce0441c02983a500', :path=>"README"},
  148 {:version=>'2.7.0-pl2', :md5=>'6f18db3f3e9d4ae425e96c8c58398a42', :path=>"README"},
  149 {:version=>'2.8.0.3', :md5=>'89a0f6c94833a0c502a83e5a8defcdbd', :path=>"README"},
  150 {:version=>'2.8.0.4', :md5=>'51eba4598063b26ea2d5ac091d5cc21b', :path=>"README"},
  151 {:version=>'2.8.1',   :md5=>'9f0fb027d48fdc5c308f504430cd08db', :path=>"README"},
  152 {:version=>'2.8.2.4', :md5=>'fd9ebbd6a011f5c068e3fede5bf3e8c0', :path=>"README"},
  153 {:version=>'2.9.0',   :md5=>'f006341b331ca5fbc86e05f8054f08cf', :path=>"README"},
  154 {:version=>'2.9.0.1', :md5=>'065f4a7e6a2cf4937232d9bece285bcf', :path=>"README"},
  155 {:version=>'2.9.0.2', :md5=>'9961106d6d6b87c95d1ccb7114d69626', :path=>"README"},
  156 {:version=>'2.9.0.3', :md5=>'a23133f8890ef36cf177e39096c4defc', :path=>"README"},
  157 {:version=>'2.9.1.1', :md5=>'17333514823c2fab1587988940fa16fd', :path=>"README"},
  158 {:version=>'2.9.2',   :md5=>'c11bdc89e1f8d5f3aa66b3c479b2bd7c', :path=>"README"},
  159 {:version=>'3.0.0',   :md5=>'14a3933f1f0f6dea11c4471f616039c5', :path=>"README"},
  160 {:version=>'3.0.1',   :md5=>'b32b9f3e08ff848adcd4c172d35ca1af', :path=>"README"},
  161 {:version=>'3.0.1.1', :md5=>'aa7c4a696752d466f64fde54686c0569', :path=>"README"},
  162 {:version=>'3.1.0',   :md5=>'999b10c93f593d1378af0751759c3670', :path=>"README"},
  163 {:version=>'3.1.1',   :md5=>'8eec96ced6f4802906611c1c0ed2aa98', :path=>"README"},
  164 {:version=>'3.1.2',   :md5=>'c12c9f4087a50a7050fee87be17d11b9', :path=>"README"},
  165 {:version=>'3.1.3',   :md5=>'fe9aebf3468d3bfc3a709ba41d6e191a', :path=>"README"},
  166 {:version=>'3.1.3.1', :md5=>'a4e63bea00c15b0f294e76f427de0131', :path=>"README"},
  167 {:version=>'3.1.3.2', :md5=>'a762a17361517f63e384a8d0d1169362', :path=>"README"},
  168 {:version=>'3.1.4',   :md5=>'c0c2091119b7ba461c115230d08eb883', :path=>"README"},
  169 {:version=>'3.1.5',   :md5=>'2ba54b620a956ad7c3fd84246b6dbb58', :path=>"README"},
  170 {:version=>'3.2.0',   :md5=>'e1f67893278797cb1f5b0406d31ca8fc', :path=>"README"},
  171 {:version=>'3.2.0-beta1', :md5=>'8943be66720f7a1b0aff984385e27942', :path=>"README"},
  172 {:version=>'3.2.0-rc1', :md5=>'0d8f87ce919fadc5ca61104017eecd42', :path=>"README"},
  173 {:version=>'3.2.0.1', :md5=>'9b72351e14fba81418e91daccdfe6c00', :path=>"README"},
  174 {:version=>'3.2.1',   :md5=>'0c4a45f27334416679ca94a2ec31b6f4', :path=>"README"},
  175 {:version=>'3.2.2',   :md5=>'e79743b0ce7e3d729e8a6216ea082a4c', :path=>"README"},
  176 {:version=>'3.2.2.1', :md5=>'eddb65b391a790007cbfb6403a9d3c59', :path=>"README"},
  177 {:version=>'3.2.3',   :md5=>'03b2591998bfe265766c8744796a2d2d', :path=>"README"},
  178 {:version=>'3.2.4',   :md5=>'fdff087103e3cd763446bc7336decbaf', :path=>"README"},
  179 {:version=>'3.3.4-rc1', :md5=>'ce8bee6859e51915a83c27183cf6c1ea', :path=>"README"},
  180 {:version=>'3.3.7', :md5=>'71168994d7bce6ce5351c5bd51f885d4', :path=>"README"},
  181 {:version=>'3.3.9', :md5=>'d28393c2956e278570e6876fad3fce2e', :path=>"README"},
  182 {:version=>'3.3.9.2', :md5=>'6fa959ab76b2eebedc21c1f5056415a4', :path=>"README"},
  183 {:version=>'3.3.10', :md5=>'faced5f008177dacea61ed953ec799e2', :path=>"README"},
  184 {:version=>'3.3.11-dev', :md5=>'3493c96f533215e62409dd8ab07126b8', :path=>"README"},
  185 {:version=>'3.4.0-beta4', :md5=>'1ee74431ac623654fd9a3dc2a3717c45', :path=>"README"},
  186 {:version=>'3.5.8.2', :md5=>'61020688e0c93426da8e26698d86a353', :path=>"README"},
  187 {:version=>'4.1.9', :md5=>'510f3fba339c091dbbb92df00ff3e706', :path=>"README"},
  188 {:version=>'4.4.15', :md5=>'c57c2a3873e5bdf7daaf56b14b1c1a2f', :path=>"README"},
  189 {:version=>'4.5.1', :md5=>'2d53318ad6d93bbc10e6ebe3be669c03', :path=>"README"},
  190 {:version=>'4.6.1', :md5=>'dbd24fb33b5a0c72ce12c36ffe274bee', :path=>"README"},
  191 {:version=>'4.6.6', :md5=>'3e12f16f443ff6941063f97d2575223a', :path=>"README"},
  192 {:version=>'4.9.7', :md5=>'8424d7ba6fdc70f44b2318f1d7f54474', :path=>"README"},
  193 {:version=>'5.0.4', :md5=>'a1babfbb758b5dfe9292a51db7c0b545', :path=>"README"},
  194 
  195 ]
  196 
  197     # Fetch and hash files
  198     to_download = files.map {|x| x[:path]}.sort.uniq
  199     downloads={}
  200     to_download.each do |d|
  201         target = URI.join(@base_uri.to_s,d).to_s
  202         status,url,ip,body,headers=open_target(target)
  203         downloads[d] = {:md5sum=>Digest::MD5.hexdigest(body).to_s}
  204     end
  205 
  206     # Compare file hashes to known hashes
  207     version=nil
  208     files.each do |thisfile|
  209         unless downloads[thisfile[:path]].nil?
  210             version=thisfile[:version] if downloads[thisfile[:path]][:md5sum] == thisfile[:md5]
  211         end
  212     end
  213 
  214     # Set version if present
  215     unless version.nil?
  216         m << {:name=>"md5 sums of files", :version=>version}
  217     end
  218 
  219         # Extract version from Documentation.html (README is not present in debian package)
  220     target = URI.join(@base_uri.to_s, "Documentation.html").to_s
  221     status,url,ip,body,headers=open_target(target)
  222 
  223     if body =~ /<title>phpMyAdmin ([^\s^<]+)[^<]*<\/title>/
  224         version = body.scan(/<title>phpMyAdmin ([^\s^<]+)[^<]*<\/title>/)[0].to_s
  225         m << {:name=>"Documentation version", :version=>version }
  226     end
  227 
  228     # Return aggressive matches
  229     m
  230 end
  231 
  232 end
  233