A small experience in determining the Web database Method

Source: Internet
Author: User
Tags web database

SELF: exploits blog

Many websites prevent or filter parameters submitted by ASP.
If isnumeric (id) Then
Response. write "yes! "
Call SQL _query (id)
Else
Response. write "Error id"
Response. End
End if

In this way, no matter what the problem is, if there is a non-numeric value, there will be an error, it is very direct prevention, there is no way to make an error, there is no way to get the Database Type
But we still have methods,
For example, this ID is submitted by xxx. asp.
Xxx. asp? Id = 1
We add more than 38 numbers to the end, such as 0.
Xxx. asp? Id = 100000000... {"0" x38}
In this way, the above ASP encountered an error when executing SQL _Query.
The prompt is as follows:
Reference content:
Microsoft ole db Provider for SQL Server Error 80040e57

The number 100000000000000000000000000000000000000000000000000000000000000000 exceeds the value range (the maximum precision is 38 valid digits ).

/Announce. asp, row 19



Do you understand? We have made a database error. We can see that the prevention of Isnumeric is not thorough.
In fact, the reason is also very simple: the maximum precision of Numeric data defined in SQL is only 38. If we submit more than 38 values, an error will occur, which leads to database errors...
Defense is also very simple. A sentence of code is sufficient.
Program code:
If id> 1000000000 Then Call Error (id) 100000000 is always enough?

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.