Skip to content

Wra7h/PEResourceInject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PEResourceInject

A way to avoid using VirtualAllocEx/WriteProcessMemory to inject shellcode into a process. You need access to modify the target executable.

If the target exe has a .rsrc section already, it is overwritten with the new resource. However if the exe did not have a .rsrc, the section is added before being spawned.

  • Write shellcode to the target's .rsrc as a bitmap using the UpdateResource APIs
  • Spawn the exe suspended
  • Calculate the shellcode location by parsing the PE header
  • VirtualProtectEx to RX
  • Get/SetThreadContext to execute

Usage (x64 only)

PEResourceInject.exe -exe <C:\path\to\target.exe> -bin <C:\Path\to\raw\shellcode.bin>

Tested with:

  • MS Office/VLC/FireFox
  • Shellcode: MSFVenom/Apollo

References/APIs:

A dive into the PE file format by 0xRick

BeginUpdateResource
UpdateResource
EndUpdateResource

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages