<%
„Ermitteln Sie die Adresse des Besuchers.“
ip=Request.ServerVariables(REMOTE_ADDR)
''Der zulässige IP-Adressbereich liegt zwischen 10.0.0.0 und 10.68.63.255
Allowip1=10.0.0.0
Allowip2=10.68.10.71
Antwort.writecheckip(ip,allowip1,allowip2)
functioncheckip(ip,allowip1,allowip2)
Dimcheck(4)
checkip=false
ipstr=split(ip,.)
Allow1=split(allowip1,.)
Allow2=split(allowip2,.)
ifcint(allow1(0))>cint(allow2(0))then'' bestimmt, ob das IP-Adresssegment zulässig ist
Response.writeVerbotener Zugriff
Exit-Funktion
endif
fori=0toubound(ipstr)
ifcint(allow1(i))<cint(allow2(i))then
ifcint(allow1(i))=cint(ipstr(i))then
check(i)=true
checkip=true
Exitfor
anders
ifcint(ipstr(i))<cint(allow2(i))then
check(i)=true
checkip=true
Exitfor
anders
ifcint(ipstr(i))>cint(allow2(i))then
check(i)=false
checkip=false
Exitfor
anders
check(i)=true
checkip=true
endif
endif
endif
anders
ifcint(allow1(i))>cint(ipstr(i))orcint(allow1(i))<cint(ipstr(i))then
check(i)=false
checkip=false
ifi<>ubound(ipstr)then
Exitfor
endif
anders
check(i)=true
endif
endif
nächste
if(check(0)=trueandcheck(1)=trueandcheck(2)=trueandcheck(3)=false)and(cint(allow2(2))>cint(ipstr(2)))then
checkip=true
endif
Endfunktion
%>
Auszug aus WebShells Blog