943,186 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 1681
  • PHP RSS
Jul 11th, 2010
0

How to make PHP site Hack Proof

Expand Post »
Hi,


Can any one tell me how to make secure php site or what is the key point for making secure website using php.


-keval
Similar Threads
Reputation Points: 8
Solved Threads: 4
Banned
keval_hack is offline Offline
66 posts
since Jan 2010
Jul 11th, 2010
0
Re: How to make PHP site Hack Proof
There are several. Among others: "Never trust user input". (You have to handle it of course, but you need to sanitize it before you let it loose in the system). For instance, instead of saying "update mytable set user_item = $form_3" , make sure that $form_3 is quoted correctly to avoid SQL injection attack. (Imagine that the user had typed in "doofus; drop table if exists mytable")
Reputation Points: 344
Solved Threads: 255
Veteran Poster
griswolf is offline Offline
1,132 posts
since Apr 2010
Jul 11th, 2010
0
Re: How to make PHP site Hack Proof
To be clear, The only website that is hacker proof is google.
and thats only because they have tens of thousands of employees.
being an ex-hacker (I only hacked my own stuff btw)
You not only need to prevent any user input hacks.
but on any user input forms do the following:
Prevent sql-injection
make sure they are coming from correct page
do NOT have any source code that obviously points to code.
- use javascript to print innerhtml all over the place
- it doesn't make it any more 'hack-proof' but it will annoy the hell out of the hacker and they won't bother after 5 seconds of viewing the source code.
use https where possible
use false links
-header as follows on food site
PHP Syntax (Toggle Plain Text)
  1. <?PHP include ('connections.php');
  2. include ('menulist.php');
  3. include ('bgimage.php');
  4. include ('database.php');
  5. include ('ingredientsearch.php');
  6. ?>
have them all look authentic but bgimage.php can contain your connect info.
HARD CODE THESE FILES
Convert to binary
HARD ENCODE ALL PUBLIC SITES
don't use links like index.php, main.php, menu.php
use lkj98234nf.php
install internal hacker prevention
- i can delete most sites with a mouse click and very fancy software.
- I have only deleted my own sites, I don't act illegally btw.
make sure if you send trojans to external hacker intervention don't make them so annoying that they wage war on your site. you won't win

hope this helps
don't feel inclined to go this deep though. it will be easier just to re upload your site for the once every ten years this might happen. just make sure you back up your site and database regulary
Reputation Points: 13
Solved Threads: 34
Posting Whiz in Training
metalix is offline Offline
218 posts
since Mar 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: can't place values inside database
Next Thread in PHP Forum Timeline: Event Time according Visitors time (MAXMIND).





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC