LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 12-04-2005, 08:15 AM   #1
koyi
Member
 
Registered: Jul 2003
Location: Osaka, Japan
Distribution: Arch, Ubuntu
Posts: 421

Rep: Reputation: 31
Firefox making PHP source available?


Hi, I am using firefox 1.0.4(Yeah, I know this is old but this is Debian... :P ) and I just discovered this weird thing.

I have configured a web server, using Debian, Apache2 and PHP4. When I tried to access it with the above mentioned firefox, specifying an address like http://www.example.com/ without specifying the filename, it allowed me to download the PHP source file!!!

I thought this was because of the setting on the server(I am a newbie at configuring server...), so I went to check around but didn't find anything suspicious. Then, I tried access it the same way from another machine, using firefox, too, the page is displayed properly.

Therefore, I deleted ~/.mozilla and start to test the firefox on the first machine again. And this time no prompt for download.

What is wrong here?
Is there a problem with my server or in the firefox settings?
I think it lays with the server settings personally but I have no idea where is it.

Any help is appreciated.

Thanks.
 
Old 12-04-2005, 11:31 AM   #2
mimithebrain
Member
 
Registered: Nov 2003
Location: ~
Distribution: Ubuntu 10.04
Posts: 843
Blog Entries: 1

Rep: Reputation: 30
PHP is a server side preprocessing language. If you are able to download the PHP file (such as it happened to me before), it's the server's fault, not the browser.

When a server is functionning properly, you can even put password hardcode into the PHP file safely, asumming there is no public FTP access to the PHP sources.

You need to look into the settings and configuration of your server.
 
Old 12-04-2005, 05:01 PM   #3
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
Quote:
Originally Posted by mimithebrain
you can even put password hardcode into the PHP file safely
"Safely" being a relative term there. You're better off using .htaccess or a database to store the passwords in files not located under the httpd's root directory.
 
Old 12-05-2005, 05:17 AM   #4
maginotjr
Member
 
Registered: Aug 2004
Location: BR - Floripa
Distribution: Ubuntu 9.10 - 2.6.x.x
Posts: 661

Rep: Reputation: 35
probably you dont activated the php module in the httpd.conf.

if you browse the forum or look at google you can find lots of content about enabling php in apache.

[ ]'s

Slackware 10.1 - Kernel 2.6.12.3

LPIC-1 Certified since 28/10/05
Linux Professional Institute Certified - https://www.lpi.org/en/verify.html
id: LPI000095352 ver: juswaj4mct


We are the thinking geeks!

P: every rule have an exception, what's the exception of this rule?
R: That this rule have no exception!

Last edited by maginotjr; 12-05-2005 at 05:19 AM.
 
Old 12-05-2005, 01:09 PM   #5
int0x80
Member
 
Registered: Sep 2002
Posts: 310

Rep: Reputation: Disabled
Make sure the following line appears in your Apache conf files:
Code:
AddType application/x-httpd-php .php
On my Debian server, it appears in the following files:
Code:
/etc/apache2$ grep -rn AddType * | grep php
mods-available/php5.conf:2:  AddType application/x-httpd-php .php .phtml .php3
mods-available/php5.conf:3:  AddType application/x-httpd-php-source .phps
mods-enabled/php5.conf:2:  AddType application/x-httpd-php .php .phtml .php3
mods-enabled/php5.conf:3:  AddType application/x-httpd-php-source .phps

Quote:
Originally Posted by koyi
Hi, I am using firefox 1.0.4(Yeah, I know this is old but this is Debian... :P )
What is that supposed to mean? You've apparently never been to DistroWatch or learned how to use APT. Debian almost always has the current versions of applications in their repositories such that using APT makes it incredibly easy to be up to date. If you're going to use Debian, at least take advantage of what it offers you.
 
Old 12-06-2005, 07:37 AM   #6
koyi
Member
 
Registered: Jul 2003
Location: Osaka, Japan
Distribution: Arch, Ubuntu
Posts: 421

Original Poster
Rep: Reputation: 31
Thanks for all your advices, guys!
I will take a look again when I have the chance.

Quote:
Originally Posted by GNUbie
What is that supposed to mean? You've apparently never been to DistroWatch or learned how to use APT. Debian almost always has the current versions of applications in their repositories such that using APT makes it incredibly easy to be up to date. If you're going to use Debian, at least take advantage of what it offers you.
Ya, I know how to use apt-get but since I am using Sarge, the latest verion of firefox here is still 1.0.4. At least it hasn't been upgraded yet when I apt-get update + upgrade today

I have upgraded to 1.5 in a slackware box, though, and think that it is cool
 
Old 12-06-2005, 09:03 AM   #7
int0x80
Member
 
Registered: Sep 2002
Posts: 310

Rep: Reputation: Disabled
Understood. You should upgrade to Sid. It really isn't unstable. There have only been a few minor instances where I've had dependency issues. The benefits of having the most current versions outweigh any potential problems by far. If you have any qualms about it, feel free to hop in #debian on irc.freenode.net and ask around. I highly recommend Sid over Sarge.
 
Old 12-06-2005, 09:39 AM   #8
stimpsonjcat
Member
 
Registered: Apr 2005
Location: switzerland
Distribution: debian etch
Posts: 99

Rep: Reputation: 15
why would one want the latest firefox on a webserver?
 
Old 12-06-2005, 04:29 PM   #9
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
Quote:
Ya, I know how to use apt-get but since I am using Sarge, the latest verion of firefox here is still 1.0.4
Are you sure about this? If firefox was included in Debian then they keep it up to date with security updates, full stop. They wouldn't let it languish in an unpatched old version. What's most likely happened is they've backported the changes from the later versions but kept the version the same, this is consistent with what they do for all the other packages in the distro (eg. kernel, glibc, kde etc.) and other distros do it this way (eg. Mandriva).
 
Old 12-07-2005, 08:16 AM   #10
koyi
Member
 
Registered: Jul 2003
Location: Osaka, Japan
Distribution: Arch, Ubuntu
Posts: 421

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by stimpsonjcat
why would one want the latest firefox on a webserver?
No it is not installed on a server but a normal client.

I think they have patched it with security patches but without the new functions...

Anyway this is not a thread to discuss about this so I think we should stop here or the moderators might make noises :P

Thanks for the info, guys
 
Old 12-07-2005, 11:23 PM   #11
koyi
Member
 
Registered: Jul 2003
Location: Osaka, Japan
Distribution: Arch, Ubuntu
Posts: 421

Original Poster
Rep: Reputation: 31
After reading suggestions from you guys, I went back to check the configurations again.
But I couldn't find anything wrong. So, I decided to stop the server and do a re-installation.

The funny thing is, even after I stopped the apache server or shut down the server, I still got firefox offering me to download the PHP source file. So I guessed there is something wrong with firefox's cache files.

Therefore, I moved the Cache folder from Cache to Cache.BAK and restart firefox.
Viola! The download prompt went away

As a conclusion, I think this happened because:
1. Before the server was properly set up, I accessed it with this firefox browser, and firefox stored the content into its cache.
2. The server was finally properly set up.
3. When accessed, something went wrong and firefox still offered me with something from its cache.

Just a wild guess, though.
If somebody can explain this please do so.

The morale behind the story:
Never get your server online before it is properly set up!

Thanks.
 
Old 12-08-2005, 02:13 AM   #12
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
Usually in Firefox going View->Reload should get the latest version, bypassing the cache. Anyway to clean out the cache all you have to do is Edit->Preferences->Privacy (Tools->Options in Windows).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
making firefox available for all users sukimac Linux - Newbie 5 09-26-2005 09:05 PM
Making Galeon like Firefox hanzj Linux - Software 5 07-22-2005 05:54 PM
Making Firefox my default Browser? carlosinfl Fedora 39 05-10-2005 10:02 AM
Making firefox faster berrance Linux - Software 3 02-18-2005 01:36 PM
making firefox / thunderbird work together kersten78 Linux - Software 7 10-03-2004 03:02 AM

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

All times are GMT -5. The time now is 10:32 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