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:

May 2024

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