LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 06-21-2007, 07:00 PM   #1
techmom
LQ Newbie
 
Registered: Dec 2006
Posts: 4

Rep: Reputation: 0
Question linux and php security


I am trying to use php to allow my users to change their password through my website. They can change it in my database but not on the secure directory that the website files are stored in. The host server has disabled exec(), system(), and passthru() "for security reasons". Is there some other way I can send a passwd command to the shell so that when a user changes his password it is changed both in the database and on the server?
 
Old 06-24-2007, 08:25 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
The host server has disabled exec(), system(), and passthru() "for security reasons". Is there some other way I can send a passwd command to the shell
If it's disabled for security reasons and you want to force it, then doesn't that constitute deliberately weakening security? How about indirect changes? Say you include a database field "has_changed" which serves as a flag that gets set when a user changes his pass. You add a non-root background process that at intervals queries the database for the "has_changed" flag, logs what its doing, extracts the username and pass to a temp file if the username is validated and known and resets the field. Then add a more privileged process that logs what its doing, reads the temp file, checks the username, validates the pass for the usual suspects, backups the old pass and then changes it. Now PHP makes crappy programming easy to do so this relies on a) nobody coming up with a qualitatively safer alternative, b) good security posture of the box and c) you being a responsable PHP programmer who *knows* and acts on A Guide to Building Secure Web Applications.
 
Old 06-25-2007, 07:40 AM   #3
techmom
LQ Newbie
 
Registered: Dec 2006
Posts: 4

Original Poster
Rep: Reputation: 0
Great idea! I'll have to check on how privileged a process I can run. Also, being a newbie to php (I just picked it up from a book) I've never heard of A Guide to Building Secure Web Applications. But I'll check it out. Thanks!
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Gentoo Linux PHP Security Advisory LXer Syndicated Linux News 0 05-27-2007 09:46 PM
PHP security Ephracis Programming 1 10-29-2004 09:14 AM
PHP security patpawlowski Programming 2 03-05-2004 10:24 PM
Security with PHP clau_bolson Linux - Security 2 02-03-2004 04:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 03:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration