exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

7-Zip 16 DLL Hijacking

7-Zip 16 DLL Hijacking
Posted Apr 20, 2022
Authored by Eduardo Braun Prado

7-Zip versions 16 and below, and possibly other software that utilizes the HTML Help System to display help content to the user, are prone to a remote DLL hijacking issue which leads to arbitrary code execution due to an OS issue.

tags | exploit, remote, arbitrary, code execution
systems | windows
SHA-256 | 8c60536ca33b8fdb99ab41432c7cbf8cf1095fba9f29c3616248979fbdc94e58

7-Zip 16 DLL Hijacking

Change Mirror Download
Microsoft Windows Environment Variable Expansion Issue Leads To Remote DLL Hijack 

Attack vector: 7-ZIP v.16

7-ZIP v.16 and possibly other softwares that utilizes the HTML Help System are prone to a remote DLL hijacking issue which leads to arbitrary code execution. PoC attached.

because the OS fails to expand the "%systemroot%" environment variable and additionally an unsafe search for hhctrl.ocx when the program invokes "HtmlHelp()" to load the HTML Help system

so if the current working directory of the program is set to an attacker controlled location such as WebDAV/SMB shares and the path '.\%systemroot%\system32\hhctrl.ocx' exists, it will be loaded

instead of the legit 'hhctrl.ocx' due to unsafe search order. This allows for arbitrary code execution.


Note: "Notepad.exe" app imported from Windows XP SP3 into a Windows 7/8/10 OS is also vulnerable.


Vulnerable Windows versions: 7 / 8.1 / 10 depending on the patch level.


Patches up to November 2015 on 8.1 and 10 v.1511 is vulnerable.

Windows 8.1 patches up to January 2020 is assumed vulnerable

Windows 7, fully patched as of January 2020 is vulnerable.


A C (not C++, C# etc) DLL must be created and contain the "DllMain()" fuction which you can use to run arbitrary code.

then create a subdirectory on the WebDAV/SMB share called '7z', then create the tree: '.\%systemroot%\system32' and place the DLL named 'hhctrl.ocx' on the 'system32' folder.

Place a valid ZIP / 7Z archive on '7z' folder and send the UNC path / link to the target.


The target accesses the remote share via Windows Explorer (File Explorer) and opens the archive (with 7-ZIP) then proceeds to click "Help" then "Contents (F1)" or pressing "F1" key to trigger the vulnerability
and run arbitrary code.

exploit complexity: "easy"

reliability: 100%

severity: medium


Video demo on: https://www.youtube.com/watch?v=_muAPMzd9T0
Login or Register to add favorites

File Archive:

July 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close