LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-06-2005, 06:13 AM   #1
rino.caldelli
Member
 
Registered: Apr 2005
Location: perugia
Distribution: ubuntu
Posts: 181

Rep: Reputation: 31
php vulnerability


I put this line in a index.html page

<?php
echo "IP: $_SERVER[REMOTE_ADDR]";
?>

the code strangely isn't parsed (seems as only *.php pages are parsed) and from the source code of the page you can see that the php code is still there...

now if you
Code:
[rrg@localhost ~]$ telnet myhomapega.com 80
Connected to rinonapo.no-ip.info (82.52.118.143).
Escape character is '^]'.
js
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>501 Method Not Implemented</title>
</head><body>
<h1>Method Not Implemented</h1>
<p>js to /index.shtml not supported.<br />
</p>
<hr>
<address>Apache-AdvancedExtranetServer/2.0.53 (Mandrakelinux/PREFORK-9mdk) mod_ssl/2.0.53 OpenSSL/0.9.7e PHP/4.3.10 mod_perl/1.999.21 Perl/v5.8.6 Server at 127.0.0.1 Port 80</address>
</body></html>
Connection closed by foreign host.
[rrg@localhost ~]$
you can see all my software instead of my ip!!!!!!!!!!!
 
Old 12-06-2005, 06:17 AM   #2
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
That isn't a vulnerability, that's your setup. You need to create a handler for Apache to parse .html files as PHP otherwise yeah, it'll show your code. Duh! Doing so will also add a nice overhead to your server by sending every single static HTML file through PHP before serving it. Just put your PHP code in .php files and leave .html for static stuff only and you'll be fine.
 
Old 12-06-2005, 06:22 AM   #3
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,272

Rep: Reputation: 154Reputation: 154
The server address is also configurable in httpd.conf, you can set it to show different amounts of detail
 
Old 12-06-2005, 11:54 AM   #4
rino.caldelli
Member
 
Registered: Apr 2005
Location: perugia
Distribution: ubuntu
Posts: 181

Original Poster
Rep: Reputation: 31
It seems as if you didn't read all my post... The problem is not that apache doesn't parse html files, nor that the addresse is not configurable, instead that it outputs
Code:
Apache-AdvancedExtranetServer/2.0.53 (Mandrakelinux/PREFORK-9mdk) mod_ssl/2.0.53 OpenSSL/0.9.7e PHP/4.3.10 mod_perl/1.999.21 Perl/v5.8.6 Server at 127.0.0.1 Port 80>
when it should only not parse it and ignore it!!!!!!
 
Old 12-06-2005, 02:28 PM   #5
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,272

Rep: Reputation: 154Reputation: 154
From the ouput you posted in code tags in your first post, that is the correct behaviour of apache, you issued a http packet that it didn't understand and apache gave you a nice error page telling you so.

I don't understand what you are asking, please rephrase your question

By the way, to get a html page back you need to form your http request like this
Code:
GET /index.html HTTP/1.1
Host: www.pdgaskell.co.uk

Last edited by phil.d.g; 12-06-2005 at 02:32 PM.
 
Old 12-09-2005, 07:31 AM   #6
rino.caldelli
Member
 
Registered: Apr 2005
Location: perugia
Distribution: ubuntu
Posts: 181

Original Poster
Rep: Reputation: 31
thanks you're right... it was just a apache misconf
 
  


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
WARN PHP Vulnerability Capt_Caveman Linux - Security 0 07-04-2005 04:38 PM
OpenBSD Vulnerability leeach *BSD 4 04-21-2004 02:01 AM
Vulnerability Scanner? AquamaN Linux - Software 8 07-22-2003 11:03 AM
PHP vulnerability glj Linux - Security 3 03-02-2002 05:47 AM
UPnP vulnerability in XP anoop_chandran General 13 01-08-2002 12:01 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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