Ejemplo n.º 1
0
 private function getXMLReport()
 {
     $fileScanner = new FileList();
     $dom = new DOMDocument('1.0', 'utf-8');
     // create report container
     $websiteInfoNode = $dom->createElement('website_info');
     $dom->appendChild($websiteInfoNode);
     // gather server info and append it to the report
     $wsEnv = new WebServerEnvInfo();
     $wsEnvNode = $wsEnv->getXMLNode();
     $dom->documentElement->appendChild($dom->importNode($wsEnvNode, true));
     // gather cms list and append it to the report
     $cmsDetector = new CmsVersionDetector($_SERVER['DOCUMENT_ROOT']);
     $cmsListNode = $cmsDetector->getXMLNode();
     $dom->documentElement->appendChild($dom->importNode($cmsListNode, true));
     // retrieve list of files and append it to the report
     $tmpXmlDoc = new DOMDocument();
     $tmpXmlDoc->loadXML('<files>' . $fileScanner->getXMLFilelist() . '</files>');
     $dom->documentElement->appendChild($dom->importNode($tmpXmlDoc->documentElement, true));
     return $dom->saveXML();
 }
Ejemplo n.º 2
0
            die("\nCannot write report. Report dir " . REPORT_PATH . " is not writable.");
        } else {
            if (!REPORT_FILE) {
                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';
        }
Ejemplo n.º 3
0
        $g_FoundTotalFiles = $g_TotalFiles;
    } else {
        // scan whole file system
        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);
    }