Get a Pentest and security assessment of your IT network.

Cyber Security

Change Browser Shortcut Location (No Admin)

TL;DR

Yes, a program can change a browser’s shortcut location to itself without needing administrator permissions in Windows. This is done by modifying the target path of an existing shortcut file. However, this only affects the current user and doesn’t require UAC elevation.

How it Works

Windows shortcuts (.lnk files) are just small files that point to another application or document. Their properties can be changed without needing admin rights, as long as the shortcut is owned by the current user. We’ll use PowerShell for this because it’s readily available and powerful.

Steps

  1. Find the Shortcut: First, you need to locate the browser shortcut you want to modify. Common locations include:
    • Desktop
    • Start Menu (%AppData%MicrosoftWindowsStart MenuPrograms)
    • Taskbar (pinned shortcuts are stored in a different location, more complex to find directly)
  2. Get the Shortcut Path: Once you’ve found the shortcut, get its full path. For example, C:UsersYourNameDesktopChrome.lnk.
  3. Use PowerShell to Modify the Target: Use the following PowerShell script to change the target of the shortcut. Replace "C:UsersYourNameDesktopChrome.lnk" with the actual path to your shortcut and "C:Program FilesGoogleChromeApplicationchrome.exe" with the correct path to the browser executable.
    $ShortcutPath = "C:UsersYourNameDesktopChrome.lnk"
    $WScriptShell = New-Object -ComObject WScript.Shell
    $Shortcut = $WScriptShell.CreateShortcut($ShortcutPath)
    $Shortcut.TargetPath = "C:Program FilesGoogleChromeApplicationchrome.exe"
    $Shortcut.Save()
  4. Explanation of the PowerShell Script:
    • $ShortcutPath = ...: Sets a variable to hold the path of the shortcut file.
    • $WScriptShell = New-Object -ComObject WScript.Shell: Creates an object that allows us to interact with Windows shell objects, including shortcuts.
    • $Shortcut = $WScriptShell.CreateShortcut($ShortcutPath): Loads the specified shortcut file into a variable.
    • $Shortcut.TargetPath = ...: Sets the new target path for the shortcut.
    • $Shortcut.Save(): Saves the changes to the shortcut file.
  5. Verify the Change: Right-click on the modified shortcut and select ‘Properties’. Check that the ‘Target’ field now points to the correct browser executable path.

Important Considerations

  • User Scope: This method only changes the shortcut for the current user. Other users will not be affected.
  • UAC Bypass: This does *not* bypass User Account Control (UAC). It simply modifies a file that doesn’t require admin privileges to change.
  • Executable Path: Ensure you use the correct path to the browser executable. Incorrect paths will result in a broken shortcut.
  • Permissions: The user must have write permissions to the directory containing the shortcut file.
Related posts
Cyber Security

Zip Codes & PII: Are They Personal Data?

Cyber Security

Zero-Day Vulnerabilities: User Defence Guide

Cyber Security

Zero Knowledge Voting with Trusted Server

Cyber Security

ZeroNet: 51% Attack Risks & Mitigation