แนะนำ: การป้องกันช่องโหว่การปลอมแปลงคุกกี้ (การใช้งาน VBS JS) 1. หลักการของการโจมตีคุกกี้การปลอมแปลงส่วนใหญ่ใช้วิธีปฏิบัติที่ไม่ปลอดภัยในการจัดเก็บข้อมูลการเข้าสู่ระบบของผู้ใช้ในคุกกี้ในเครือข่ายปัจจุบัน วิธีการโจมตีค่อนข้างยากเมื่อเทียบกับช่องโหว่เช่นช่องโหว่การฉีด SQL & rdquo
ต่อไปนี้เป็นเนื้อหาที่ยกมา: - '' ตัวอย่างการโทร 'dim int_rpp, int_start, int_shownumberlink_, str_nonlinkcolor_, tof_, top10_, top1_, top1_, ton1_, ton10_, tol_, showmorepagego_type_, cpageno 'int_rpp = 2' ตั้งจำนวนจอแสดงผลต่อหน้า 'int_shownumberlink_ = 8' หมายเลขจอแสดงผล NumberName 'showmorepagego_type_ = 1' เป็นเมนูแบบเลื่อนลงหรือกระโดดค่าอินพุตสามารถเลือกได้เพียง 1 ครั้งเมื่อมีการเรียกหลายสาย 'str_nonlinkcolor _ =#999999' สีลิงค์ที่ไม่ร้อนแรง 'tof _ = <font face = webdings> 9 </font>' บ้าน 'top10_ = <font face = webdings> 7 </font>' ในสิบ 'top1_ = <font face = webdings> 3 </font>' ก่อนหน้านี้ 'ton1_ = <font face = webdings> 4 </font>' ถัดไป 'ton10_ = <font face = webdings> 8 </font>' สิบถัดไป 'tol _ = <font face = webdings>: </font>' หน้าสุดท้าย - 'รหัสนี้จะต้องอยู่ระหว่าง vclass_rs.open และสำหรับลูป 'ตั้งค่า vclass_rs = createObject (g_fs_rs) 'vclass_rs.open this_fun_sql, user_conn, 1,1 'ถ้าไม่ใช่ vclass_rs.eof แล้ว 'vclass_rs.pagesize = int_rpp 'cpageno = nosqlhack (request.querystring (หน้า)) 'ถ้า cpageno = จากนั้น cpageno = 1 'ถ้าไม่ใช่ isnumeric (cpageno) แล้ว cpageno = 1 'cpageno = clng (cpageno) 'ถ้า cpageno <= 0 แล้ว cpageno = 1 'ถ้า cpageno> vclass_rs.pagecount แล้ว cpageno = vclass_rs.pagecount 'vclass_rs.absolutepage = cpageno 'สำหรับ int_start = 1 ถึง int_rpp - 'เพิ่มวงวนเพื่อแสดงข้อมูล - 'vclass_rs.movenext 'ถ้า vclass_rs.eof หรือ vclass_rs.bof ออกจาก ' ต่อไป 'สิ้นสุดถ้า - 'response.write <p> & fpagecount (vclass_rs, int_shownumberlink_, str_nonlinkcolor_, tof_, top10_, top1_, top1_, ton1_, ton10_, tol_, showmorepagego_type_, cpageno) - - 'วัตถุประสงค์: เก็บพารามิเตอร์หน้าของการแบ่งหน้า 'ความสม่ำเสมอของการตอบคำถาม 'อินพุต: MoveParam: พารามิเตอร์การปนเปื้อน 'Removelist: พารามิเตอร์ที่จะลบออก 'return: url pagination - Function PageUrl (MoveParam, RemoveList) Dim Strname Dim Keepurl, Keepform, Keepmove removeList = removelist &, & movparam Keepform = สำหรับแต่ละ strname ใน request.form 'ผู้พิพากษาส่งและค่าว่างในพารามิเตอร์แบบฟอร์ม หากไม่ใช่ Instrrev (, & Removelist & ,,, & strname & ,, -1, 1)> 0 และ request.form (strName) <> จากนั้น KeepForm = KeepForm &&& strName & = & server.urlencode (request.form (strName)) สิ้นสุดถ้า removeList = removelist &, & strName ต่อไป Keepurl = สำหรับแต่ละ strName ในคำขอ. QueryString ถ้าไม่ใช่ (Instrrev (, & removelist & ,,, & strname & ,, -1, 1)> 0) จากนั้น Keepurl = Keepurl & & strName & = & server.urlencode (request.QueryString (strName)) สิ้นสุดถ้า ต่อไป KeepMove = KeepForm & Keepurl ถ้า (Keepmove <>) แล้ว KeepMove = ขวา (KeepMove, Len (KeepMove) - 1) KeepMove = Server.htmlencode (KeepMove) & & & สิ้นสุดถ้า 'PageUrl = แทนที่ (request.serverVariables (URL),/search.asp,/search.html) &? & Keepmove & MoveParam & = PageUrl =? & Keepmove & MoveParam & = ฟังก์ชันสิ้นสุด ฟังก์ชั่น fpagecount (page_rs, redialumberlink_, nonlinkcolor_, tof_, top10_, top1_, top1_, ton1_, ton10_, tol_, showmorepagego_type_, หน้า) dim this_func_get_html_, topage_, p_, sp2_, i, tpagecount Dim Navilength, startpage, endpage this_func_get_html_ =: i = 1 ความยาวคลื่น = sovermentumberlink_ ถ้า isempty (showmorepagego_type_) จากนั้น showmorepagego_type_ = 1 tpagecount = page_rs.pagecount ถ้า tpagecount <1 ดังนั้น tpagecount = 1 ถ้าไม่ใช่ page_rs.eof หรือไม่ page_rs.bof แล้ว topage_ = pageUrl (หน้า, ส่ง, getType, no-cache, _) ถ้าหน้า = 1 แล้ว this_func_get_html_ = this_func_get_html_ & <font color = & nonlinkcolor_ & title = home> & tof _ & </font> & vbnewline อื่น this_func_get_html_ = this_func_get_html_ & <a href = & topage_ & 1 title = home> & tof_ & </a> & vbnewline สิ้นสุดถ้า ถ้าหน้า <navilength แล้ว startpage = 1 อื่น startPage = fix (หน้า / ความยาวคลื่น) * ความยาวี สิ้นสุดถ้า endpage = startpage navilength-1 ถ้า endpage> tpagecount ดังนั้น endpage = tpagecount ถ้าเริ่มต้น> 1 แล้ว this_func_get_html_ = this_func_get_html_ & <a href = & topage_ & page - Navilength & title = & int_shownumberlink_ & หน้า> & top10_ & </a> & vbneWline อื่น this_func_get_html_ = this_func_get_html_ & <font color = & nonlinkcolor_ & title = & int_shownumberlink_ & page> & top10 _ & </font> & vbnewline สิ้นสุดถ้า ถ้าหน้า <> 1 และหน้า <> 0 จากนั้น this_func_get_html_ = this_func_get_html_ & <a href = & topage _ & (หน้า 1) & title = หน้าก่อนหน้า> & top1_ & </a> & vbNewline อื่น this_func_get_html_ = this_func_get_html_ & <font color = & nonlinkcolor_ & title = หน้าก่อนหน้า> & top1 _ & </font> & vbnewline สิ้นสุดถ้า สำหรับ i = startpage to endpage ถ้า i = หน้าแล้ว this_func_get_html_ = this_func_get_html_ & <b> & i & </b> & vbnewline อื่น this_func_get_html_ = this_func_get_html_ & <a href = & topage_ & i &> & i & </a> & vbNewline สิ้นสุดถ้า ถ้าฉัน <> tpagecount แล้ว this_func_get_html_ = this_func_get_html_ & vbnewline ต่อไป ถ้าหน้า <> page_rs.pagecount และหน้า <> 0 จากนั้น this_func_get_html_ = this_func_get_html_ & <a href = & topage _ & (หน้า 1) & title = หน้าถัดไป> & ton1_ & </a> & vbNewline อื่น this_func_get_html_ = this_func_get_html_ & <font color = & nonlinkcolor_ & title = หน้าถัดไป> & ton1 _ & </font> & vbnewline สิ้นสุดถ้า ถ้า endpage <tpagecount แล้ว this_func_get_html_ = this_func_get_html_ & <a href = & topage_ & page navilength & title = & int_shownumberlink_ & page> & ton10_ & </a> & vbnewline อื่น this_func_get_html_ = this_func_get_html_ & <font color = & nonlinkcolor_ & title = & int_shownumberlink_ & page> & ton10 _ & </font> & vbnewline สิ้นสุดถ้า ถ้า page_rs.pagecount <> หน้าจากนั้น this_func_get_html_ = this_func_get_html_ & <a href = & topage_ & page_rs.pagecount & title = หน้าสุดท้าย> & tol_ & </a> & vbneWline อื่น this_func_get_html_ = this_func_get_html_ & <font color = & nonlinkcolor_ & title = หน้าสุดท้าย> & tol _ & </font> & vbnewline สิ้นสุดถ้า ถ้า showmorepagego_type_ = 1 แล้ว dim show_page_i show_page_i = หน้า 1 ถ้า show_page_i> tpagecount แล้ว show_page_i = 1 this_func_get_html_ = this_func_get_html_ & <ประเภทอินพุต = ขนาดข้อความ = 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 ('ข้อความ', clipboardData.getData ('ข้อความ') แทนที่ (/[^1-9]/g, '') & <อินพุตประเภท = ค่าปุ่ม = ไป onMouseOver = func_input_page.focus (); onclick = javascript: var js_jumpvalue; js_jumpvalue = document.all.func_input_page.value; ถ้า (js_jumpvalue == ''! isnan (js_jumpvalue)) ที่ตั้ง = '& topage_ &' js_jumpvalue; location = '& topage_ & 1';> & vbnewline อื่น this_func_get_html_ = this_func_get_html_ & jump: <select name = menu1 onchange = var js_jumpvalue; js_jumpvalue = this.options [this.selectedindex] .value; สำหรับ i = 1 ถึง tpagecount this_func_get_html_ = this_func_get_html_ & <ตัวเลือกค่า = & topage_ & i ถ้าหน้า = ฉันแล้ว this_func_get_html_ = this_func_get_html_ & selected style = 'color:#0000ff' this_func_get_html_ = this_func_get_html_ &> & cstr (i) & page </optopt> & vbnewline ต่อไป this_func_get_html_ = this_func_get_html_ & </select> & vbnewline สิ้นสุดถ้า this_func_get_html_ = this_func_get_html_ & p_ & sp2 _ && nbsp; <b> & page_rs.pagesize & </b> บันทึกต่อหน้าตอนนี้คือ: <b> id = 'recordCount'> & sp2_ & page_rs.recordcount & </b> บันทึก อื่น 'ไม่มีบันทึก สิ้นสุดถ้า fpagecount = this_func_get_html_ ฟังก์ชันสิ้นสุด - |
แบ่งปัน: วิธีค้นหาที่อยู่ IP จริงด้วย ASP อย่างที่เราทราบกันดีว่าวิธีการรับที่อยู่ IP คือเนื้อหาที่อ้างอิงต่อไปนี้: <%= request.ServerVariables (remote_addr)%>