Skip to content

ftp_version: Use FTP mixin#21378

Open
g0tmi1k wants to merge 7 commits into
rapid7:masterfrom
g0tmi1k:ftp_version
Open

ftp_version: Use FTP mixin#21378
g0tmi1k wants to merge 7 commits into
rapid7:masterfrom
g0tmi1k:ftp_version

Conversation

@g0tmi1k

@g0tmi1k g0tmi1k commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

This PR covers:

  • Move functions into FTP mixin
  • Add more metadata (Notes & references)
  • Remove un-used variables/options/settings (FTPUSER/FTPPASS)
  • ...and Get rubocop happy
          current  name     hosts  services  vulns  creds  loots  notes
          -------  ----     -----  --------  -----  -----  -----  -----
Before -> *        default  2      4         0      0      0      2
After  -> *        default  2      4         0      0      0      5
[+] 10.0.0.10:21          - FTP Banner: '220 (vsFTPd 2.3.4)\x0d\x0a'
[...]
[+] 10.0.0.10:21          - FTP Banner: vsFTPd 2.3.4

Target is Metasploitable 2.

Before

  • FTP banner needs trimming
  • Host/service metadata isn't "rich"
$ ./msfconsole -q -x 'workspace -D;
setg RHOSTS 10.0.0.10;
use auxiliary/scanner/ftp/ftp_version;
run;
set RPORT 2121;
run;
set RHOST 10.0.0.1;
set RPORT 21;
run;'
[*] Deleted workspace: default
[*] Recreated the default workspace
RHOSTS => 10.0.0.10
[+] 10.0.0.10:21          - FTP Banner: '220 (vsFTPd 2.3.4)\x0d\x0a'
[*] 10.0.0.10:21          - Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
RPORT => 2121
[+] 10.0.0.10:2121        - FTP Banner: '220 ProFTPD 1.3.1 Server (Debian) [::ffff:10.0.0.10]\x0d\x0a'
[*] 10.0.0.10:2121        - Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
RHOST => 10.0.0.1
RPORT => 21
[*] 10.0.0.1:21           - Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
msf auxiliary(scanner/ftp/ftp_version) > workspace -v

Workspaces
==========

current  name     hosts  services  vulns  creds  loots  notes
-------  ----     -----  --------  -----  -----  -----  -----
*        default  2      4         0      0      0      2

msf auxiliary(scanner/ftp/ftp_version) > hosts

Hosts
=====

address    mac  name  os_name  os_flavor  os_sp  purpose  info  comments
-------    ---  ----  -------  ---------  -----  -------  ----  --------
10.0.0.1
10.0.0.10             Unknown                    device

msf auxiliary(scanner/ftp/ftp_version) > services
Services
========

host       port  proto  name  state  info                                                          resource  parents
----       ----  -----  ----  -----  ----                                                          --------  -------
10.0.0.10  21    tcp    tcp   open                                                                 {}
10.0.0.10  21    tcp    ftp   open   220 (vsFTPd 2.3.4)\x0d\x0a                                    {}        tcp (21/tcp)
10.0.0.10  2121  tcp    tcp   open                                                                 {}
10.0.0.10  2121  tcp    ftp   open   220 ProFTPD 1.3.1 Server (Debian) [::ffff:10.0.0.10]\x0d\x0a  {}        tcp (2121/tcp)

msf auxiliary(scanner/ftp/ftp_version) > notes

Notes
=====

 Time                     Host       Service  Port  Protocol  Type        Data
 ----                     ----       -------  ----  --------  ----        ----
 2026-05-20 09:37:56 UTC  10.0.0.10  ftp      21    tcp       ftp.banner  {:banner=>"220 (vsFTPd 2.3.4)"}
 2026-05-20 09:37:56 UTC  10.0.0.10  ftp      2121  tcp       ftp.banner  {:banner=>"220 ProFTPD 1.3.1 Server (Debian) [::ffff:10.0.0.10]"}

msf auxiliary(scanner/ftp/ftp_version) >

After

$ ./msfconsole -q -x 'workspace -D;
setg RHOSTS 10.0.0.10;
use auxiliary/scanner/ftp/ftp_version;
run;
set RPORT 2121;
run;
set RHOST 10.0.0.1;
set RPORT 21;
run;'
[*] Deleted workspace: default
[*] Recreated the default workspace
RHOSTS => 10.0.0.10
[+] 10.0.0.10:21          - FTP Banner: vsFTPd 2.3.4
[*] 10.0.0.10:21          - Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
RPORT => 2121
[+] 10.0.0.10:2121        - FTP Banner: ProFTPD 1.3.1
[*] 10.0.0.10:2121        - Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
RHOST => 10.0.0.1
RPORT => 21
[*] 10.0.0.1:21           - Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
msf auxiliary(scanner/ftp/ftp_version) > workspace -v

Workspaces
==========

current  name     hosts  services  vulns  creds  loots  notes
-------  ----     -----  --------  -----  -----  -----  -----
*        default  2      4         0      0      0      5

msf auxiliary(scanner/ftp/ftp_version) > hosts

Hosts
=====

address    mac  name  os_name  os_flavor  os_sp  purpose  info  comments
-------    ---  ----  -------  ---------  -----  -------  ----  --------
10.0.0.1
10.0.0.10             Linux    Debian            device

msf auxiliary(scanner/ftp/ftp_version) > services
Services
========

host       port  proto  name  state  info           resource  parents
----       ----  -----  ----  -----  ----           --------  -------
10.0.0.10  21    tcp    ftp   open   vsFTPd 2.3.4   {}        tcp (21/tcp)
10.0.0.10  21    tcp    tcp   open                  {}
10.0.0.10  2121  tcp    ftp   open   ProFTPD 1.3.1  {}        tcp (2121/tcp)
10.0.0.10  2121  tcp    tcp   open                  {}

msf auxiliary(scanner/ftp/ftp_version) > notes

Notes
=====

 Time                     Host       Service  Port  Protocol  Type        Data
 ----                     ----       -------  ----  --------  ----        ----
 2026-05-20 09:36:19 UTC  10.0.0.10  ftp      21    tcp       ftp.banner  {:banner=>"220 (vsFTPd 2.3.4)"}
 2026-05-20 09:36:19 UTC  10.0.0.10  ftp      21    tcp       ftp.cpe     {:cpe=>"cpe:/a:vsftpd_project:vsftpd:2.3.4"}
 2026-05-20 09:36:19 UTC  10.0.0.10  ftp      2121  tcp       ftp.banner  {:banner=>"220 ProFTPD 1.3.1 Server (Debian) [::ffff:10.0.0.10]"}
 2026-05-20 09:36:19 UTC  10.0.0.10  ftp      2121  tcp       ftp.cpe     {:cpe=>"cpe:/a:proftpd:proftpd:1.3.1"}
 2026-05-20 09:36:19 UTC  10.0.0.10  ftp      2121  tcp       ftp.cpe     {:cpe=>"cpe:/o:debian:debian_linux:-"}

msf auxiliary(scanner/ftp/ftp_version) >

Comment thread modules/auxiliary/scanner/ftp/ftp_version.rb Outdated
@g0tmi1k g0tmi1k force-pushed the ftp_version branch 11 times, most recently from 116233e to 0cf2482 Compare April 30, 2026 11:58
@g0tmi1k g0tmi1k requested a review from adfoster-r7 May 4, 2026 11:40
@g0tmi1k g0tmi1k changed the title ftp_version: Strip banner ftp_version: Various improvements May 4, 2026
@g0tmi1k g0tmi1k force-pushed the ftp_version branch 6 times, most recently from 57c88ca to 896421d Compare May 5, 2026 17:46
@g0tmi1k

g0tmi1k commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

This needs #21416 to be merged ahead of time.

@g0tmi1k g0tmi1k force-pushed the ftp_version branch 7 times, most recently from ef71838 to f631c1b Compare May 6, 2026 16:27
@g0tmi1k g0tmi1k force-pushed the ftp_version branch 2 times, most recently from f631c1b to 2f8188e Compare May 12, 2026 05:35
Comment thread modules/auxiliary/scanner/ftp/ftp_version.rb
Comment thread modules/auxiliary/scanner/ftp/ftp_version.rb
@g0tmi1k g0tmi1k requested a review from msutovsky-r7 May 14, 2026 15:59
@g0tmi1k g0tmi1k force-pushed the ftp_version branch 5 times, most recently from bdc3f06 to 11ef8cc Compare May 20, 2026 09:17
@g0tmi1k g0tmi1k changed the title ftp_version: Various improvements ftp_version: Use FTP mixin May 20, 2026
@g0tmi1k

g0tmi1k commented May 20, 2026

Copy link
Copy Markdown
Contributor Author

Think I've finished tweaking with this PR!

@jheysel-r7 jheysel-r7 added the blocked Blocked by one or more additional tasks label Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked Blocked by one or more additional tasks enhancement

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

6 participants