Recommended: Prevention of Cookies spoofing vulnerabilities (vbs js implementation) 1. Principle of attack Cookies Spoofing mainly uses the unsafe practice of storing user login information in cookies on the current network. The attack method is relatively difficult compared to vulnerabilities such as SQL injection vulnerabilities&rdquo
The following is the quoted content: <%'' ''Call Example 'Dim int_RPP,int_Start,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo 'int_RPP=2' Set the number of displays per page 'int_showNumberLink_=8 'NumberName display number 'showMorePageGo_Type_ = 1 'Is it a drop-down menu or a input value jump, only 1 can be selected when multiple calls are called 'str_nonLinkColor_=#999999 'Non-hot link color 'toF_=<font face=webdings>9</font> 'Home 'toP10_= <font face=webdings>7</font> 'On ten 'toP1_= <font face=webdings>3</font> 'Previous 'toN1_= <font face=webdings>4</font> 'Next 'toN10_= <font face=webdings>8</font> 'Next ten 'toL_=<font face=webdings>:</font> 'Last page '=========================================================== 'This code must be between VClass_Rs.Open and the for loop ' Set VClass_Rs = CreateObject(G_FS_RS) ' VClass_Rs.Open This_Fun_Sql,User_Conn,1,1 ' IF not VClass_Rs.eof THEN ' VClass_Rs.PageSize=int_RPP ' cPageNo=NoSqlHack(Request.QueryString(Page)) ' If cPageNo= Then cPageNo = 1 ' If not isnumeric(cPageNo) Then cPageNo = 1 ' cPageNo = Clng(cPageNo) ' If cPageNo<=0 Then cPageNo=1 ' If cPageNo>VClass_Rs.PageCount Then cPageNo=VClass_Rs.PageCount ' VClass_Rs.AbsolutePage=cPageNo ' FOR int_Start=1 TO int_RPP '' 'Add loop body to display data '' ' VClass_Rs.MoveNext ' if VClass_Rs.eof or VClass_Rs.bof then exit for ' NEXT ' END IF '=========================================================== 'response.Write <p>& fPageCount(VClass_Rs,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo) '' '*************************************************************** ' Purpose: Keep page parameters of pagination ' Consistency of Submit Query ' Input: moveParam: Pagination Parameters ' removeList: The parameter to be removed ' Return: Pagination Url '*************************************************************** Function PageUrl(moveParam, removeList) dim strName dim KeepUrl, KeepForm, KeepMove removeList=removeList&,&movParam KeepForm= For Each strName in Request.Form 'Judge submit and empty values in form parameters if not InstrRev(,&removeList&,,,&strName&,, -1, 1)>0 and Request.Form(strName)<> then KeepForm=KeepForm&&&strName&=&Server.URLencode(Request.Form(strName)) end if removeList=removeList&,&strName Next KeepUrl= For Each strName In Request.QueryString If not (InstrRev(,&removeList&,,,&strName&,, -1, 1)>0) Then KeepUrl = KeepUrl & & & strName & = & Server.URLencode(Request.QueryString(strName)) End If Next KeepMove=KeepForm&KeepUrl If (KeepMove <> ) Then KeepMove = Right(KeepMove, Len(KeepMove) - 1) KeepMove = Server.HTMLEncode(KeepMove) & & End If 'PageUrl = replace(Request.ServerVariables(URL),/Search.asp,/Search.html) & ? & KeepMove & moveParam & = PageUrl = ? & KeepMove & moveParam & = End Function Function fPageCount(Page_Rs, showNumberLink_,nonLinkColor_,toF_,toP10_,toP1_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,Page) Dim This_Func_Get_Html_,toPage_,p_,sp2_,I,tpagecount Dim NaviLength, StartPage, EndPage This_Func_Get_Html_ = : I = 1 NaviLength=showNumberLink_ if IsEmpty(showMorePageGo_Type_) then showMorePageGo_Type_ = 1 tpagecount=Page_Rs.pagecount If tPageCount<1 Then tPageCount=1 if not Page_Rs.eof or not Page_Rs.bof then toPage_ = PageUrl(Page,submit,GetType,no-cache,_) if Page=1 then This_Func_Get_Html_=This_Func_Get_Html_& <font color=&nonLinkColor_& title=Home>&toF_&</font> &vbNewLine Else This_Func_Get_Html_=This_Func_Get_Html_& <a href=&toPage_&1 title=Home>&toF_&</a> &vbNewLine End If if Page<NaviLength then StartPage = 1 else StartPage = fix(Page / NaviLength) * NaviLength end if EndPage=StartPage NaviLength-1 If EndPage>tPageCount Then EndPage=tPageCount If StartPage>1 Then This_Func_Get_Html_=This_Func_Get_Html_& <a href=&toPage_& Page - NaviLength & title=&int_showNumberLink_&page>&toP10_&</a> &vbNewLine Else This_Func_Get_Html_=This_Func_Get_Html_& <font color=&nonLinkColor_& title=&int_showNumberLink_&page>&toP10_&</font> &vbNewLine End If If Page <> 1 and Page <>0 Then This_Func_Get_Html_=This_Func_Get_Html_& <a href=&toPage_&(Page-1)& title=Previous page>&toP1_&</a> &vbNewLine Else This_Func_Get_Html_=This_Func_Get_Html_& <font color=&nonLinkColor_& title=Previous page>&toP1_&</font> &vbNewLine End If For I=StartPage To EndPage If I=Page Then This_Func_Get_Html_=This_Func_Get_Html_& <b>&I&</b> &vbNewLine Else This_Func_Get_Html_=This_Func_Get_Html_& <a href=&toPage_&I&> &I& </a> &vbNewLine End If If I<>tPageCount Then This_Func_Get_Html_=This_Func_Get_Html_& vbNewLine Next If Page <> Page_Rs.PageCount and Page <>0 Then This_Func_Get_Html_=This_Func_Get_Html_& <a href=&toPage_&(Page 1)& title=Next page>&toN1_&</a> &vbNewLine Else This_Func_Get_Html_=This_Func_Get_Html_& <font color=&nonLinkColor_& title=Next page>&toN1_&</font> &vbNewLine End If If EndPage<tpagecount Then This_Func_Get_Html_=This_Func_Get_Html_& <a href=&toPage_& Page NaviLength & title=&int_showNumberLink_&page>&toN10_&</a> &vbNewLine Else This_Func_Get_Html_=This_Func_Get_Html_& <font color=&nonLinkColor_& title=&int_showNumberLink_&page>&toN10_&</font> &vbNewLine End If if Page_Rs.PageCount<>Page then This_Func_Get_Html_=This_Func_Get_Html_& <a href=&toPage_&Page_Rs.PageCount& title=Last Page>&toL_&</a> &vbNewLine Else This_Func_Get_Html_=This_Func_Get_Html_& <font color=&nonLinkColor_& title=Last page>&toL_&</font> &vbNewLine End If If showMorePageGo_Type_ = 1 then Dim Show_Page_i Show_Page_i = Page 1 if Show_Page_i > tPageCount then 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').replace(/[^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)) location='&topage_&' Js_JumpValue; else location='&topage_&1';> &vbNewLine Else 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!='') location=Js_JumpValue;> for i=1 to tPageCount This_Func_Get_Html_=This_Func_Get_Html_& <option value=&topage_&i if Page=i then This_Func_Get_Html_=This_Func_Get_Html_& selected style='color:#0000FF' This_Func_Get_Html_=This_Func_Get_Html_& >&cstr(i)&page</option> &vbNewLine next This_Func_Get_Html_=This_Func_Get_Html_& </select> &vbNewLine End if This_Func_Get_Html_=This_Func_Get_Html_& p_&sp2_& <b>&Page_Rs.PageSize&</b> records per page, now is:<b><span class=tx>&sp2_&Page&</span>/&tPageCount&</b> page, a total of <b><span id='recordcount'>&sp2_&Page_Rs.recordCount&</b> records. else 'No record end if fPageCount = This_Func_Get_Html_ End Function %> |
Share: How to find the real IP address with ASP As we all know, the method to get an IP address is the following referenced content: <%=Request.ServerVariables(REMOTE_ADDR)%>