Exploitation Tools

RWX_MEMORY_HUNT_AND_INJECTION_DV : Exploiting OneDrive.exe To Inject Shellcode Without New RWX Allocations

Abusing Windows fork API and OneDrive.exe process to inject the malicious shellcode without allocating new RWX memory region.

This technique is finding RWX region in already running processes in this case OneDrive.exe and Write shellcode into that region and execute it without calling VirtualProtect, VirtualAllocEx, VirtualAlloc.

Usage

Just compile the program and run the (EXE) without any paremeter.

Steps

  • Find the OneDrive.exe in running processes.
  • Get the handle of OneDrive.exe.
  • Query remote process memory information.
  • look for RWX memory regions.
  • Write shellcode into found region of OneDrive.exe
  • Fork OneDrive.exe into a new process.
  • Set the forked process’s start address to the cloned shellcode.
  • Terminate the cloned process after execution.

Shellcode

This technique will work with ntdll based shellcode which is not dependent on any section. I used to generate my shellcode.

Shellcode Creation

  • Edit the shellcode template file funtion ‘shellcode_template’ according to instructions given on
  • Compile the code and open .EXE file in any hex editor (HxD)
  • Extract the .text section and use that in given project file.
  • To extract the shellcode there are other methods also explained in the repository.
Varshini

Varshini is a Cyber Security expert in Threat Analysis, Vulnerability Assessment, and Research. Passionate about staying ahead of emerging Threats and Technologies.

Recent Posts

Limbo : The Modern Evolution Of SQLite

Limbo is an ambitious project aimed at reimagining SQLite, the widely-used embedded database, by rewriting…

3 hours ago

Typst : Revolutionizing Typesetting With Markup And Speed

Typst is a modern, markup-based typesetting system designed to combine the power of LaTeX with…

3 hours ago

msuserstats : Streamlining Hybrid Microsoft Environments For Enhanced User Account Management

The msuserstats tool is a robust PowerShell-based solution designed to streamline user account management in…

3 hours ago

Cube : The Semantic Layer For Data Applications

Cube is a powerful semantic layer designed to streamline the process of building data applications…

3 hours ago

Iced : Unleashing The Power Of Rust For Cross-Platform GUI Development

Iced is a cross-platform GUI library for Rust, designed with a focus on simplicity and…

3 hours ago

MEGR-APT : Harnessing Graph Neural Networks For Advanced Threat Detection

MEGR-APT is an advanced and scalable system designed for hunting Advanced Persistent Threats (APTs) by…

3 hours ago