is there a better way to check for security faults in a PHP program?
I am not sure if there is a way to do this, except than taking a look in your site, and make sure it is not defaced
I am kiddin. But anyway it is too hard to tell that there is a way to check the security faults of a site.
You must be allways reading articles and news regarding to the languages you use, make small or no use at all of common vurnerabal functions such as eval and exec, and check your log files on a regular base.
I am not sure if there is a way to do this, except than taking a look in your site, and make sure it is not defaced
I am kiddin. But anyway it is too hard to tell that there is a way to check the security faults of a site.
You must be allways reading articles and news regarding to the languages you use, make small or no use at all of common vurnerabal functions such as eval and exec, and check your log files on a regular base.
Thanks, Nikolas! I actually don't check my log files, except when I'm testing my scripts. But I will start doing so.
Also, since this is about CMS security, what do you think is the best way to prevent spam in comments/guestbook systems within a CMS?
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 7974
40801 credits Members referred : 3
« Reply #5 on: Sep 07, 2005, 02:02:36 PM »
The first thing you have to do is puting the code rel=nofollow to the links that created from your guestbook or comment script. Then you should put a security image to your submit page, as the comment spammers are programs ( I mean that comment spamming is not generated by humans that browse your site)
An example is in the topsites directory. Browse the directory and try to submit a review for a site.
After all of these things you can also use a script to stop the referer spam like aStatSpam
That is the method I used to code one of my websites. Very basic and easy.
It is very basic and easy, but it is also the number one 'weapon' for deface hacking attacks!
Sandwich Artist
Posts: 25
48 credits Members referred : 0
« Reply #11 on: Jan 16, 2006, 11:54:31 AM »
You may also want to make sure the file exists before including it. Then redirect anyone to the main page if the file is invalid.
Raped By Google
Gender:
Posts: 27
12 credits Members referred : 0
« Reply #12 on: Jan 24, 2006, 10:15:48 PM »
Thing is , if you do an echo on errors like , "Couldnt find $page"; Its still suscpetible to XSS , you can use HTML to include frames and things , PHP to echo config files and the like or SQL to delete user tables or get them etc. Its very confusing but just use stripslashes and htmlspecialchars on your echo and you should be fine.
aka J Love Community Supporter?
Bill Gates is my home boy
Gender:
Posts: 884
1636 credits Members referred : 4
« Reply #13 on: Feb 05, 2006, 09:49:32 PM »
storing pages in a mysql or postgre db is much more secure then storing file on your webserver directory alone... then echoing these values with something like this:
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 7974
40801 credits Members referred : 3
« Reply #14 on: Feb 05, 2006, 10:14:54 PM »
Meth0d I will not agree with you.
Database is not used because it is safer, but because it gives you the abillity to make more things like content managment, CMS upgrades, layout upgrades.
Files are much faster, but are usefull only for small static sites.
You may also want to make sure the file exists before including it. Then redirect anyone to the main page if the file is invalid.
I agree!
Another thought... wouldn't a mod rewrite be easier and safer still?! At the same time, your site (in the public areas) will become more SE friendly and get you higher rankings.