Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by justbecrazy · May 10, 2012 at 07:31 PM · wwwmysqlphp

WWW class and PHP security issues

  1. Is it possible to set the PHP files on the server sides only be visited by Unity3D's WWW class?

  2. Is the PHP possibly be opened/viewed/downloaded with some text editor? I got my database's password in the php script.

  3. I read some tutorial about pack some codes into some header file, like header.inc. It says it use the inc extension for the security purpose. Otherwise hackers might guess the header's filename, and then open it with some text editor. My question is, could it be downloaded and opened ?!

  4. for the security purpose, where should I put the header file?

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image JimmyJJeeter · May 10, 2012 at 08:49 PM 0
Share

for 3, just don't use .inc. Use .php

avatar image justbecrazy · May 11, 2012 at 07:24 PM 0
Share

Thanks @JimmyJJeeter Could you tell me why?

1 Reply

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by apocriva · May 10, 2012 at 08:35 PM

  1. Anyone with a browser can potentially call up your PHP files. If you have some kind of session handling in place, you probably won't have to worry about it.

  2. You cannot view the source of a PHP file if it's being accessed by HTTP, because the script is run on the server before being fed down the pipe. You can view the PHP file via FTP or some other protocol, but as long as you don't have those protocols publicly accessible, you'll be fine.

  3. If you're talking about including files into a PHP script, and those files aren't PHP scripts, then I imagine it's possible that someone with the filename could simply point their browser at the file to view it. You may be able to adjust the permissions of the file (via chmod) so that only the PHP process can access it, but I'm not sure. That's over my head. :)

  4. Not sure!

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image by0log1c · May 10, 2012 at 09:08 PM 0
Share

Just to point out you should also revise the SQL account's authorizations. Stacking all those measures should keep you fine... I've never had issues yet - or the hackers were good enough to not leave trace for me to notice.

avatar image justbecrazy · May 11, 2012 at 07:26 PM 0
Share

for 3, I'm talking about including a PHP script, like mysql_connect(), however renname it like .inc ins$$anonymous$$d of .php.I don't see any advantages or disadvantages from it.

avatar image Bunny83 · May 11, 2012 at 08:07 PM 0
Share

It's all up to the webserver you use. I've been on websites and it seems their webserver is, well buggy. Sometimes it returned the php script ins$$anonymous$$d of executing it on the server. This must not happen on a server that supports php.

using file extention inc is not a good idea since usually only .php files are feed to the php interpreter. If a user can access the file directly, he can download / view it since it's not a php file. The decision if a requested file goes through php or not is up to your webserver.

I noticed the mentioned bug on this wiki (just a wiki for a $$anonymous$$ecraft mod). Sometimes it doesn't open links but start a download of the php. As said this is up to the webserver and if it's configured / setup correctly it shouldn't happen.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

About renting the host for the game 1 Answer

Upload audio file into mysql database 0 Answers

Unity php functions 1 Answer

How Do i check for Duplicate username in database 4 Answers

Multistage Delete with WWW 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges