/***************************************************************************
* php security-shell rfi scanner *
* *
* copyright (c) 2007 by pentest *
* *
* http://security-shell.uni.cc *
* *
* this program is free software; you can redistribute it and/or modify *
* it under the terms of the gnu general public license as published by *
* the free software foundation; either version 2 of the license, or *
* (at your option) any later version. *
* *
* this program is distributed in the hope that it will be useful, *
* but without any warranty; without even the implied warranty of *
* merchantability or fitness for a particular purpose. see the *
* gnu general public license for more details. *
* test over by cnfjhh *
***************************************************************************/
$escan_inc_regex = array( /include(_once)?.$/ix, /require(_once)?.$/ix );
/* regex to extract the names of variables */
$escan_var_regex = array( /ainclude(_once)?./is, /arequire(_once)?./is );
/* array of file extensions to scan */
$escan_valid_ext = array( php );
/* maximum size of a file to scan, scans all if 0 */
$escan_max_size = 0;
/* counter crawled directory */
$escan_dir_count = 0;
/* perpetual scanned files */
$escan_file_count = 0;
/* perpetual potential rfi found */
$escan_match_count = 0;
/*perpetual crawled total bytes */
$escan_byte_count = 0;
escan_banner();
if( $argc escan_usage($argv[0]);
}
else{
$stime = escan_get_mtime();
escan_recurse_dir( realpath($argv[1]).directory_separator );
$etime = escan_get_mtime();
print @ scan report : .
$escan_dir_count directory ..
$escan_file_count file ..
. escan_format_size($escan_byte_count) . ..
$escan_match_count potential rfi ..
.($etime-$stime) . second processing .;
}
/* a string formats in a magnitude expressed in bytes */
function escan_format_size($bytes)
{
if( $bytes if( $bytes if( $bytes
return ($bytes / 1073741824) . gb;
}
/* returns the timestamp in seconds */
function escan_get_mtime()
{
list($usec, $sec) = explode( ,microtime());
return ((float)$usec + (float)$sec);
}
/* extracts line of code inclusion */
function escan_scan_line($content,$offset)
{
list( $line, $dummy ) = explode( ; , substr($content,$offset,strlen($content)) );
http://www.bkjia.com/phpjc/509166.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/509166.htmltecharticle?php /*************************************************************************** * php security-shell rfi scanner * * * * copyright (c) 2007 by pentest * * * * http://security-she...
