Being familiar with blobs, php and PHPObject will help when reading thins.
I'm not 100% sure about what kind of tools can be used to map out your server,
but I'm sure it can be done.
This can be a problem for sensitive SWF files. The user can discover the
location and download the SWF file and decomple it. If that file contained
important info, it is now exposed, and they can abuse your site that much more.
Say for example you have an Admin SWF utility (which perhaps uses PHPObject,
thus it contains key and gateway info), you want to expose it to the Admins but
not leave the file available on the server for people to look at. There is a
way to do this.
Make a php login page, it will authenticate your admins. You can even apply a
maximum number of failed logins, you can also block that IP from the site all
together to prevent the user from attempting to login with other admin accounts
(depends on the security level you want).
Here is the important part - the php script will connect to your database to
authenticate the user, if they check out then get your script to retrieve a
blob object from your databse. This blob object is non other than the Admin
utility SWF! Then simply header out the file type and blob info.
The browser should display the SWF file alone in the window.
The Admin utility can also request the session and any other authenticating
variables to further ensure security.
Here is a generic blob table, and the script gets the Admin swf
<?php
$dbQuery = "SELECT blobType, blobData FROM blobs WHERE blobId = $blobId";
$result = mysql_query($dbQuery) or die("Couldn't get file list");
if(mysql_num_rows($result) == 1) {
$record = @mysql_fetch_row($result);
$fileType = $record[0];
$fileContent = $record[1];
header("Content-type: $fileType");
echo $fileContent;
} else {
echo "Record doesn't exist.";
}
?>
Since the SWF file was retrieved from a database, the chances of it being
found and downloaded from the server are 0!
I got the idea from looking at a tutorial on blobs and php from
http://www.devarticles.com If you can find that article you should read it, it covers in detail how to
upload and store a file as a blob and then later display the file in the
browser.