コード例 #1
0
ファイル: remote_nmap.php プロジェクト: jhbsz/ossimTest
require_once 'classes/Scan.inc';
include_once 'classes/Session.inc';
$net = $argv[1];
$remote_sensor = $argv[2];
$timing_template = $argv[3] != "" ? $argv[3] : "-T3";
$full = $argv[4] == "full" || $argv[4] == "fast" ? $argv[4] : "";
$nmap_completed_scan = $argv[5];
if (!preg_match("/\\d+\\.\\d+\\.\\d+\\.\\d+/", $net)) {
    die("Incorrect net/host format {$net}\n");
}
if ($remote_sensor != "" && $remote_sensor != "null") {
    $rscan = new RemoteScan($net, "ping", $remote_sensor, $nmap_completed_scan);
    $quiet = $timing_template != "" ? FALSE : TRUE;
    echo "Scanning remote network: {$net}\n";
    $rscan->do_scan($quiet);
    if ($rscan->err() == "") {
        $ips = $rscan->get_scan();
    } else {
        $ips = array();
        echo "Unable to run remote scan: " . $rscan->err() . "\n";
    }
} else {
    echo "Scanning local network: {$net}\n";
    $scan = new Scan($net, null, $nmap_completed_scan);
    $scan->append_option($timing_template);
    if ($full == "fast") {
        $scan->append_option("-F");
        $scan->do_scan(TRUE);
    } elseif ($full == "full") {
        $scan->do_scan(TRUE);
    } else {
コード例 #2
0
ファイル: remote_scans.php プロジェクト: jhbsz/ossimTest
include "../hmenu.php";
$scan = GET('scan');
$delete = GET('delete');
ossim_valid($scan, OSS_ALPHA, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("Scan"));
ossim_valid($delete, OSS_ALPHA, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("Scan"));
if (ossim_error()) {
    die(ossim_error());
}
require_once 'classes/Scan.inc';
$rscan = new RemoteScan("", "");
if ($delete != "") {
    $rscan->delete_scan($delete);
}
if ($scan != "") {
    $rscan->import_scan($scan);
    if ($rscan->err() != "") {
        echo ossim_error(_("Failed remote network scan: ") . $rscan->err());
    } else {
        $rscan->save_scan();
    }
    echo "<div class='ossim_success'>";
    echo _("Scan imported successfully") . "<span style='margin-left:5px'><a href='index.php#results'>[" . _("Click here to show the results") . "]</a></span>";
    echo "</div>";
} else {
    if ($rscan->available_scan()) {
        ?>
		<table align="center" cellpadding="2" cellspacing="2">
			<tr>
				<th class='agent'><?php 
        echo _("Agent");
        ?>