what you don't know can hurt you
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:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    23 Files
  • 25
    Apr 25th
    16 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 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