Asp'de Güvenlik (1 İzleyici)

Katıldı
3 Haziran 2014
Mesajlar
438
Yaşadığın yer
Elazığ
Evet arkadaşlar bu örneğimizde functionlarla güvenlik yapmaya çalışacağız.
Üye girişlerinde ve yönetim paneli girişerinde birtakım açıklar meydana gelir bunları kapatmamız gerekir bunu asp'de functionların replace komutu ile sağlarız.
Dilerseniz Kodlamamıza Geçelim!
PHP:
<%
Function security(data)
Data = Replace(Data, "<", "<" ) 
Data = Replace(Data, ">", ">" ) 
Data = Replace(Data, "^", "-" ) 
Data = Replace(Data, vbcrlf, "<br>" ) 
Data = Replace(Data, "script", "script", 1, -1, 0 ) 
Data = Replace(Data, "SCRIPT", "SCRIPT", 1, -1, 0 ) 
Data = Replace(Data, "Script", "Script", 1, -1, 0 ) 
Data = Replace(Data, "script", "Script", 1, -1, 1 ) 
Data = Replace(Data, "object", "object", 1, -1, 0 ) 
Data = Replace(Data, "OBJECT", "OBJECT", 1, -1, 0 ) 
Data = Replace(Data, "Object", "Object", 1, -1, 0 ) 
Data = Replace(Data, "object", "Object", 1, -1, 1 ) 
Data = Replace(Data, "applet", "applet", 1, -1, 0 ) 
Data = Replace(Data, "APPLET", "APPLET", 1, -1, 0 ) 
Data = Replace(Data, "Applet", "Applet", 1, -1, 0 ) 
Data = Replace(Data, "applet", "Applet", 1, -1, 1 ) 
Data = Replace(Data, "embed", "embed", 1, -1, 0 ) 
Data = Replace(Data, "EMBED", "EMBED", 1, -1, 0 ) 
Data = Replace(Data, "Embed", "Embed", 1, -1, 0 ) 
Data = Replace(Data, "embed", "Embed", 1, -1, 1 ) 
Data = Replace(Data, "event", "event", 1, -1, 0 ) 
Data = Replace(Data, "EVENT", "EVENT", 1, -1, 0 ) 
Data = Replace(Data, "Event", "Event", 1, -1, 0 ) 
Data = Replace(Data, "event", "Event", 1, -1, 1 ) 
Data = Replace(Data, "document", "document", 1, -1, 0 ) 
Data = Replace(Data, "DOCUMENT", "DOCUMENT", 1, -1, 0 ) 
Data = Replace(Data, "Document", "Document", 1, -1, 0 ) 
Data = Replace(Data, "document", "Document", 1, -1, 1 ) 
Data = Replace(Data, "cookie", "cookie", 1, -1, 0 ) 
Data = Replace(Data, "COOKIE", "COOKIE", 1, -1, 0 ) 
Data = Replace(Data, "Cookie", "Cookie", 1, -1, 0 ) 
Data = Replace(Data, "cookie", "Cookie", 1, -1, 1 ) 
Data = Replace(Data, "form", "form", 1, -1, 0 ) 
Data = Replace(Data, "FORM", "FORM", 1, -1, 0 ) 
Data = Replace(Data, "Form", "Form", 1, -1, 0 ) 
Data = Replace(Data, "form", "Form", 1, -1, 1 ) 
Data = Replace(Data, "on", "on", 1, -1, 0 ) 
Data = Replace(Data, "ON", "ON", 1, -1, 0 ) 
Data = Replace(Data, "On", "On", 1, -1, 0 ) 
Data = Replace(Data, "on", "on", 1, -1, 1 ) 
Data = Replace(Data, "or", "or", 1, -1, 0 ) 
Data = Replace(Data, "OR", "OR", 1, -1, 0 ) 
Data = Replace(Data, "Or", "Or", 1, -1, 0 ) 
Data = Replace(Data, "or", "or", 1, -1, 1 ) 
Data = Replace(Data, "document.cookie", "Document.cookie", 1, -1, 1 ) 
Data = Replace(Data, "javascript:", "javascript ", 1, -1, 1 ) 
Data = Replace(Data, "vbscript:", "vbscript ", 1, -1, 1 ) 
Data = Replace(Data, "SELECT", "Select ", 1, -1, 1 ) 
Data = Replace(Data, "DROP", "Drop ", 1, -1, 1 ) 
Data = Replace(Data, ";", "; ", 1, -1, 1 ) 
Data = Replace(Data, "--", "-- ", 1, -1, 1 ) 
Data = Replace(Data, "INSERT", "Insert ", 1, -1, 1 ) 
Data = Replace(Data, "DELETE", "Delete ", 1, -1, 1 ) 
Data = Replace(Data, "xp_", "xp_ ", 1, -1, 1 ) 
Data = Replace(Data, "UNION", "Union ", 1, -1, 1 ) 
Data = Replace(Data, "'", "`" ) 
data = Replace (data ,"`","",1,-1,1)
data = Replace (data ,"=","",1,-1,1)
data = Replace (data ,"&","",1,-1,1)
data = Replace (data ,"%","",1,-1,1)
data = Replace (data ,"!","",1,-1,1)
data = Replace (data ,"#","",1,-1,1)
data = Replace (data ,"<","",1,-1,1)
data = Replace (data ,">","",1,-1,1)
data = Replace (data ,"*","",1,-1,1)
data = Replace (data ,"/" ,"" ,1,-1,1)
data = Replace (data ,"" ,"" ,1,-1,1)
data = Replace (data ,"And","",1,-1,1)
data = Replace (data ,"'","",1,-1,1)
data = Replace (data ,"Chr(34)","",1,-1,1)
data = Replace (data ,"Chr(39)","",1,-1,1)
data = Replace (data ,"select","",1,-1,1)
data = Replace (data ,"join","",1,-1,1)
data = Replace (data ,"union","",1,-1,1) 
data = Replace (data ,"where","",1,-1,1)
data = Replace (data ,"insert","",1,-1,1)
data = Replace (data ,"delete","",1,-1,1)
data = Replace (data ,"update","",1,-1,1)
data = Replace (data ,"like","",1,-1,1)
data = Replace (data ,"drop","",1,-1,1)
data = Replace (data ,"create","",1,-1,1)
data = Replace (data ,"modify","",1,-1,1)
data = Replace (data ,"rename","",1,-1,1)
data = Replace (data ,"alter","",1,-1,1)
data = Replace (data ,"cast","",1,-1,1)
security=data
End Function
%>
 

Bu konuyı kimler okuyor

Benzer konular

Top