LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 05-05-2009, 01:13 AM   #1
ddaas
Member
 
Registered: Oct 2004
Location: Romania
Distribution: Ubuntu server, FreeBsd
Posts: 474

Rep: Reputation: 30
deny user access to phpinfo


Hi there !
Is there a way to deny normal user access to phpinfo(); so that an unprivileged user can't see server details?

Thanks
 
Old 05-05-2009, 07:59 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Hi

In your php.ini, you can add phpinfo to disable_functions:

disable_functions = phpinfo

But I don't think it makes much difference to security. I think all the information can be found by other means.
 
Old 05-05-2009, 08:40 AM   #3
unixfool
Member
 
Registered: May 2005
Location: Northern VA
Distribution: Slackware, Ubuntu, FreeBSD, OpenBSD, OS X
Posts: 782
Blog Entries: 8

Rep: Reputation: 158Reputation: 158
Quote:
Originally Posted by Guttorm View Post
Hi

In your php.ini, you can add phpinfo to disable_functions:

disable_functions = phpinfo

But I don't think it makes much difference to security. I think all the information can be found by other means.
Not in a quiet manner, unless its over a 10 yr. scan period.

Using that option in php.ini is much better than not using it, IMO.

There ARE ways to prevent such leakage of information...it just requires dedication and know-how. You can leverage other technologies to disallow such traffic, also (such as modsecurity or snort-inline).
 
Old 05-05-2009, 09:13 AM   #4
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Well I was thinking of stopping users that can upload php scripts from getting that information. If you disable phpinfo, you still can use functions like ini_get_all, get_loaded_extensions, php_ini_scanned_files, and so on. You can also look at the $_SERVER array, and you can read a lot of files.

PHP safe_mode helps a bit, but many web servers with safe_mode turned on still allow perl scripts. So I think it's a bit "shallow" - it just makes it a bit harder to get such information. I read somewhere, that there will be no safe_mode in PHP 6. I guess the reason is, that it just gives server admins a false sense of security.

My point is, if you allow users to upload and run PHP code on your server in the first place, denying for example phpinfo does not add much to security.
 
Old 05-05-2009, 10:26 AM   #5
unixfool
Member
 
Registered: May 2005
Location: Northern VA
Distribution: Slackware, Ubuntu, FreeBSD, OpenBSD, OS X
Posts: 782
Blog Entries: 8

Rep: Reputation: 158Reputation: 158
Quote:
Originally Posted by Guttorm View Post
Well I was thinking of stopping users that can upload php scripts from getting that information. If you disable phpinfo, you still can use functions like ini_get_all, get_loaded_extensions, php_ini_scanned_files, and so on. You can also look at the $_SERVER array, and you can read a lot of files.

PHP safe_mode helps a bit, but many web servers with safe_mode turned on still allow perl scripts. So I think it's a bit "shallow" - it just makes it a bit harder to get such information. I read somewhere, that there will be no safe_mode in PHP 6. I guess the reason is, that it just gives server admins a false sense of security.

My point is, if you allow users to upload and run PHP code on your server in the first place, denying for example phpinfo does not add much to security.
The thing is, if those types of calls are required to do the job, then there is not much that can be done, other than continuously observe the logs.

RBAC may help in this, though.
 
  


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
deny a user access to specific command krock923 Linux - Security 7 10-11-2012 03:04 PM
deny access sftp to aaa user procfs Linux - Newbie 6 01-17-2008 11:07 PM
mySQL deny user access to database blizunt7 Programming 3 10-10-2007 09:34 AM
Deny user access to terminal/directory browsing intranet_man Linux - Networking 2 03-22-2006 12:04 PM
how to deny user to use ftp to access system ust Linux - Software 4 05-23-2005 08:39 PM

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

All times are GMT -5. The time now is 03:31 AM.

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