ASP vulnerability and security recommendations
ASP Vulnerability and Security Suggestions (Birds) A Preface Microsoft Active Server Pages (ASP) is a server-side script to write a web server application that can create and run dynamic, interactive. Use ASP to combine HTML pages, scripting commands, and ActiveX components to create an interactive web page and web-based power-based applications. Nowadays, many websites, especially the e-commerce website, mostly used ASP on the front desk. So now ASP is very common on the website application. ASP is a quick tool for developing website applications, but some webmasters only see the rapid development capabilities of ASP, but ignore ASP security issues. The ASP has been subject to many vulnerabilities, the pain of the latter, including the nightmare of% 81, password verification, IIS vulnerability, etc. have always made the ASP website developers have been shocked. This article tries from an Operating system vulnerability and ASP program itself, and explains the ASP security issues, and gives a solution or suggestion. Two keywords ASP, network security, IIS, SSL, encryption. The three ASP work mechanism Active Server Page technology provides the application developers with scripting intuitive, fast, and efficient application development methods, which greatly improves the development of the development. Let's take a look at how the ASP works before discussing the security issues of ASP. The ASP script is written in a plain text. The ASP script is a file that is written in a text format that is composed of a script that is mixed with a standard HTML page in a series of specific symphony (currently supporting VBScript and JScript two scripting languages). When the client's end user uses a web browser to access an ASP script-based app, the web browser will send an HTTP request to the Web server. Web server analysis, judging that the request is an application of the ASP script, and automatically calls the ASP script to interpret the ASP script through the ISAPI interface. Asp.dll will get the specified ASP script file from the file system or internal buffer, then perform syntax analysis and explain it. The final processing result will form the contents of the HTML format, return to the web browser through the web server "original road", and the final result is presented by the web browser to the client. This completes a complete ASP script call. Several organic ASP script calls form a complete ASP scripting application. Let's take a look at the environment you need to run the ASP: Microsoft Internet Information Server 3.0 / 4.0 / 5.0 ON NT Server Microsoft Internet Information Server 3.0 / 4.0 / 5.0 on Win2000 Microsoft Personal Web Server On Windows 95/98 Windows NT Option Pack Microsoft IIS provides powerful features, but IIS is more dangerous in network security. Because few people will use Windows 95/98 as the server, this article I will discuss from the IIS security issues in NT. Safety Advantages of Siwei Soft Solites ASP Although the focus of our paper is to explore the ASP vulnerability and the back door, it is necessary to talk about the "advantage" of ASP in network security, "" because sometimes these Microsoft claims " Advantages "is precisely its security hidden. Microsoft said that ASP is a major advantage in network security. It is that users cannot see ASP's source programs. From ASP, the ASP executes and interprets a standard HTML statement to the client browser.
"Shield" source can maintain the copyright of the ASP developer. Imagine that you have made a very good process, give people any Copy, what do you think? And hackers can also analyze your ASP program and pick out the vulnerability. More importantly, some ASP developers like to write passwords, privileged usernames and paths directly in the program, so others can find the "entrance" of the attack system through guessing code, guess the path. However, many vulnerabilities that can view the ASP source program have been discovered, and we will also discuss it later. IIS supports virtual directory, manage virtual directories by the Directory tab in the Server Properties dialog box. Establishing a virtual directory is very important for managing Web sites. The virtual directory hides important information about the site directory structure. Because the customer can obtain the file path information of the page by selecting "View Source Code", it is easy to obtain the file path information of the page. If you use the physical path in the web page, you will expose important information about the site directory, which is easy to cause the system to be attacked. . Second, as long as the two machines have the same virtual directory, you can move the web page from one machine from one machine without any changes to the page code. Also, when you place a web page in a virtual directory, you can set different properties to your directory, such as: Read, Excute, Script. Read Access Indicates that directory content is passed from IIS to your browser. The execution of access can perform executable files in this directory. When you need to use the ASP, you must set the directory of the .asp file to "Excute". It is recommended that when you set up a Web site, place the HTML file with the ASP file in different directories, then set the HTML subdirectory to "Read", set the ASP subdirectory to "Execute", which is not only convenient for web. Manage, and most importantly improve the security of the ASP program to prevent program content from being accessed by the customer. Five ASP vulnerability analysis and solution Some people say that a computer that does not contact the outside is the safest computer, a computer that closes all ports and does not provide any service is also the safest. Hackers often use the port we open to implement attacks. These attacks are the most common is DDOS (denial of service attack). I will list more than 20 vulnerabilities in ASP, each vulnerability will have a vulnerability description and solution. 1 Add a special symbol after the ASP program, you can see the affected version of the ASP source: Win95 PWS IIS3.0 98 PWS4 does not exist this vulnerability. This loophole does not exist in IIS4.0 or more. Description of the problem: These special symbols include decimal points,% 81,:: $ data. For example: http: //someurl/somepage.asp. Http: // SomeURL / SomePage.asp% 81 http: // SomeURL / Somepage.asp :: $ data http: // SomeURL / SomePage.asp% 2E HTTP: / / someURL / SomePage% 2E% 41sp http: // SomeURL / SomePage% 2E% ASP http: // SomeURL / SomePage.asp% 2e http: //someurl/msadc/samples/selector/showcode.asp? Source = / MSADC /samples/../../../..../../boot.ini (you can see the file content of boot.ini) So in the installation of IIS3.0 and Win95 PWS. It is easy to see SomePage.asp source program.
What is the reason for this terrible vulnerability? The root cause is actually the Windows NT-specific file system is doing strange. One of the common sense knows that in NT provides a file system completely different from FAT: NTFS, this technique called new technology file system makes NT have a high security mechanism, but it is because It has produced a lot of hazardous hazards. Everyone may not know that NTFS supports the multi-basis flow in a file, and this main data stream containing all content is called "data", so it makes it easy to access this characteristic of the NTFS system directly in the browser. The capture of the script in the file is possible. However, the reason for: $ data is due to the problem of IIS when the file name is analyzed, it does not standardize the file name. Solutions and recommendations: If you are WinodWS NT users, install IIS4.0 or IIS5.0, Windows2000 does not exist. If you are Win95 users, install WIN98 and PWS4.0. 2 ACCESS MDB Database Multi-Vulnerability Description: When you use Access to make a background database, if someone knows or guesses the path of the server and the database name of the server, then he can download this Access database file. This is very dangerous. For example, if your Access database book.mdb is placed in the Database directory in the virtual directory, then someone is entered in the browser: http:// SomeURL / Database / book.mdb If your book.mdb database does not encrypt in advance If all important data in book.mdb, all important data is in the hands of others. Solution: For your database file name, you will have a complex unconventional name and put him in a few destinations. The so-called "unconventional", for example, if there is a database to save information about books, don't give him a "book.mdb" name, a weird name, such as D34ksfslf.mdb, then Put him in a few layers of directory such as ./kdslf/i44/studi/, this hacker wants to get your Access database file by guessing. (2) Do not write the database name in the program. Some people like to write DSN in the program, such as: dbpath = server.mappath ("cmddb.mdb") conn.open "driver = {Microsoft Access Driver (* .mdb)}; dbq =" & dbpath, if When people get the source program, your name of your Access database has a lot. So I suggest you set up a data source in ODBC, then write in the program: Conn.open "shujiyuan" (3) Use Access to encode and encrypt database file file. First, "Tools-> Security-> Encrypted / Decrypting Database, select the database (such as: EMPLOYER.MDB), then then then determine, then" Database Caused Save Save Save "window, save: Employer1.mdb. Employer.mdb will be encoded, then eMployer1.mdb .. It is important to note that the above action is not a password to the database, but only the database file is encoded, the purpose is to prevent others from using another tool to view The content of the database file. Next we encrypt the database, first open the encoded Employer1.mdb, select "exclusive" mode when open.
Then select the "Tools -> Security -> Setting Database Password" of the menu, then enter the password. After setting the password for the Employer1.mdb, then if you use the Acces database file, Access will first require a password to verify the correct database. However, in the open method of the Connection object in the ASP program, the parameters of the PWD can be added, for example: param = "driver = {Microsoft Access Driver (* .mdb)}; PWD = YFDSFS" param = param & "; dbq =" & Server.mappath ("Employer1.mdb") Conn.open param This even if he got an Employer1.mdb file, there is no password, he can't see Employer1.mdb. 3 Code.asp files Leak ASP code problem description: A simple example, there is a .asp file in the ASP1.0 routine provided by Microsoft, which is specifically used to view the source code for other .asp files, this file is Aspsamp / samples / code.asp. If someone uploads this program to the server, he can easily view the procedures of others. For example: code.asp? Source = / directory / file.asp But this is a more old vulnerability, I believe this vulnerability now. The following is a comparison of new: http: //someurl/iissample/exair/howitworks/code.asp? /Lunwen/soushuo.asp=xxx.asp The biggest harm is that the ASA file can be read by the above manner; database password Exposing in the form of a hacker; problem resolution or suggestion: For the SHOW ASP Code of IIS, delete the file or disable access to this directory 4, FileSystemObject component Doctor Download any files on the FAT partition Download any file on the FAT partition. Vulnerability Problem Description: IIS3, IIS4 ASP file operations can be implemented through the FileSystemObject, including the read and write directory operation of the text file, copy of the file, but this powerful function has left a very dangerous "back door". Use FileSystemObjet to tamper with any files on the FAT partition. Even if the NTFS partition, if the permissions are not set, it can also destroy, and you may suffer from the disaster of the top. Unfortunately, a lot of WebMaster only knows that the web server is running, and rarely performs permission settings, and the default setting of NT directory permissions is low and terrible. So if you are a webmaster, it is recommended that you pay close attention to the server settings, try to build the web directory in the NTFS partition, do not set the Everyone Full Control, even if the member of the administrator group is generally there is nothing necessary, as long as there is Read, change the permissions is enough. You can also delete or rename the components of FileSystemObject. 5. Input standard HTML statement or JavaScript statement changes the output result problem description: What is the result of being entered in the standard HTML statement in the input box? For example, a message, we will join in the message: Hello! font> If you do not block the HTML statement in your ASP program, you will change the size of the "Hello" font.
7, IIS4 or IIS5 installed with Index Server service Vulnerability ASP Source Problem Description: InDex Server running IIS4 or IIS5, enter a special character format to see a program of ASP source or other pages. Even the system has been added to the system of the patch of the source code, or there is no .htw file system, there is the same problem. Get an ASP program, even the source code of the global.asa file, undoubtedly a very significant security hazard. User passwords and IDs are often included in these codes, as well as the source path and name of the database. This is very important for the attacker to collect system information. By building the following special programs, you can see the program source code: http://202.116.26.38/null.htw?ciwebhitsfile=/default.asp&cirestriction=none&cihilittype=full This is just the file code of some HTML format, but when you add% Behind the parameters of CiWebhitsFile, as follows: http: //someurl/null.htw? CiWebhitsFile = / default.asp% 20 & Cirestriction = None & CiHILITYPE = FULL This will get the source code of the program. (Note: /Default.asp is calculated by the root of the web. Such as a site http: //welcome/welcome.asp is then: http: //someurl/null.htw? CiWebhitsFile = / welcome / welcome. ASP% 20 & CIRESTTION = None & CiHilittype = FULL) Since the 'null.htw' file is not a real system mapping file, it is just a virtual file stored in system memory. Even if you have removed all the true .htw files from your system, because the request for null.htw file is processed by WebHits.dll. Therefore, IIS still receives the threat of the vulnerability. Problem resolution or suggestion: If the function provided by the WebHits is that the system must, download the appropriate patch. If there is no need, use IIS's MMC management tool to simply remove the .htw image file.
The patch is as follows: Index Server 2.0: Intel: http://www.microsoft.com/downloads/release.asp?releaseid=17727 alpha: http://www.microsoft.com/downloads/release.asp?releaseid=17728 Indexing Services for Windows 2000: Intel: http://www.microsoft.com/downloads/release.asp?releaseid=17726 8. Vulnerability Problem of ASP Chat Room Program: If the chat room ASP program is not properly designed, it is easy to give Others have used to do bad things: can kick, wear walls, mess. First, let's take a look at what vulnerabilities in the chat room, let's take a look at the code below:
.........................................................