Skip to content

Commit f9b8a9b

Browse files
committed
Adds more robust check method
1 parent 6c65db5 commit f9b8a9b

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

modules/exploits/osx/misc/remote_for_mac_udp_rce.rb

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
require 'json'
2-
require 'socket'
1+
##
2+
# This module requires Metasploit: https://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
35

46
class MetasploitModule < Msf::Exploit::Remote
57
Rank = ExcellentRanking
68

79
include Msf::Exploit::Remote::HttpClient
810
include Msf::Exploit::Remote::Udp
11+
prepend Msf::Exploit::Remote::AutoCheck
912

1013
def initialize(info = {})
1114
super(
@@ -21,7 +24,7 @@ def initialize(info = {})
2124
'Author' => ['Chokri Hammedi'],
2225
'License' => MSF_LICENSE,
2326
'References' => [
24-
['URL', 'https://packetstorm.news/files/id/196351/']
27+
['PACKETSTORM', '196351']
2528
],
2629
'Platform' => 'unix',
2730
'Arch' => ARCH_CMD,
@@ -59,9 +62,18 @@ def check
5962
json_body = res.get_json_document
6063
auth_enabled = json_body.fetch('requires.auth', nil)
6164

62-
return CheckCode::Appears('Authentication is disabled, target is vulnerable') if auth_enabled == 'false'
65+
return CheckCode::Detected('Remote For Mac detected, but authentication enabled') unless auth_enabled.to_s == 'false'
6366

64-
CheckCode::Detected('Remote For Mac detected, but authentication enabled')
67+
version = json_body.fetch('version').to_s
68+
69+
return CheckCode::Unknown('Could not determine target version') if version.empty?
70+
71+
target_version = Rex::Version.new(version)
72+
vulnerable_version = Rex::Version.new('2025.7')
73+
74+
return CheckCode::Appears("Detected vulnerable version #{version} with authentication disabled") if target_version <= vulnerable_version
75+
76+
CheckCode::Safe("Target version #{version} is not vulnerable")
6577
end
6678

6779
def exploit

0 commit comments

Comments
 (0)