[.07] EMET 4 compatibility
Posted: Fri Apr 19, 2013 4:50 pm
With the beta release of EMET 4 (and final May 14), the EMET template needs a small update in order for the EMET Agent (notifier) to receive notifications if EMET is triggered in a sandboxed program. EMET 4 uses a Mailslot instead of window messages. The Mailslot is named EMET_Agent_SessionID, so add the following:
OpenPipePath=\Device\Mailslot\EMET_Agent_*
BTW, in the EMET DLL, I see the string ...\EMET_Recipient_%u%u and in the sent Mailslot message, a Reply XML attribute, etc. So it's possible another Mailslot could be used for some other communication, although nothing I did showed evidence of that. But anyway, not sure if there could be a need for:
OpenPipePath=\Device\Mailslot\EMET_Recipient_*
As well. Or even simply \EMET_*
*shrug*
AND... There seems to be another bug with 4.01 vs 3.76 (although it seems weird too), after I noticed it mentioned in this Wilders EMET thread about EMET not showing stuff as protected. Shouldn't be any problems with that (the current template's IPC is fine still), however...
I noticed that when using Run Sandboxed with IE (XP and 7 64-bit), the EMET DLL doesn't even get loaded! On Win 7 (IE 8 I guess?), the child iexplore.exe does get it, so again it seems like Start.exe is messing something up?
This should NOT be specific to EMET, but perhaps any AppCompat mechanism is being interfered with...?
What's REALLY weird is that another program I was checking for the EMET Notifier (crashes with DEP), DOES get EMET loaded if I use "Run From Start Menu," but not Run Sandboxed -- aren't they almost the same?! With IE, nothing involving Start.exe lets EMET load.
Even weirder, in 3.76 (only checked on XP), EMET loads in IE 6 no matter what, but the other DEP-crash-testing program won't load EMET no matter how I do it -- from sandboxed Explorer, nothing...
So different random things seem to be happening with the AppCompat layer and Sandboxie...
Just found it.
EMET seems to load from Run Sandboxed before 4.01.04, so I'm assuming it's related to the .04 change: Sandboxie ignores __COMPAT_LAYER setting (since it's AppCompat related). I was also going to ask about that __COMPAT_LAYER fix, since I'm not sure you preserved some manifest-related behavior I noticed (not sure it's important), but haven't gone back to check on Win 7 yet... (I had just been poking around with RunAsInvoker tricks, etc. a couple months ago before you updated the thread.)
OpenPipePath=\Device\Mailslot\EMET_Agent_*
BTW, in the EMET DLL, I see the string ...\EMET_Recipient_%u%u and in the sent Mailslot message, a Reply XML attribute, etc. So it's possible another Mailslot could be used for some other communication, although nothing I did showed evidence of that. But anyway, not sure if there could be a need for:
OpenPipePath=\Device\Mailslot\EMET_Recipient_*
As well. Or even simply \EMET_*

AND... There seems to be another bug with 4.01 vs 3.76 (although it seems weird too), after I noticed it mentioned in this Wilders EMET thread about EMET not showing stuff as protected. Shouldn't be any problems with that (the current template's IPC is fine still), however...
I noticed that when using Run Sandboxed with IE (XP and 7 64-bit), the EMET DLL doesn't even get loaded! On Win 7 (IE 8 I guess?), the child iexplore.exe does get it, so again it seems like Start.exe is messing something up?

What's REALLY weird is that another program I was checking for the EMET Notifier (crashes with DEP), DOES get EMET loaded if I use "Run From Start Menu," but not Run Sandboxed -- aren't they almost the same?! With IE, nothing involving Start.exe lets EMET load.
Even weirder, in 3.76 (only checked on XP), EMET loads in IE 6 no matter what, but the other DEP-crash-testing program won't load EMET no matter how I do it -- from sandboxed Explorer, nothing...
So different random things seem to be happening with the AppCompat layer and Sandboxie...
Just found it.
