Reading files through ASP pages
Translation of the original in Spanish. Read it in: CatalàCastellano
Loop on Servers.
The ASP pages programmed for version 5.0 of Microsoft's web server (IIS) that make use of the "Execute" method can allow a directory traversal and give access to most of the files on the server.
The ASP language emerges as an extension to HTML code to allow greater dynamism in the presentation of content and to obtain greater power from the web server. But if the programming of these pages is not done correctly it can produce serious problems that can allow an attacker the possibility of accessing data, stealing information and even getting to take control of the machine.
Since the appearance of version 5.0 of IIS many programmers make use of the "Execute" method to develop websites without the need to use "frames" or use the "#include" directive. In this way it is simpler to implement HTML templates to make the work of developers easier.
THE problem occurs when the page that must be loaded is indicated from the URL itself, for example:
http://servidor/inicio.asp?file=/asp/home.asp
By modifying the URL it may be possible to traverse directories by using modified URL's:
http://servidor/inicio.asp?file=../../WINNT/win.ini
This will allow an attacker to access with read permissions many of the files on the server, or all of them if it is not using the NTFS file format.
A second problem is a possible denial of service if the same file that makes the call to Server.Execute is requested:
http://servidor/inicio.asp?file=inicio.asp
This would cause the ASP script to enter an infinite loop that would lead it to use 100% of the CPU and large amounts of memory while the script did not "time out", generally 90 seconds after the request had started.
The possible solutions involve verifying that the file passed to the Execute method does not contain strings like "../" or disabling the "parent paths" in the configuration of the IIS server itself.
1 comment
Comments from the old blog, as they were written. Comments are closed.
zhivko
good