About SQL injection defense functions

zhaozj2021-02-16  85

I just saw a function of SQL injection defense, I suddenly remembered that there was a problem when I saw these articles. I was very simple for the defense injected in SQL injection. Two functions:

'####' ## '## SQL injection attack preventive device [character type]' ## ## @ Data -> Processing data '## @ length -> Length limit' ## '##:: STRSQL ("SQL Character Data", 50) '## function strsql (data, length)' ###################################################################################################################################################################################################################################################################### ############################################################## Data = Left (data, length) strsql = "'", "'") & "'" end function

'####' ## '## SQL injection attack preventive device [Digital] ##' ## @ Numeric -> Digital '##' ##:: IntSQL (50) '##' ## 2004 / 03/04, improved version, reason: ISNUMERIC is misjudgment when the MSSQL data type is detected. '## function INTSQL (NuMeric)' ################################################################################################################################################################################################################################################################################### ############################### inttemp on error resume next if numeric = "" "" "" "" Numeric) if err = 0 Then INTSQL = NUMERIC ELSE INTSQL = 0 End IFEND FUNCTION

STRSQL's Length is not in the range of defense SQL injection, which I have a small defense in order to prevent the insertion character exceeding the field length. I saw a variety of SQL injection defense functions on the Internet, so I am very curious. Is this function not to defend against injection? Who knows the vulnerability of these two functions, please tell me.

转载请注明原文地址:https://www.9cbs.com/read-12388.html

New Post(0)