Just noticed there's no checks in WebInspect that involve the .php5 extension. Many hosting services, where PHP4 still exists and is utilised by way of the .php extension, require that .php5 extension be used in order to utilise PHP5.
Just ran a little test (using the default "standard" policy, restricted to directory and subdirectories only, path truncation disabled) on a directory containing the following:
tests/index.php5 (the target...aka: tests/ )
tests/debug.php
tests/debug.php3
tests/debug.php5
tests/debug/index.php5 (aka: tests/debug/ )
(note: the files simply display their corresponding filename and contain no links)
However WebInspect only found:
tests/
tests/debug/
So why didn't Check #1376 find 'debug.php'?
and why didn't Check #1377 find 'debug.php3'?
What's confusing me is that those files are found by those checks when path truncation is enabled...
HP Web Security Research Group
*** interesting to see Checks #1376 and #1377 have been removed with today's Smart Update...?!...well, despite this, I'm still going to talk about them :) ***
Definitely had 'Enable Path Truncation' unchecked (and checked for the subsequent test) - enabling it meant the difference between a 15minute scan and a 2.5hour scan in this case. I double checked, prior to initial post, that with Path Truncation disabled, debug.php and debug.php3 are not detected.The target URL served the following response:HTTP/1.1 200 OKConnection: Keep-AliveProxy-Connection: Keep-AliveTransfer-Encoding: chunkedDate: Thu, 10 Apr 2008 03:01:57 GMTContent-Type: text/htmlServer: ApacheX-Powered-By: PHP/5.1.4Keep-Alive: timeout=10, max=10filename: index.php5So unless Smart Assessment is ignoring the X-Powered-By header and not recognising .php5 as PHP then it should have detected the presence of PHP, right? Looks like that isn't the case, as only when I added a hyperlink to a .php file within the target file's response did Check #10184 'PHP Version Information Disclosure' get run...which poses the problem, how does PHP get recognised by Smart Assessment if, say, mod_rewrite is being used to hide all .php file extensions?
The similar checks to find debug.txt, debug.asp, debug.html are picking those files up when Path Truncation is disabled and there are no hyperlinks in any responses to those files...so were the debug.php and debug.php3 checks bugged?
w00t, she's working a lot better today!
Smart Scan has detected PHP from the X-Powered-By header and once PHP is detected those debug files are being looked for and found (debug.php, debug.php3), except for debug.php5....however still not picking up PHP when there's no X-Powered-By header and only reference to a .php5 file (e.g. <a href="index.php5">index.php5</a>). Note: I did not reference an existent .php5 file, so ultimately no PHP file was served and no X-Powered-By=PHP/XXXX header was served. I can see reasons why this is so, but also potential problems due to it (such as failure to run any PHP checks against an entirely PHP system that's well disguised).
So is it fair to say WI runs ASP checks regardless of whether ASP has been detected or not, but will only run PHP checks if PHP is detected?