ASP for Web source code security auditing (1)

Source: Internet
Author: User

0 × 01 ASP introduction:

ASP is a server-side scripting environment that can be used to create and run dynamic Web pages or Web applications. ASP Web pages can contain HTML tags, common text, script commands, and COM components. Using ASP, you can add interactive content (such as online forms) to a webpage, or create a web application that uses an HTML webpage as the user interface.

0 × 02 ASP Vulnerability introduction:

1. DataBase Path Leak)

Overview: Database path leakage is mainly manifested in the WEB built by ASP + Access. When an attacker submits % 5c, IIS will cause a parsing error, resulting in the output of the real database path, % 5c is the hexadecimal code of \, that is, another representation.

Vulnerability principle: When submitting data, IE will automatically convert % 5c to/to get the same address. A database connection file is used in asp websites. The name is conn. asp.

Vulnerability code: Here I use the dynamic article system as an example. The Code is as follows:

 
 
  1. <%
  2. Dim conn
  3. Dim connstr
  4. Dim db
  5. Db = "database/adsfkldfogowerjnokfdslwejhdfsjhk. mdb" 'location of the database file
  6. Set conn = Server. CreateObject ("ADODB. Connection ")
  7. Connstr = "Provider = Microsoft. Jet. OLEDB.4.0; Data Source =" & Server. MapPath (db)
  8. Conn. Open connstr
  9. %>

Vulnerability exploits: when accessing http://www.aspmps.com/cn%5cconn.asp IIS, an error is reported to output the absolute database path to the client, as shown in

When the database path is leaked, attackers can download the database to the local computer and find the background Administrator account and password in the table, so that they can easily access the background management of the website, this vulnerability is only applicable to ACCESS databases and does not affect SQL server databases. The brute-force database of the power system has been suffering for a long time. Last year, 360 companies released an announcement to this end. Multiple media outlets have reposted the link: http://tech.163.com/digi/12/0312/15/7sdhi0lj00163he0.html.

Vulnerability repair: There are two methods to fix this vulnerability. The first method is in conn. before the open connstr code, add On Error Resume Next. In the second method, select "Send the following text Error message to the client" in the IIS server configuration option ". Example 2


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.