Executing DLL as a Process

Download from: https://github.com/jmprsp/ProcessFailures

Reference: https://recon.cx/2016/talks/Process-Failure-Modes.html

As presented in RECON 2016 by James Forshaw. He demonstrated that he is able to execute a DLL as a standalone process. According to his presentation, the reason why a DLL can’t be executed as a process is due to a check on the ProhibitedImageCharacteristics field. His POC is in the form of C#/Powershell. I simply converted it to C/Executable.

ProhibitedImageCharacteristics
Figure 1. ProhibitedImageCharacteristics

So by simply resetting this field to 0, we could then run a DLL as a process!

The following is a DLL with a .txt extension; just for fun… using regsvr32 is one of the way to execute a DLL and as you can see, a messagebox shows up stating that it is a DLL.

dll
Figure 2. running a DLL

Now using James approach, we can now execute pikachu.txt as an executable!

Executable
Figure 3. running the DLL as a process
taskmanager
Figure 4. pikachu.txt running as a process

Looking it from IDA Pro

Clear.PNG
Figure 5. Clearing ProhibitedImageCharacteristics

Note that one do not necessary need to clear the field with 0. Other values work as well.

Advertisements
Executing DLL as a Process

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s