Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Is This A Security Issue


While trying to sign on at a website, I got the following PHP code
back. I suppose that their apache was mistakenly returning php text
instead of executing it....




View Complete Forum Thread with Replies

Related Forum Messages:
Php Security Issue.
currently i designing one website using php,may i know wat security issue need to be concern when design it?eg to prevent hacker hijack the browser or hack the website.
or have any url talk abt this?

View Replies !
Security Issue.
I have found out that someone is sending advertisment emails out to all the users on my site. I have a few scripts with the mail() function in them, but if that is the problem how do I secure it? If it is not one of the scripts with the mail function, and is possible to get the users email information without that, what exactly do I do?

View Replies !
Security Issue
I have a registeration page where people register to my site and I add them to the database. Now I know it's possible for people to simple go to "FileSave As". download the html version, put in whatever info they want and change the <form action path to the FULL URL which would submit it to my page with their custom information. Even though I use htmlspecialchars in order to prevent SQL injection. Is there an easier way to make sure that only pages from that domain can submit a form?

the onnly way I thought of doing it is using $_SERVER['HTTP_REFERER']; and looking at it to see if it contains my server's IP or domain name. and if not then don't let them register and track their IP. this seemed to work when i tested it but then today when i looked i saw around 54 IP addresses there. around 17 unique ones. some were googlebots but others were just normal IPs. i know they cant ALL be trying to register with a custom page. SO whats an easier way to accomplish this?

View Replies !
Exec() Security Issue?
For the past couple of days i've been trying to figure out how to get around a problem on our local network where we have a Gopher CSO (phone number) database, which can only be browsed w/ Netscape 4.x. I solved this problem by creating a PHP page that uses a lynx file source dump output and then displays that output.

What I'm wondering now is about the security of using the exec() function, since the execution is variable depending what/who a user is searching for.

here's my code:
exec("lynx -source gopher://cso.server.edu:105/2?$SEARCH > $page");

where $SEARCH is someones name, or e-mail, etc. So the question is, Am i putting myself at risk that someone would use either ||'s or some other 'escape' characters to send something like rm -r *.* etc. where they could delete all my information?

I have a script for CGI's that checks input like this:
if ($link=~ tr/;<>*|'&$!#()[]{}:'"//) {
print "Content-type: text/html";
print "Security Alert! Action canceled.<br>";
print "Please do not use weird symbols";
exit;
}
But i'm not sure how to change that over to PHP.

View Replies !
Fopen Security Issue
I just spent the last 5 hours on this issue. I'm not the best PHP programmer and that may be why. But I'm officially throwing in the towel...here goes.

I wrote a web site for a company and they insisted I link the main content for *every* page to their little wiki clone; since they were too cheap to have me write a DB and interface.

I wrote the site including a script that pulls the remote content using fopen contents. Everything is peachy. Works great on my home testing server. Works on my hosted server (1and1 hosting); but I set it up on their server and it won't fopen the pages.

Their wiki program lives on the same server as their web site but here's the thing. It will grab their main page and it will grab pages from other sites.

My best guess is that there is a security issue on the directories some layers down in their wiki program. But then I wonder why I could fopen those pages from 2 other locations. To access the site I'm forced to use an SSH shell.

So, if this is a security issue what do I need to tell them to do?

Things I've tried: I've tried using their IP rather than their DNS entry. Reading everything on the entire innnnernet about fopen and related functions.

For the record here's my code: ....

View Replies !
MySQL Security Issue
I have conn.php (file which connects to MySql). Can someone simply include that file and retrieve my database data?

View Replies !
Session Security Issue
I have a page that user put his username and password. then my script checks his username and password form database. if it is correct then my script saves them in session: PHP Code:

$_SESSION['username']=$username;
$_SESSION['password']=$password;

In this page script reads $_SESSION['username'] and $_SESSION['password'] if it is correct from database then showes the content of page. all other pages that linked from this page doing same this page too.

View Replies !
Key-passing From PHP To TCL CGI Script - How Is It Done (web Security Issue)?
On one of my sites, I have a TCL CGI script that has a security hole
in spite of it having effective server-side validation (the fact that
it's CGI IS its security hole). The front end is a PHP script, and I
am writing server-side validation onto it, however, it is required to
redirect to the TCL CGI script because only a CGI script has the
ability to access a group-accessible XML script on the back end.

I had to take the whole thing down because a hacker found a way to
exploit the TCL CGI script and send in viral DoS-generating data
packets via simple form text field submissions, somehow even bypassing
the TCL CGI script's server-side validation.

Hence, that is why I am writing server-side validation on the front-end
PHP script, which is not CGI, of course.

The only way I could figure out how to make this secure was the concept
of "key passing", that is, passing a key from the PHP script into a
$_SESSION variable, then the TCL CGI script must have the same key on
its end, somehow, in order to expedite further.

Bottom line: I have no clue how to do this. Is there anyone out there
that knows this stuff and can either give me a quick tutorial or point
me in the right direction? I have absolutely no idea where to begin,
nor do I know any other means of ensuring web security.

*NOTE* I cannot destroy the TCL CGI script, because only a CGI script
can access the group-accessible XML on the back end, so that's not an
option by any means.

View Replies !
Update Form, Security Issue
I have to write secure update record php script, here are the complete
details of the website,

the website has a login system that authenticates the user, writes the
session ID for username and goes

on.

The user can post, read msg he can also update the msgs that he had
posted in the past once he is

loged in.

when user tries to update the msg, the script check MySql DB with

select * from Msg where username = session ID

suppose recorset returns msg number 1,3,5,7,9 with that perticular
username.
I pass the user to a page ...update.php?msg_id=1 and the user can
update the stuff.

Everything is working fine,

Problem

what if the user changes the url to ...update.php?msg_id=2

he can still update the record, what to do he has not posted msg id 2.
what sort of method or code

should i use to restrict him to the msg that he posted

If you feel that i am using a bad method or my database structure
should have a new field please let me

know coz I can still make changes in DB structure as well as my
scripts we are in the somewhat initial

stage of the development of the product.

View Replies !
Force Download - Security Issue
Below is a simple PHP force download script, but is there anyway to limit what it can download, such as only ".mov" or ".jpg" files as its a security issue because this version means you can download any file. I dont want people having access to files such as .php

<?php
header('Content-type: application/force-download');
$file=$_GET["file"];
if(file_exists($file)){
header('Content-Disposition: attachment; filename="'.$file.'"');
readfile($file);
}
?>


View Replies !
Security Issue - Images And HTTP Athentication
I have realized in the past that an obvious problem with many board softwares is Image HTTP athentication. What that basically is:

Someone posts an image using the [img] tags on a forum. Once the image is posted, or even before, they make the directory that stores the image as "passworded". Some people can even make this so that it asks you for your forum login, appearing to be a part of the forum. Code:

View Replies !
PHP Security - Some Common Security Pitfalls That Are Inherent In The Language?
I'm working on developing an application in PHP4/MySQL and I've got very little experience with either. Most of my work is in ASP/Access and compiled programs. The app that I'm developing doesn't need to be perfectly secure, but I want to avoid common pitfalls, and I have no idea where to start.

From your experience, what are some common security pitfalls that are inherent in the language? I shouldn't have any trouble with program logic being an issue, just stuff that may be PHP specific. (Like the User being able to put anything that they'd like in the QueryString and having that show up as a variable in the script).

View Replies !
Query Issue - Item Grouping Issue
I have a number of items in a database and I group them together by each's series number (ranges from 1-20). The query then sorts them by series ascending from 1-20, but does so by sorting all the ones that begin with 1, then 2, etc where the 10-19 series show up before 2-9. I know why it's happening but is there a way around it?

View Replies !
How Would Php Security Compare To Java Security?
I just want to know how would php security compare to java security? Its because that me and my officemate are developing a site which would handle confidential documents and we just cant decide on whether we should use php or java. Please do post you opinions regarding this and it would even be better if you could also post links to write-ups about php security.

View Replies !
Security - What Security Dangers Should I Be Aware Of?
I am quite new to PHP but I have managed to write a simple page create script. So far the script does not have any user input. It does open/write files and it also accesses my MySQL database. No variables are passed from script to script either.

My question is, what security dangers should I be aware of? My other question is, can you download a php file and view the contents?

View Replies !
PHP And Security??
I am very new with php and web content in general, and my concern is with my novice ability leaving huge secuirty holes for any joker to have there way with.

Here is my current thought.

If I have a php script in a public html fodler named index.php3 how secure is this if at all.

Say I have a line like:
MySql_pconnect("host","account","passowrd");

How easy is it for people to get the host,account,password.

View Replies !
Security
For security reasons I want to know more about (1)where session store its info and (2)what "single sign on" is. Does anybody know any articles about these subjects, or does anyone know the answers to these 2 questions?

View Replies !
PDF Security
This is where the security problem is POSTED

Is there anything we could server side?

In the meanwhile I am turning off on each client's domain the user PDF uploading capability (where it is allowed) and restrict to the domain admin side that capability.

View Replies !
Security In Php
I'm doing ok for a newbie in php, but i just have a few questions as far as security goes. i am actually a java programmer, so from my experience with an object oriented language i would like to use encapsulation and other methods used in java with php for example i would like to make a php page that handles my database connection and has a whole lot of functions that i can call as i need them instead of re-coding the connection each time. i know that i can use 'require('****.php')' and 'include('xxx.php')' to get access to the code in xxx.php but can i extend and override the functions in xxx.php and is it safe to connect to a database in this way?

i also wanted to know if it more secure to put a php script in the same web page or to make a page that contains the script and another html page that uses a form to goto the the php page? and finally i just want to know if anyone knows of any good reading material on the topic of intergrating java with php (except the php manual) ....

View Replies !
Php.ini Issue
I'm running Apache 1.3.29 and PHP 4.2.3 on Windows XP Pro. I built a
page that runs phpinfo() and it works. The location of the php.ini is
what I expect it to be, c:winnt. But the values set in the ini file
are not the ones displayed on the phpinfo() page.

View Replies !
PHP Security
I am fairly new to the php scene but have managed to learn quite a bit from you folks and other resources on the web. I have developed a few scripts that actually work. LOL.

I ran across a post on here mentioning Chris Shiflett and took a trip over to his site. He has some intriguing articles on the security of php scripts. However, he doesn't get into much detail as it would seem he writes for a more advanced crowd.

Anyway, what I am looking for now is more information on securing these scripts. Know a good book? Maybe a good website? By all means, let me know!

View Replies !
401.3 ACL Issue In IIS
I've just installed PHP on an IIS 5/W2K server. The installation was
succesful, as I can load a test.php file in the first website I setup
for PHP. However, the second website I setup for PHP will not work. I
keep getting a "you are not authorized to view this page" error,
despite having given the I_USR_machine account Read & Execute rights to
the directory.

View Replies !
Second Issue
When posting my form to another page which runs various shell_execute
commands, the actual page that runs the command does not load, but the
command seems to be executed. Why is this? I tried putting a two second
sleep at the top of the page to make sure it loads, but it still doesn't
load. How can I make this page load before the command is processed by php?

View Replies !
PHP GET Issue
I have Get Issue in URL E.g

If I have a url lets say   "www.mydomain.com/page_x.php?passvariable=10"

If someone changes the "passvariable=10" To "passvariable=15" as example they go to that record that might not be relevent to them even if they are loged in.

Is there a way of validating or avoiding this to happen?

View Replies !
WS-Security
I am currently using NuSOAP to create a web service, but I'd like to use WS-Security. AFAIK, NuSOAP doesn't support this. Is there anything else for PHP I can use that does implement WS-Security?

View Replies !
Security: SSL And Other
i got a few questions here:

a) With sessions is it worth the code hastle to hash the session file before any writing or reading to be done. to check that the data is valid ?

b) Does anyone know any basic introductions to SSL as I want to use it as its most effective against session hijacking and other attacks.

View Replies !
PDF Security?
I have a portal secured through php scripts. I want to have a pdf document online. Is there a way to secure a pdf document though php? If not how else would i do that?

View Replies !
.inc Security
I'm trying to start learning PHP security and recently read this:

Don't store includes under document root.
The only resources you should store under document root are
those that must be accessible via URL.
Making anything else available to the public is an unnecessary
risk.

If you must:

<Files ~ ".inc$">
Order allow,deny
Deny from all
</Files>

If I can't install .inc files under my root, why would a related directory be any more secure? Couldn't the user, if they knew enough to search the .inc path to begin with, follow the second .inc path? Sorry if this is obvious and I'm missing the obvious.

View Replies !
Ip Security
what i am trying to do is when u go to vote to check ur ip based upon a subid and compare that to the remote address to prevent double votes. here is the coding. PHP Code:

/* BEGIN ANTI CHEATING VERIFICATION PROTOCAL */
$sql = "SELECT * FROM voted WHERE subid = $subid";
$r = mysql_query($sql) or die('Error, query failed');
$arr = mysql_fetch_array($r);
         $ip = $arr['ip_address'];

         if ($ip = $REMOTE_ADDR) {
                  echo "<p align=center  class=contest_small>SORRY YOU HAVE ALREADY VOTED";
                  exit;
         }
/*END ANTI CHEATING PROTOCAL */

View Replies !
Nav Bar Issue
We've got an issue with out nav bar, it's disappeared all of a sudden to put it plainly We were wondering if someone could help us. The error we get is:

var AgntUsr=navigator.userAgent.toLowerCase();

View Replies !
CSS, PHP And Security
I am thinking about opening a web site which will allow people to register and then have direct access to a stylesheet in order to brand their page. When a user saves their stylesheet, the system will reject it if it includes any of the '<', '>' or '?' characters. I know this restricts some CSS, but that's fine for my purposes. Is there anything else I should check for? How vulnerable does having this option leave me?

View Replies !
Issue Php V 5.1.6
I am trying to get the php_mysqli extension to work off of a manual php install. I have my extension dir set up and have the extension added.

extension=php_mysqli.dll

however when I go to test it out the extension is never loaded. since this is my first manual instal of php did I miss some other config option in the recommended config file that allows extensions to be used?
I am runing php through apache 2.2.3 in module form.

View Replies !
CMS Security
I'm here still learning about PHP and MySQL, from alot of different sources right now. One of my goals is to get the simplest type of CMS up and running, If I really needed one I would probably use something like Wordpress, but I'm just interested in learning how they function.

I have some basics down.. Looking into regular expressions at the moment. But I was wondering if anyone here had some good links they could share, regarding how to implement techniques for preventing security issues and such. As of the moment I only know of like, query injection but I've heard of other things like session stealing and some others I cannot remember.

View Replies !
Security
I dont know ifthis is the right forum, but I was wondering if you store your mysql database connection details in a php file that you then include() on each page, is that a secure way to goabout it? I thought about this because if someone knows your filename they could just type to get your username and password. Would changing the permissions to this file work or is there a generally much more secure way to do this sort of thing?

View Replies !
Md5() And Security
I have created a form with the help from Houdini and I need some assistance with security. In the application customers will be inputting ssn#'s and checking account#'s. I want this information to be secure when its submitted. The form will be processed to an email address. How would I set up this security to work with my form?

View Replies !
NOW() Issue
I am running this query below to show only events happening today and forward:

SELECT date_FORMAT(AuctionDate, '%M %e, %Y') as newdate, AuctionDescription, AuctionTitle, AuctionDate, AuctionTime, AuctionAddress, AuctionCity, AuctionState, AuctionCity, AuctionZip FROM auctions WHERE AuctionDate >= NOW() ORDER BY AuctionDate

For some reason, it only shows values for events GREATER than today. So today's events are not showing up. It used to work and now it doesn't. I recently changed from PHP 4 to PHP 5. Is there something I need to change with ">= NOW()"? That is the only think I can think of.

View Replies !
Mktime Issue
I am using the following code to create a drop dowm menu with each hour of the day. Up until a recent server switch the code was working fine. Now the option value prints properly, but the times diplayed all say "6 pm". Any ideas?
<?
$Btime = 00;
while ($Btime < 24) {
print "<Option value="$Btime.0"";
if ($Btime=="8.0") {
print " SELECTED";
}
print ">";
if ($Btime=="12.0"){
print "Noon";
} else {
echo date ("h a", mktime ($Btime,0,0,0,0,0));
}
$Btime++;
}
?>

View Replies !
Security Measures!!!
Can I use session_is_registered() to track if the user has already logged in before using any pages on my web?Or is there a much easier and efficient way?

View Replies !
A Book On PHP And Security
Are there any books out there on PHP and Security issues?

View Replies !
Where Can I Find Something About Security?
Do you know where can I find something about security? it means encription and all that? can I do it with PHP?

View Replies !
Script Security
Is it more safe to keep code scripts outside of root and have them included in scripts inside of root?

View Replies !
Include() Via URL And Security
I have written an web based application that uses a header and footer files to provide a co branded look for customers.

every page is like this example

include customer's header
print generated content
include customer's footer

Here is the problem. I want to let users keep the header and footer files on their webservers so they can edit them and not have to bother me when they make changes.

How do I ensure that they are not going to pass me a file that contains malecious code.

for example if the header file is like this, bad things would happen

<html>
<body>
Stuff
<?
exec (cat /etc/passwd)
?>
</html>

I want to escape all php code that is in the include file because the include should only have html in it.

Should I use fopen and find/replace the php code.

The two important considerations for the solution are speed and security.

The header and footer are included on every page and I do not want something that is going to slow down the process very much. Currently pages load very quickly using a regular include via URL.

View Replies !
Wht Are Different Security Methods In Php
What are the different USER security methods which we can follow and how to
manage them, it will be helpful for all of us.

like what i know is to manage session id and to manage the user security along
with it only.

What would you like to suggest to have a user managed security.
I please all to share your views on different methods.

View Replies !
Session Issue
can anyone help me with this problem, the code listed below should
return a username into the session variable instead it is returning
"1". I am not sure how this is happening, the only thing I can figure
it is returning the number of rows returned by the database. If anyone
could look this over and point me in the right direction that would be
great. Thanks to everyone in advance.

<?
$username = $_REQUEST["username"]; //varaible to hold username
$password = $_REQUEST["password"]; //variable to hold password
$DBconn = mysql_connect("****", "****", "****"); //Database connection
information
mysql_select_db("lpdb", $DBconn); //connection to the database
$sql = "SELECT user_name, pword from tbl_logins WHERE user_name =
'$username' and pword = '$password'"; //SQL query to search for the
username
$results = mysql_query($sql, $DBconn) or die(mysql_error()); //the
resulting data is outputted to $results variable
$num = mysql_num_rows($results); //the outputted data is enumerated
out into colums to be read in the HTML
if ($num !=0) {
session_start();
$session_register("loginusername");
$_SESSION['loginusername'] = $username;
header("Location: ../newlogin/username.php");
} else {
print "<h3> Unauthorized Login </h3> <br><br><a
href='../login.php'>Please Try Again</a>";
exit;
}
?>

View Replies !
Security Issues With PHP SSI
I was wondering if there are any security issues I should know about with using PHP Server Side Includes.

View Replies !
PHP Website Security
We have developed an ads network script for running ads network site. Can someone please guide us on security features that we must implement to prevent hecking and exploits...?

We have looked into major security problems commonly known like image uploads checks but I would like to know more on other security checks that are generally over looked.

View Replies !
Security Question
If I have a file in the public html directory (e.g. mypage.php) then can
anyone read this file (i.e. read its actual content rather then the
interpreted contents it returns when someone opens
www.myurl.com/mypage.php)?

View Replies !
Security Through Obscurity
I've got some security through obscurity questions - not directly related to
PHP programming per se, but indirectly related, as most php programmers are
also server admins of their servers.

I want to restrict what my box reports back to the likes of scanners like
Nmap & Nessus.

I know how to get PHP to not report its version number, and the same with
Apache.

My question is:

a) how to I prevent MySQL from reporting its version number?

b) My Apache now reports itself as just "Apache" - can I fake that, and just
get it to report as ,say, "MyWebServer"

c) Is it possible to get MySQL to report back as say "Oracle"?

d) What about PHP - can I fake the reporting of it to say "Tomcat version 2"
or something?

View Replies !
Security About POST!
I need to check and make sure users don't "hack" my post values. but im not really sure if i need to check these post values..

The values are coming from a registration form, and are the following... I will obviously check the database for existing users, or exisiting email addresses, but other then that, this code can't really be used to hack me, can it?? PHP Code:

View Replies !
Cookie Issue
I want my script to only work if the user has cookies enabled for his/her browser. How do I do this? Is there a way I could get information about the user's browser settings?

View Replies !
Security Advice On My Cms
I am using the following code to make module system cms.
Code:
//index.php
require_once("mainfile.php");
global $site_path;

if (!isset($_GET["file"]))
{ $file="index"; }
else {
$file=$_GET["file"];}
if (!isset($_GET["mod"])) {
$mod="home"; }
else { $mod=$_GET["mod"]; }

if(ereg("..",$mod) || ereg("..",$file)) {
echo "Bad boy";
exit(); }
$file ="$site_path/modules/$mod/$file.php";
if (file_exists("$file")) {
include($file);
} else { die("sorry, File does not exist");}

You can see that I am using this concept
http://www.mysite.com/ index.php?mod=$modulename&file=$modulefilename

I just want to know is there any security hole in the code.How to stop direct access to a file withouth my main index.php file ?let say i have module call"member" and inside i have index.php,myprofile.php etc... and I want to stop direct access to these file(ie.http://www.mysite.com/member/index.php)

onlyway, http://www.mysite.com/index.php?mod=member&file=index is allowed in this case.

View Replies !
PHPMailer Issue
i'm using phpmailer, the variable that makes up the html body contains
other variables.

when one of these other variables contains more than 980 characters, it
stops rendering. any ideas on what would cause this limitation? is it
the mailer or might it be my code which basically prepends and appends
html (a table images etc.) around a message body containing the other
variables (like product info fields). any workarounds?

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved