auditing php programs?

This is a discussion on auditing php programs? within the PHP Language forums, part of the PHP Programming Forums category; I'm trying to perform an audit on a PHP script and am curious what kind of software there already ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-06-2006
yawnmoth
 
Posts: n/a
Default auditing php programs?

I'm trying to perform an audit on a PHP script and am curious what kind
of software there already exists to do such things.

I think the ideal solution would be something that, for each variable,
provided a list of the functions that variable was passed through. eg.

$a = someFunction($_GET['var']);
echo $a;

function someFunction($b) {
return htmlspecialchars($b);
}

Here, $_GET['var'] passes through someFunction and htmlspecialchars
before getting passed to echo (which I suppose isn't technically a
function, but rather, a language construct).

if statements could kinda confound this, but it seems like presenting
the data in an appropriate fashion could mitigate that.

Anyway, any ideas?

Reply With Quote
  #2 (permalink)  
Old 12-06-2006
naixn
 
Posts: n/a
Default Re: auditing php programs?

yawnmoth wrote :
> I'm trying to perform an audit on a PHP script and am curious what kind
> of software there already exists to do such things.
>
> I think the ideal solution would be something that, for each variable,
> provided a list of the functions that variable was passed through. eg.
>
> $a = someFunction($_GET['var']);
> echo $a;
>
> function someFunction($b) {
> return htmlspecialchars($b);
> }
>
> Here, $_GET['var'] passes through someFunction and htmlspecialchars
> before getting passed to echo (which I suppose isn't technically a
> function, but rather, a language construct).
>
> if statements could kinda confound this, but it seems like presenting
> the data in an appropriate fashion could mitigate that.
>
> Anyway, any ideas?
>


There is xDebug available for PHP :
http://www.xdebug.com/

It's able to do some profiling, and getting the functions call tree, showing
relative execution time, and so on (it generates cachegrind files, readable
with Kcachegrind.
See http://www.xdebug.com/docs-profiling2.php

It's not _exactly_ what you're looking for, but it's powerful enough to tell
you which function call costs the most time, and so on. :p

--
Naixn
http://fma-fr.net
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:28 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0