E-learning online learning platform cookie # SQL Injection

Source: Internet
Author: User

E-learning online learning platform cookie # SQL Injection

 

Keywords: inurl: e-learning/index. asp



File: \ e-learning \ ShowNews. asp

id=request("id")Set rsnews=Server.CreateObject("ADODB.RecordSet") sql="Update News set Hits=Hits+1 where id="&cstr(request("id"))conn.execute sqlsql="Select * From News Where id="&idrsnews.Open sql,conn,1,1Title=rsnews("Title")BigClassName=rsnews("BigClassName")SmallClassName=rsnews("SmallClassName")





File: \ inc \ Check_ SQL .asp

'----- Filter the get query value. if request. queryString <> "" thenChk_badword = split (Query_Badword, "Baidu") for each Query_Name IN Request. queryStringfor I = 0 to ubound (Chk_badword) If Instr (LCase (request. queryString (Query_Name), Chk_badword (I) <> 0 ThenSelect Case Err_Message Case "1" Response. write "<Script Language = JavaScript> alert ('parameter passing error! The value of the parameter "& name &" contains an invalid string! \ N do not include invalid characters such as: and update delete; insert mid master in the parameter! '); Window. close (); </Script> "Case" 2 "Response. write "<Script Language = JavaScript> location. href = '"& Err_Web &"' </Script> "Case" 3 "Response. write "<Script Language = JavaScript> alert ('parameter passing error! The value of the parameter "& name &" contains an invalid string! \ N do not include invalid characters such as: and update delete; insert mid master in the parameter! '); Location. href = '"& Err_Web &"'; </Script> "End SelectResponse. endEnd IfNEXTNEXTEnd if '----- filter the single value of the post table. if request. form <> "" thenChk_badword = split (Form_Badword, "signature") for each name IN Request. formfor I = 0 to ubound (Chk_badword) If Instr (LCase (request. form (name), Chk_badword (I) <> 0 ThenSelect Case Err_Message Case "1" Response. write "<Script Language = JavaScript> alert ('error! The value of Form "& name &" contains an invalid string! \ N do not contain invalid characters such as % & * # () in the form! '); Window. close (); </Script> "Case" 2 "Response. write "<Script Language = JavaScript> location. href = '"& Err_Web &"' </Script> "Case" 3 "Response. write "<Script Language = JavaScript> alert ('error! The value of the parameter "& name &" contains an invalid string! \ N do not contain invalid characters such as % & * # () in the form! '); Location. href =' "& Err_Web &" '; </Script> "End SelectResponse. EndEnd IfNEXTNEXTend if





Look at the filtering code. It's just a pitfall. Only get and post are filtered out.


 


 

 

Solution:

Filter

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.