ASP and PHP implement a way to generate Web site shortcuts and download them to the desktop

  • 2021-06-28 08:56:52
  • OfStack

Setting up buttons such as "Add to Collection, Set as Home Page" on websites is what most websites do, but some websites also have such function settings as "Put on Desktop".
Here is the php implementation code generated and downloaded to the desktop, excerpted and modified on the network for reference only

php implementation code:


<?php
if(isset($_GET[title]) && trim($_GET[title]) !== "") $title = trim($_GET[tilte]);
$content='
[DEFAULT]
BASEURL=https://www.ofstack.com/?desktop
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
URL=https://www.ofstack.com/?desktop
IDList=[{000214A0-0000-0000-C000-000000000046}]
IconFile=https://www.ofstack.com/favicon.ico
IconIndex=1
HotKey=0
Prop3=19,2';
header("Content-type:application/octet-stream");
header("Content-Disposition:attachment; {$title}.url;");
echo $content;
?>

asp implementation code:


<%
id = int(request("id"))
if id="" then id="1"
title = request("title")
if title="" then title=" Script Home "
Shortcut = "[DEFAULT]" & vbCrLf
Shortcut = Shortcut & "BASEURL=https://www.ofstack.com/?desktop" & vbCrLf
Shortcut = Shortcut & "[{000214A0-0000-0000-C000-000000000046}]" & vbCrLf
Shortcut = Shortcut & "Prop3=19,2" & vbCrLf
Shortcut = Shortcut & "[InternetShortcut]" & vbCrLf
Shortcut = Shortcut & "URL=https://www.ofstack.com/?desktop" & vbCrLf
Shortcut = Shortcut & "IDList=[{000214A0-0000-0000-C000-000000000046}]" & vbCrLf
Shortcut = Shortcut & "IconFile=https://www.ofstack.com/favicon.ico" & vbCrLf
Shortcut = Shortcut & "IconIndex=" & id & vbCrLf
Shortcut = Shortcut & "HotKey=0" & vbCrLf
Shortcut = Shortcut & "Prop3=19,2" & vbCrLf
Response.AddHeader "Content-Dispositon", "attachment;filename=" & title & ".url";
Response.ContetType = "application/octet-steam"
Response.Write Shortcut
%>


It works by simply forcing the contents of the url shortcut to be output as an attachment and downloading to a custom site shortcut when visited.However, this function may be very useful. You can set its default icon to be the same as my computer, online neighbors, folders, etc. Because it is a normal shortcut and will not be killed by anti-virus software, it is also often used by some hackers to bring huge real access traffic.


Related articles: