FTP Bounce Port Scanner - Metasploit
This page contains detailed information about how to use the auxiliary/scanner/portscan/ftpbounce metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: FTP Bounce Port Scanner
Module: auxiliary/scanner/portscan/ftpbounce
Source code: modules/auxiliary/scanner/portscan/ftpbounce.rb
Disclosure date: -
Last modification time: 2019-03-05 03:38:51 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: ftp
Target network port(s): 21, 2121
List of CVEs: -
Enumerate TCP services via the FTP bounce PORT/LIST method.
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
This module is a scanner module, and is capable of testing against multiple hosts.
msf > use auxiliary/scanner/portscan/ftpbounce
msf auxiliary(ftpbounce) > show options
... show and set options ...
msf auxiliary(ftpbounce) > set RHOSTS ip-range
msf auxiliary(ftpbounce) > exploit
Other examples of setting the RHOSTS option:
Example 1:
msf auxiliary(ftpbounce) > set RHOSTS 192.168.1.3-192.168.1.200
Example 2:
msf auxiliary(ftpbounce) > set RHOSTS 192.168.1.1/24
Example 3:
msf auxiliary(ftpbounce) > set RHOSTS file:/tmp/ip_list.txt
Required Options
RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
BOUNCEHOST: FTP relay host
Knowledge Base
Vulnerable Application
Enumerate TCP services via the FTP bounce PORT/LIST method
Verification Steps
- Start msfconsole
- Do:
use modules/auxiliary/scanner/portscan/ftpbounce
- Do:
set BOUNCEHOST [ip]
- Do:
set PORTS [number(s)]
- Do:
set RHOSTS [ip]
- Do:
set FTPUSER [user]
- Do:
set FTPPASS [password]
- Do:
run
Scenarios
Docker Usage: docker run -e "ADDED_FLAGS=-w -W -d -d" -e FTP_USER_NAME=bob -e FTP_USER_PASS=12345 -e FTP_USER_HOME=/home/bob stilliard/pure-ftpd
PureFTPd and Kali Linux 2019.3
msf > use modules/auxiliary/scanner/portscan/ftpbounce
msf auxiliary(scanner/portscan/ftpbounce) > set BOUNCEHOST 172.17.0.2
BOUNCEHOST => 172.17.0.2
msf auxiliary(scanner/portscan/ftpbounce) > set PORTS 8080
BOUNCEPORT => 8080
msf auxiliary(scanner/portscan/ftpbounce) > set RHOSTS 172.17.0.4
RHOSTS => 172.17.0.4
msf auxiliary(scanner/portscan/ftpbounce) > set FTPUSER bob
FTPUSER => bob
msf auxiliary(scanner/portscan/ftpbounce) > set FTPPASS 12345
FTPPASS => 12345
msf auxiliary(scanner/portscan/ftpbounce) > run
[+] 172.17.0.2:21 - TCP OPEN 172.17.0.4:8080
[*] 172.17.0.2:21 - Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
Manual Exploitation
root@ubuntu:~# nmap -p 8080 -v -b bob:[email protected] 172.17.0.4 -Pn
Starting Nmap 7.60 ( https://nmap.org ) at 2019-11-25 20:34 UTC
Resolved FTP bounce attack proxy to 172.17.0.2 (172.17.0.2).
Initiating Parallel DNS resolution of 1 host. at 20:34
Completed Parallel DNS resolution of 1 host. at 20:34, 0.00s elapsed
Attempting connection to ftp://bob:[email protected]:21
Connected:220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 1 of 5 allowed.
220-Local time is now 20:34. Server port: 21.
220-This is a private system - No anonymous login
220-This server supports FXP transfers
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
Login credentials accepted by FTP server!
Initiating Bounce Scan at 20:34
Discovered open port 8080/tcp on 172.17.0.4
Completed Bounce Scan at 20:34, 0.00s elapsed (1 total ports)
Nmap scan report for 172.17.0.4
Host is up.
PORT STATE SERVICE
8080/tcp open http-proxy
Go back to menu.
Msfconsole Usage
Here is how the scanner/portscan/ftpbounce auxiliary module looks in the msfconsole:
msf6 > use auxiliary/scanner/portscan/ftpbounce
msf6 auxiliary(scanner/portscan/ftpbounce) > show info
Name: FTP Bounce Port Scanner
Module: auxiliary/scanner/portscan/ftpbounce
License: Metasploit Framework License (BSD)
Rank: Normal
Provided by:
kris katterjohn <[email protected]>
Check supported:
No
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
BOUNCEHOST yes FTP relay host
BOUNCEPORT 21 yes FTP relay port
DELAY 0 yes The delay between connections, per thread, in milliseconds
FTPPASS [email protected] no The password for the specified username
FTPUSER anonymous no The username to authenticate as
JITTER 0 yes The delay jitter factor (maximum value by which to +/- DELAY) in milliseconds.
PORTS 1-10000 yes Ports to scan (e.g. 22-25,80,110-900)
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
THREADS 1 yes The number of concurrent threads (max one per host)
Description:
Enumerate TCP services via the FTP bounce PORT/LIST method.
Module Options
This is a complete list of options available in the scanner/portscan/ftpbounce auxiliary module:
msf6 auxiliary(scanner/portscan/ftpbounce) > show options
Module options (auxiliary/scanner/portscan/ftpbounce):
Name Current Setting Required Description
---- --------------- -------- -----------
BOUNCEHOST yes FTP relay host
BOUNCEPORT 21 yes FTP relay port
DELAY 0 yes The delay between connections, per thread, in milliseconds
FTPPASS [email protected] no The password for the specified username
FTPUSER anonymous no The username to authenticate as
JITTER 0 yes The delay jitter factor (maximum value by which to +/- DELAY) in milliseconds.
PORTS 1-10000 yes Ports to scan (e.g. 22-25,80,110-900)
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
THREADS 1 yes The number of concurrent threads (max one per host)
Advanced Options
Here is a complete list of advanced options supported by the scanner/portscan/ftpbounce auxiliary module:
msf6 auxiliary(scanner/portscan/ftpbounce) > show advanced
Module advanced options (auxiliary/scanner/portscan/ftpbounce):
Name Current Setting Required Description
---- --------------- -------- -----------
CHOST no The local client address
CPORT no The local client port
ConnectTimeout 10 yes Maximum number of seconds to establish a TCP connection
FTPDEBUG false no Whether or not to print verbose debug statements
FTPTimeout 16 yes The number of seconds to wait for a reply from an FTP command
PassiveMode false no Set true for extended passive (EPSV) ftp mode.
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
SSL false no Negotiate SSL/TLS for outgoing connections
SSLCipher no String for SSL cipher - "DHE-RSA-AES256-SHA" or "ADH"
SSLVerifyMode PEER no SSL verification method (Accepted: CLIENT_ONCE, FAIL_IF_NO_PEER_CERT, NONE, PEER)
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)
ShowProgress true yes Display progress messages during a scan
ShowProgressPercent 10 yes The interval in percent that progress should be shown
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 scanner/portscan/ftpbounce module can do:
msf6 auxiliary(scanner/portscan/ftpbounce) > show actions
Auxiliary actions:
Name Description
---- -----------
Evasion Options
Here is the full list of possible evasion options supported by the scanner/portscan/ftpbounce auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 auxiliary(scanner/portscan/ftpbounce) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
TCP::max_send_size 0 no Maxiumum 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.
PORTS
Here is a relevant code snippet related to the "PORTS" error message:
46: end
47:
48: def run_host(ip)
49: ports = Rex::Socket.portspec_crack(datastore['PORTS'])
50: if ports.empty?
51: raise Msf::OptionValidateError.new(['PORTS'])
52: end
53:
54: jitter_value = datastore['JITTER'].to_i
55: if jitter_value < 0
56: raise Msf::OptionValidateError.new(['JITTER'])
JITTER
Here is a relevant code snippet related to the "JITTER" error message:
51: raise Msf::OptionValidateError.new(['PORTS'])
52: end
53:
54: jitter_value = datastore['JITTER'].to_i
55: if jitter_value < 0
56: raise Msf::OptionValidateError.new(['JITTER'])
57: end
58:
59: delay_value = datastore['DELAY'].to_i
60: if delay_value < 0
61: raise Msf::OptionValidateError.new(['DELAY'])
DELAY
Here is a relevant code snippet related to the "DELAY" error message:
56: raise Msf::OptionValidateError.new(['JITTER'])
57: end
58:
59: delay_value = datastore['DELAY'].to_i
60: if delay_value < 0
61: raise Msf::OptionValidateError.new(['DELAY'])
62: end
63:
64: return if not connect_login
65:
66: ports.each do |port|
Unknown error
Here is a relevant code snippet related to the "Unknown error" error message:
91:
92: if resp =~ /^[12]/
93: print_good(" TCP OPEN #{ip}:#{port}")
94: report_service(:host => ip, :port => port)
95: end
96: rescue ::Exception
97: print_error("Unknown error: #{$!}")
98: end
99: end
100: end
101: end
Go back to menu.
Related Pull Requests
- #11523 Merged Pull Request: MSF5: Remove unneeded RHOST deregister in scanners
- #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
- #6317 Merged Pull Request: Add capability for delays (+/- jitter) to all auxiliary scanner modules & implement in portscan modules
- #3235 Merged Pull Request: First little bit at Bug 8498
- #2779 Merged Pull Request: Raise Msf::OptionValidateError when the PORTS option is invalid
- #2525 Merged Pull Request: Change module boilerplate
- #1228 Merged Pull Request: MSFTIDY cleanup #1 - auxiliary
Go back to menu.
See Also
Check also the following modules related to this module:
- auxiliary/scanner/natpmp/natpmp_portscan
- auxiliary/scanner/portscan/ack
- auxiliary/scanner/portscan/syn
- auxiliary/scanner/portscan/tcp
- auxiliary/scanner/portscan/xmas
- auxiliary/scanner/sap/sap_router_portscanner
- auxiliary/scanner/http/frontpage_credential_dump
Authors
kris katterjohn
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.