GNU Wget FTP Symlink Arbitrary Filesystem Access - Metasploit
This page contains detailed information about how to use the auxiliary/server/wget_symlink_file_write metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: GNU Wget FTP Symlink Arbitrary Filesystem Access
Module: auxiliary/server/wget_symlink_file_write
Source code: modules/auxiliary/server/wget_symlink_file_write.rb
Disclosure date: 2014-10-27
Last modification time: 2020-05-12 22:15:21 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): -
List of CVEs: CVE-2014-4877
This module exploits a vulnerability in Wget when used in recursive (-r) mode with a FTP server as a destination. A symlink is used to allow arbitrary writes to the target's filesystem. To specify content for the file, use the "file:/path" syntax for the TARGET_DATA option. Tested successfully with wget 1.14. Versions prior to 1.16 are presumed vulnerable.
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/server/wget_symlink_file_write
msf auxiliary(wget_symlink_file_write) > show targets
... a list of targets ...
msf auxiliary(wget_symlink_file_write) > set TARGET target-id
msf auxiliary(wget_symlink_file_write) > show options
... show and set options ...
msf auxiliary(wget_symlink_file_write) > exploit
Go back to menu.
Msfconsole Usage
Here is how the server/wget_symlink_file_write auxiliary module looks in the msfconsole:
msf6 > use auxiliary/server/wget_symlink_file_write
msf6 auxiliary(server/wget_symlink_file_write) > show info
Name: GNU Wget FTP Symlink Arbitrary Filesystem Access
Module: auxiliary/server/wget_symlink_file_write
License: Metasploit Framework License (BSD)
Rank: Normal
Disclosed: 2014-10-27
Provided by:
hdm <[email protected]>
Available actions:
Name Description
---- -----------
Service Run malicious FTP server
Check supported:
No
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
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 2121 yes The port for the malicious FTP server to listen on
SSL false no Negotiate SSL for incoming connections
SSLCert no Path to a custom SSL certificate (default is randomly generated)
TARGET_DATA Hello from Metasploit yes The data to write to the target file
TARGET_FILE /tmp/pwned yes The target file to overwrite
Description:
This module exploits a vulnerability in Wget when used in recursive
(-r) mode with a FTP server as a destination. A symlink is used to
allow arbitrary writes to the target's filesystem. To specify
content for the file, use the "file:/path" syntax for the
TARGET_DATA option. Tested successfully with wget 1.14. Versions
prior to 1.16 are presumed vulnerable.
References:
https://nvd.nist.gov/vuln/detail/CVE-2014-4877
https://bugzilla.redhat.com/show_bug.cgi?id=1139181
https://blog.rapid7.com/2014/10/28/r7-2014-15-gnu-wget-ftp-symlink-arbitrary-filesystem-access
Module Options
This is a complete list of options available in the server/wget_symlink_file_write auxiliary module:
msf6 auxiliary(server/wget_symlink_file_write) > show options
Module options (auxiliary/server/wget_symlink_file_write):
Name Current Setting Required Description
---- --------------- -------- -----------
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 2121 yes The port for the malicious FTP server to listen on
SSL false no Negotiate SSL for incoming connections
SSLCert no Path to a custom SSL certificate (default is randomly generated)
TARGET_DATA Hello from Metasploit yes The data to write to the target file
TARGET_FILE /tmp/pwned yes The target file to overwrite
Auxiliary action:
Name Description
---- -----------
Service Run malicious FTP server
Advanced Options
Here is a complete list of advanced options supported by the server/wget_symlink_file_write auxiliary module:
msf6 auxiliary(server/wget_symlink_file_write) > show advanced
Module advanced options (auxiliary/server/wget_symlink_file_write):
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 server/wget_symlink_file_write module can do:
msf6 auxiliary(server/wget_symlink_file_write) > show actions
Auxiliary actions:
Name Description
---- -----------
Service Run malicious FTP server
Evasion Options
Here is the full list of possible evasion options supported by the server/wget_symlink_file_write auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 auxiliary(server/wget_symlink_file_write) > 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.
Related Pull Requests
- #13443 Merged Pull Request: Add descriptions to auxiliary modules Actions
- #12949 Merged Pull Request: This fixes broken links to the community.rapid7.com blog
- #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
- #4373 Merged Pull Request: fix invalid URI scheme
- #4088 Merged Pull Request: Add module for CVE-2014-4877 (Wget)
References
- CVE-2014-4877
- https://bugzilla.redhat.com/show_bug.cgi?id=1139181
- https://blog.rapid7.com/2014/10/28/r7-2014-15-gnu-wget-ftp-symlink-arbitrary-filesystem-access
See Also
Check also the following modules related to this module:
- post/linux/busybox/wget_exec
- auxiliary/dos/windows/smb/ms09_001_write
- auxiliary/dos/windows/tftp/pt360_write
- exploit/linux/http/lucee_admin_imgprocess_file_write
- exploit/linux/local/netfilter_xtables_heap_oob_write_priv_esc
- exploit/multi/fileformat/archive_tar_arb_file_write
- exploit/windows/browser/chilkat_crypt_writefile
- exploit/windows/browser/hp_loadrunner_writefilebinary
- exploit/windows/browser/hp_loadrunner_writefilestring
- exploit/windows/browser/mozilla_interleaved_write
- exploit/windows/ftp/quickshare_traversal_write
- exploit/windows/http/manageengine_connectionid_write
- exploit/windows/http/oracle_btm_writetofile
- exploit/windows/local/mqac_write
- exploit/windows/misc/solidworks_workgroup_pdmwservice_file_write
- auxiliary/scanner/http/rewrite_proxy_bypass
- exploit/multi/browser/opera_configoverwrite
- exploit/windows/fileformat/foxit_reader_filewrite
- exploit/windows/http/apache_mod_rewrite_ldap
- exploit/windows/mssql/ms09_004_sp_replwritetovarbin
- exploit/windows/mssql/ms09_004_sp_replwritetovarbin_sqli
- auxiliary/admin/smb/samba_symlink_traversal
- exploit/windows/local/ms13_097_ie_registry_symlink
Authors
- hdm
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.