iis 防盜鏈 破解圖片防盜鏈的程式碼asp/php測試通過

WBOY
發布: 2016-07-29 08:43:09
原創
1084 人瀏覽過

php版的程式碼比較簡單:

複製程式碼 程式碼如下:


$p=$_GE ['p'];
$pics=file($p);
for($i=0;$i{
echo $pics [$i];
}
?>


使用方法:將檔案儲存成i.php上傳到根目錄
將不能外鏈的圖片位址改成http ://你的網域p.php?p=圖片位址
asp版,網路上用的比較多的

複製程式碼 程式碼如下:


Dim url, body, myCache
url = Request.QueryString("url")
Set myCache = new cache
myCache.name = "picindex" &url
If myCache.valid Then
body = myCache.value
Else
body = GetWebData(url)
myCache.add body,dateadd("d",1,now)
myCache.add body,dateadd("d",1,now)
End If
If Err.Number = 0 Then
Response.CharSet = "UTF-8"
Response.ContentType = "application/octet-stream"
Response.BinaryWrite bodys .Flush
Else
Wscript.Echo Err.Description
End if
'取得資料
Public Function GetWebData(ByVal strUrl)
Dim curl
1,Instr(8,strUrl,"/"))
Dim Retrieval
Set Retrieval = Server.CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", strUrl, False,"",""
.setRequestHeader "Referer", curlpath
.Send
GetWebData =.ResponseBody
End With
Set Retrieval = Nothing
cache類別
class Cache
private obj 'cache內容
private expireTime '過期時間
private expireTimeName '過期時間application名稱
private cacheName 'cache內容內容 那麼app
private sub class_initialize()
path=request.servervariables("url")
path=left(path,instrRev(path,"/"))
end sub
private sub class_terminate ()
end sub
public property get blEmpty
'是否為空
if isempty(obj) then
blEmpty=true
else
Empm if
end property
public property get valid
'是否可用(過期)
if isempty(obj) or not isDate(expireTime) then
valid=false
if )valid=false
else
valid=true
end if
end property
public property let name(str)
'設定cache>🎜>public property let name(str)
'設定cacheache
名稱
cacheName=str & path
obj=application(cacheName)
expireTimeName=str & "expires" & path
expireTime=application(expireTimeName)
end property
publicperty tm expires(
'重新設定過期時間
expireTime=tm
application.lock
application(expireTimeName)=expireTime
application.unlock
end property
public subsubadd(var,expire )
'賦值
if isempty(var) or not isDate(expire) then
exit sub
end if
obj=var
expireTime=expire
application.obj=var
expireTime=expire
application.obj=var
expireTime=expire
application.obj=var
expireTime=expire
🎜>application(cacheName)=obj
application(expireTimeName)=expireTime
application.unlock
end sub
public property get value
'取值
not isDate(expireTime) then
value=null
elseif CDate(expireTime)value=null
else
value=obj
if
else
value=obj
end if
🎜>public sub makeEmpty()
'釋放application
application.lock
application(cacheName)=empty
application(expireTimeName)=empty
🎜>expireTime=empty
end sub
public function equal(var2)
'比較
if typename(obj)typename(var2) then
equal=false typename(var2) then
equal=false if obj is var2 then
equal=true
else
equal=false
end if
elseif typename(obj)="Variant() " then
if join(obj,"^")=join(var2,"^") then
equal=true
else
equal=false
end if
else
if obj=var2 then
equal=true
else
equal=false
end if
end if

end function
end class % >

使用方法:將檔案保存成i.asp上傳到根目錄

將不能外鏈的圖片位址改成http://你的網域名稱/p.asp?url=圖片位址

為方便大家使用,複製的程式碼,容易發生錯誤。特打包下載

以上就介紹了iis 防盜鏈 破解圖片防盜鏈的程式碼asp/php測試通過,包括了iis 防盜鏈方面的內容,希望對PHP教程有興趣的朋友有所幫助。

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!