Guest User

Untitled

a guest
Nov 19th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. Public function preventSQLInjection(lstr)
  2.  
  3. BlackList = Array("--", ";", "'", "/*", "*/", "@@", "@",_
  4. "alter ", "begin ", "create ", "cursor ",_
  5. "declare ", "delete ", "drop ", " end", "exec ",_
  6. "execute ", "fetch ", "insert ", "kill ", "open ",_
  7. "select ", "sysobjects", "syscolumns",_
  8. "table ", "update ", "=")
  9.  
  10. preventSQLInjection = lstr
  11.  
  12. For Each s in BlackList
  13. If ( InStr (lstr, s) <> 0 ) Then
  14. execSqlQuery "INSERT INTO AccesLogs (datetime,ip,action,comments) VALUES ('" & formatDate(date) & " " & formatTime(time) & "','" & request.ServerVariables("REMOTE_ADDR") & "','SQLINJ','" & replace(lstr,"'","''") & "')",connectionstring
  15. preventSQLInjection = "DONOTUSEIT"
  16. exit for
  17. End If
  18. Next
  19.  
  20. end function
Add Comment
Please, Sign In to add comment