mirror of
https://github.com/urbanadventurer/WhatWeb
synced 2026-06-21 14:12:19 +00:00
29aa301273
Changelog:
* Updated version from 0.5.5 to 0.6.1
* Improved SSL/TLS security with comprehensive cipher suite support (TLSv1, TLSv1.1, TLSv1.2, SSLv3, SSLv2)
- Added SSL_ATTRIBUTES constant for verify_mode
- Replaced dynamic SSL parameter collection with explicit SSLContext configuration
- Set verify_mode to VERIFY_NONE for maximum compatibility
- Enabled negotiation of all SSL/TLS versions including legacy SSLv2/SSLv3
* Enhanced HTTPS connection handling with optimized verification settings
- Cleared minimum version restrictions and disabled protocol exclusion flags
- Added fallback handling for different OpenSSL configurations
* Added dual-protocol feature: simple hostnames (without paths or ports) are now scanned using both HTTP and HTTPS protocols
- Automatically creates and tests both HTTP and HTTPS versions of simple hostnames
- Shows informational message when dual-protocol scanning is performed
- Intelligently detects and avoids duplicate URL scanning with redirect handling
* Added robust input validation and error handling
- Automatically aborts processing after 10 consecutive parsing errors
- Prevents wasted resources when processing invalid data sources
- Provides helpful error messages to guide users in troubleshooting input issues
- Handles various error cases including malformed URLs and non-URL input data
* Improved dependency management with Bundler group support
- Reorganized Gemfile with proper optional group definitions for mongo and rchardet
- Added clear installation instructions for optional dependencies
- Set explicit version constraints for test dependencies
- Added support for older Bundler versions through GEMFILE_GROUPS environment variable
* Expanded documentation for optional dependencies
- Added detailed installation instructions for MongoDB support
- Added clear steps for character set detection configuration
- Provided combined installation commands for all optional features
- Improved explanation of performance implications
This release introduces three new search contexts for plugin authors to use:
- uri.path
- uri.query
- uri.extension
An example of how to use this is from the PHP plugin.
```
{ :name=>"File extension", :regexp=>/^(php|phtml|php3|php4|php5|phps)$/, :search=>"uri.extension" }
```
* #311 - JSON Logging fails... UTF-8 can't modify frozen String (@juananpe)
* Refactored Helper::convert_to_utf8. Droped Ruby 2.0 support (@urbanadventurer)
* Added new search contexts for plugins: uri.path, uri.query, uri.extension (@urbanadventurer)
* Plex Media Server (@urbanadventurer)
* Meta-Facebook-Infrastructure (@urbanadventurer)
* Netflix-Platform (@urbanadventurer)
* VKontakte-Platform (@urbanadventurer)
* Distributed-Tracing (@urbanadventurer)
* Modern-Security-Headers (@urbanadventurer)
* Baidu-Platform (@urbanadventurer)
* Alibaba-Aliyun (@urbanadventurer)
* Weibo-Platform (@urbanadventurer)
* Adobe-Flash (@urbanadventurer)
* ASP_NET (@urbanadventurer)
* ColdFusion (@urbanadventurer)
* Drupal (@gboddin)
* Java (@urbanadventurer)
* Perl (@urbanadventurer)
* PHP (@urbanadventurer)
* Python (@urbanadventurer)
* Ruby (@urbanadventurer)
* TYPO3 (@definity)
* WordPress (@juananpe)
* Shopify (enhanced HTTP header detection) (@urbanadventurer)
* CloudFlare (enhanced with CF-RAY and other headers) (@urbanadventurer)
* CloudFront (renamed to Amazon-CloudFront and enhanced) (@urbanadventurer)
* Tengine Web Server (added Alibaba-specific headers) (@urbanadventurer)
* Content-Security-Policy (added modern CSP headers) (@urbanadventurer)
* Azure (renamed to Microsoft-Azure and enhanced) (@urbanadventurer)
73 lines
2.4 KiB
Ruby
73 lines
2.4 KiB
Ruby
# Copyright 2009 to 2025 Andrew Horton and Brendan Coles
|
|
#
|
|
# This file is part of WhatWeb.
|
|
#
|
|
# WhatWeb 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 2 of the License, or
|
|
# at your option) any later version.
|
|
#
|
|
# WhatWeb 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 WhatWeb. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
class Version
|
|
def initialize(name_product = nil, versions = nil, url = nil)
|
|
raise 'You must specify the name of the product' if name_product.nil?
|
|
raise 'You must specify the available versions of the product' if versions.nil?
|
|
raise 'You must specify the available url of the website' if url.nil?
|
|
|
|
@name = name_product
|
|
@versions = versions
|
|
@files = Hash['filenames' => [], 'files' => [], 'md5' => []]
|
|
@url = url
|
|
@got_best_versions = false
|
|
@best_versions = []
|
|
|
|
versions.each do |version|
|
|
version[1].each do |file|
|
|
next if @files['filenames'].include? file[0]
|
|
@files['filenames'].push(file[0])
|
|
@files['files'].push(URI.join(@url.to_s, file[0]).to_s)
|
|
_status, url, _ip, body, _headers = open_target(@files['files'].last)
|
|
@files['md5'].push(Digest::MD5.hexdigest(body))
|
|
end
|
|
end
|
|
end
|
|
|
|
def best_matches
|
|
return @best_versions if @got_best_versions == true
|
|
|
|
@versions.each do |version|
|
|
count = 0
|
|
version[1].each do |file|
|
|
i = @files['filenames'].index(file[0])
|
|
count += 1 if @files['md5'][i] == file[1]
|
|
end
|
|
while !@best_versions.empty? && @best_versions[0][1] < count
|
|
@best_versions.delete_at(0)
|
|
end
|
|
if count > 0 && (@best_versions.empty? || @best_versions[0][1] == count) && \
|
|
!@best_versions.include?([version[0], count])
|
|
@best_versions.insert(0, [version[0], count])
|
|
end
|
|
end
|
|
|
|
@got_best_versions = true
|
|
@best_versions.flatten!
|
|
|
|
@best_versions.each_index { |i| @best_versions.delete_at(i + 1) }.sort!
|
|
|
|
@best_versions
|
|
end
|
|
|
|
def matches_format
|
|
best_matches if @got_best_versions == false
|
|
@best_versions
|
|
end
|
|
end
|