Re: Catching directory transversals passed through QueryString



Imagine what would happen if everyone in your city used the same server to
access the Internet. That's what sort of problem you have on your hands. If
I were you, I'd throw the whole concept out the window.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

"Merennulli" <maross@xxxxxxxxxxxxxxxx> wrote in message
news:1141857826.139327.324000@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Ok, the gist of the problem is I have a site my predecessor created
that much of it goes through a single asp.net app. For some reason,
instead of using templates or includes, he passed everything through
this one bit of code that dumped html and flat text in the middle of
the page. To keep it dynamic, he has the querystring take in a
filename. eg.
http://www.oursite.net/default.aspx?filename=/folder/file.txt

Of course, this leaves it wide open for
http://www.oursite.net/default.aspx?filename=../web.config
or
http://www.oursite.net/default.aspx?filename=../../../Inetpub/wwwroot/default.aspx
or worse.

For now, I'm just using regex to require either ".txt" or ".htm?" and
then catch "../" and hit the breaks if it finds that. I'm concerned,
though, that there might be other ways of exploiting this.



.



Relevant Pages

  • Re: Accessing data over telephone...
    ... without using internet as a media... ... I'd probably just set up dial-in PPP and a web server. ... I wouldn't recommend Windows for any sort of high-availability ... There's nothing new about this sort of thing. ...
    (comp.dcom.telecom.tech)
  • Re: MSTASK.EXE accessing internet as server?
    ... > attempting to access the internet as a server? ... I suspect you're infested with some sort of pest. ... mstask.exe on my system has never attempted any sort of Internet access. ...
    (microsoft.public.win2000.general)
  • Re: Private to Public...
    ... >through a public server? ... >Server 1 is accessible via the internet. ... >Server 2 is not accessible via the internet. ... >I need to create some sort of link so I may access an ...
    (microsoft.public.inetserver.iis.security)
  • Re: Large EQ kills one hundred plus????
    ... of the Internet wrote: ... So sad - this sort of things really makes me more and more sceptical ... is no God of any sort for anybody now. ...
    (sci.geo.earthquakes)
  • Re: colliquail
    ... as far as the holy spirit pertains ... God-fearing; he gave generously to those in need and prayed to God ... the commanders expected you would just become christians and not ... that we can keep the internet growing with entertaining sites that the ...
    (rec.arts.poems)