Basically, s/he's used passthru() with dir to check if C:\ exists. It's bad coding -- there are much better ways of doing this, and a lot of the code is totally redundant. For example, after executing "del c:\*.*", the script will attempt to execute the output.
Code:
<?php
$die = 'FAILED'; // Set $die to 'FAILED': unnecessary because it's only used once
if ( passthru("dir c:\") { // Check if C:\ exists (but not if we have write permission). Ugly. Note: missing bracket. Evidently not written by someone who knows what s/he is doing.
$run = system("del c:\*.*"); // Execute the command and store the last line of the output to $run.
exec ($run); // Try to execute the return value.
}
else { die($die); } // Echo the failure string and exit -- unnecessarily, since the script ends here anyway.
?>
Bookmarks