Visualizzazione dei risultati da 1 a 2 su 2

Discussione: Sql Injection

  1. #1
    Utente di HTML.it
    Registrato dal
    Aug 2002
    Messaggi
    17

    Sql Injection

    Ciao,
    qualcuno mi sa dire come posso evitare l'Sql Injection in questa pagina di login creata con Dreamweaver?

    Grazie


    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

    <%
    ' *** Validate request to log in to this site.
    MM_LoginAction = Request.ServerVariables("URL")
    If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Request.QueryString
    MM_valUsername=CStr(Request.Form("email"))
    If MM_valUsername <> "" Then
    MM_fldUserAuthorization="accesso"
    MM_redirectLoginSuccess="loginok.asp"
    MM_redirectLoginFailed="nologin.asp"
    MM_flag="ADODB.Recordset"
    set MM_rsUser = Server.CreateObject(MM_flag)
    MM_rsUser.ActiveConnection = MM_conn_dati_STRING
    MM_rsUser.Source = "SELECT email, password"
    If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
    MM_rsUser.Source = MM_rsUser.Source & " FROM musicisti_gold WHERE email='" & MM_valUsername &"' AND password='" & CStr(Request.Form("password")) & "'"
    MM_rsUser.CursorType = 0
    MM_rsUser.CursorLocation = 2
    MM_rsUser.LockType = 3
    MM_rsUser.Open
    If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
    ' username and password match - this is a valid user
    Session("MM_Username") = MM_valUsername
    If (MM_fldUserAuthorization <> "") Then
    Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization ).Value)
    Else
    Session("MM_UserAuthorization") = ""
    End If
    if CStr(Request.QueryString("accessdenied")) <> "" And false Then
    MM_redirectLoginSuccess = Request.QueryString("accessdenied")
    End If
    MM_rsUser.Close
    Response.Redirect(MM_redirectLoginSuccess)
    End If
    MM_rsUser.Close
    Response.Redirect(MM_redirectLoginFailed)
    End If
    %>
    <%
    Dim Repeat1__numRows
    Repeat1__numRows = -1
    Dim Repeat1__index
    Repeat1__index = 0
    rs_gold_numRows = rs_gold_numRows + Repeat1__numRows
    %>
    <%
    ' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

    ' create the list of parameters which should not be maintained
    MM_removeList = "&index="
    If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="
    MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_kee pNone=""

    ' add the URL parameters to the MM_keepURL string
    For Each Item In Request.QueryString
    NextItem = "&" & Item & "="
    If (InStr(1,MM_removeList,NextItem,1) = 0) Then
    MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
    End If
    Next

    ' add the Form variables to the MM_keepForm string
    For Each Item In Request.Form
    NextItem = "&" & Item & "="
    If (InStr(1,MM_removeList,NextItem,1) = 0) Then
    MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
    End If
    Next

    ' create the Form + URL string and remove the intial '&' from each of the strings
    MM_keepBoth = MM_keepURL & MM_keepForm
    if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
    if (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
    if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)

    ' a utility function used for adding additional parameters to these strings
    Function MM_joinChar(firstItem)
    If (firstItem <> "") Then
    MM_joinChar = "&"
    Else
    MM_joinChar = ""
    End If
    End Function
    %>

  2. #2
    Io si , ma giusto perchč hai usato Dreamweaver non dico niente

    Guarda quā vā

    http://www.aspitalia.com/script/595/...ction-ASP.aspx

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.