Simple FTP Fuzzer - Metasploit


This page contains detailed information about how to use the auxiliary/fuzzers/ftp/ftp_pre_post metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: Simple FTP Fuzzer
Module: auxiliary/fuzzers/ftp/ftp_pre_post
Source code: modules/auxiliary/fuzzers/ftp/ftp_pre_post.rb
Disclosure date: -
Last modification time: 2019-03-05 03:38:51 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): 21
List of CVEs: -

This module will connect to a FTP server and perform pre- and post-authentication fuzzing

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/fuzzers/ftp/ftp_pre_post
msf auxiliary(ftp_pre_post) > show options
    ... show and set options ...
msf auxiliary(ftp_pre_post) > set RHOSTS ip-range
msf auxiliary(ftp_pre_post) > exploit

Other examples of setting the RHOSTS option:

Example 1:

msf auxiliary(ftp_pre_post) > set RHOSTS 192.168.1.3-192.168.1.200 

Example 2:

msf auxiliary(ftp_pre_post) > set RHOSTS 192.168.1.1/24

Example 3:

msf auxiliary(ftp_pre_post) > set RHOSTS file:/tmp/ip_list.txt

Required Options


  • RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'

Go back to menu.

Msfconsole Usage


Here is how the fuzzers/ftp/ftp_pre_post auxiliary module looks in the msfconsole:

msf6 > use auxiliary/fuzzers/ftp/ftp_pre_post

msf6 auxiliary(fuzzers/ftp/ftp_pre_post) > show info

       Name: Simple FTP Fuzzer
     Module: auxiliary/fuzzers/ftp/ftp_pre_post
    License: Metasploit Framework License (BSD)
       Rank: Normal

Provided by:
  corelanc0d3r <[email protected]>
  jduck <[email protected]>

Check supported:
  No

Basic options:
  Name          Current Setting      Required  Description
  ----          ---------------      --------  -----------
  CONNRESET     true                 no        Break on CONNRESET error
  DELAY         1                    no        Delay between connections in seconds
  ENDSIZE       20000                no        Fuzzing string endsize
  FASTFUZZ      true                 no        Only fuzz with cyclic pattern
  PASS          [email protected]  no        Password
  RHOSTS                             yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
  RPORT         21                   yes       The target port (TCP)
  STARTATSTAGE  1                    no        Start at this test stage
  STARTSIZE     10                   no        Fuzzing string startsize
  STEPSIZE      10                   no        Increase string size each iteration with this number of chars
  STOPAFTER     2                    no        Stop after x number of consecutive errors
  THREADS       1                    yes       The number of concurrent threads (max one per host)
  USER          anonymous            no        Username

Description:
  This module will connect to a FTP server and perform pre- and 
  post-authentication fuzzing

Module Options


This is a complete list of options available in the fuzzers/ftp/ftp_pre_post auxiliary module:

msf6 auxiliary(fuzzers/ftp/ftp_pre_post) > show options

Module options (auxiliary/fuzzers/ftp/ftp_pre_post):

   Name          Current Setting      Required  Description
   ----          ---------------      --------  -----------
   CONNRESET     true                 no        Break on CONNRESET error
   DELAY         1                    no        Delay between connections in seconds
   ENDSIZE       20000                no        Fuzzing string endsize
   FASTFUZZ      true                 no        Only fuzz with cyclic pattern
   PASS          [email protected]  no        Password
   RHOSTS                             yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
   RPORT         21                   yes       The target port (TCP)
   STARTATSTAGE  1                    no        Start at this test stage
   STARTSIZE     10                   no        Fuzzing string startsize
   STEPSIZE      10                   no        Increase string size each iteration with this number of chars
   STOPAFTER     2                    no        Stop after x number of consecutive errors
   THREADS       1                    yes       The number of concurrent threads (max one per host)
   USER          anonymous            no        Username

Advanced Options


Here is a complete list of advanced options supported by the fuzzers/ftp/ftp_pre_post auxiliary module:

msf6 auxiliary(fuzzers/ftp/ftp_pre_post) > show advanced

Module advanced options (auxiliary/fuzzers/ftp/ftp_pre_post):

   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
   ExpandCrash          false                                                                    no        Expand any crash strings
   FtpCommands          ABOR ACCT ALLO APPE AUTH CWD CDUP DELE FEAT HELP HOST LANG LIST MDTM MK  no        Commands to fuzz at stages 4 and 5
                        D MLST MODE NLST NLST -al NOOP OPTS PASV PORT PROT PWD REIN REST RETR R
                        MD RNFR RNTO SIZE SITE SITE CHMOD SITE CHOWN SITE EXEC SITE MSG SITE PS
                        WD SITE ZONE SITE WHO SMNT STAT STOR STOU STRU SYST TYPE XCUP XCRC XCWD
                         XMKD XPWD XRMD
   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 fuzzers/ftp/ftp_pre_post module can do:

msf6 auxiliary(fuzzers/ftp/ftp_pre_post) > show actions

Auxiliary actions:

   Name  Description
   ----  -----------

Evasion Options


Here is the full list of possible evasion options supported by the fuzzers/ftp/ftp_pre_post auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 auxiliary(fuzzers/ftp/ftp_pre_post) > 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.

STOPAFTER


Here is a relevant code snippet related to the "STOPAFTER" error message:

23:	        OptInt.new('STARTATSTAGE', [ false, "Start at this test stage",1]),
24:	        OptInt.new('STEPSIZE', [ false, "Increase string size each iteration with this number of chars",10]),
25:	        OptInt.new('DELAY', [ false, "Delay between connections in seconds",1]),
26:	        OptInt.new('STARTSIZE', [ false, "Fuzzing string startsize",10]),
27:	        OptInt.new('ENDSIZE', [ false, "Fuzzing string endsize",20000]),
28:	        OptInt.new('STOPAFTER', [ false, "Stop after x number of consecutive errors",2]),
29:	        OptString.new('USER', [ false, "Username",'anonymous']),
30:	        OptString.new('PASS', [ false, "Password",'[email protected]']),
31:	        OptBool.new('FASTFUZZ', [ false, "Only fuzz with cyclic pattern",true]),
32:	        OptBool.new('CONNRESET', [ false, "Break on CONNRESET error",true]),
33:	      ])

CONNRESET


Here is a relevant code snippet related to the "CONNRESET" error message:

27:	        OptInt.new('ENDSIZE', [ false, "Fuzzing string endsize",20000]),
28:	        OptInt.new('STOPAFTER', [ false, "Stop after x number of consecutive errors",2]),
29:	        OptString.new('USER', [ false, "Username",'anonymous']),
30:	        OptString.new('PASS', [ false, "Password",'[email protected]']),
31:	        OptBool.new('FASTFUZZ', [ false, "Only fuzz with cyclic pattern",true]),
32:	        OptBool.new('CONNRESET', [ false, "Break on CONNRESET error",true]),
33:	      ])
34:	
35:	    @evilchars = [
36:	      'A','a','%s','%d','%n','%x','%p','-1','0','0xfffffffe','0xffffffff','A/','//','/..','//..',
37:	      'A%20','./A','.A',',A','A:','!A','&A','?A','\A','../A/','..?','//A:','\\A','{A','$A','A*',

Exception <ERROR_CNT> of <NR_ERRORS>


Here is a relevant code snippet related to the "Exception <ERROR_CNT> of <NR_ERRORS>" error message:

106:	
107:	            count += datastore['STEPSIZE']
108:	
109:	          rescue ::Exception => e
110:	            @error_cnt += 1
111:	            print_status("Exception #{@error_cnt} of #{@nr_errors}")
112:	            if (e.class.name == 'Rex::ConnectionRefused') or (e.class.name == 'EOFError') or (e.class.name == 'Errno::ECONNRESET' and datastore['CONNRESET']) or (e.class.name == 'Errno::EPIPE')
113:	              if datastore['ExpandCrash']
114:	                print_status("Crash string : #{prepend}#{evil}")
115:	              else
116:	                print_status("Crash string : #{prepend}#{evilstr} x #{count}")

Rex::ConnectionRefused


Here is a relevant code snippet related to the "Rex::ConnectionRefused" error message:

107:	            count += datastore['STEPSIZE']
108:	
109:	          rescue ::Exception => e
110:	            @error_cnt += 1
111:	            print_status("Exception #{@error_cnt} of #{@nr_errors}")
112:	            if (e.class.name == 'Rex::ConnectionRefused') or (e.class.name == 'EOFError') or (e.class.name == 'Errno::ECONNRESET' and datastore['CONNRESET']) or (e.class.name == 'Errno::EPIPE')
113:	              if datastore['ExpandCrash']
114:	                print_status("Crash string : #{prepend}#{evil}")
115:	              else
116:	                print_status("Crash string : #{prepend}#{evilstr} x #{count}")
117:	              end

System does not respond - exiting nown


Here is a relevant code snippet related to the "System does not respond - exiting nown" error message:

114:	                print_status("Crash string : #{prepend}#{evil}")
115:	              else
116:	                print_status("Crash string : #{prepend}#{evilstr} x #{count}")
117:	              end
118:	              if @error_cnt >= @nr_errors
119:	                print_status("System does not respond - exiting now\n")
120:	                @stopprocess = true
121:	                print_error("Error: #{e.class} #{e} #{e.backtrace}\n")
122:	                return
123:	              else
124:	                print_status("Exception triggered, need #{@nr_errors - @error_cnt} more exception(s) before interrupting process")

Error: <E.CLASS> <E> <E.BACKTRACE>n


Here is a relevant code snippet related to the "Error: <E.CLASS> <E> <E.BACKTRACE>n" error message:

116:	                print_status("Crash string : #{prepend}#{evilstr} x #{count}")
117:	              end
118:	              if @error_cnt >= @nr_errors
119:	                print_status("System does not respond - exiting now\n")
120:	                @stopprocess = true
121:	                print_error("Error: #{e.class} #{e} #{e.backtrace}\n")
122:	                return
123:	              else
124:	                print_status("Exception triggered, need #{@nr_errors - @error_cnt} more exception(s) before interrupting process")
125:	                select(nil,nil,nil,3)  #wait 3 seconds
126:	              end

Exception triggered, need <VALUE> more exception(s) before interrupting process


Here is a relevant code snippet related to the "Exception triggered, need <VALUE> more exception(s) before interrupting process" error message:

119:	                print_status("System does not respond - exiting now\n")
120:	                @stopprocess = true
121:	                print_error("Error: #{e.class} #{e} #{e.backtrace}\n")
122:	                return
123:	              else
124:	                print_status("Exception triggered, need #{@nr_errors - @error_cnt} more exception(s) before interrupting process")
125:	                select(nil,nil,nil,3)  #wait 3 seconds
126:	              end
127:	            end
128:	            if @error_cnt >= @nr_errors
129:	              count += datastore['STEPSIZE']

STOPAFTER


Here is a relevant code snippet related to the "STOPAFTER" error message:

145:	
146:	  def run_host(ip)
147:	
148:	    startstage = datastore['STARTATSTAGE']
149:	
150:	    @nr_errors = datastore['STOPAFTER']
151:	    @error_cnt = 0
152:	    @stopprocess = false
153:	
154:	    if datastore['FASTFUZZ']
155:	      @evilchars = ['']

Exception <ERROR_CNT> of <NR_ERRORS>


Here is a relevant code snippet related to the "Exception <ERROR_CNT> of <NR_ERRORS>" error message:

222:	                select(nil, nil, nil, datastore['DELAY'])
223:	                @error_cnt = 0
224:	              end
225:	            rescue ::Exception => e
226:	              @error_cnt += 1
227:	              print_status("Exception #{@error_cnt} of #{@nr_errors}")
228:	              if (e.class.name == 'Rex::ConnectionRefused') or (e.class.name == 'EOFError') or (e.class.name == 'Errno::ECONNRESET' and datastore['CONNRESET']) or (e.class.name == 'Errno::EPIPE')
229:	                if @error_cnt >= @nr_errors
230:	                  print_status("System does not respond - exiting now\n")
231:	                  @stopprocess = true
232:	                  print_error("Error: #{e.class} #{e} #{e.backtrace}\n")

Rex::ConnectionRefused


Here is a relevant code snippet related to the "Rex::ConnectionRefused" error message:

223:	                @error_cnt = 0
224:	              end
225:	            rescue ::Exception => e
226:	              @error_cnt += 1
227:	              print_status("Exception #{@error_cnt} of #{@nr_errors}")
228:	              if (e.class.name == 'Rex::ConnectionRefused') or (e.class.name == 'EOFError') or (e.class.name == 'Errno::ECONNRESET' and datastore['CONNRESET']) or (e.class.name == 'Errno::EPIPE')
229:	                if @error_cnt >= @nr_errors
230:	                  print_status("System does not respond - exiting now\n")
231:	                  @stopprocess = true
232:	                  print_error("Error: #{e.class} #{e} #{e.backtrace}\n")
233:	                  return

System does not respond - exiting nown


Here is a relevant code snippet related to the "System does not respond - exiting nown" error message:

225:	            rescue ::Exception => e
226:	              @error_cnt += 1
227:	              print_status("Exception #{@error_cnt} of #{@nr_errors}")
228:	              if (e.class.name == 'Rex::ConnectionRefused') or (e.class.name == 'EOFError') or (e.class.name == 'Errno::ECONNRESET' and datastore['CONNRESET']) or (e.class.name == 'Errno::EPIPE')
229:	                if @error_cnt >= @nr_errors
230:	                  print_status("System does not respond - exiting now\n")
231:	                  @stopprocess = true
232:	                  print_error("Error: #{e.class} #{e} #{e.backtrace}\n")
233:	                  return
234:	                else
235:	                  print_status("Exception triggered, need #{@nr_errors - @error_cnt} more exception(s) before interrupting process")

Error: <E.CLASS> <E> <E.BACKTRACE>n


Here is a relevant code snippet related to the "Error: <E.CLASS> <E> <E.BACKTRACE>n" error message:

227:	              print_status("Exception #{@error_cnt} of #{@nr_errors}")
228:	              if (e.class.name == 'Rex::ConnectionRefused') or (e.class.name == 'EOFError') or (e.class.name == 'Errno::ECONNRESET' and datastore['CONNRESET']) or (e.class.name == 'Errno::EPIPE')
229:	                if @error_cnt >= @nr_errors
230:	                  print_status("System does not respond - exiting now\n")
231:	                  @stopprocess = true
232:	                  print_error("Error: #{e.class} #{e} #{e.backtrace}\n")
233:	                  return
234:	                else
235:	                  print_status("Exception triggered, need #{@nr_errors - @error_cnt} more exception(s) before interrupting process")
236:	                  select(nil,nil,nil,3)  #wait 3 seconds
237:	                end

Exception triggered, need <VALUE> more exception(s) before interrupting process


Here is a relevant code snippet related to the "Exception triggered, need <VALUE> more exception(s) before interrupting process" error message:

230:	                  print_status("System does not respond - exiting now\n")
231:	                  @stopprocess = true
232:	                  print_error("Error: #{e.class} #{e} #{e.backtrace}\n")
233:	                  return
234:	                else
235:	                  print_status("Exception triggered, need #{@nr_errors - @error_cnt} more exception(s) before interrupting process")
236:	                  select(nil,nil,nil,3)  #wait 3 seconds
237:	                end
238:	              end
239:	              if @error_cnt >= @nr_errors
240:	                @error_cnt = 0

Go back to menu.


Go back to menu.

See Also


Check also the following modules related to this module:

Authors


  • corelanc0d3r <peter.ve[at]corelan.be>
  • jduck

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.