<% if instr(YourId ,\"\'\") Or _ instr(YourId ,\"&\") Or _ instr(YourId ,\",\") Or _ instr(YourId ,\";\") Or _ instr(YourId ,\"_\") Or _ instr(YourId ,\"=\") Or _ instr(YourId ,\" \") Or _ instr(lcase(YourId) ,\"select \") Or _ instr(lcase(YourId) ,\" where \") Or _ instr(lcase(YourId) ,\" or \") Or _ instr(lcase(YourId) ,\" by \") Or _ instr(lcase(YourId) ,\" insert \") Or _ instr(lcase(YourId) ,\" update \") Or _ instr(lcase(YourId) ,\" and \") Then FejlYourId = FejYourId + 1 End If
if instr(Password ,\"\'\") Or _ instr(Password ,\"&\") Or _ instr(Password ,\",\") Or _ instr(Password ,\";\") Or _ instr(Password ,\"_\") Or _ instr(Password ,\"=\") Or _ instr(Password ,\" \") Or _ instr(lcase(Password) ,\"select \") Or _ instr(lcase(Password) ,\" where \") Or _ instr(lcase(Password) ,\" or \") Or _ instr(lcase(Password) ,\" by \") Or _ instr(lcase(Password) ,\" insert \") Or _ instr(lcase(Password) ,\" update \") Or _ instr(lcase(Password) ,\" and \") Then FejlPassword = FejPassword + 1 End If
If FejlYourId > 0 Or FejlPassword > 0 Then Response.Redirect \"login.asp?FejlYourId=\" & FejlYourId & _ \"&FejlPassword=\" & FejlPassword End If
Set Conn = Server.CreateObject(\"ADODB.Connection\") Conn.Open \"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=D:\\home\\formordk\\db\\member.mdb\" Set RS = conn.Execute (\"SELECT MedlemsIdNr, MedlemsPassword From MedlemsInfo WHERE MedlemsIdNr =\'\" & YourId & \"\'\")
If RS.EOF Then FejlYourIdNotInDb = FejlYourIdNotInDb + 1 Else If RS(\"MedlemsPassword\") <> Password Then FejlForkertPassword = FejlForkertPassword + 1 End If
If FejlYourIdNotInDb > 0 Or FejlForkertPassword > 0 Then Response.Redirect \"login.asp?FejlYourIdNotInDb=\" & FejlYourIdNotInDb & _ \"&FejlForkertPassword=\" & FejlForkertPassword Else Response.Cookies(\"Memberacces\")(\"YourId\") = \"\" & YourId & \"\" Response.Cookies(\"Memberacces\")(\"Password\") = \"\" & Password & \"\" Response.Cookies(\"Memberacces\").Expires = Date+365 Response.Redirect \"enellerandenside.asp\" End If End If %>
Eller burde jeg tjekke noget mere for at sikre at folk ikke kan snyde med den??
I dette særtema ser vi på, hvordan cloud og AI bliver fundamentet for virksomhedernes digitale forretning, og hvordan de nye muligheder for automatisering og forretningsværdi kan udnyttes uden at miste overblik, sikkerhed og menneskelig kontrol.
bojohansen:> du kan gemme user/pass i en DB og så gemme ID\'et på den post der indeholder deres user/pass i en cookie. Det er mere sikkert på den måde..
Ok, jeg havde nemlig tænkt på at lave en random selected talrække som gemmes i db (15 til 20 tal) og så derved tjekke om den passer med cookien. Den tygger jeg lige lidt på.
Man kan ikke direkte læse pass og id i cookien, men man vil selvfølgelig kunne kopiere cookien og så gå ind på kontoen og ændre password da dette bliver en mulighed i systemet, men det kan jo kun lade sig gøre ved at man finder personen\'s IP nummer og hacker sig direkte ind på personens comp. og kopiere cookien.... eller hvad??
<% if instr(YourId ,\"\'\") Or _ instr(YourId ,\"&\") Or _ instr(YourId ,\",\") Or _ instr(YourId ,\";\") Or _ instr(YourId ,\"_\") Or _ instr(YourId ,\"=\") Or _ instr(YourId ,\" \") Or _ instr(lcase(YourId) ,\"select \") Or _ instr(lcase(YourId) ,\" where \") Or _ instr(lcase(YourId) ,\" or \") Or _ instr(lcase(YourId) ,\" by \") Or _ instr(lcase(YourId) ,\" insert \") Or _ instr(lcase(YourId) ,\" update \") Or _ instr(lcase(YourId) ,\" and \") Then FejlYourId = FejYourId + 1 End If
if instr(Password ,\"\'\") Or _ instr(Password ,\"&\") Or _ instr(Password ,\",\") Or _ instr(Password ,\";\") Or _ instr(Password ,\"_\") Or _ instr(Password ,\"=\") Or _ instr(Password ,\" \") Or _ instr(lcase(Password) ,\"select \") Or _ instr(lcase(Password) ,\" where \") Or _ instr(lcase(Password) ,\" or \") Or _ instr(lcase(Password) ,\" by \") Or _ instr(lcase(Password) ,\" insert \") Or _ instr(lcase(Password) ,\" update \") Or _ instr(lcase(Password) ,\" and \") Then FejlPassword = FejPassword + 1 End If
If FejlYourId > 0 Or FejlPassword > 0 Then Response.Redirect \"login.asp?FejlYourId=\" & FejlYourId & _ \"&FejlPassword=\" & FejlPassword End If
Set Conn = Server.CreateObject(\"ADODB.Connection\") Conn.Open \"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=D:\\home\\formordk\\db\\member.mdb\" Set RS = conn.Execute (\"SELECT MedlemsIdNr, MedlemsPassword From MedlemsInfo WHERE MedlemsIdNr =\'\" & YourId & \"\'\")
If RS.EOF Then FejlYourIdNotInDb = FejlYourIdNotInDb + 1 Else If RS(\"MedlemsPassword\") <> Password Then FejlForkertPassword = FejlForkertPassword + 1 End If
If FejlYourIdNotInDb > 0 Or FejlForkertPassword > 0 Then Response.Redirect \"login.asp?FejlYourIdNotInDb=\" & FejlYourIdNotInDb & _ \"&FejlForkertPassword=\" & FejlForkertPassword Else
Function MakePassword(intAntaltegn) For x = 1 To intAntalTegn Randomize intChooser = Int(Rnd * 2) + 1 Select Case intChooser Case 1 intWildChar = Int(Rnd * 57) + 65 If intWildChar => 91 And intWildChar <= 96 Then intWildChar = intWildChar + 8 End If strPassword = strPassword & Chr(intWildChar) Case Else intWildChar = Int(Rnd * 9) + 1 strPassword = strPassword & intWildChar End Select Next MakePassword = strPassword End Function CookieId = MakePassword(20)
Set RS1 = conn.Execute (\"UPDATE MedlemsInfo SET CookieId = \'\" & CookieId & \"\' Where MedlemsIdNr = \'\" & YourId & \"\' \")
Response.Cookies(\"Memberacces\")(\"CookieId\") = \"\" & CookieId & \"\" Response.Cookies(\"Memberacces\").Expires = Date+365 Response.Redirect \"enellerandenside.asp\" End If End If %>
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.