diff --git a/DonutTest/Hello.exe b/DonutTest/Hello.exe deleted file mode 100644 index 64bb670..0000000 Binary files a/DonutTest/Hello.exe and /dev/null differ diff --git a/DonutTest/calc.xsl b/DonutTest/calc.xsl deleted file mode 100644 index fc0a3ab..0000000 --- a/DonutTest/calc.xsl +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/loader/test/dlltest.c b/DonutTest/dlltest.c similarity index 100% rename from loader/test/dlltest.c rename to DonutTest/dlltest.c diff --git a/DonutTest/hello.c b/DonutTest/hello.c deleted file mode 100644 index b5f3d2a..0000000 --- a/DonutTest/hello.c +++ /dev/null @@ -1,56 +0,0 @@ -#define UNICODE - -#include -#include -#include -#include -#include -#include - -#include -#pragma comment(lib, "user32.lib") -#pragma comment(lib, "shell32.lib") - -__declspec(dllexport) -VOID WINAPI RunProcess(PWCHAR proc1, PWCHAR proc2) { - PROCESS_INFORMATION pi; - STARTUPINFO si; - - ZeroMemory(&si, sizeof(si)); - si.cb = sizeof(si); - CreateProcess(NULL, proc1, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - - ZeroMemory(&si, sizeof(si)); - si.cb = sizeof(si); - CreateProcess(NULL, proc2, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); -} - -__declspec(dllexport) -VOID WINAPI DonutApiW(PWCHAR arg0, PWCHAR arg1, PWCHAR arg2, PWCHAR arg3) { - WCHAR msg[4096]; - - _snwprintf(msg, ARRAYSIZE(msg), - L"param[0] : %ws\r" - L"param[1] : %ws\r" - L"param[2] : %ws\r" - L"param[3] : %ws\r", - arg0, arg1, arg2, arg3); - - MessageBox(NULL, msg, L"Donut Test", MB_OK); -} - -__declspec(dllexport) -BOOL WINAPI DllMain(HMODULE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved) { - switch (ul_reason_for_call) { - case DLL_PROCESS_ATTACH: - MessageBox(NULL, L"Hello, World!", L"Hello, World!", 0); - break; - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - case DLL_PROCESS_DETACH: - break; - } - return TRUE; -} diff --git a/DonutTest/testcase.c b/DonutTest/testcase.c deleted file mode 100644 index 80cafaf..0000000 --- a/DonutTest/testcase.c +++ /dev/null @@ -1,88 +0,0 @@ - - -// just some simple test cases to use with donut library - -#include "donut.h" - -typedef struct _test_case_t { - int arch; - int bypass; - int inst_type; - char *domain; - char *cls; - char *method; - char *param; - char *file; - char *url; - char *runtime; - int err; // expected result based on test case -} test_case; - -test_case tests[] = { - // nothing supplied - {0,0,0,"","","","","","","",DONUT_ERROR_INVALID_PARAMETER}, - // requesting x86 shellcode for x64 DLL - {DONUT_ARCH_X86,DONUT_BYPASS_CONTINUE,DONUT_INSTANCE_PIC,"domain","cls","method","param","hello_amd64.dll","","",DONUT_ERROR_ARCH_MISMATCH}, - // requesting x64 shellcode for x86 DLL - {DONUT_ARCH_X64,DONUT_BYPASS_CONTINUE,DONUT_INSTANCE_PIC,"domain","","","","hello_x86.dll","","",DONUT_ERROR_ARCH_MISMATCH}, - // supplying parameters for unmanaged DLL, but not function name - {DONUT_ARCH_X64,DONUT_BYPASS_CONTINUE,DONUT_INSTANCE_PIC,"domain","","","calc.exe,notepad.exe","hello_amd64.dll","","",DONUT_ERROR_DLL_PARAM}, - // supplying function name that can't be found in DLL - {DONUT_ARCH_X64,DONUT_BYPASS_CONTINUE,DONUT_INSTANCE_PIC,"domain","","NoMethod","calc.exe,notepad.exe","hello_amd64.dll","","",DONUT_ERROR_DLL_FUNCTION}, - // supplying file that isn't recognized - {DONUT_ARCH_ANY,DONUT_BYPASS_CONTINUE,DONUT_INSTANCE_PIC,"","","","","/dev/null","","",DONUT_ERROR_FILE_INVALID}, - // .NET DLL assembly with no method provided - {DONUT_ARCH_X84,DONUT_BYPASS_CONTINUE,DONUT_INSTANCE_PIC,"domain","TestClass","","","class1.dll","","",DONUT_ERROR_NET_PARAMS}, - // .NET DLL assembly with no class provided - {DONUT_ARCH_X84,DONUT_BYPASS_CONTINUE,DONUT_INSTANCE_PIC,"domain","","RunProcess","calc.exe,notepad.exe","class1.dll","","",DONUT_ERROR_NET_PARAMS}, - // .NET DLL with good parameters - {DONUT_ARCH_X84,DONUT_BYPASS_CONTINUE,DONUT_INSTANCE_PIC,"domain","TestClass","RunProcess","calc.exe,notepad.exe","class1.dll","","",DONUT_ERROR_SUCCESS}, - // invalid URL - {DONUT_ARCH_X84,DONUT_BYPASS_CONTINUE,DONUT_INSTANCE_URL,"domain","TestClass","RunProcess","calc.exe,notepad.exe","class1.dll","http:","",DONUT_ERROR_INVALID_URL}, - // invalid URL length - {DONUT_ARCH_X84,DONUT_BYPASS_CONTINUE,DONUT_INSTANCE_URL,"domain","TestClass","RunProcess","calc.exe,notepad.exe","class1.dll","http://","",DONUT_ERROR_URL_LENGTH}, - {DONUT_ARCH_X84,DONUT_BYPASS_CONTINUE,DONUT_INSTANCE_URL,"domain","TestClass","RunProcess","calc.exe,notepad.exe","class1.dll","https://","",DONUT_ERROR_URL_LENGTH}, - {DONUT_ARCH_X84,DONUT_BYPASS_CONTINUE,DONUT_INSTANCE_URL,"domain","TestClass","RunProcess","calc.exe,notepad.exe","class1.dll","https://a","",DONUT_ERROR_SUCCESS}, - {DONUT_ARCH_X84,DONUT_BYPASS_CONTINUE,DONUT_INSTANCE_URL,"domain","TestClass","RunProcess","calc.exe,notepad.exe","class1.dll", - "https://AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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include - -#include -#pragma comment(lib, "user32.lib") -#pragma comment(lib, "shell32.lib") - -__declspec(dllexport) -VOID WINAPI RunProcess(PWCHAR proc1, PWCHAR proc2) { - PROCESS_INFORMATION pi; - STARTUPINFO si; - - ZeroMemory(&si, sizeof(si)); - si.cb = sizeof(si); - CreateProcess(NULL, proc1, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - - ZeroMemory(&si, sizeof(si)); - si.cb = sizeof(si); - CreateProcess(NULL, proc2, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); -} - -__declspec(dllexport) -VOID WINAPI DonutApiW(PWCHAR arg0, PWCHAR arg1, PWCHAR arg2, PWCHAR arg3) { - WCHAR msg[4096]; - - _snwprintf(msg, ARRAYSIZE(msg), - L"param[0] : %ws\r" - L"param[1] : %ws\r" - L"param[2] : %ws\r" - L"param[3] : %ws\r", - arg0, arg1, arg2, arg3); - - MessageBox(NULL, msg, L"Donut Test", MB_OK); -} - -__declspec(dllexport) -BOOL WINAPI DllMain(HMODULE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved) { - switch (ul_reason_for_call) { - case DLL_PROCESS_ATTACH: - MessageBox(NULL, L"Hello, World!", L"Hello, World!", 0); - break; - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - case DLL_PROCESS_DETACH: - break; - } - return TRUE; -} diff --git a/loader/test/hello.cs b/loader/test/hello.cs deleted file mode 100644 index b3e4f95..0000000 --- a/loader/test/hello.cs +++ /dev/null @@ -1,16 +0,0 @@ -// A Hello World! program in C#. -using System; -namespace HelloWorld -{ - class Hello - { - static void Main() - { - Console.WriteLine("Hello World!"); - - // Keep the console window open in debug mode. - Console.WriteLine("Press any key to exit."); - Console.ReadKey(); - } - } -}