<%
Option Explicit
On Error Resume Next
IF Response.IsClientConnected = False Then Response.End
Dim ProxyIPs, StrRadyoAc, RsTema,StrUyeDIP, StrUyeUlkesi, strGlobalBan, strSistem, StrUyeIP, StrUyeBR, StrPage, StrSesID, PerformanceDebug, StrMobil, b,v, strPrgrm, detectUA, uaLST, StrBRvrfy, uaLSTIP, uaLSTBR, strCSS, LocalIPs, Strdenied, StrIPvrfy, StrPC, StrXhtml, StrModSecim, StrModNo, WmlYok
'--------------------
PerformanceDebug=Timer
Response.Buffer=True
Response.Expires=-1
Response.CacheControl="no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.CharSet="ISO-8859-9"
Session.LCID=1055
StrUyeUlkesi="XX"
StrUyeGlobalBan="0"
strGlobalBan="1"
WmlYok=0
'--------------
StrSesID=Session.SessionID
StrUyeIP=Request.ServerVariables("REMOTE_ADDR")
StrUyeBR=Left(TemizC(Request.ServerVariables("HTTP_USER_AGENT")),500)
StrPage=Request.ServerVariables("SCRIPT_NAME")
strPrgrm="0"
StrBRvrfy=False
StrIPvrfy=True
StrMobil=False
StrPC=False
StrXhtml=False
StrRadyoAc=False
IF inStr(Request.ServerVariables("HTTP_ACCEPT"),"html")>0 Then StrXhtml=True
'---------------
IF Request.Servervariables("HTTP_ACCEPT_LANGUAGE")="" AND Request.Servervariables("HTTP_ACCEPT_ENCODING")="" AND Request.Servervariables("HTTP_ACCEPT_CHARSET")="" Then StrMobil=False:StrBRvrfy=False
LocalIPs="0.*.*.*, 10.*.*.*, 127.*.*.*, 169.254.*.*, 172.1*.*.*, 172.2*.*.*, 172.3*.*.*, 192.*.2.*, 192.88.99.*, 192.168.*.*, 198.18.*.*, 198.51.100.*, 203.0.113.*, 224.*.*.*, 24*.*.*.*, 25*.*.*.*"
ProxyIPs="5.153.*.*,5.135.*.*,5.254.*.*,23.*.*.*,31.210.*.*,37.48.*.*,37.157.*.*,46.16*.*.*,46.17.*.*,46.18*.*.*,50.*.*.*,54.*.*.*,62.75.*.*,64.9.*.*,64.131.*.*,66.*.*.*,67.*.*.*,69.*.*.*,74.6*.*.*,78.90.*.*,78.186.165.128,79.98.*.*,81.16.*.*,82.194.*.*,82.146.63.*,85.114.*.*,88.198.*.*,93.186.192.*,94.242.*.*,96.126.*.*,103.16.*.*,185.100.*.*,109.74.*.*,115.238.*.*,122.*.*.*,142.4*.*.*,148.*.*.*,162.144.*.*,173.2*.*.*,176.10.*.*,178.16*.*.*,178.254.*.*,175.41.*.*,190.*.*.*,192.154.*.*,195.2.*.*,198.27.*.*,198.144.*.*,199.*.*.*,216.70.*.*,217.8.*.*,217.79.*.*,204.4*.*.*,205.188.*.*,206.*.*.*"
'--------------
Private Function BRDuzelt(input,tur)
IF isNull(input)=True Then Exit Function
IF tur="0" Then
input=Replace(input,"+","*")
ELSE
input=Replace(input,"*","+")
END IF
BRDuzelt=input
End Function
'-----------
Function IsRestrictedIP(s,ip)
IF isNull(ip)=True Then Exit Function
Dim regEx, p
Set regEx = New RegExp
p = "^(" & Replace(Replace(Replace(Replace(s," ",""),",",")|("),"*",_
"([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])"),".","\.") & "$)"
regEx.Pattern = p
IsRestrictedIP = regEx.Test(ip)
Set regEx=Nothing
Set p=Nothing
End Function
'--------------------
Set b=New RegExp
'# 3rd program denetle
b.Pattern="HTTP_X_DEVICE_USER_AGENT|HTTP_X_ORIGINAL_USER_AGENT|HTTP_X_OPERAMINI_PHONE_UA|HTTP_X_SKYFIRE_PHONE|HTTP_X_BOLT_PHONE_UA|HTTP_X_MOBILE_UA|HTTP_DEVICE_STOCK_UA|HTTP_X_UCBROWSER_DEVICE_UA"
b.IgnoreCase=true:b.Global=true
Set detectUA=b.Execute(Request.ServerVariables("ALL_HTTP"))
IF detectUA.Count>0 Then StrUyeBR=Request.Servervariables(""&detectUA.Item(0)&""):StrMobil=True:StrBRvrfy=True:StrIPvrfy=True:strPrgrm="1":StrPC=False:Set detectUA=Nothing
IF inStr(StrUyeBR,"Opera Mobi/SYB")>0 Then strPrgrm="1":StrMobil=True:StrBRvrfy=True:StrIPvrfy=True:StrPC=False
'# Orjinal IP Bul
b.Pattern="HTTP_FORWARDED|HTTP_X_FORWARDED_FOR|HTTP_X_FORWARDED|HTTP_FORWARDED_FOR|HTTP_REMOTE_ADDR_REAL|HTTP_CLIENT_IP|HTTP_X_REAL_IP|HTTP_REMOTE_ADDR_REAL"
b.IgnoreCase=true:b.Global=true
Set detectUA=b.Execute(Request.ServerVariables("ALL_HTTP"))
IF detectUA.Count>0 Then
IF NOT inStr(Request.Servervariables(""&detectUA.Item(0)&""),",")>0 Then
StrUyeIP=TemizIP(Request.Servervariables(""&detectUA.Item(0)&"")):StrIPvrfy=False
IF IsRestrictedIP(LocalIPs,StrUyeIP) Then StrIPvrfy=True:StrUyeIP=Request.ServerVariables("REMOTE_ADDR")
END IF
END IF:Set detectUA=Nothing
Set b=Nothing
IF inStr(StrUyeIP,":")>0 Then
StrRadyoAc=Split(StrUyeIP,":")
StrUyeIP=TemizIP(StrRadyoAc(0))
StrRadyoAc=False
END IF
'54. ip fix
IF (isNull(Trim(StrUyeIP))=True OR Trim(StrUyeIP)="") AND (Request.ServerVariables("HTTP_X_FORWARDED_FOR")<>"") Then StrUyeIP=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
'------------
set b=new RegExp
set v=new RegExp
b.Pattern="(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino"
v.Pattern="1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-"
b.IgnoreCase=true
v.IgnoreCase=true
b.Global=true
v.Global=true
IF b.test(StrUyeBR) or v.test(Left(StrUyeBR,4)) Then
StrMobil=True
StrPC=False
ELSE
StrMobil=False
StrPC=True
END IF
Set b=Nothing:Set v=Nothing
'--------------------
IF Request("u")="" Then
IF Request.ServerVariables("HTTP_X_WAP_PROFILE")<>"" Then StrIPvrfy=True:StrMobil=True:StrPC=False:StrBRvrfy=True
IF Request.ServerVariables("HTTP_PROFILE")<>"" Then StrIPvrfy=True:StrMobil=True:StrPC=False:StrBRvrfy=True
IF inStr(Request.ServerVariables("HTTP_ACCEPT"),"vnd.wap.wtls-ca-certificate")>0 Then StrIPvrfy=True:StrMobil=True:StrPC=False:StrBRvrfy=True
IF Request.ServerVariables("network-access-type")<>"" Then StrIPvrfy=True:StrMobil=True:StrPC=False:StrBRvrfy=True
IF inStr(StrUyeBR,"U; Bada")>0 AND inStr(StrUyeBR,"AppleWebKit")>0 Then StrIPvrfy=True:StrMobil=True:StrPC=False:StrBRvrfy=True:WmlYok=1
IF inStr(StrUyeBR,"BlackBerry")>0 AND inStr(StrUyeBR,"Mobile Safari")>0 Then StrIPvrfy=True:StrMobil=True:StrPC=False:StrBRvrfy=True:WmlYok=1
IF inStr(StrUyeBR,"iPhone")>0 AND inStr(Request.ServerVariables("HTTP_ACCEPT"),"application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5")>0 Then StrIPvrfy=True:StrMobil=True:StrPC=False:StrBRvrfy=True:WmlYok=1
IF inStr(StrUyeBR,"Mozilla")>0 AND inStr(StrUyeBR,"Konqueror")>0 AND inStr(StrUyeBR,"compatible")>0 Then StrMobil=False:StrPC=True:StrBRvrfy=True:StrRadyoAc=True
IF (inStr(StrUyeBR,"Mozilla")>0 AND inStr(StrUyeBR,"Safari")>0) AND (inStr(StrUyeBR,"Windows")>0 OR inStr(StrUyeBR,"Macintosh")>0) Then StrMobil=False:StrPC=True:StrBRvrfy=True:StrRadyoAc=True
IF inStr(StrUyeBR,"Mozilla")>0 AND inStr(StrUyeBR,"MSIE")>0 AND inStr(StrUyeBR,"Windows")>0 Then StrMobil=False:StrPC=True:StrBRvrfy=True:StrRadyoAc=True:WmlYok=1
IF inStr(StrUyeBR,"Mozilla")>0 AND inStr(StrUyeBR,"Windows NT")>0 Then StrMobil=False:StrPC=True:StrBRvrfy=True:StrRadyoAc=True:WmlYok=1
IF inStr(StrUyeBR,"Linux; U; Android")>0 AND inStr(StrUyeBR,"AppleWebKit")>0 Then StrIPvrfy=True:StrMobil=True:StrPC=False:StrBRvrfy=True:WmlYok=1
IF inStr(StrUyeBR,"Opera")>0 AND inStr(StrUyeBR,"Presto")>0 Then StrMobil=True:StrPC=False:StrBRvrfy=True
IF inStr(StrUyeBR,"Opera")>0 AND inStr(StrUyeBR,"Windows")>0 Then StrMobil=False:StrPC=True:StrBRvrfy=True:StrRadyoAc=True
IF inStr(StrUyeBR,"Mozilla")>0 AND inStr(StrUyeBR,"Chrome")>0 AND inStr(StrUyeBR,"KHTML, like Gecko")>0 Then StrMobil=False:StrPC=True:StrBRvrfy=True:StrRadyoAc=True
'----------
IF Request.ServerVariables("HTTP_ACCEPT")="text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" AND Request.ServerVariables("HTTP_X_WAP_PROFILE")="" Then
IF (inStr(StrUyeBR,"Firefox")>0 OR inStr(StrUyeBR,"Chrome")>0) AND inStr(StrUyeBR,"Windows")>0 Then
StrBRvrfy=True:StrMobil=False:StrPC=True:StrRadyoAc=True:WmlYok=1
ELSE
StrBRvrfy=False:StrMobil=False:StrPC=True
END IF
'# Mobil program fix
IF Request.ServerVariables("HTTP_ACCEPT_LANGUAGE")<>"tr-TR,tr;q=0.8,en-US;q=0.5,en;q=0.3" AND inStr(StrUyeBR,"iPhone") Then StrMobil=True:StrPC=False:strPrgrm="1":StrRadyoAc=False:StrBRvrfy=True:WmlYok=1
IF Request.ServerVariables("HTTP_ACCEPT_LANGUAGE")<>"tr-TR,tr;q=0.8,en-US;q=0.5,en;q=0.3" AND inStr(StrUyeBR,"Android") Then StrMobil=True:StrPC=False:strPrgrm="1":StrRadyoAc=False:StrBRvrfy=True:WmlYok=1
IF inStr(StrUyeBR,"Xoom") Then StrMobil=True:StrPC=False:strPrgrm="1":StrRadyoAc=False:StrBRvrfy=False:WmlYok=1
IF inStr(StrUyeBR,"ICL53F") Then StrMobil=True:StrPC=False:strPrgrm="1":StrRadyoAc=False:StrBRvrfy=False:WmlYok=1
IF inStr(StrUyeBR,"Mobile; rv:") Then StrMobil=True:StrPC=False:strPrgrm="1":StrRadyoAc=False:WmlYok=1
'# Masaüstü Görünüm Fix
IF inStr(StrUyeBR,"X11")>0 AND inStr(StrUyeBR,"x86_64")>0 Then StrMobil=True:StrPC=False:StrRadyoAc=False:StrBRvrfy=False:strPrgrm="1":WmlYok=1
IF inStr(StrUyeBR,"X11")>0 AND inStr(StrUyeBR,"zbov")>0 Then StrMobil=True:StrPC=False:StrRadyoAc=False:StrBRvrfy=False:strPrgrm="1":WmlYok=1
END IF
IF IsRestrictedIP(ProxyIPs,StrUyeIP) Then StrBRvrfy=False:StrMobil=False:StrIPvrfy=False:StrPC=False
IF StrMobil=False AND Request.ServerVariables("HTTP_CACHE_CONTROL")="max-age=2419200" Then StrIPvrfy=False:StrBRvrfy=False
IF StrMobil=False AND Request.ServerVariables("HTTP_TE")<>"" Then StrIPvrfy=False:StrBRvrfy=False
'----------
Set b=New RegExp
'# Proxy Browser Bul
b.Pattern="proxy|porxy|anonym|T9space|2Mobile|Phonifier|www\.|http|emulator|\.com|\.org|Novarra-Vision|jBrowser|UCBrowser|UC Browser|UCWEB|BOLT|Mini Opera|php|perl"
b.IgnoreCase=true:b.Global=true
Set detectUA=b.Execute(StrUyeBR)
IF detectUA.Count>0 Then StrBRvrfy=False:StrMobil=False:StrIPvrfy=False:StrPC=False:Set detectUA=Nothing
'# UCBrowser fix
IF Request.ServerVariables("HTTP_X_PIPER_ID")<>"" AND inStr(StrUyeBR,"Android")>0 Then StrIPvrfy=True:StrMobil=True:StrPC=False:StrBRvrfy=True
'# Örümcek Bul
IF Request("sifre")="" Then
b.Pattern="alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|nagios|postrank|pingdom|slurp|spider|yahoo|bot|googlebot|spider|robot|google|baidu|yandex|ezooms|survey|archive|validator"
b.IgnoreCase=true:b.Global=true
Set detectUA=b.Execute(StrUyeBR)
IF detectUA.Count>0 Then StrBRvrfy=True:StrMobil=True:StrIPvrfy=True:StrPC=True:StrRadyoAc=False:Set detectUA=Nothing
END IF
Set b=Nothing
'---------
IF inStr(StrUyeBR,"Android")>0 Then StrRadyoAc=False
IF inStr(StrUyeBR,"Nokia")>0 Then StrRadyoAc=False
IF inStr(StrUyeBR,"Mobile")>0 Then StrRadyoAc=False
IF inStr(StrUyeBR,"x86_64")>0 Then StrRadyoAc=False
END IF
'--------------------
IF StrMobil=False OR WmlYok=1 Then
strSistem=".XHTML"
StrModNo=2
StrModSecim="0"
ELSE
IF (strPrgrm="1") OR (StrXhtml=True) OR (StrMobil=True AND StrPC=True) Then
strSistem=".XHTML"
StrModNo=2
StrModSecim="1"
IF StrModSecim="1" Then
IF Request("m")="1" Then
strSistem=".WML"
StrModNo=1
ELSEIF Request("m")="2" Then
strSistem=".XHTML"
StrModNo=2
END IF
END IF
ELSE
strSistem=".WML"
StrModSecim="0"
StrModNo=1
END IF
END IF
'--------------------
IF inStr(Lcase(StrPage),"login.asp")>0 OR inStr(Lcase(StrPage),"loginaccess.asp")>0 OR inStr(Lcase(StrPage),"poweraccess.asp")>0 OR inStr(Lcase(StrPage),"kayit.asp")>0 OR inStr(Lcase(StrPage),"dostsiteler.asp")>0 Then
Dim objGlobal, StrUyeGlobalBan
set objGlobal=Server.CreateObject("MSXML2.DOMDocument")
objGlobal.Async=false
objGlobal.SetProperty "ServerHTTPRequest", true
objGlobal.Load("http://techtr.org/-FXGOLD/GlobalXML/ipbrxml.asp?ip="&StrUyeIP&"&br="&BRDuzelt(StrUyeBR,0)&"&xr="&Request.ServerVariables("HTTP_X_REQUESTED_WITH")&"")
StrUyeBR=BRDuzelt(StrUyeBR,1)
IF objGlobal.ParseError="0" Then
StrUyeUlkesi=objGlobal.documentElement.childNodes.item(0).Text
StrUyeGlobalBan=objGlobal.documentElement.childNodes.item(1).Text
ELSE
StrUyeUlkesi="XX"
StrUyeGlobalBan="0"
END IF
Set objGlobal=Nothing
'--------------------
Select Case strGlobalBan
Case "1"
'-------
IF StrUyeGlobalBan="1" Then
IF StrSistem=".XHTML" Then
Response.ContentType="text/html"
Response.write("<html><head><title>TechTR Wap Sohbet Sistemi</title></head><body><div style=""color:#000000;font-family:Tahoma;background-color:#E0E0E0;font-size:18px;padding:2px;"">IP Adresiniz ya da Tarayıcınız tüm TechTR sistemlerinden yasaklanmıştır. İletişim: destek@techtr.info - www.techtr.net</div></body></html>")
ELSE
Response.ContentType="text/vnd.wap.wml"
Response.write("<?xml version=""1.0"" encoding=""ISO-8859-9""?><!DOCTYPE wml PUBLIC ""-//WAPFORUM//DTD WML 1.1//EN"" ""http://www.wapforum.org/DTD/wml_1.1.xml""><wml><card id=""Sohbet"" title=""TechTR Wap Sohbet Sistemi""><p>IP Adresiniz ya da Tarayıcınız tüm TechTR sistemlerinden yasaklanmıştır. İletişim: destek@techtr.info - www.techtr.net</p></card></wml>")
END IF
Response.END
END IF
'-------
Case ELSE
'-------
Dim GBfso
Set GBfso=Server.Createobject("Scripting.FileSystemObject")
Set objGlobal=GBfso_OpenTextFile(Server.Mappath("./kernel/txt/GlobalBan.txt"),1,false)
While Not objGlobal.atEndOfStream
IF inStr(StrUyeBR,objGlobal.readline)>0 Then
Response.Redirect("accessdenied.asp?wut=2")
Response.End
END IF
Wend
objGlobal.close:Set objGlobal=Nothing:Set GBfso=Nothing
'-------
End Select
END IF
'--------------------
Set LocalIPs=Nothing
Set ProxyIPs=Nothing
'--------------------
IF StrUyeBR="" Then
Response.Redirect "http://google.com.tr"
Response.End
END IF
IF Request.ServerVariables("HTTP_ACUNETIX_PRODUCT")<>"" Then
Response.Redirect "http://google.com.tr"
Response.End
END IF
IF Len(StrUyeBR)<5 Then
Response.Redirect "http://google.com.tr"
Response.End
END IF
%>