Jump to content

Restricting script access, but not web


blaher

Recommended Posts

I'll have to set up a example, so I can explain this better.

Say I have the following directory setup:

 

/public_html/

- /config.php

- /index.php

- /inc/

- /site1/

- /site2/

 

In /public_html I have the domain rootsite.com pointing to /public_html/ I have site1.com pointing to /public_html/site1/ and site2.com to /public_html/site2/.

 

Now the problem is there could be a injected file in /site1 that uses:

<?php
    include('../config.php');
    echo $password,'\n';
    include('../site2/config.php');
    echo $password,'\n';

    $fh = fopen('../index.php', 'w');
    fwrite($fh, "You've been hacked\n");
    fclose($fh);
?>

I want to restrict this somehow from happening, without blocking web access.

Link to comment
https://forums.phpfreaks.com/topic/179224-restricting-script-access-but-not-web/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.