Пример #1
0
    }
}
pclose($handle);
$read = "Scan of {$client_ip} Complete!";
fwrite($fp_log, $read . "\n");
if ($javascript) {
    echo "<script type='text/javascript'>" . "document.getElementById('processing_steps').innerHTML = \"<span style='color: #000;'>" . "<div class='percentbox2'>{$read}</div><br><br>" . "</span>\";\n" . "</script>";
} else {
    echo "<div class='percentbox' style='z-index: 0; background-image(\"../images/white.png\"); height: 40px;'>" . "&nbsp;" . "</div>";
    @ob_end_flush();
    flush();
    echo "<div class='percentbox' style='z-index: 0;'>{$read}</div>";
}
@ob_end_flush();
flush();
$_nes = new Nessus($output);
$output = trim($_nes->output_html('', true, true));
// Must replace newlines so javascript wont break
$output = str_replace("\n", "", $output);
if ($javascript) {
    echo "<script type='text/javascript'>" . "document.getElementById('processing_output').innerHTML = \"<span style='color: #000;'>{$output}</span>\";\n" . "</script>";
} else {
    echo "</div><br><br><br><br>";
    echo $output;
    echo "</body></html>";
}
@ob_end_flush();
flush();
$time = date("m-d-Y-H:i:s", time());
syslog(LOG_INFO, "ScanMeNow: Finished {$logtype} on {$client_ip} at {$time}");
fwrite($fp_log, "ScanMeNow: Finished {$logtype} on {$client_ip} at {$time}\n");
Пример #2
0
         }
     }
     break;
 case "email_report":
     require_once _ABSPATH . '/lib/User.php';
     $usr = User::getInstance();
     $profile_id = import_var('profile_id', 'P');
     $results_id = import_var('results_id', 'P');
     $format = import_var('format', 'P');
     $username = import_var('username', 'S');
     $email = $usr->get_email_from_uid($username);
     if ($email === false) {
         echo "fail";
         return;
     }
     $nes = new Nessus();
     $sql = array('select' => "\tSELECT scan_results \n\t\t\t\t\tFROM saved_scan_results \n\t\t\t\t\tWHERE profile_id=':1'\n\t\t\t\t\tAND results_id=':2'\n\t\t\t\t\tORDER BY results_id DESC \n\t\t\t\t\tLIMIT 1;", 'format' => "\tSELECT report_format \n\t\t\t\t\tFROM profile_settings \n\t\t\t\t\tWHERE profile_id=':1' \n\t\t\t\t\tAND username='******';");
     $stmt1 = $sa->prepare($sql['select']);
     $stmt2 = $db->prepare($sql['format']);
     $stmt1->execute($profile_id, $results_id);
     if ($stmt1->num_rows() < 1) {
         echo "fail";
         return;
     }
     $content = $stmt1->result(0);
     if ($format == "default") {
         $stmt2->execute($profile_id, $username);
         $format = $stmt2->result(0);
     }
     if ($format == 'txt') {
         /**
Пример #3
0
#!/usr/bin/php -q

<?php 
set_time_limit(0);
if (!@$argc) {
    die("<p>script can only be run from command line");
}
define('_ABSPATH', dirname(dirname(__FILE__)));
require_once _ABSPATH . '/confs/config-inc.php';
require_once _ABSPATH . '/lib/functions.php';
require_once _ABSPATH . '/lib/scan-maker.php';
require_once _ABSPATH . '/lib/Nessus.php';
require_once _ABSPATH . '/lib/IXR_Library.php';
require_once _ABSPATH . '/lib/Netmask.php';
$nes = new Nessus();
$_nm = new Netmask();
$client = getIXRClient();
define_syslog_variables();
@($profile_id = $argv[1]);
if ($profile_id == '') {
    exit;
}
// Begin processing the scan
$machine_list = array();
$scanner_set = array();
$output = array();
$settings = array();
$reading_output = false;
$stopped = false;
$output = '';
$recipients = array();