Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8652871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:24:27+00:00 2026-06-12T14:24:27+00:00

In the past few years, malware (and some pen-test tools like Metasploit’s meterpreter payload)

  • 0

In the past few years, malware (and some pen-test tools like Metasploit’s meterpreter payload) have begun to use reflective DLL injection (PDF) to load a DLL into the memory of a process. The benefit is that the file is never written to disk and is difficult to detect. Many examples I’ve seen are based on Joachim Bauch’s work.

However, at DEF CON 20 Andrew King demonstrated that he was able to detect DLL’s injected using reflective DLL injection. His presentation was called “Detecting Reflective Injection“. Unfortunately, he has not released the source code (which he certainly is under no obligation to do).

UPDATE: Apparently I missed it, but Andrew did open-source this work a couple years ago: https://github.com/aking1012/dc20

In addition, a tool called “Antimeter” can detect the meterpreter engine when loaded using reflective dll injection. Again, closed source.

I understand that Andrew King’s tool and Antimeter are both written in Python and use pydbg/pydasm in order to enumerate the memory of running executables.

Does anyone have some general source code (in Python, C, Delphi, or otherwise) that they are willing to share that demonstrates how to detect reflective DLL injection? There are memory forensic tools that can analyze a memory dump and find this, but I’m looking to execute an application on a running system (like antimeter does) and find processes with reflectively injected DLL’s.

If you are interested in understanding how reflective DLL injection works, there is some open-source code written in Delphi that shows how to do this.

UPDATE:
I tested and I can reflectively inject DLL’s without admin rights (and as a regular user), but of course as a USER I can only inject into processes running at the same integrity level (and in my session)…but that still covers applications like the Office suite, Internet Explorer, etc.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T14:24:28+00:00Added an answer on June 12, 2026 at 2:24 pm

    What about hooking the VirtualProtect API. Because DLLs that load itself will certainly set execute on its memory code range. This is because (as you mentioned) they use User access rights so they have to use the process userspace API.

    NTSYSAPI NTSTATUS NTAPI ZwProtectVirtualMemory(
        IN HANDLE ProcessHandle,
        IN PVOID *  BaseAddress,
        IN SIZE_T *     NumberOfBytesToProtect,
        IN ULONG    NewAccessProtection,
        OUT PULONG  OldAccessProtection 
    );
    

    If you hook that at the very beginning of your program, you can filter out suspicious protection calls (the one that enable code execution). I would then scan for PE header or such in front of the requested pages to know that its a loadable module… note: i think this is not called for regular DLLs as LoadLibrary handles this inside the Kernel space. right? TODO: verify

    Normally the PE header is located 0x1000 (4096) bytes or one page in front of the first executable code. So a VERY basic approach can be to scan for the “MZ” tag:

    char* pe = ((char*)BaseAddress) - 0x1000;
    if ((NewAccessProtection == PAGE_EXECUTE || ... ) & pe[0] == 'M' && pe[0] == 'Z')
    {
        // do checks here
    }
    

    If you need further info on API hooking just ask or read tons of articles on the net. Another hooking candidate is: FlushInstructionCache(…). But I think only Blizzard is using this for warden anti cheat modules as theres no reason on x86 architecture to call this.

    … just a thought,

    will

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For the past few years I have been using Gary Keith's browscap file to
I have been following the usage of JavaScript for the past few years, and
In the past few years I have read plenty of articles on Foreign Keys
Most software-development buzzwords of the past few years, have been at times labeled either
I have written quite a bit of code of the past few years. I've
I have just started web development after a few years. Mostly in the past
I have been using css for a few years but have never ventured past
In the past few years of using svn, I've frequently run into problems where
Over the past few years I've been on projects where we've run into a
For the past few years, I've generally accepted that if I am going to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.