How to find out a website is secure?
Hello all,
I am all set to launch a website on which i have been working from months but now am afraid how safe it might be once it gets attention of hackers . As most of the code in website is in PHP,html,mysql i am posting this in this forum so that i can get suggestions from you all. Websites that are developed by Big companies might undergo testing from various testing tools , tests from hired ethical hackers ,etc, before getting launched where as what about websites that cant afford all those expensive methods. I understand that without undergoing all those procedures no website could be hacker safe but any suggestions about measures to be taken before launching a website would be appreciated.
Thank you all in advance.
Kavitha Butchi
Junior Poster in Training
69 posts since May 2008
Reputation Points: 10
Solved Threads: 4
Ask your selfDid you do everything to prevent SQL injection
Do you use id values as indentificators, did you secure option for array exploit
Are you using RSS feeds, are they secure
Hosting, who is responsible for website security? You or your web hosting company? Are the folder permission set correctly?
That is just few things you should look into...
peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
Shanti C
Posting Virtuoso
1,642 posts since Jul 2008
Reputation Points: 137
Solved Threads: 162
Thank you peter_budo, Demiloy and Shanthi for your time.
I shall look into all those security measures now and shall make sure I complete all of them before releasing the site.
If anybody knows some more security measures that are to be taken before launching a website please share them here.
Appreciate your time in advance
Thank you
Kavitha Butchi
Junior Poster in Training
69 posts since May 2008
Reputation Points: 10
Solved Threads: 4
[QUOTE=peter_budo;666783][list=1]
[*]Do you use id values as indentificators, did you secure option for array exploit
Hi peter_budo,
Can you please tell what are indentificators..
Thanks in advance
Kavitha Butchi
Junior Poster in Training
69 posts since May 2008
Reputation Points: 10
Solved Threads: 4
I can not remember exactly what was it but it had something to do with "id" passing values in following format WEB_ADDRESS/page.php?id=32, when adding square brackets [] after "id" will show site structure. I will try to find where I read about it and let you know.
peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
thnx Demiloy & Peter_budo I made use of is_numeric().
Now,
when user manipulates the url like,
when the url is www.example.com/xyz.php/userid=22
how to avoid displaying results when user changes the userid from 22 to someother number in the url.
Basically, my site has a search page, when on submitting the username in search, if username exists then linnk is given.
when clicked , www.example.com/xyz.php/userid=22 appears in the address bar.
how to avoid displaying results when users manipulates the userid there?
Anyhelp is apreciated.
Thankyou all.
Kavitha Butchi
Junior Poster in Training
69 posts since May 2008
Reputation Points: 10
Solved Threads: 4
You do not want to keep user identification as part of the URL. Put these data into session.
peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
Also, session variables can be exploited if you are in a shared hosted environment.
Someone with ssh access to the shared server can get a valid session id from where PHP stores them and pretend to be authenticated. A way to work around this is to store the IP address of the user at login, and keep checking it on every page. If the IP address changes during the session, require the user to re-login. (Obviously, don't store it in the session variable, but store it in the database).
BTW, this only applies to if you're using shared hosting.
scru
Posting Virtuoso
1,629 posts since Feb 2007
Reputation Points: 975
Solved Threads: 140
yes,... scru is damn right...
kavitha,keep that point in your mind...
Shanti C
Posting Virtuoso
1,642 posts since Jul 2008
Reputation Points: 137
Solved Threads: 162
sure Shanthi,Robbob and scru, I shall work on that too.. shall add the logic you mentioned Scru.
Thankyou :)
Kavitha Butchi
Junior Poster in Training
69 posts since May 2008
Reputation Points: 10
Solved Threads: 4
> A way to work around this is to store the IP address of the user at login, and keep checking
> it on every page.
And what are you going to do about users who are behind a common proxy which is almost the case with all corporate organizations. Employees never directly connect to the internet, it's always done via a proxy, so a IP address based solution is as brittle as it gets.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
What I have done before is just pull a timestamp and innitially add it to session and database record. The the next page request I pull the timestamp record from the database, compare it with the session, if the two match, pull the most current timestamp, replace the session timestamp and the database timestamp with the most current and allow access. If they don't compare I force a login for that user.
Though it means that for *every* request you end up making an extra database read and write call. Though it might be a really good solution for normal sites, high traffic sites can't afford this overhead. Yes, there has to be a better way of doing it. :-)
The distinct advantage of using mature technologies is that you don't have to worry about such details, you pay for it and you get the service. For e.g. when developing a J2EE application using the IBM stack, a few configuration changes here and there using the administrative console of the Application Server and you are good to go with Single Sign On, Session management and the likes.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
Kavitha Butchi
Junior Poster in Training
69 posts since May 2008
Reputation Points: 10
Solved Threads: 4