views:

562

answers:

3

Hi, I have couple of .swf games files uploaded to my server. I want to run some test, but I dont want to expose or let public/others people to see our swf files. Currently, if I type:

www.domain.com/games/game1.swf

It will play the swf file.

I tried to visit some other flash game based websites. When I visit one of the swf files (e.g www.xxx.com/folder/flash.swf), it would redirect me to the homepage (www.xxx.com)

Is this the correct way to prevent public people to view my swf files?

There are a lot of swf-to-fla decompiler third party software, will my swf files secured?

Will my swf files being hacked/stolen (code and graphics)?

Once your swf files being hacked, will my website safe from web attacks?

How to secure swf files?

Please help

+1  A: 

You have a lot of questions here.

When I visit one of the swf files ... it would redirect me to the homepage ...

I would suspect this is implemented by checking the 'HTTP_REFER', when loading the .SWF page. You could do this if you like.

Is this the correct way to prevent public people to view my swf files?

No. Depending on what server you're running, you should put some authentication on the folder '/TestSwfs', and then upload all your swfs to there, and you will need to log in first. Fairly simple to do this in both IIS and Apache, but let us know which one you are running.

There are a lot of swf-to-fla decompiler third party software, will my swf files secured?

I suspect not. There are probably SWF Obfuscators though, but they can still be reversed.

Once your swf files being hacked, will my website safe from web attacks?

It shouldn't matter. You should not be inlcuding secrets/passwords in your SWFs that you don't want to be public. You may be writing high-scores, and you can step up the complexity required by doing some crypto, or other such things, but really, for just high scores, it's probably not important.

Design your SWF code so that even if it was public, your server would be safe.

Noon Silk
Thanks for the quick response. 1. Checking HTTP REFER? What do you mean?2. I am using IIS. And yes, I need to login before the game can start. Every game swf files, i do a login check whether the user is logged in?? Is that what you mean?3. I see. i agree with you4. My password are store in database (mysql) and php is the middleman5."Design your SWF code so that even if it was public, your server would be safe" abit hard to digest..
1. You check this field in code. I assume you're not a web programmer? It's going to be a bit difficult for you to implement this all properly then ...
Noon Silk
To do the folder-security thing in IIS, start->run->`inetmgr` then find the folder, right click, properties, and uncheck 'anonymous access', then you can look at the 'authenticated access' options you have. i'd go with integrated windows, so just use a windows account with appropriate privileges.
Noon Silk
1. do a simple check like this: if ( eregi ( "www.mysite.com", $_SERVER['HTTP_REFERER'] ) ){ then let it view my swf }is that what you mean? I am using php though
tried uncheck 'anonymous access', but i still can run the swf files without login. Hmmmm... do i need to restart my server? (I dont think so)
And did you then check [x] integrated windows? it works for me. check it again.
Noon Silk
A: 

One additional point to Silky's answer.

You should implement REST Api correctly in your SWF, that will assume that even if someone can hack your swf (which is very easy), the can not login to your server and manipulate any data or bring it down.

You should never directly alter database by using direct apis, you should always use webservices instead of database connectivity tools.

Akash Kava
A: 

To protect swf use these steps

  • Use Actionscrip obfuscator like SWF Protector from DComSoft
  • Server side protection by using htaccess URL rewrite and hotlink preventing rules that will hide/mask the URL to your SWF
  • You may try Encryption with As3crypto library
  • Load SWF at Runtime. Just embed an SWF as a ByteArray into the loader SWF and it can be loaded through Loader.loadBytes().
Alex