Web Design and Development Forums

CMS Security

This is a discussion on "CMS Security" within the Accessibility and Usability section. This forum, and the thread "CMS Security are both part of the Plan Your Website category.

Old Sep 25th, 2007, 12:19   #1 (permalink)
Up'n'Coming Member
 
Join Date: Nov 2006
Location: Ipswich
Posts: 58
CMS Security

Hi peeps.

I've just built my first custom CMS using PHP and MySQL.

I've put all the admin pages in the directory mydomain.com/cms

I'm new to web security issues, so could I get people's opinions on the best way of securing these pages:

1. From being edited by people naughty enough to want to do so?

2. From Google and other search engines indexing the pages to assist those mentioned in 1.?

Thanks in advance for any suggestions.

Chris
ChrisTheSoul is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Sep 25th, 2007, 16:10   #2 (permalink)
Administrator
 
alexgeek's Avatar
 
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 4,102
Blog Entries: 9
Send a message via MSN to alexgeek
Re: CMS Security

Quote:
Originally Posted by ChrisTheSoul View Post
Hi peeps.

I've just built my first custom CMS using PHP and MySQL.

I've put all the admin pages in the directory mydomain.com/cms

I'm new to web security issues, so could I get people's opinions on the best way of securing these pages:

1. From being edited by people naughty enough to want to do so?

2. From Google and other search engines indexing the pages to assist those mentioned in 1.?

Thanks in advance for any suggestions.

Chris
Use sessions,
on login, the user get's two session like so:
$_SESSION['user'] = $username (from $_POST and will be queried to log in)
$_SESSION['seskey'] = $md5(rand(1000, 9999));

and the mysql table with have at least three columns (username, password, session)

when the user logs in the random session will be put in their session and mysql table.

hope you follow
__________________
Languages: PHP, mySQL (queries), C#, (X)html, CSS, JS.


alexgeek is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Sep 25th, 2007, 16:23   #3 (permalink)
Up'n'Coming Member
 
Join Date: Nov 2006
Location: Ipswich
Posts: 58
Re: CMS Security

Hi Alex - cheers for the response.

Erm, I'm a little confused...

So a session variable runs for the course of the session presumably, i.e. until the user closes their browser window?

I understand the principle of the username and password in a table that I can then match with the login details that are posted, but what about the session column, what does that do?

The random number thing has thrown me a little too.
ChrisTheSoul is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Sep 25th, 2007, 16:53   #4 (permalink)
Administrator
 
alexgeek's Avatar
 
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 4,102
Blog Entries: 9
Send a message via MSN to alexgeek
Re: CMS Security

Quote:
Originally Posted by ChrisTheSoul View Post
Hi Alex - cheers for the response.

Erm, I'm a little confused...

So a session variable runs for the course of the session presumably, i.e. until the user closes their browser window?

I understand the principle of the username and password in a table that I can then match with the login details that are posted, but what about the session column, what does that do?

The random number thing has thrown me a little too.
Yes the session will be there until the browser is closed (or if session_destroy() is called)

The purpose of the session column is that the random session is unique to the user for that period of time.

Hackers can change their session to make them seem as someone else.
example:
The script checks to see what username is in the 'user' session, if it finds a match it will show that users private messages.
so tom comes along with a session user that will look like this:
$_SESSION['user'] = "tom";

Now if Tom where to edit this with some easy to find tools, he could change it to:

$_SESSION['user'] = "Frank";

Giving him access to all Frank's messages.

The session 'seskey' (almost) stops this.
example 2.
the same as before except the script checks to the user session and the seskey session. So Tom is:
$_SESSION['user'] = "tom";
$_SESSION['seskey'] = "gifj87er8934uerfjdi" //random string

the script will find the username and match it and will find that the seskey matches the session column, granting him access to his mail.
Now if Tom tried to change his session again he could change his user session to frank fine, but it could take him days to generate the random session to access franks mail.

As Toms session is:
$_SESSION['seskey'] = "gifj87er8934uerfjdi"
and Franks could be:
$_SESSION['seskey'] = "cdjijf8574jfd84899"
or anything! and Tom would have to go through every single combination until he had the right match.

You cannot stop him from doing that (at least not a way I know) but you can make him have to generate ridiculous amounts to get access.

If you follow, I will go on else I will try and explain further.

P.S. I spent ages on that ha! Should be a newsletter tut!
__________________
Languages: PHP, mySQL (queries), C#, (X)html, CSS, JS.


alexgeek is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Sep 25th, 2007, 20:37   #5 (permalink)
 
JacobHaug's Avatar
 
Join Date: Dec 2005
Location: On Internet
Posts: 5,550
Send a message via AIM to JacobHaug Send a message via MSN to JacobHaug
Re: CMS Security

Yes, Alex is correct. Applying a password to the admin area makes the most since. You would do this though sessions in your PHP file. Perhaps this URL will help get you started with using sessions with PHP.

http://www.developertutorials.com/tu...620/page1.html
__________________
JacobHaug.com - My Portfolio
JacobHaug is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Feb 21st, 2008, 16:28   #6 (permalink)
Reputable Member
 
Join Date: Jan 2008
Location: Pasig
Posts: 106
Re: CMS Security

May I ask, how will you check if the user is already log-in? I mean, if I'm already log-in, they cannot log-in using my Username. It will prompt the user that the Username is already Log-in.
sekuchi is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
php security saltedm8 PHP Forum 22 Sep 27th, 2007 09:22
Help with security wiggles Website Planning Discussion 16 Apr 9th, 2007 22:28
Security Ryan Fait PHP Forum 5 Nov 28th, 2006 12:22
Security cbrams9 JavaScript Forum 2 Sep 22nd, 2006 01:47



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 16:25.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59