Recommandé: prévention des vulnérabilités de l'usurpation des cookies (implémentation VBS JS) 1. Principe des cookies d'attaque L'usurpation de l'usurpation principalement de la pratique dangereuse de stocker les informations de connexion des utilisateurs dans les cookies sur le réseau actuel. La méthode d'attaque est relativement difficile par rapport aux vulnérabilités telles que les vulnérabilités d'injection SQL et RDQUO
Ce qui suit est le contenu cité: <% '' Exemple d'appel 'Dim int_rpp, int_start, int_shownumberlink_, str_nonlinkcolor_, tof_, top10_, top1_, top1_, ton1_, ton10_, tol_, showmorepagego_type_, cpageno 'int_rpp = 2' définir le nombre d'affichages par page 'int_shownumberlink_ = 8' NumberName Numéro d'affichage 'showmorepagego_type_ = 1' est-ce un menu déroulant ou un saut de valeur d'entrée, un seul peut être sélectionné lorsque plusieurs appels sont appelés 'str_nonlinkcolor _ = # 999999' Couleur de liaison non avec 'tof _ = <font face = webdings> 9 </font>' Accueil 'top10_ = <font face = webdings> 7 </font>' sur dix 'top1_ = <font face = webdings> 3 </font>' Précédent 'ton1_ = <font face = webdings> 4 </font>' Suivant 'ton10_ = <font face = webdings> 8 </font>' Dix prochain 'Tol _ = <Font face = webdings>: </font>' Dernière page '=====================================================================. 'Ce code doit être entre VClass_rs.open et la boucle pour 'SET VCLASS_RS = CreateObject (G_FS_RS) 'VClass_rs.open this_fun_sql, user_conn, 1,1 'Si ce n'est pas vClass_rs.eof alors 'VClass_rs.pagesize = int_rpp 'cpageno = nosqlhack (request.querystring (page)) 'Si cpageno = alors cpageno = 1 'Si ce n'est pas le Numérique (cpageno) alors Cpageno = 1 'cpageno = Clng (cpageno) 'Si cpageno <= 0 alors cpageno = 1 'Si cpageno> vClass_rs.pageCount alors cpageno = vClass_rs.pageCount 'VClass_rs.absolupage = cpageno 'Pour int_start = 1 à int_rpp '' 'Ajouter un corps de boucle pour afficher les données '' 'VClass_rs.movnext 'Si vClass_rs.eof ou vClass_rs.bof, alors quittez ' SUIVANT 'Fini si '=====================================================================. 'réponse.write <p> & fpageCount (vClass_rs, int_shownumberlink_, str_nonlinkColor_, tof_, top10_, top1_, top1_, ton1_, ton10_, tol_, showmorepagego_type_, cpageno) '' '*************************************************************** 'Objectif: gardez les paramètres de la page de la pagination 'Cohérence de la requête de soumission 'Entrée: MoveParam: paramètres de pagination 'Removelist: le paramètre à supprimer 'Retour: URL de pagination '*************************************************************** Fonction Pageurl (MoveParam, Removelist) sombre strname Dim Keepurl, Keepform, Keepmove Removelist = Removelist &, & Movparam Keepform = Pour chaque strname dans demande.form 'Juger soumettre et les valeurs vides dans les paramètres de forme Si pas Instrev (, et Removelist & ,,, & strname & ,, -1, 1)> 0 et request.form (strname) <> puis Keepform = keepform &&& strName & = & server.urlencode (request.form (strname)) terminer si RemoveList = Removelist &, & strname Suivant Keepurl = Pour chaque Strname dans demande.Querystring Sinon (instrrrev (, & revelist & ,,, & strname & ,, -1, 1)> 0) alors KeepUrl = keepurl & & & strname & = & server.urlencode (request.Querystring (strname)) Terminer si Suivant Keepmove = keepform & keepurl Si (keepmove <>) alors Keepmove = Right (Keepmove, Len (Keepmove) - 1) Keepmove = server.htmlencode (keepmove) & & Terminer si 'PageUrl = remplacer (request.servervariables (url), / search.asp, / search.html) &? & Keepmove & MoveParam & = PageUrl =? & Keepmove & MoveParam & = Fonction finale Fonction fpageCount (page_rs, wamisdumberlink_, nonLinkColor_, tof_, top10_, top1_, top1_, ton1_, ton10_, tol_, showmorepagego_type_, page) Dim this_func_get_html_, topage_, p_, sp2_, i, tpageCount DIM NAVILNETH, STARTPAGE, PAGE This_func_get_html_ =: i = 1 NAVILNEGTH = WAVERDUDIMINK_ Si isEmpty (showmorepagego_type_) alors showmorepagego_type_ = 1 tpageCount = page_rs.pageCount Si tpageCount <1 alors tpageCount = 1 Si pas page_rs.eof ou non page_rs.bof alors topage_ = pageurl (page, soumettre, getType, sans cache, _) Si page = 1 alors This_func_get_html_ = this_func_get_html_ & <font color = & nonlinkColor_ & title = home> & tof _ & </font> & vbnewline Autre This_func_get_html_ = this_func_get_html_ & <a href = & topage_ & 1 title = home> & tof_ & </a> & vbnewline Terminer si Si page <Navilength alors StartPage = 1 autre StartPage = Fix (page / Navilngle) * Navilength terminer si EndPage = startPage Navilength-1 Si page finale> tpageCount alors alors page = tpageCount Si startpage> 1 alors This_func_get_html_ = this_func_get_html_ & <a href = & topage_ & page - Navilength & title = & int_shownumberlink_ & page> & top10_ & </a> & vbnewline Autre This_func_get_html_ = this_func_get_html_ & <font color = & nonLinkColor_ & title = & int_shownumberlink_ & page> & top10 _ & </font> & vbnewline Terminer si Si page <> 1 et page <> 0 alors This_func_get_html_ = this_func_get_html_ & <a href = & topage _ & (page-1) & title = page précédente> & top1_ & </a> & vbnewline Autre This_func_get_html_ = this_func_get_html_ & <font color = & nonlinkColor_ & title = page précédente> & top1 _ & </font> & vbnewline Terminer si Pour i = startpage à la page en fin Si i = page alors This_func_get_html_ = this_func_get_html_ & <b> & i & </b> & vbnewline Autre This_func_get_html_ = this_func_get_html_ & <a href = & topage_ & i &> & i & </a> & vbnewline Terminer si Si je <> tpageCount, alors this_func_get_html_ = this_func_get_html_ & vbnewline Suivant Si page <> page_rs.pageCount et page <> 0 alors This_func_get_html_ = this_func_get_html_ & <a href = & topage _ & (page 1) & title = page suivante> & ton1_ & </a> & vbnewline Autre This_func_get_html_ = this_func_get_html_ & <font color = & nonlinkColor_ & title = page suivante> & ton1 _ & </font> & vbnewline Terminer si Si la page finale <tpageCount alors This_func_get_html_ = this_func_get_html_ & <a href = & topage_ & page Navilength & title = & int_shownumberlink_ & page> & ton10_ & </a> & vbnewline Autre This_func_get_html_ = this_func_get_html_ & <font color = & nonlinkcolor_ & title = & int_shownumberlink_ & page> & ton10 _ & </font> & vbnewline Terminer si Si page_rs.pageCount <> page alors This_func_get_html_ = this_func_get_html_ & <a href = & topage_ & page_rs. Autre This_func_get_html_ = this_func_get_html_ & <font color = & nonlinkColor_ & title = dernière page> & tol _ & </font> & vbnewline Terminer si Si showmorepagego_type_ = 1 alors DIM Show_Page_i Show_page_i = page 1 Si show_page_i> tpageCount alors alors show_page_i = 1 This_func_get_html_ = this_func_get_html_ & <input type = text size = 4 maxLength = 10 name = func_input_page onMouseOver = this.focus (); onfocus = this.value = '& show_page_i &'; onkeyup = value = value.replace (/ [^ 1-9] / g, '') onBeforepaste = ClipboardData.setData ('Text', ClipboardData.getData ('Text'). Remplace (/ [^ 1-9] / G, ''))> & vBnewline _ & <input type = Button Value = go onMouseOver = func_input_page.focus (); onClick = javascript: var js_jumpValue; js_jumpValue = document.all.func_input_page.value; if (js_jumpValue == ''! Isnan (js_jumpValue)) localisation = '& topage_ &' js_jumpvalue; else location = '& topage_ & 1';> & vbnewline Autre This_func_get_html_ = this_func_get_html_ & Jump: <select name = menu1 onchange = var js_jumpValue; js_jumpValue = this.options [this.selectedIndex] .value; if (js_jumpValue! = '') Localisation = js_jumpValue;> pour i = 1 à tpageCount This_func_get_html_ = this_func_get_html_ & <option value = & topage_ & i Si page = I alors this_func_get_html_ = this_func_get_html_ & selected style = 'colori: # 0000ff' This_func_get_html_ = this_func_get_html_ &> & cstr (i) & page </ option> & vbnewline suivant This_func_get_html_ = this_func_get_html_ & </lect> & vbnewline Terminer si This_func_get_html_ = this_func_get_html_ & p_ & sp2 _ && nbsp; <b> & page_rs. id = 'recordCount'> & sp2_ & page_rs.recordCount & </b> enregistre. autre 'Aucun enregistrement terminer si fpageCount = this_func_get_html_ Fonction finale %> |
Partager: comment trouver la véritable adresse IP avec ASP Comme nous le savons tous, la méthode pour obtenir une adresse IP est le contenu référencé suivant: <% = request.servervariables (Remote_addr)%>