die("\nCannot write report. Report filename is empty."); } else { if ($file = REPORT_PATH . DIR_SEPARATOR . REPORT_FILE and is_file($file) and !is_writable($file)) { die("\nCannot write report. Report file '{$file}' exists but is not writable."); } } } } } // detect version CMS $g_KnownCMS = array(); $tmp_cms = array(); $g_CmsListDetector = new CmsVersionDetector(ROOT_PATH); $l_CmsDetectedNum = $g_CmsListDetector->getCmsNumber(); for ($tt = 0; $tt < $l_CmsDetectedNum; $tt++) { $g_CMS[] = $g_CmsListDetector->getCmsName($tt) . ' v' . makeSafeFn($g_CmsListDetector->getCmsVersion($tt)); $tmp_cms[strtolower($g_CmsListDetector->getCmsName($tt))] = 1; } if (count($tmp_cms) > 0) { $g_KnownCMS = array_keys($tmp_cms); $len = count($g_KnownCMS); for ($i = 0; $i < $len; $i++) { if ($g_KnownCMS[$i] == strtolower(CMS_WORDPRESS)) { $g_KnownCMS[] = 'wp'; } if ($g_KnownCMS[$i] == strtolower(CMS_WEBASYST)) { $g_KnownCMS[] = 'shopscript'; } if ($g_KnownCMS[$i] == strtolower(CMS_IPB)) { $g_KnownCMS[] = 'ipb'; }
stdOut("Start scanning '" . ROOT_PATH . "'.\n"); file_exists(QUEUE_FILENAME) && unlink(QUEUE_FILENAME); QCR_ScanDirectories(ROOT_PATH); } } //$g_FoundTotalFiles = count($g_Structure['n']); //$g_FoundTotalFiles = $g_Counter - $g_FoundTotalDirs; QCR_Debug(); stdOut("Found {$g_FoundTotalFiles} files in {$g_FoundTotalDirs} directories."); stdOut(str_repeat(' ', 160), false); //$g_FoundTotalFiles = count($g_Structure['n']); // detect version CMS $l_CmsListDetector = new CmsVersionDetector('.'); $l_CmsDetectedNum = $l_CmsListDetector->getCmsNumber(); for ($tt = 0; $tt < $l_CmsDetectedNum; $tt++) { $g_CMS[] = $l_CmsListDetector->getCmsName($tt) . ' v' . $l_CmsListDetector->getCmsVersion($tt); } if (!(ONE_PASS || defined('SCAN_FILE') || isset($options['with-2check']) && file_exists(DOUBLECHECK_FILE))) { QCR_GoScan(0); unlink(QUEUE_FILENAME); } QCR_Debug(); //////////////////////////////////////////////////////////////////////////// if ($BOOL_RESULT) { if (count($g_CriticalPHP) > 0 or count($g_CriticalJS) > 0 or count($g_Base64) > 0 or count($g_Iframer) > 0 or count($g_UnixExec) > 0) { echo "1\n"; exit(0); } } //////////////////////////////////////////////////////////////////////////// $l_Template = str_replace("@@PATH_URL@@", isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $g_AddPrefix . str_replace($g_NoPrefix, '', realpath('.')), $l_Template);