PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > alt.apache.configuration > limiting access to images/banning direct access
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
alt.apache.configuration Apache web server configuration issues.

limiting access to images/banning direct access

Réponse
 
LinkBack Outils de la discussion
Vieux 18/01/2008, 18h39   #1
Boris Epstein
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut limiting access to images/banning direct access

Hello everyone!

I have a PHP-based application (MediaWiki) installed on a Linux box
(CentOS 5, Apache 2.2.3, PHP 5.1.6). This application is password
protected; however, even without logging in one can view our images
and documents by simply typing in the full URL to it.

So here is my question: is there a way to ban Apache from displaying
files that the user has not been redirected to following a legitimate
login?

Thanks in advance.

Boris.
  Réponse avec citation
Vieux 18/01/2008, 19h06   #2
Kees Nuyt
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: limiting access to images/banning direct access

On Fri, 18 Jan 2008 10:39:39 -0800 (PST), Boris Epstein
<borepstein@gmail.com> wrote:

>Hello everyone!
>
>I have a PHP-based application (MediaWiki) installed on a Linux box
>(CentOS 5, Apache 2.2.3, PHP 5.1.6). This application is password
>protected; however, even without logging in one can view our images
>and documents by simply typing in the full URL to it.


Which means it is not password protected.

>So here is my question: is there a way to ban Apache from displaying
>files that the user has not been redirected to following a legitimate
>login?


Two possibilities:
1- use wiki software with better protection

2- redirect to a PHP script which only sends the requested
document or image if the session belongs to a logged in
user, and redirect to the login page if it doesn't, or if
there is no session at all.
Details can be found in the PHP docs and with a search on
Google.

>Thanks in advance.
>
>Boris.


HTH
--
( Kees
)
c[_] The greatest of faults is to be conscious of none.
(Thomas Carlyle) (#304)
  Réponse avec citation
Vieux 18/01/2008, 19h47   #3
Boris Epstein
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: limiting access to images/banning direct access

On Jan 18, 2:06 pm, Kees Nuyt <k.n...@nospam.demon.nl> wrote:
> On Fri, 18 Jan 2008 10:39:39 -0800 (PST), Boris Epstein
>
> <borepst...@gmail.com> wrote:
> >Hello everyone!

>
> >I have a PHP-based application (MediaWiki) installed on a Linux box
> >(CentOS 5, Apache 2.2.3, PHP 5.1.6). This application is password
> >protected; however, even without logging in one can view our images
> >and documents by simply typing in the full URL to it.

>
> Which means it is not password protected.


Well, it is partially protected - the Wiki pages you can not see
without logging in first. However, if you just type in something like:
http://the_site/images/h/h8/sample_file.pdf

you can read the PDF.

>
> >So here is my question: is there a way to ban Apache from displaying
> >files that the user has not been redirected to following a legitimate
> >login?

>
> Two possibilities:
> 1- use wiki software with better protection
>
> 2- redirect to a PHP script which only sends the requested
> document or image if the session belongs to a logged in
> user, and redirect to the login page if it doesn't, or if
> there is no session at all.
> Details can be found in the PHP docs and with a search on
> Google.


Neither will work - if you type in the full URL to the image/PDF file
you bypass both the Wiki and the PHP engine.

>
> >Thanks in advance.

>
> >Boris.

>
> HTH
> --
> ( Kees
> )
> c[_] The greatest of faults is to be conscious of none.
> (Thomas Carlyle) (#304)


  Réponse avec citation
Vieux 18/01/2008, 20h21   #4
Kees Nuyt
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: limiting access to images/banning direct access

On Fri, 18 Jan 2008 11:47:15 -0800 (PST), Boris Epstein
<borepstein@gmail.com> wrote:

>On Jan 18, 2:06 pm, Kees Nuyt <k.n...@nospam.demon.nl> wrote:
>> On Fri, 18 Jan 2008 10:39:39 -0800 (PST), Boris Epstein
>>
>> <borepst...@gmail.com> wrote:
>> >Hello everyone!

>>
>> >I have a PHP-based application (MediaWiki) installed on a Linux box
>> >(CentOS 5, Apache 2.2.3, PHP 5.1.6). This application is password
>> >protected; however, even without logging in one can view our images
>> >and documents by simply typing in the full URL to it.

>>
>> Which means it is not password protected.

>
>Well, it is partially protected - the Wiki pages you can not see
>without logging in first. However, if you just type in something like:
>http://the_site/images/h/h8/sample_file.pdf


That's what I mean: it's not protected.

>you can read the PDF.
>
>>
>> >So here is my question: is there a way to ban Apache from displaying
>> >files that the user has not been redirected to following a legitimate
>> >login?

>>
>> Two possibilities:
>> 1- use wiki software with better protection
>>
>> 2- redirect to a PHP script which only sends the requested
>> document or image if the session belongs to a logged in
>> user, and redirect to the login page if it doesn't, or if
>> there is no session at all.
>> Details can be found in the PHP docs and with a search on
>> Google.

>
>Neither will work - if you type in the full URL to the image/PDF file
>you bypass both the Wiki and the PHP engine.


Not if you rewrite all URLs that point to the protected
files to that particular PHP script. I'm sorry I
mistakenly wrote redirect where I meant rewrite.

Additional measures:
In some situations you can afford to move the protected
files outside the DocumentRoot, but in a content
management system like a wiki that might be hard to do,
because the functions to upload contents would fail.
So I didn't mention that one.


>> >Thanks in advance.

>>
>> >Boris.


Good luck!
--
( Kees
)
c[_] Prune: A plum that has seen better days. (#416)
  Réponse avec citation
Vieux 19/01/2008, 18h18   #5
D. Stussy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: limiting access to images/banning direct access

"Boris Epstein" <borepstein@gmail.com> wrote in message
news:1ce81d8d-9e2e-41e3-8a0a-923536f58a67@k39g2000hsf.googlegroups.com...
> So here is my question: is there a way to ban Apache from displaying
> files that the user has not been redirected to following a legitimate
> login?


Although it can be forged, you could check the HTTP_REFERER field to see if
the hostname it contains is your (virtual) host. If it's not, you should
probably serve a different resource in its place. This step should probably
be used in combination with other methods suggested.


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 21h26.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,14109 seconds with 13 queries