短网址预览,让冲浪更安全

普遍适用的规则分享、讨论

Moderator: phoenix

Post Reply
User avatar
phoenix
Site Admin
Posts: 526
Joined: Dec 29 2007, 16:27

短网址预览,让冲浪更安全

Post by phoenix »

随着微博的流行,短网址的应用也越来越广泛。然而,如果一个短网址指向一个恶意网站,那么盲目点击则有可能将你的计算机置于风险之中。

导入下面的规则,则在浏览器被重定向到目标网址之前,proxomitron 会弹出一个确认框,提示你目标网址的细节,并由你决定是否继续浏览。如果你选择否,则调用 Google Mobile Proxy 打开目标网址,以提高安全性。

测试短网址: http://tinyurl.com/g0hz

效果如图:
tinyurl_preview.png
tinyurl_preview.png (5.4 KiB) Viewed 28582 times
规则如下:

Code: Select all

[HTTP headers]
In = TRUE
Out = FALSE
Key = "Location: Preview Shortened URL Before Redirected 09.10.06 [phoenix,ln] (In)"
URL = "bit.ly|is.gd|xrl.us|tinyurl.com|br.st|om.ly|j.mp|qu.pe|sl.ly|mxtux.tk|tweak.tk"
Match = "\0&(^$IHDR(Content-Type: image/*))($CONFIRM(\u     is to be redirected to:\n\0\n\nGo Ahead?)$SET(1=\0)$LOG(R$DTM(c): Shortened URL Passed)|$SET(1=http://www.google.com/gwt/n?u=\0)$LOG(R$DTM(c): Shortened URL Rejected))"
Replace = "\1"
Bonnie
Moderator
Posts: 165
Joined: Oct 05 2008, 01:27

Re: 短网址预览,让冲浪更安全

Post by Bonnie »

弹框有点不方便吧。
不如像gm脚本一样直接转化成普通网址,
对于有嫌疑的域名可以先google再确认是否要点击。
User avatar
phoenix
Site Admin
Posts: 526
Joined: Dec 29 2007, 16:27

Re: 短网址预览,让冲浪更安全

Post by phoenix »

Bonnie wrote:不如像gm脚本一样直接转化成普通网址
个人不喜欢这种方式。

上面的规则只会对点击的链接进行提示,而gm脚本要对所有链接都进行转换,没必要而且浪费资源,另外js执行总归要占用时间。

btw,js是影响网页加载速度的罪魁祸首,我的浏览器默认设置是禁用js的。
Bonnie
Moderator
Posts: 165
Joined: Oct 05 2008, 01:27

Re: 短网址预览,让冲浪更安全

Post by Bonnie »

我以前也是用opera关闭全局js然后用站点首选项开启的,速度很快又不怎么影响浏览网页,的确很赞。
后来渐渐的很多论坛都直接贴视频网站的视频了,
关闭全局js就有点麻烦了。
搜索一些视频10有89会链接到一些我从没去过的论坛,这时就要开启一下全局js刷新了才能看。
慢慢就不用了。。
User avatar
phoenix
Site Admin
Posts: 526
Joined: Dec 29 2007, 16:27

Re: 短网址预览,让冲浪更安全

Post by phoenix »

更新下,使用通配符来匹配7个字符以下的短网址域名,比如最近新出现的 goo.gl 和 fb.me 等等。

Code: Select all

[HTTP headers]
In = TRUE
Out = FALSE
Key = "Location: Preview Shortened URL Before Redirected 09.12.17 [phoenix,ln] (In)"
URL = "[^/]+{3,7}/|tinyurl.com|mxtux.tk|tweak.tk"
Match = "\0&(^$IHDR(Content-Type: image/*))($CONFIRM(\u     is to be redirected to:\n\0\n\nGo Ahead?)$SET(1=\0)$LOG(R$DTM(c): Shortened URL Passed)|$SET(1=http://www.google.com/gwt/n?u=\0)$LOG(R$DTM(c): Shortened URL Rejected))"
Replace = "\1"
User avatar
phoenix
Site Admin
Posts: 526
Joined: Dec 29 2007, 16:27

Re: 短网址预览,让冲浪更安全

Post by phoenix »

修正一个会匹配没有 Location header 的短网址的 bug ,比如: http://img.ly/qrc

Code: Select all

[HTTP headers]
In = TRUE
Out = FALSE
Key = "Location: Preview Shortened URL Before Redirected 10.01.30 [phoenix,ln] (In)"
URL = "[^/]+{3,7}/|tinyurl.com|mxtux.tk|tweak.tk"
Match = "(?*)\0&(^$IHDR(Content-Type: image/*))($CONFIRM(\u     is to be redirected to:\n\0\n\nGo Ahead?)$SET(1=\0)$LOG(R$DTM(c): Shortened URL Passed)|$SET(1=http://www.google.com/gwt/n?u=\0)$LOG(R$DTM(c): Shortened URL Rejected))"
Replace = "\1"
imsheng
Posts: 37
Joined: Jan 08 2008, 13:24

Re: 短网址预览,让冲浪更安全

Post by imsheng »

很实用,的确没必要把网页里的全部检测一次
funnyPC
Posts: 10
Joined: Jun 13 2011, 19:32

Re: 短网址预览,让冲浪更安全

Post by funnyPC »

弹出窗口不太友好,特别是同时打开多个链接的时候,根本分不清哪个。可不可以做成sidki里提示jslink的那样?
在短网址上hover的时候提示真实网址?
User avatar
phoenix
Site Admin
Posts: 526
Joined: Dec 29 2007, 16:27

Re: 短网址预览,让冲浪更安全

Post by phoenix »

那样要插入js代码来实现了,只是我不懂js。
Post Reply