Exploit the possiblities

JRSoft InnoSetup DLL Hijack

JRSoft InnoSetup DLL Hijack
Posted Dec 8, 2015
Authored by Stefan Kanthak

JRSoft InnoSetup executable installers suffer from a DLL hijacking vulnerability.

tags | exploit
systems | windows
MD5 | 55adf916340c35736cb747365753c9f4

JRSoft InnoSetup DLL Hijack

Change Mirror Download
Hi @ll,

executable installers [°] created with JRSoft InnoSetup
(see <http://jrsoftware.org/isinfo.php>; this includes of course
InnoSetup itself too) are vulnerable:

1. They load and execute a rogue/bogus/malicious UXTheme.dll [']
eventually found in the directory they are started from (the
"application directory").

For software downloaded with a web browser this is typically the
"Downloads" directory: see
and <http://seclists.org/fulldisclosure/2012/Aug/134>

If UXTheme.dll gets planted in the "Downloads" directory per
"drive-by download" this vulnerability becomes a remote code

Due to an application manifest embedded in the executable which
specifies "requireAdministrator" or the "installer detection" (see
of Windows' "user account control" executable installers are
typically started with administrative privileges ("protected"
administrators are prompted for consent, unprivileged standard
users are prompted for an administrator password); execution of
UXTheme.dll then results in an escalation of privilege!

2. They extract embedded DLLs (_ShFolder.dll [²]) to an unsafe
temporary (sub)directory "%TEMP%\is-<random>.tmp\" and load them
from there [³].

These DLLs can be overwritten by an unprivileged user between their
creation and execution, resulting in an escalation of privilege.

3. They extract an embedded subinstaller (is-*.tmp) to an unsafe
temporary (sub)directory "%TEMP%\is-<random>.tmp\" and load it
from there [³].

These EXEs can be overwritten by an unprivileged user between their
creation and execution, resulting in an escalation of privilege.

Proof of concept/demonstration:

1. visit <http://home.arcor.de/skanthak/sentinel.html>, download
<http://home.arcor.de/skanthak/download/SENTINEL.DLL> and save
it as UXTheme.dll in your "Downloads" directory;

2. download <http://jrsoftware.org/download.php/is.exe>
(via <http://jrsoftware.org/isdl.php>) and save it in your
"Downloads" directory;

3. execute isetup-5-5-6.exe from your "Downloads" directory;

4. notice the message box displayed from UXTheme.dll placed in step 1.


Unless overwritten by the creator of the executable installer the
string "This installation was built with Inno Setup." contained in
their version resource and the string "JR.Inno.Setup" contained in
their embedded application manifest identify these executable installers.



If your favourite applications are not distributed in the native
installer package format of the resp. target platform: ask^WURGE
their vendors/developers to provide native installation packages.
If they don't: dump these applications, stay away from such cruft!

1. Turn off privilege elevation for standard users and installer
detection for all users:

"ConsentPromptBehaviorUser"=dword:00000000 ; Automatically deny elevation requests

See <https://technet.microsoft.com/en-us/library/dd835564.aspx#BKMK_RegistryKeys>

2. NEVER execute files in UNSAFE directories (like "Downloads" and
and "%TEMP%")!

3. Deny execution (at least) in the "downloads" directories and all
"%TEMP%" directories and their subdirectories:

* Add the NTFS ACE "(D;OIIO;WP;;;WD)" meaning "deny execution of
files in this directory for everyone, inheritable to all files
in all subdirectories" (use CACLS.EXE /S:<SDDL> for example);

* Use "software restriction policies" resp. AppLocker.

Consider to apply either/both to every "%USERPROFILE%" as well as
"%ALLUSERSPROFILE%" alias %ProgramData%" and "%PUBLIC%": Windows
doesn't place executables in these directories and beyond.

See <http://home.arcor.de/skanthak/safer.html> and/or
<http://mechbgon.com/srp/> plus
or <https://books.google.de/books?isbn=1437914926> and finally

stay tuned
Stefan Kanthak

PS: see <http://seclists.org/fulldisclosure/2015/Nov/101> (resp. the
not yet finished <http://home.arcor.de/skanthak/!execute.html>)
for more details!

PPS: the case numbers are not in chronological order.

[°] Self-extracting archives and executable installers are flawed^W
b(rainde)ad in concept and dangerous in practice.

ALWAYS use the resp. target platforms native package and archive

For Windows these are .INF (plus .CAB) and .MSI (plus .CAB),
introduced 20 years ago (with Windows 95 and Windows NT4) resp.
16 years ago (with Office 2000).

Both .INF and .MSI are "opened" by programs residing in
%SystemRoot%\System32\ which are therefore immune to this kind of
"DLL (and EXE) Search Order Hijacking" attack.
Since both .INF and .MSI access the contents of .CAB directly
they eliminate the attack vector "unsafe temporary directory" too.

['] A well-known (trivial, easy to exploit and easy to avoid) and
well-documented vulnerability: see
<https://msdn.microsoft.com/en-us/library/ff919712.aspx> and

[²] ShFolder.dll is cruft from the last millennium, it was used on
Windows 9x without Internet Explorer 4; see

DONT USE the sample code shown in this MSKB article!

[³] Another well-known (trivial, easy to exploit and easy to avoid)
and well-documented vulnerability: see
<https://capec.mitre.org/data/definitions/29.html> ...


2015-11-28 vulnerability report sent to author

2015-12-01 reponse from author:
"This is not a vulnerability."

2015-12-01 OUCH!
You should have read the linked documents.
For some prior "art" see:

NO ANSWER, not even an acknowledgement of receipt

2015-12-08 report published


RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

Want To Donate?

Bitcoin: 18PFeCVLwpmaBuQqd5xAYZ8bZdvbyEWMmU

File Archive:

March 2018

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    14 Files
  • 2
    Mar 2nd
    12 Files
  • 3
    Mar 3rd
    1 Files
  • 4
    Mar 4th
    3 Files
  • 5
    Mar 5th
    15 Files
  • 6
    Mar 6th
    23 Files
  • 7
    Mar 7th
    15 Files
  • 8
    Mar 8th
    15 Files
  • 9
    Mar 9th
    3 Files
  • 10
    Mar 10th
    2 Files
  • 11
    Mar 11th
    1 Files
  • 12
    Mar 12th
    16 Files
  • 13
    Mar 13th
    20 Files
  • 14
    Mar 14th
    12 Files
  • 15
    Mar 15th
    10 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    0 Files
  • 19
    Mar 19th
    0 Files
  • 20
    Mar 20th
    0 Files
  • 21
    Mar 21st
    0 Files
  • 22
    Mar 22nd
    0 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    0 Files
  • 26
    Mar 26th
    0 Files
  • 27
    Mar 27th
    0 Files
  • 28
    Mar 28th
    0 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags


packet storm

© 2018 Packet Storm. All rights reserved.

Security Services
Hosting By